OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // None of these tests is relevant for Chrome OS. | 5 // None of these tests is relevant for Chrome OS. |
6 GEN('#if !defined(OS_CHROMEOS)'); | 6 GEN('#if !defined(OS_CHROMEOS)'); |
7 | 7 |
8 GEN('#include "base/command_line.h"'); | 8 GEN('#include "base/command_line.h"'); |
9 GEN('#include "chrome/common/chrome_switches.h"'); | 9 GEN('#include "chrome/common/chrome_switches.h"'); |
10 | 10 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 assertEquals('policy', indicator.getAttribute('controlled-by')); | 294 assertEquals('policy', indicator.getAttribute('controlled-by')); |
295 | 295 |
296 CreateProfileOverlay.updateSignedInStatus(custodianEmail); | 296 CreateProfileOverlay.updateSignedInStatus(custodianEmail); |
297 CreateProfileOverlay.updateManagedUsersAllowed(true); | 297 CreateProfileOverlay.updateManagedUsersAllowed(true); |
298 assertFalse(checkbox.disabled, 're-allowed and signed in'); | 298 assertFalse(checkbox.disabled, 're-allowed and signed in'); |
299 assertFalse(link.hidden, 're-allowed and signed in'); | 299 assertFalse(link.hidden, 're-allowed and signed in'); |
300 assertEquals('none', window.getComputedStyle(indicator, null).display, | 300 assertEquals('none', window.getComputedStyle(indicator, null).display, |
301 're-allowed and signed in'); | 301 're-allowed and signed in'); |
302 }); | 302 }); |
303 | 303 |
304 // The managed user checkbox should correctly update its state during profile | |
305 // creation and afterwards. | |
306 TEST_F('ManageProfileUITest', 'CreateInProgress', function() { | |
307 ManageProfileOverlay.getInstance().initializePage(); | |
308 | |
309 var custodianEmail = 'chrome.playpen.test@gmail.com'; | |
310 CreateProfileOverlay.updateSignedInStatus(custodianEmail); | |
311 CreateProfileOverlay.updateManagedUsersAllowed(true); | |
312 var checkbox = $('create-profile-managed'); | |
313 var link = $('create-profile-managed-not-signed-in-link'); | |
314 var indicator = $('create-profile-managed-indicator'); | |
315 | |
316 assertFalse(checkbox.disabled, 'allowed and signed in'); | |
317 assertFalse(link.hidden, 'allowed and signed in'); | |
318 assertEquals('none', window.getComputedStyle(indicator, null).display, | |
319 'allowed and signed in'); | |
320 assertFalse(indicator.hasAttribute('controlled-by')); | |
321 | |
322 CreateProfileOverlay.updateCreateInProgress(true); | |
323 assertTrue(checkbox.disabled, 'creation in progress'); | |
324 | |
325 CreateProfileOverlay.updateCreateInProgress(false); | |
Pam (message me for reviews)
2013/09/05 10:08:38
This test wouldn't have caught the bug. We must ha
Bernhard Bauer
2013/09/05 12:49:14
Good catch! Yeah, ProfileSyncService is quite libe
| |
326 assertFalse(checkbox.disabled, 'creation finished'); | |
327 }); | |
328 | |
304 // Managed users shouldn't be able to open the delete or create dialogs. | 329 // Managed users shouldn't be able to open the delete or create dialogs. |
305 TEST_F('ManageProfileUITest', 'ManagedShowDeleteAndCreate', function() { | 330 TEST_F('ManageProfileUITest', 'ManagedShowDeleteAndCreate', function() { |
306 this.setProfileManaged_(false); | 331 this.setProfileManaged_(false); |
307 | 332 |
308 ManageProfileOverlay.showCreateDialog(); | 333 ManageProfileOverlay.showCreateDialog(); |
309 assertEquals('createProfile', OptionsPage.getTopmostVisiblePage().name); | 334 assertEquals('createProfile', OptionsPage.getTopmostVisiblePage().name); |
310 OptionsPage.closeOverlay(); | 335 OptionsPage.closeOverlay(); |
311 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); | 336 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); |
312 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); | 337 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); |
313 assertEquals('manageProfile', OptionsPage.getTopmostVisiblePage().name); | 338 assertEquals('manageProfile', OptionsPage.getTopmostVisiblePage().name); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); | 374 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); |
350 | 375 |
351 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); | 376 ManageProfileOverlay.showDeleteDialog(this.testProfileInfo_(false)); |
352 this.setProfileManaged_(true); | 377 this.setProfileManaged_(true); |
353 messages = clickAndListen(); | 378 messages = clickAndListen(); |
354 assertEquals(0, messages.length); | 379 assertEquals(0, messages.length); |
355 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); | 380 assertEquals('settings', OptionsPage.getTopmostVisiblePage().name); |
356 }); | 381 }); |
357 | 382 |
358 GEN('#endif // OS_CHROMEOS'); | 383 GEN('#endif // OS_CHROMEOS'); |
OLD | NEW |