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 <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 SystemTray* GetSystemTray() { | 68 SystemTray* GetSystemTray() { |
69 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray(); | 69 return StatusAreaWidgetTestHelper::GetStatusAreaWidget()->system_tray(); |
70 } | 70 } |
71 | 71 |
72 // Trivial item implementation for testing PopupAndSystemTray test case. | 72 // Trivial item implementation for testing PopupAndSystemTray test case. |
73 class TestItem : public SystemTrayItem { | 73 class TestItem : public SystemTrayItem { |
74 public: | 74 public: |
75 TestItem() : SystemTrayItem(GetSystemTray()) {} | 75 TestItem() : SystemTrayItem(GetSystemTray()) {} |
76 | 76 |
77 views::View* CreateDefaultView(user::LoginStatus status) override { | 77 views::View* CreateDefaultView(LoginStatus status) override { |
78 views::View* default_view = new views::View; | 78 views::View* default_view = new views::View; |
79 default_view->SetLayoutManager(new views::FillLayout); | 79 default_view->SetLayoutManager(new views::FillLayout); |
80 default_view->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); | 80 default_view->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); |
81 return default_view; | 81 return default_view; |
82 } | 82 } |
83 | 83 |
84 views::View* CreateNotificationView(user::LoginStatus status) override { | 84 views::View* CreateNotificationView(LoginStatus status) override { |
85 return new views::View; | 85 return new views::View; |
86 } | 86 } |
87 | 87 |
88 private: | 88 private: |
89 DISALLOW_COPY_AND_ASSIGN(TestItem); | 89 DISALLOW_COPY_AND_ASSIGN(TestItem); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 class WebNotificationTrayTest : public test::AshTestBase { | 94 class WebNotificationTrayTest : public test::AshTestBase { |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, | 540 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, |
541 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); | 541 move.time_stamp()+base::TimeDelta::FromMilliseconds(50)); |
542 generator.Dispatch(&release); | 542 generator.Dispatch(&release); |
543 EXPECT_FALSE(tray->draw_background_as_active()); | 543 EXPECT_FALSE(tray->draw_background_as_active()); |
544 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 544 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
545 } | 545 } |
546 | 546 |
547 #endif // OS_CHROMEOS | 547 #endif // OS_CHROMEOS |
548 | 548 |
549 } // namespace ash | 549 } // namespace ash |
OLD | NEW |