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

Unified Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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 | « chrome/browser/ui/webui/history_ui.cc ('k') | chrome/browser/ui/webui/ntp/ntp_login_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
index 64733b64c4d640928fd604aae82c81643c0fa924..0dcba841b281376fa47fecc13bdc95490a93b926 100644
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
@@ -15,10 +15,12 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h"
+#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chrome/test/base/web_ui_browser_test.h"
+#include "chromeos/chromeos_switches.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/signin_manager_base.h"
@@ -361,12 +363,6 @@ class LocalDiscoveryUITest : public WebUIBrowserTest {
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(browser()->profile());
-#if defined(OS_CHROMEOS)
- // Chrome OS initializes prefs::kGoogleServicesUsername to "stub user" so
- // we need to override it as well.
- browser()->profile()->GetPrefs()->
- SetString(prefs::kGoogleServicesUsername, kSampleUser);
-#endif
DCHECK(signin_manager);
signin_manager->SetAuthenticatedUsername(kSampleUser);
@@ -429,6 +425,14 @@ class LocalDiscoveryUITest : public WebUIBrowserTest {
}
virtual void SetUpCommandLine(CommandLine* command_line) override {
+#if defined(OS_CHROMEOS)
+ // On chromeos, don't sign in with the stub-user automatically. Use the
+ // kLoginUser instead.
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
+ kSampleUser);
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
+ chrome::kTestUserProfileDir);
+#endif
WebUIBrowserTest::SetUpCommandLine(command_line);
}
« no previous file with comments | « chrome/browser/ui/webui/history_ui.cc ('k') | chrome/browser/ui/webui/ntp/ntp_login_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698