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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/chrome_notification_types.h" 5 #include "chrome/browser/chrome_notification_types.h"
6 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" 6 #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
7 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" 7 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
8 #include "chromeos/chromeos_switches.h" 8 #include "chromeos/chromeos_switches.h"
9 #include "content/public/test/browser_test_utils.h" 9 #include "content/public/test/browser_test_utils.h"
10 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 SetSignFormField("password", OobeBaseTest::kFakeUserPassword); 77 SetSignFormField("password", OobeBaseTest::kFakeUserPassword);
78 ExecuteJsInSigninFrame("document.getElementById('nextButton').click();"); 78 ExecuteJsInSigninFrame("document.getElementById('nextButton').click();");
79 79
80 session_start_waiter.Wait(); 80 session_start_waiter.Wait();
81 } 81 }
82 82
83 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowGuest) { 83 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowGuest) {
84 WaitForGaiaPageLoad(); 84 WaitForGaiaPageLoad();
85 JsExpect("!$('guest-user-header-bar-item').hidden"); 85 JsExpect("!$('guest-user-header-bar-item').hidden");
86 chromeos::CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false); 86 CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false);
87 JsExpect("$('guest-user-header-bar-item').hidden"); 87 JsExpect("$('guest-user-header-bar-item').hidden");
88 } 88 }
89 89
90 // Create new account option should be available only if the settings allow it.
91 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowNewUser) {
92 DisableRestrictiveProxyCheck();
93 WaitForGaiaPageLoad();
94
95 std::string frame_url = "$('gaia-signin').gaiaAuthHost_.reloadUrl_";
96 // New users are allowed.
97 JsExpect(frame_url + ".search('flow=nosignup') == -1");
98
99 // Disallow new users - we also need to set a whitelist due to weird logic.
100 CrosSettings::Get()->Set(kAccountsPrefUsers, base::ListValue());
101 CrosSettings::Get()->SetBoolean(kAccountsPrefAllowNewUser, false);
102 WaitForGaiaPageReload();
103
104 // flow=nosignup indicates that user creation is not allowed.
105 JsExpect(frame_url + ".search('flow=nosignup') != -1");
106 }
107
90 } // namespace chromeos 108 } // namespace chromeos
OLDNEW
« 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