Index: chrome/browser/apps/custom_launcher_page_browsertest_views.cc |
diff --git a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc |
index 68d8c198e5459ec894bf10a44315aa1c11521547..3c5a41e0f3c3b2c3c99e047cd140953f078eb7f2 100644 |
--- a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc |
+++ b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc |
@@ -7,9 +7,15 @@ |
#include "base/command_line.h" |
#include "chrome/browser/apps/app_browsertest_util.h" |
#include "chrome/browser/ui/app_list/app_list_service.h" |
+#include "chrome/browser/ui/app_list/app_list_service_views.h" |
+#include "chrome/browser/ui/app_list/app_list_shower_views.h" |
#include "extensions/common/extension.h" |
#include "extensions/common/switches.h" |
+#include "extensions/test/extension_test_message_listener.h" |
#include "ui/app_list/app_list_switches.h" |
+#include "ui/app_list/views/app_list_main_view.h" |
+#include "ui/app_list/views/app_list_view.h" |
+#include "ui/app_list/views/contents_view.h" |
namespace { |
@@ -54,6 +60,34 @@ class CustomLauncherPageBrowserTest |
DISALLOW_COPY_AND_ASSIGN(CustomLauncherPageBrowserTest); |
}; |
-IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest, LoadPageAndOpenLauncher) { |
+IN_PROC_BROWSER_TEST_F(CustomLauncherPageBrowserTest, |
+ OpenLauncherAndSwitchToCustomPage) { |
LoadAndLaunchPlatformApp(kCustomLauncherPagePath, "Launched"); |
+ |
+ AppListServiceViews* service = static_cast<AppListServiceViews*>( |
+ AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)); |
+ // The app list should have loaded instantly since the profile is already |
+ // loaded. |
+ EXPECT_TRUE(service->IsAppListVisible()); |
+ |
+ app_list::ContentsView* contents_view = |
+ service->shower().app_list()->app_list_main_view()->contents_view(); |
+ |
+ ASSERT_TRUE( |
+ contents_view->IsStateActive(app_list::AppListModel::STATE_START)); |
+ |
+ { |
+ ExtensionTestMessageListener listener("onPageExpanded", false); |
+ contents_view->SetActivePage(contents_view->GetPageIndexForState( |
+ app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)); |
+ |
+ listener.WaitUntilSatisfied(); |
+ } |
+ { |
+ ExtensionTestMessageListener listener("onPageCollapsed", false); |
+ contents_view->SetActivePage(contents_view->GetPageIndexForState( |
tapted
2014/11/07 05:34:56
You might run into a problem here on ChromeOS that
calamity
2014/11/10 03:38:30
Added and implemented the disable-app-list-on-blur
|
+ app_list::AppListModel::STATE_START)); |
+ |
+ listener.WaitUntilSatisfied(); |
+ } |
} |