| Index: ash/launcher/launcher_unittest.cc
|
| diff --git a/ash/launcher/launcher_unittest.cc b/ash/launcher/launcher_unittest.cc
|
| index 59d6a67e7092777d5364d823de7b06cf6d47720b..b18edca82cfb4c66e05a3b6c2a599772416ddc9d 100644
|
| --- a/ash/launcher/launcher_unittest.cc
|
| +++ b/ash/launcher/launcher_unittest.cc
|
| @@ -3,10 +3,13 @@
|
| // found in the LICENSE file.
|
|
|
| #include "ash/launcher/launcher.h"
|
| +
|
| +#include <vector>
|
| +
|
| +#include "ash/launcher/app_list_button.h"
|
| #include "ash/launcher/launcher_button.h"
|
| #include "ash/launcher/launcher_model.h"
|
| #include "ash/launcher/launcher_view.h"
|
| -
|
| #include "ash/shelf/shelf_widget.h"
|
| #include "ash/shell.h"
|
| #include "ash/test/ash_test_base.h"
|
| @@ -24,6 +27,7 @@
|
| #endif
|
|
|
| typedef ash::test::AshTestBase LauncherTest;
|
| +using ash::internal::AppListButton;
|
| using ash::internal::LauncherView;
|
| using ash::internal::LauncherButton;
|
|
|
| @@ -57,7 +61,7 @@ TEST_F(LauncherTest, OpenBrowser) {
|
|
|
| // Confirm that using the menu will clear the hover attribute. To avoid another
|
| // browser test we check this here.
|
| -TEST_F(LauncherTest, checkHoverAfterMenu) {
|
| +TEST_F(LauncherTest, CheckHoverAfterMenu) {
|
| Launcher* launcher = Launcher::ForPrimaryDisplay();
|
| ASSERT_TRUE(launcher);
|
| LauncherView* launcher_view = launcher->GetLauncherViewForTest();
|
| @@ -116,4 +120,49 @@ TEST_F(LauncherTest, ShowOverflowBubble) {
|
| EXPECT_FALSE(launcher->IsShowingOverflowBubble());
|
| }
|
|
|
| +// Tests app list button toggles when app list UI shows up.
|
| +TEST_F(LauncherTest, AppMenuToggle) {
|
| + Launcher* launcher = Launcher::ForPrimaryDisplay();
|
| + test::LauncherViewTestAPI test(launcher->GetLauncherViewForTest());
|
| + Shell* shell = Shell::GetInstance();
|
| +
|
| + EXPECT_FALSE(shell->GetAppListTargetVisibility());
|
| + EXPECT_FALSE(test.GetAppListButton()->toggled());
|
| + shell->ToggleAppList(NULL);
|
| + EXPECT_TRUE(shell->GetAppListTargetVisibility());
|
| + EXPECT_TRUE(test.GetAppListButton()->toggled());
|
| +}
|
| +
|
| +// Tests only the app list button with a UI is toggled.
|
| +TEST_F(LauncherTest, MultipleAppMenuToggle) {
|
| + UpdateDisplay("300x300,200x200");
|
| +
|
| + std::vector<AppListButton*> app_list_buttons;
|
| + Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
|
| + for (Shell::RootWindowList::const_iterator it = root_windows.begin();
|
| + it != root_windows.end(); ++it) {
|
| + Launcher* launcher = Launcher::ForWindow(*it);
|
| + test::LauncherViewTestAPI test(launcher->GetLauncherViewForTest());
|
| + AppListButton* button = test.GetAppListButton();
|
| + app_list_buttons.push_back(button);
|
| + EXPECT_FALSE(button->toggled());
|
| + }
|
| +
|
| + Shell* shell = Shell::GetInstance();
|
| +
|
| + EXPECT_FALSE(shell->GetAppListTargetVisibility());
|
| + shell->ToggleAppList(root_windows[0]);
|
| + EXPECT_TRUE(shell->GetAppListTargetVisibility());
|
| + EXPECT_TRUE(app_list_buttons[0]->toggled());
|
| + EXPECT_FALSE(app_list_buttons[1]->toggled());
|
| +
|
| + shell->ToggleAppList(NULL);
|
| + EXPECT_FALSE(shell->GetAppListTargetVisibility());
|
| +
|
| + shell->ToggleAppList(root_windows[1]);
|
| + EXPECT_TRUE(shell->GetAppListTargetVisibility());
|
| + EXPECT_FALSE(app_list_buttons[0]->toggled());
|
| + EXPECT_TRUE(app_list_buttons[1]->toggled());
|
| +}
|
| +
|
| } // namespace ash
|
|
|