| Index: chrome/browser/ui/app_list/app_list_controller_browsertest.cc
|
| diff --git a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
|
| index 7e8412c7a927f645a577cdf90f5b779ef35c145a..63edad90705578221d6dd6cecaab13256eca4f83 100644
|
| --- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
|
| +++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
|
| @@ -8,14 +8,13 @@
|
| #include "base/prefs/pref_service.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| -#include "chrome/browser/ui/app_list/app_list_util.h"
|
| +#include "chrome/browser/ui/app_list/app_list_service.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
|
|
| -
|
| // Browser Test for AppListController that runs on all platforms supporting
|
| // app_list.
|
| class AppListControllerBrowserTest : public InProcessBrowserTest {
|
| @@ -38,16 +37,21 @@ class AppListControllerBrowserTest : public InProcessBrowserTest {
|
| DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest);
|
| };
|
|
|
| -#if defined(OS_WIN) && !defined(USE_AURA)
|
| +// TODO(tapted): This should work on OS_CHROMEOS as well, but DismissAppList
|
| +// does not affect IsAppListVisible immediately.
|
| +#if defined(OS_WIN)
|
| // Show the app list, then dismiss it.
|
| IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, ShowAndDismiss) {
|
| - ASSERT_FALSE(chrome::IsAppListVisible());
|
| - chrome::ShowAppList(browser()->profile());
|
| - ASSERT_TRUE(chrome::IsAppListVisible());
|
| - chrome::DismissAppList();
|
| - ASSERT_FALSE(chrome::IsAppListVisible());
|
| + AppListService* service = AppListService::Get();
|
| + ASSERT_FALSE(service->IsAppListVisible());
|
| + service->ShowAppList(browser()->profile());
|
| + ASSERT_TRUE(service->IsAppListVisible());
|
| + service->DismissAppList();
|
| + ASSERT_FALSE(service->IsAppListVisible());
|
| }
|
| +#endif // defined(OS_WIN)
|
|
|
| +#if defined(OS_WIN)
|
| IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, SwitchAppListProfiles) {
|
| ProfileManager* profile_manager = g_browser_process->profile_manager();
|
| ASSERT_TRUE(temp_profile_dir_.CreateUniqueTempDir());
|
| @@ -58,15 +62,16 @@ IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, SwitchAppListProfiles) {
|
| string16(), string16(), false);
|
| content::RunMessageLoop(); // Will stop in OnProfileCreated().
|
|
|
| - ASSERT_FALSE(chrome::IsAppListVisible());
|
| - chrome::ShowAppList(browser()->profile());
|
| - ASSERT_TRUE(chrome::IsAppListVisible());
|
| - ASSERT_EQ(browser()->profile(), chrome::GetCurrentAppListProfile());
|
| - chrome::ShowAppList(profile2_);
|
| - ASSERT_TRUE(chrome::IsAppListVisible());
|
| - ASSERT_EQ(profile2_, chrome::GetCurrentAppListProfile());
|
| - chrome::DismissAppList();
|
| - ASSERT_FALSE(chrome::IsAppListVisible());
|
| + AppListService* service = AppListService::Get();
|
| + ASSERT_FALSE(service->IsAppListVisible());
|
| + service->ShowAppList(browser()->profile());
|
| + ASSERT_TRUE(service->IsAppListVisible());
|
| + ASSERT_EQ(browser()->profile(), service->GetCurrentAppListProfile());
|
| + service->ShowAppList(profile2_);
|
| + ASSERT_TRUE(service->IsAppListVisible());
|
| + ASSERT_EQ(profile2_, service->GetCurrentAppListProfile());
|
| + service->DismissAppList();
|
| + ASSERT_FALSE(service->IsAppListVisible());
|
| }
|
|
|
| class ShowAppListBrowserTest : public InProcessBrowserTest {
|
| @@ -82,14 +87,15 @@ class ShowAppListBrowserTest : public InProcessBrowserTest {
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_F(ShowAppListBrowserTest, ShowAppListFlag) {
|
| + AppListService* service = AppListService::Get();
|
| // The app list should already be shown because we passed
|
| // switches::kShowAppList.
|
| - ASSERT_TRUE(chrome::IsAppListVisible());
|
| + ASSERT_TRUE(service->IsAppListVisible());
|
|
|
| // Create a browser to prevent shutdown when we dismiss the app list. We
|
| // need to do this because switches::kShowAppList suppresses the creation of
|
| // any browsers.
|
| - CreateBrowser(chrome::GetCurrentAppListProfile());
|
| - chrome::DismissAppList();
|
| + CreateBrowser(service->GetCurrentAppListProfile());
|
| + service->DismissAppList();
|
| }
|
| -#endif // defined(OS_WIN) && !defined(USE_AURA)
|
| +#endif // defined(OS_WIN)
|
|
|