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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/shelf/shelf_button.h" | 8 #include "ash/common/shelf/shelf_button.h" |
9 #include "ash/common/shelf/shelf_layout_manager.h" | 9 #include "ash/common/shelf/shelf_layout_manager.h" |
10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
11 #include "ash/common/shelf/shelf_types.h" | 11 #include "ash/common/shelf/shelf_types.h" |
12 #include "ash/common/shelf/shelf_view.h" | 12 #include "ash/common/shelf/shelf_view.h" |
13 #include "ash/common/shelf/shelf_widget.h" | 13 #include "ash/common/shelf/shelf_widget.h" |
14 #include "ash/common/shelf/wm_shelf.h" | 14 #include "ash/common/shelf/wm_shelf.h" |
15 #include "ash/common/shell_window_ids.h" | 15 #include "ash/common/shell_window_ids.h" |
16 #include "ash/common/system/web_notification/web_notification_tray.h" | 16 #include "ash/common/system/web_notification/web_notification_tray.h" |
17 #include "ash/common/wm/mru_window_tracker.h" | 17 #include "ash/common/wm/mru_window_tracker.h" |
18 #include "ash/common/wm/window_state.h" | 18 #include "ash/common/wm/window_state.h" |
19 #include "ash/common/wm_root_window_controller.h" | 19 #include "ash/common/wm_root_window_controller.h" |
20 #include "ash/common/wm_shell.h" | 20 #include "ash/common/wm_shell.h" |
| 21 #include "ash/common/wm_window_property.h" |
21 #include "ash/display/display_manager.h" | 22 #include "ash/display/display_manager.h" |
22 #include "ash/screen_util.h" | 23 #include "ash/screen_util.h" |
23 #include "ash/shelf/shelf_util.h" | |
24 #include "ash/shell.h" | 24 #include "ash/shell.h" |
25 #include "ash/test/ash_test_base.h" | 25 #include "ash/test/ash_test_base.h" |
26 #include "ash/test/display_manager_test_api.h" | 26 #include "ash/test/display_manager_test_api.h" |
27 #include "ash/test/shelf_view_test_api.h" | 27 #include "ash/test/shelf_view_test_api.h" |
28 #include "ash/test/test_shelf_delegate.h" | 28 #include "ash/test/test_shelf_delegate.h" |
29 #include "ash/wm/window_state_aura.h" | 29 #include "ash/wm/window_state_aura.h" |
30 #include "ash/wm/window_util.h" | 30 #include "ash/wm/window_util.h" |
31 #include "base/command_line.h" | 31 #include "base/command_line.h" |
32 #include "base/compiler_specific.h" | 32 #include "base/compiler_specific.h" |
33 #include "base/i18n/rtl.h" | 33 #include "base/i18n/rtl.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 test::ShelfViewTestAPI* shelf_view_test() { return shelf_view_test_.get(); } | 222 test::ShelfViewTestAPI* shelf_view_test() { return shelf_view_test_.get(); } |
223 | 223 |
224 // Clicks the shelf items on |shelf_view| that is associated with given | 224 // Clicks the shelf items on |shelf_view| that is associated with given |
225 // |window|. | 225 // |window|. |
226 void ClickShelfItemForWindow(ShelfView* shelf_view, aura::Window* window) { | 226 void ClickShelfItemForWindow(ShelfView* shelf_view, aura::Window* window) { |
227 test::ShelfViewTestAPI test_api(shelf_view); | 227 test::ShelfViewTestAPI test_api(shelf_view); |
228 test_api.SetAnimationDuration(1); | 228 test_api.SetAnimationDuration(1); |
229 test_api.RunMessageLoopUntilAnimationsDone(); | 229 test_api.RunMessageLoopUntilAnimationsDone(); |
230 int index = WmShell::Get()->shelf_model()->ItemIndexByID( | 230 int index = WmShell::Get()->shelf_model()->ItemIndexByID( |
231 GetShelfIDForWindow(window)); | 231 WmWindowAura::Get(window)->GetIntProperty(WmWindowProperty::SHELF_ID)); |
232 gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen(); | 232 gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen(); |
233 | 233 |
234 ui::test::EventGenerator& event_generator = GetEventGenerator(); | 234 ui::test::EventGenerator& event_generator = GetEventGenerator(); |
235 event_generator.MoveMouseTo(bounds.CenterPoint()); | 235 event_generator.MoveMouseTo(bounds.CenterPoint()); |
236 event_generator.ClickLeftButton(); | 236 event_generator.ClickLeftButton(); |
237 | 237 |
238 test_api.RunMessageLoopUntilAnimationsDone(); | 238 test_api.RunMessageLoopUntilAnimationsDone(); |
239 } | 239 } |
240 | 240 |
241 WmShelf* GetShelfForWindow(aura::Window* window) { | 241 WmShelf* GetShelfForWindow(aura::Window* window) { |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 911 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
912 target = targeter->FindTargetForEvent(root, &touch); | 912 target = targeter->FindTargetForEvent(root, &touch); |
913 EXPECT_NE(w.get(), target); | 913 EXPECT_NE(w.get(), target); |
914 } | 914 } |
915 | 915 |
916 INSTANTIATE_TEST_CASE_P(LtrRtl, | 916 INSTANTIATE_TEST_CASE_P(LtrRtl, |
917 PanelLayoutManagerTextDirectionTest, | 917 PanelLayoutManagerTextDirectionTest, |
918 testing::Bool()); | 918 testing::Bool()); |
919 | 919 |
920 } // namespace ash | 920 } // namespace ash |
OLD | NEW |