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

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

Issue 976553003: Fix Launcher crash in ChromeOS guest mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to tapted comments. Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f295c938e74230a1dc9a220b60e7e6e10aff8618 100644
--- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
+++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
@@ -15,7 +15,9 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/testing_profile.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/search_box_model.h"
@@ -23,6 +25,11 @@
#include "ui/app_list/search_result_observer.h"
#include "ui/base/models/list_model_observer.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/chromeos_switches.h"
+#include "chromeos/login/user_names.h"
+#endif // defined(OS_CHROMEOS)
+
// Browser Test for AppListController that runs on all platforms supporting
// app_list.
typedef InProcessBrowserTest AppListControllerBrowserTest;
@@ -212,3 +219,37 @@ IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest,
StopWatchingResults();
service->DismissAppList();
}
+
+#if defined(OS_CHROMEOS)
+
+class AppListControllerGuestModeBrowserTest : public InProcessBrowserTest {
+ public:
+ AppListControllerGuestModeBrowserTest() {}
+
+ protected:
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AppListControllerGuestModeBrowserTest);
+};
+
+void AppListControllerGuestModeBrowserTest::SetUpCommandLine(
+ base::CommandLine* command_line) {
+ command_line->AppendSwitch(chromeos::switches::kGuestSession);
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
+ chromeos::login::kGuestUserName);
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
+ TestingProfile::kTestUserProfileDir);
+ command_line->AppendSwitch(switches::kIncognito);
+}
+
+// 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)
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698