Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: chrome/browser/ui/app_list/app_list_controller_browsertest.cc

Issue 11968034: Enable profile switching for standalone App Launcher via the Settings App. (Closed) Base URL: git://nomatter.syd/chromium/src.git@master
Patch Set: respond to comments Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a928fe14706070fa49e3364f682d968b8f1b3406..8a0e6effc1bd3eead9e3536a7983ce81c026dd6f 100644
--- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
+++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
@@ -2,7 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/prefs/pref_service_simple.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/app_list_util.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"
// Browser Test for AppListController that runs on all platforms supporting
@@ -15,14 +22,34 @@ class AppListControllerBrowserTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest);
};
-// Disabled on Windows. Investigating in http://crbug.com/169114 .
-#if defined(OS_WIN)
-#define MAYBE_ShowAndShutdown DISABLED_ShowAndShutdown
-#else
-#define MAYBE_ShowAndShutdown ShowAndShutdown
-#endif
+// Show the app list, then dismiss it.
+IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, ShowAndDismiss) {
+ ASSERT_FALSE(chrome::IsAppListVisible());
tapted 2013/01/26 01:10:08 I think this test will run on CrOS, so app_list_co
koz (OOO until 15th September) 2013/01/29 00:34:11 Done.
+ chrome::ShowAppList(browser()->profile());
+ ASSERT_TRUE(chrome::IsAppListVisible());
+ chrome::DismissAppList();
+ ASSERT_FALSE(chrome::IsAppListVisible());
+}
+
+class ShowAppListBrowserTest : public InProcessBrowserTest {
+ public:
+ ShowAppListBrowserTest() {}
+
+ void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ command_line->AppendSwitch(switches::kShowAppList);
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(ShowAppListBrowserTest);
+};
+
+IN_PROC_BROWSER_TEST_F(ShowAppListBrowserTest, ShowAppList) {
+ // The app list should already be shown because we passed
+ // switches::kShowAppList.
+ ASSERT_TRUE(chrome::IsAppListVisible());
-// Test showing the app list, followed by browser close.
-IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, MAYBE_ShowAndShutdown) {
- chrome::ShowAppList();
+ // Create a browser to prevent shutdown when we dismiss the app list. We
+ // need to do this becuase switches::kShowAppList suppresses the creation of
+ // any browsers.
+ CreateBrowser(chrome::GetCurrentAppListProfile());
+ chrome::DismissAppList();
}

Powered by Google App Engine
This is Rietveld 408576698