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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h"
6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/prefs/pref_service_simple.h"
8 #include "chrome/browser/profiles/profile_manager.h"
5 #include "chrome/browser/ui/app_list/app_list_util.h" 9 #include "chrome/browser/ui/app_list/app_list_util.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/common/pref_names.h"
6 #include "chrome/test/base/in_process_browser_test.h" 13 #include "chrome/test/base/in_process_browser_test.h"
7 14
8 // Browser Test for AppListController that runs on all platforms supporting 15 // Browser Test for AppListController that runs on all platforms supporting
9 // app_list. 16 // app_list.
10 class AppListControllerBrowserTest : public InProcessBrowserTest { 17 class AppListControllerBrowserTest : public InProcessBrowserTest {
11 public: 18 public:
12 AppListControllerBrowserTest() {} 19 AppListControllerBrowserTest() {}
13 20
14 private: 21 private:
15 DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest); 22 DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest);
16 }; 23 };
17 24
18 // Disabled on Windows. Investigating in http://crbug.com/169114 . 25 // Show the app list, then dismiss it.
19 #if defined(OS_WIN) 26 IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, ShowAndDismiss) {
20 #define MAYBE_ShowAndShutdown DISABLED_ShowAndShutdown 27 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.
21 #else 28 chrome::ShowAppList(browser()->profile());
22 #define MAYBE_ShowAndShutdown ShowAndShutdown 29 ASSERT_TRUE(chrome::IsAppListVisible());
23 #endif 30 chrome::DismissAppList();
31 ASSERT_FALSE(chrome::IsAppListVisible());
32 }
24 33
25 // Test showing the app list, followed by browser close. 34 class ShowAppListBrowserTest : public InProcessBrowserTest {
26 IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, MAYBE_ShowAndShutdown) { 35 public:
27 chrome::ShowAppList(); 36 ShowAppListBrowserTest() {}
37
38 void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
39 command_line->AppendSwitch(switches::kShowAppList);
40 }
41
42 DISALLOW_COPY_AND_ASSIGN(ShowAppListBrowserTest);
43 };
44
45 IN_PROC_BROWSER_TEST_F(ShowAppListBrowserTest, ShowAppList) {
46 // The app list should already be shown because we passed
47 // switches::kShowAppList.
48 ASSERT_TRUE(chrome::IsAppListVisible());
49
50 // Create a browser to prevent shutdown when we dismiss the app list. We
51 // need to do this becuase switches::kShowAppList suppresses the creation of
52 // any browsers.
53 CreateBrowser(chrome::GetCurrentAppListProfile());
54 chrome::DismissAppList();
28 } 55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698