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/ash_switches.h" | |
10 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
12 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
13 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
14 #include "ash/shell.h" | 13 #include "ash/shell.h" |
15 #include "ash/system/status_area_widget.h" | 14 #include "ash/system/status_area_widget.h" |
16 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
17 #include "ash/system/tray/system_tray_item.h" | 16 #include "ash/system/tray/system_tray_item.h" |
18 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" | 17 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
19 #include "ash/test/ash_test_base.h" | 18 #include "ash/test/ash_test_base.h" |
20 #include "ash/test/status_area_widget_test_helper.h" | 19 #include "ash/test/status_area_widget_test_helper.h" |
21 #include "ash/test/test_system_tray_delegate.h" | 20 #include "ash/test/test_system_tray_delegate.h" |
22 #include "ash/wm/window_state.h" | 21 #include "ash/wm/window_state.h" |
23 #include "base/command_line.h" | 22 #include "base/command_line.h" |
24 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
25 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
26 #include "ui/aura/client/aura_constants.h" | 25 #include "ui/aura/client/aura_constants.h" |
27 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
| 27 #include "ui/base/ui_base_switches.h" |
28 #include "ui/events/event.h" | 28 #include "ui/events/event.h" |
29 #include "ui/events/test/event_generator.h" | 29 #include "ui/events/test/event_generator.h" |
30 #include "ui/gfx/display.h" | 30 #include "ui/gfx/display.h" |
31 #include "ui/gfx/point.h" | 31 #include "ui/gfx/point.h" |
32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
33 #include "ui/gfx/screen.h" | 33 #include "ui/gfx/screen.h" |
34 #include "ui/message_center/message_center_style.h" | 34 #include "ui/message_center/message_center_style.h" |
35 #include "ui/message_center/message_center_tray.h" | 35 #include "ui/message_center/message_center_tray.h" |
36 #include "ui/message_center/notification_list.h" | 36 #include "ui/message_center/notification_list.h" |
37 #include "ui/message_center/notification_types.h" | 37 #include "ui/message_center/notification_types.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::kAshEnableTouchViewTouchFeedback); | 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) { |
(...skipping 435 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 |