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 e47d90be33f280c905fd10260579081d50a8c16d..7fe701d02ae1070cf6314fd6ab19c8caeae7ab89 100644 |
--- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc |
+++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc |
@@ -23,6 +23,20 @@ |
#include "ui/app_list/search_result_observer.h" |
#include "ui/base/models/list_model_observer.h" |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/chromeos/login/chrome_restart_request.h" |
+#include "chromeos/chromeos_switches.h" |
+ |
+namespace { |
+ |
+GURL GetGoogleURL() { |
+ return GURL("http://www.google.com/"); |
+} |
+ |
+} // namespace |
+ |
+#endif // defined(OS_CHROMEOS) |
+ |
// Browser Test for AppListController that runs on all platforms supporting |
// app_list. |
typedef InProcessBrowserTest AppListControllerBrowserTest; |
@@ -212,3 +226,31 @@ IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, |
StopWatchingResults(); |
service->DismissAppList(); |
} |
+ |
+#if defined(OS_CHROMEOS) |
+ |
+class AppListControllerGuestModeBrowserTest : public InProcessBrowserTest { |
+ protected: |
+ void SetUpCommandLine(base::CommandLine* command_line) override; |
+}; |
tapted
2015/03/04 05:01:10
nit: DISALLOW_COPY_AND_ASSIGN -- you'll need defa
Matt Giuca
2015/03/04 06:07:05
Done.
|
+ |
+void AppListControllerGuestModeBrowserTest::SetUpCommandLine( |
+ base::CommandLine* command_line) { |
+ base::CommandLine command_line_copy = *command_line; |
+ command_line_copy.AppendSwitchASCII(chromeos::switches::kLoginProfile, |
+ "user"); |
tapted
2015/03/04 05:01:10
"user" -> TestingProfile::kTestUserProfileDir ?
Matt Giuca
2015/03/04 06:07:05
Done.
|
+ command_line_copy.AppendSwitch(chromeos::switches::kGuestSession); |
+ chromeos::GetOffTheRecordCommandLine(GetGoogleURL(), true, command_line_copy, |
tapted
2015/03/04 05:01:10
Can `GetOffTheRecordCommandLine` be cut out of the
Matt Giuca
2015/03/04 06:07:05
Yeah, I replaced this with the code from guest_mod
|
+ command_line); |
+} |
+ |
+// Test creating the initial app list in guest mode. |
+IN_PROC_BROWSER_TEST_F(AppListControllerGuestModeBrowserTest, Incognito) { |
+ AppListService* service = test::GetAppListService(); |
+ EXPECT_TRUE(service->GetCurrentAppListProfile()); |
+ |
+ service->ShowForProfile(browser()->profile()); |
+ EXPECT_EQ(browser()->profile(), service->GetCurrentAppListProfile()); |
+} |
+ |
+#endif // defined(OS_CHROMEOS) |