Chromium Code Reviews| 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 534351c66d4f502d34c3abbcb2f72de775714b75..2e6f056a79ac4b7b440f40e8308d6cdf877dd203 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 { |
| @@ -55,6 +61,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); |
|
Matt Giuca
2014/11/03 00:57:41
Looks like this hasn't been updated with the new A
calamity
2014/11/06 02:36:31
It has been? It listens to the new event. It's jus
|
| + 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( |
| + app_list::AppListModel::STATE_START)); |
| + |
| + listener.WaitUntilSatisfied(); |
| + } |
| } |