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

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

Issue 75363002: Set focus to the "OK" button when editing a supervised user profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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
===================================================================
--- chrome/browser/ui/webui/options/manage_profile_browsertest.js (revision 235678)
+++ chrome/browser/ui/webui/options/manage_profile_browsertest.js (working copy)
@@ -66,6 +66,8 @@
},
};
+// Receiving the new profile defaults in the manage-user overlay shouldn't mess
+// up the focus in a visible higher-level overlay.
TEST_F('ManageProfileUITest', 'NewProfileDefaultsFocus', function() {
var self = this;
@@ -150,17 +152,22 @@
assertTrue($('create-profile-managed').disabled);
});
-// Managed users should not be able to edit their profile names.
+// Managed users should not be able to edit their profile names, and the initial
+// focus should be adjusted accordingly.
TEST_F('ManageProfileUITest', 'EditManagedUserNameAllowed', function() {
var nameField = $('manage-profile-name');
this.setProfileManaged_(false);
ManageProfileOverlay.showManageDialog();
- assertFalse(nameField.disabled);
+ expectFalse(nameField.disabled);
+ expectEquals(nameField, document.activeElement);
+ OptionsPage.closeOverlay();
+
this.setProfileManaged_(true);
ManageProfileOverlay.showManageDialog();
- assertTrue(nameField.disabled);
+ expectTrue(nameField.disabled);
+ expectEquals($('manage-profile-ok'), document.activeElement);
});
// Setting profile information should allow the confirmation to be shown.
« 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