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

Unified Diff: chrome/browser/ui/webui/options/manage_profile_browsertest.js

Issue 23875002: Correctly update enabled state of the "create managed user" checkbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 7 years, 3 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
« no previous file with comments | « chrome/browser/resources/options/manage_profile_overlay.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/manage_profile_browsertest.js
diff --git a/chrome/browser/ui/webui/options/manage_profile_browsertest.js b/chrome/browser/ui/webui/options/manage_profile_browsertest.js
index e02a526cad5ff8225a6be8e79ef0e554aa2701d3..f17f6f0a256bbc02edcd1188680974c6bff10b63 100644
--- a/chrome/browser/ui/webui/options/manage_profile_browsertest.js
+++ b/chrome/browser/ui/webui/options/manage_profile_browsertest.js
@@ -301,6 +301,36 @@ TEST_F('ManageProfileUITest', 'PolicyDynamicRefresh', function() {
're-allowed and signed in');
});
+// The managed user checkbox should correctly update its state during profile
+// creation and afterwards.
+TEST_F('ManageProfileUITest', 'CreateInProgress', function() {
+ ManageProfileOverlay.getInstance().initializePage();
+
+ var custodianEmail = 'chrome.playpen.test@gmail.com';
+ CreateProfileOverlay.updateSignedInStatus(custodianEmail);
+ CreateProfileOverlay.updateManagedUsersAllowed(true);
+ var checkbox = $('create-profile-managed');
+ var link = $('create-profile-managed-not-signed-in-link');
+ var indicator = $('create-profile-managed-indicator');
+
+ assertFalse(checkbox.disabled, 'allowed and signed in');
+ assertFalse(link.hidden, 'allowed and signed in');
+ assertEquals('none', window.getComputedStyle(indicator, null).display,
+ 'allowed and signed in');
+ assertFalse(indicator.hasAttribute('controlled-by'));
+
+ CreateProfileOverlay.updateCreateInProgress(true);
+ assertTrue(checkbox.disabled, 'creation in progress');
+
+ // A no-op update to the sign-in status should not change the UI.
+ CreateProfileOverlay.updateSignedInStatus(custodianEmail);
+ CreateProfileOverlay.updateManagedUsersAllowed(true);
+ assertTrue(checkbox.disabled, 'creation in progress');
+
+ CreateProfileOverlay.updateCreateInProgress(false);
+ assertFalse(checkbox.disabled, 'creation finished');
+});
+
// Managed users shouldn't be able to open the delete or create dialogs.
TEST_F('ManageProfileUITest', 'ManagedShowDeleteAndCreate', function() {
this.setProfileManaged_(false);
« no previous file with comments | « chrome/browser/resources/options/manage_profile_overlay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698