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

Unified Diff: chrome/test/data/webui/md_user_manager/create_profile_tests.js

Issue 2561243002: Hide supervised user creation from UserManager when force sign in is enabled. (Closed)
Patch Set: Created 4 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/resources/md_user_manager/create_profile.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_user_manager/create_profile_tests.js
diff --git a/chrome/test/data/webui/md_user_manager/create_profile_tests.js b/chrome/test/data/webui/md_user_manager/create_profile_tests.js
index 62579562e8d779d97563a9ba01969dbeb8038ccd..5372b0cf99d7246870f34f93ae30c24ae0173f18 100644
--- a/chrome/test/data/webui/md_user_manager/create_profile_tests.js
+++ b/chrome/test/data/webui/md_user_manager/create_profile_tests.js
@@ -66,7 +66,8 @@ cr.define('user_manager.create_profile_tests', function() {
assertFalse(!!createProfileElement.$$('paper-dropdown-menu'));
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// The dropdown menu is visible and is populated with signed in users.
@@ -115,7 +116,8 @@ cr.define('user_manager.create_profile_tests', function() {
test('Has to select a custodian for the supervised profile', function() {
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// Simulate clicking 'Create'.
@@ -135,7 +137,8 @@ cr.define('user_manager.create_profile_tests', function() {
test('Supervised profile name is duplicate (on the device)', function() {
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// There is an existing supervised user with this name on the device.
@@ -166,7 +169,8 @@ cr.define('user_manager.create_profile_tests', function() {
test('Supervised profile name is duplicate (remote)', function() {
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// There is an existing supervised user with this name on the device.
@@ -199,7 +203,8 @@ cr.define('user_manager.create_profile_tests', function() {
browserProxy.setExistingSupervisedUsers([]);
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// Select the first signed in user.
@@ -227,7 +232,8 @@ cr.define('user_manager.create_profile_tests', function() {
test('Create supervised profile', function() {
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// Select the first signed in user.
@@ -418,7 +424,8 @@ cr.define('user_manager.create_profile_tests', function() {
assertEquals(0, createProfileElement.signedInUsers_.length);
// Simulate checking the supervised user checkbox.
- MockInteractions.tap(createProfileElement.$.makeSupervisedCheckbox);
+ MockInteractions.tap(
+ createProfileElement.$$("#makeSupervisedCheckbox"));
Polymer.dom.flush();
// The dropdown menu is not visible when there are no signed in users.
@@ -507,6 +514,45 @@ cr.define('user_manager.create_profile_tests', function() {
});
});
});
+
+ suite('CreateProfileTestsForceSigninPolicy', function() {
+ setup(function() {
+ browserProxy = new TestProfileBrowserProxy();
+ // Replace real proxy with mock proxy.
+ signin.ProfileBrowserProxyImpl.instance_ = browserProxy;
+ browserProxy.setIcons([{url: 'icon1.png', label: 'icon1'}]);
+ });
+
+ teardown(function(done) {
+ createProfileElement.remove();
+ // Allow asynchronous tasks to finish.
+ setTimeout(done);
+ });
+
+ test('force sign in policy enabled', function () {
+ loadTimeData.overrideValues({
+ isForceSigninEnabled: true,
+ });
+ createProfileElement = createElement();
+ Polymer.dom.flush();
+
+ var createSupervisedUserCheckbox =
+ createProfileElement.$$("#makeSupervisedCheckbox");
+ assertFalse(!!createSupervisedUserCheckbox);
+ });
+
+ test('force sign in policy not enabled', function () {
+ loadTimeData.overrideValues({
+ isForceSigninEnabled: false,
+ });
+ createProfileElement = createElement();
+ Polymer.dom.flush();
+
+ var createSupervisedUserCheckbox =
+ createProfileElement.$$("#makeSupervisedCheckbox");
+ assertTrue(createSupervisedUserCheckbox.clientHeight > 0);
+ });
+ });
}
return {
« no previous file with comments | « chrome/browser/resources/md_user_manager/create_profile.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698