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

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

Issue 1506353007: Show warning message when trying to create SU with existing name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 c5875736f8acd1043d07ca06aa24e2ba2bb54b41..d4144e03322f392cc8a5dd8c45a478067af61b07 100644
--- a/chrome/browser/ui/webui/options/manage_profile_browsertest.js
+++ b/chrome/browser/ui/webui/options/manage_profile_browsertest.js
@@ -202,7 +202,14 @@ TEST_F('ManageProfileUITestAsync', 'CreateExistingSupervisedUser', function() {
},
{
id: 'supervisedUser4',
- name: 'SameName',
+ name: 'RepeatingName',
+ iconURL: 'chrome://path/to/icon/image',
+ onCurrentDevice: true,
+ needAvatar: false
+ },
+ {
+ id: 'supervisedUser5',
+ name: 'RepeatingName',
iconURL: 'chrome://path/to/icon/image',
onCurrentDevice: false,
needAvatar: false
@@ -218,10 +225,10 @@ TEST_F('ManageProfileUITestAsync', 'CreateExistingSupervisedUser', function() {
CreateProfileOverlay.getInstance().signedInEmail_);
this.setProfileSupervised_(false, 'create');
- // Also add the names 'Test' and 'SameName' to |existingProfileNames_| to
+ // Also add the names 'Test' and 'RepeatingName' to |existingProfileNames_| to
// simulate that profiles with those names exist on the device.
ManageProfileOverlay.getInstance().existingProfileNames_.Test = true;
- ManageProfileOverlay.getInstance().existingProfileNames_.SameName = true;
+ ManageProfileOverlay.getInstance().existingProfileNames_.RepeatingName = true;
// Initially, the ok button should be enabled and the import link should not
// exist.
@@ -252,12 +259,13 @@ TEST_F('ManageProfileUITestAsync', 'CreateExistingSupervisedUser', function() {
ManageProfileOverlay.getInstance().onNameChanged_('create');
return options.SupervisedUserListData.getInstance().promise_;
}).then(function() {
- assertFalse($('create-profile-ok').disabled);
+ assertTrue($('create-profile-ok').disabled);
assertTrue($('supervised-user-import-existing') == null);
- // A profile which does not exist on the device, but there is a profile with
- // the same name already on the device.
- nameField.value = 'SameName';
+ // A supervised user profile that is on the device, but has the same name
+ // as a supervised user profile that is not imported.
+ // This can happen due to a bug (https://crbug.com/557445)
+ nameField.value = 'RepeatingName';
ManageProfileOverlay.getInstance().onNameChanged_('create');
return options.SupervisedUserListData.getInstance().promise_;
}).then(function() {
« no previous file with comments | « chrome/browser/resources/options/manage_profile_overlay.js ('k') | chrome/browser/ui/webui/options/manage_profile_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698