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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_browsertest.cc

Issue 228553002: Preference dis/allowing supervised users creation is now available as owner setting, not only as de… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unnecessary callback removed. Patch applied for failing tests. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chromeos/login/login_manager_test.h" 8 #include "chrome/browser/chromeos/login/login_manager_test.h"
9 #include "chrome/browser/chromeos/login/startup_utils.h" 9 #include "chrome/browser/chromeos/login/startup_utils.h"
10 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" 10 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 EXPECT_EQ(is_owner, !warning_visible); 84 EXPECT_EQ(is_owner, !warning_visible);
85 85
86 bool guest_option_enabled; 86 bool guest_option_enabled;
87 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 87 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
88 contents, 88 contents,
89 "var e = document.getElementById('allowBwsiCheck');" 89 "var e = document.getElementById('allowBwsiCheck');"
90 "window.domAutomationController.send(!e.disabled);", 90 "window.domAutomationController.send(!e.disabled);",
91 &guest_option_enabled)); 91 &guest_option_enabled));
92 EXPECT_EQ(is_owner, guest_option_enabled); 92 EXPECT_EQ(is_owner, guest_option_enabled);
93 93
94 bool supervised_users_enabled;
95 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
96 contents,
97 "var e = document.getElementById('allowSupervisedCheck');"
98 "window.domAutomationController.send(!e.disabled);",
99 &supervised_users_enabled));
100 ASSERT_EQ(is_owner, supervised_users_enabled);
101
94 bool user_pods_enabled; 102 bool user_pods_enabled;
95 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 103 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
96 contents, 104 contents,
97 "var e = document.getElementById('showUserNamesCheck');" 105 "var e = document.getElementById('showUserNamesCheck');"
98 "window.domAutomationController.send(!e.disabled);", 106 "window.domAutomationController.send(!e.disabled);",
99 &user_pods_enabled)); 107 &user_pods_enabled));
100 EXPECT_EQ(is_owner, user_pods_enabled); 108 EXPECT_EQ(is_owner, user_pods_enabled);
101 109
102 bool whitelist_enabled; 110 bool whitelist_enabled;
103 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 111 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
(...skipping 24 matching lines...) Expand all
128 AddUser(kTestUsers[1]); 136 AddUser(kTestUsers[1]);
129 137
130 UserManager* manager = UserManager::Get(); 138 UserManager* manager = UserManager::Get();
131 ASSERT_EQ(2u, manager->GetLoggedInUsers().size()); 139 ASSERT_EQ(2u, manager->GetLoggedInUsers().size());
132 140
133 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */); 141 CheckAccountsUI(manager->FindUser(kTestUsers[0]), true /* is_owner */);
134 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */); 142 CheckAccountsUI(manager->FindUser(kTestUsers[1]), false /* is_owner */);
135 } 143 }
136 144
137 } // namespace chromeos 145 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698