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

Unified Diff: chrome/browser/chromeos/login/webview_login_browsertest.cc

Issue 1386523002: browser test for kAccountsPrefAllowNewUser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable_restrictive_proxy_check_for_test_ Created 5 years, 2 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/chromeos/login/webview_login_browsertest.cc
diff --git a/chrome/browser/chromeos/login/webview_login_browsertest.cc b/chrome/browser/chromeos/login/webview_login_browsertest.cc
index 520538ae22fd67889583d8c8513214cd0ed3cd7f..82030bea9a834ed767971a9eb6b7487eee6f343a 100644
--- a/chrome/browser/chromeos/login/webview_login_browsertest.cc
+++ b/chrome/browser/chromeos/login/webview_login_browsertest.cc
@@ -83,8 +83,26 @@ IN_PROC_BROWSER_TEST_F(WebviewLoginTest, DISABLED_BackButton) {
IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowGuest) {
WaitForGaiaPageLoad();
JsExpect("!$('guest-user-header-bar-item').hidden");
- chromeos::CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false);
+ CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false);
JsExpect("$('guest-user-header-bar-item').hidden");
}
+// Create new account option should be available only if the settings allow it.
+IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowNewUser) {
+ DisableRestrictiveProxyCheck();
+ WaitForGaiaPageLoad();
+
+ std::string frame_url = "$('gaia-signin').gaiaAuthHost_.reloadUrl_";
+ // New users are allowed.
+ JsExpect(frame_url + ".search('flow=nosignup') == -1");
+
+ // Disallow new users - we also need to set a whitelist due to weird logic.
+ CrosSettings::Get()->Set(kAccountsPrefUsers, base::ListValue());
+ CrosSettings::Get()->SetBoolean(kAccountsPrefAllowNewUser, false);
+ WaitForGaiaPageReload();
+
+ // flow=nosignup indicates that user creation is not allowed.
+ JsExpect(frame_url + ".search('flow=nosignup') != -1");
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/test/oobe_base_test.cc ('k') | chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698