OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "ash/common/wm_shell.h" | |
8 #include "ash/common/wm_window.h" | |
9 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shelf/app_list_button.h" | 8 #include "ash/shelf/app_list_button.h" |
11 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shelf/wm_shelf.h" | 10 #include "ash/shelf/wm_shelf.h" |
| 11 #include "ash/wm_shell.h" |
| 12 #include "ash/wm_window.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "ui/app_list/presenter/app_list.h" | 15 #include "ui/app_list/presenter/app_list.h" |
16 #include "ui/events/test/event_generator.h" | 16 #include "ui/events/test/event_generator.h" |
17 | 17 |
18 using AppListTest = InProcessBrowserTest; | 18 using AppListTest = InProcessBrowserTest; |
19 | 19 |
20 // An integration test to toggle the app list by pressing the shelf button. | 20 // An integration test to toggle the app list by pressing the shelf button. |
21 IN_PROC_BROWSER_TEST_F(AppListTest, PressAppListButtonToShowAndDismiss) { | 21 IN_PROC_BROWSER_TEST_F(AppListTest, PressAppListButtonToShowAndDismiss) { |
22 ash::WmShell* shell = ash::WmShell::Get(); | 22 ash::WmShell* shell = ash::WmShell::Get(); |
(...skipping 18 matching lines...) Expand all Loading... |
41 EXPECT_EQ(1u, app_list_container->GetChildren().size()); | 41 EXPECT_EQ(1u, app_list_container->GetChildren().size()); |
42 EXPECT_TRUE(app_list_button->is_showing_app_list()); | 42 EXPECT_TRUE(app_list_button->is_showing_app_list()); |
43 | 43 |
44 // Click the button again to dismiss the app list; the window animates closed. | 44 // Click the button again to dismiss the app list; the window animates closed. |
45 generator.ClickLeftButton(); | 45 generator.ClickLeftButton(); |
46 base::RunLoop().RunUntilIdle(); | 46 base::RunLoop().RunUntilIdle(); |
47 EXPECT_FALSE(shell->app_list()->GetTargetVisibility()); | 47 EXPECT_FALSE(shell->app_list()->GetTargetVisibility()); |
48 EXPECT_EQ(1u, app_list_container->GetChildren().size()); | 48 EXPECT_EQ(1u, app_list_container->GetChildren().size()); |
49 EXPECT_FALSE(app_list_button->is_showing_app_list()); | 49 EXPECT_FALSE(app_list_button->is_showing_app_list()); |
50 } | 50 } |
OLD | NEW |