| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 SystemTray* GetSystemTray() { | 66 SystemTray* GetSystemTray() { |
| 67 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray(); | 67 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Trivial item implementation for testing PopupAndSystemTray test case. | 70 // Trivial item implementation for testing PopupAndSystemTray test case. |
| 71 class TestItem : public SystemTrayItem { | 71 class TestItem : public SystemTrayItem { |
| 72 public: | 72 public: |
| 73 TestItem() : SystemTrayItem(GetSystemTray()) {} | 73 TestItem() : SystemTrayItem(GetSystemTray()) {} |
| 74 | 74 |
| 75 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { | 75 virtual views::View* CreateDefaultView(user::LoginStatus status) override { |
| 76 views::View* default_view = new views::View; | 76 views::View* default_view = new views::View; |
| 77 default_view->SetLayoutManager(new views::FillLayout); | 77 default_view->SetLayoutManager(new views::FillLayout); |
| 78 default_view->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); | 78 default_view->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); |
| 79 return default_view; | 79 return default_view; |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual views::View* CreateNotificationView( | 82 virtual views::View* CreateNotificationView( |
| 83 user::LoginStatus status) OVERRIDE { | 83 user::LoginStatus status) override { |
| 84 return new views::View; | 84 return new views::View; |
| 85 } | 85 } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 DISALLOW_COPY_AND_ASSIGN(TestItem); | 88 DISALLOW_COPY_AND_ASSIGN(TestItem); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace | 91 } // namespace |
| 92 | 92 |
| 93 class WebNotificationTrayTest : public test::AshTestBase { | 93 class WebNotificationTrayTest : public test::AshTestBase { |
| 94 public: | 94 public: |
| 95 WebNotificationTrayTest() {} | 95 WebNotificationTrayTest() {} |
| 96 virtual ~WebNotificationTrayTest() {} | 96 virtual ~WebNotificationTrayTest() {} |
| 97 | 97 |
| 98 virtual void SetUp() OVERRIDE { | 98 virtual void SetUp() override { |
| 99 CommandLine::ForCurrentProcess()->AppendSwitch( | 99 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 100 switches::kEnableTouchFeedback); | 100 switches::kEnableTouchFeedback); |
| 101 test::AshTestBase::SetUp(); | 101 test::AshTestBase::SetUp(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual void TearDown() OVERRIDE { | 104 virtual void TearDown() override { |
| 105 GetMessageCenter()->RemoveAllNotifications(false); | 105 GetMessageCenter()->RemoveAllNotifications(false); |
| 106 test::AshTestBase::TearDown(); | 106 test::AshTestBase::TearDown(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 protected: | 109 protected: |
| 110 void AddNotification(const std::string& id) { | 110 void AddNotification(const std::string& id) { |
| 111 scoped_ptr<message_center::Notification> notification; | 111 scoped_ptr<message_center::Notification> notification; |
| 112 notification.reset(new message_center::Notification( | 112 notification.reset(new message_center::Notification( |
| 113 message_center::NOTIFICATION_TYPE_SIMPLE, | 113 message_center::NOTIFICATION_TYPE_SIMPLE, |
| 114 id, | 114 id, |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); | 546 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); |
| 547 generator.Dispatch(&release); | 547 generator.Dispatch(&release); |
| 548 RunAllPendingInMessageLoop(); | 548 RunAllPendingInMessageLoop(); |
| 549 EXPECT_FALSE(tray->draw_background_as_active()); | 549 EXPECT_FALSE(tray->draw_background_as_active()); |
| 550 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 550 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
| 551 } | 551 } |
| 552 | 552 |
| 553 #endif // OS_CHROMEOS | 553 #endif // OS_CHROMEOS |
| 554 | 554 |
| 555 } // namespace ash | 555 } // namespace ash |
| OLD | NEW |