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/wm/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/launcher/launcher_button.h" | 9 #include "ash/launcher/launcher_button.h" |
10 #include "ash/launcher/launcher_model.h" | |
11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
12 #include "ash/screen_ash.h" | 11 #include "ash/screen_ash.h" |
13 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/shelf_model.h" |
14 #include "ash/shelf/shelf_types.h" | 14 #include "ash/shelf/shelf_types.h" |
15 #include "ash/shelf/shelf_view.h" | 15 #include "ash/shelf/shelf_view.h" |
16 #include "ash/shelf/shelf_widget.h" | 16 #include "ash/shelf/shelf_widget.h" |
17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
18 #include "ash/shell_window_ids.h" | 18 #include "ash/shell_window_ids.h" |
19 #include "ash/test/ash_test_base.h" | 19 #include "ash/test/ash_test_base.h" |
20 #include "ash/test/launcher_test_api.h" | 20 #include "ash/test/launcher_test_api.h" |
21 #include "ash/test/shelf_view_test_api.h" | 21 #include "ash/test/shelf_view_test_api.h" |
22 #include "ash/test/shell_test_api.h" | 22 #include "ash/test/shell_test_api.h" |
23 #include "ash/test/test_launcher_delegate.h" | 23 #include "ash/test/test_launcher_delegate.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 return shelf_view_test_.get(); | 215 return shelf_view_test_.get(); |
216 } | 216 } |
217 | 217 |
218 // Clicks the launcher items on |shelf_view| that is | 218 // Clicks the launcher items on |shelf_view| that is |
219 /// associated with given |window|. | 219 /// associated with given |window|. |
220 void ClickLauncherItemForWindow(ShelfView* shelf_view, | 220 void ClickLauncherItemForWindow(ShelfView* shelf_view, |
221 aura::Window* window) { | 221 aura::Window* window) { |
222 test::ShelfViewTestAPI test_api(shelf_view); | 222 test::ShelfViewTestAPI test_api(shelf_view); |
223 test_api.SetAnimationDuration(1); | 223 test_api.SetAnimationDuration(1); |
224 test_api.RunMessageLoopUntilAnimationsDone(); | 224 test_api.RunMessageLoopUntilAnimationsDone(); |
225 LauncherModel* model = | 225 ShelfModel* model = test::ShellTestApi(Shell::GetInstance()).shelf_model(); |
226 test::ShellTestApi(Shell::GetInstance()).launcher_model(); | |
227 test::TestLauncherDelegate* launcher_delegate = | 226 test::TestLauncherDelegate* launcher_delegate = |
228 test::TestLauncherDelegate::instance(); | 227 test::TestLauncherDelegate::instance(); |
229 int index = model->ItemIndexByID(launcher_delegate->GetIDByWindow(window)); | 228 int index = model->ItemIndexByID(launcher_delegate->GetIDByWindow(window)); |
230 gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen(); | 229 gfx::Rect bounds = test_api.GetButton(index)->GetBoundsInScreen(); |
231 | 230 |
232 aura::test::EventGenerator& event_generator = GetEventGenerator(); | 231 aura::test::EventGenerator& event_generator = GetEventGenerator(); |
233 event_generator.MoveMouseTo(bounds.CenterPoint()); | 232 event_generator.MoveMouseTo(bounds.CenterPoint()); |
234 event_generator.ClickLeftButton(); | 233 event_generator.ClickLeftButton(); |
235 | 234 |
236 test_api.RunMessageLoopUntilAnimationsDone(); | 235 test_api.RunMessageLoopUntilAnimationsDone(); |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 EXPECT_TRUE(w1->IsVisible()); | 777 EXPECT_TRUE(w1->IsVisible()); |
779 EXPECT_FALSE(w2->IsVisible()); | 778 EXPECT_FALSE(w2->IsVisible()); |
780 EXPECT_TRUE(w3->IsVisible()); | 779 EXPECT_TRUE(w3->IsVisible()); |
781 } | 780 } |
782 | 781 |
783 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, | 782 INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest, |
784 testing::Bool()); | 783 testing::Bool()); |
785 | 784 |
786 } // namespace internal | 785 } // namespace internal |
787 } // namespace ash | 786 } // namespace ash |
OLD | NEW |