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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 cr.define('user_manager.create_profile_tests', function() { 5 cr.define('user_manager.create_profile_tests', function() {
6 /** @return {!CreateProfileElement} */ 6 /** @return {!CreateProfileElement} */
7 function createElement() { 7 function createElement() {
8 var createProfileElement = document.createElement('create-profile'); 8 var createProfileElement = document.createElement('create-profile');
9 document.body.appendChild(createProfileElement); 9 document.body.appendChild(createProfileElement);
10 return createProfileElement; 10 return createProfileElement;
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 return browserProxy.whenCalled('createProfile').then(function(args) { 500 return browserProxy.whenCalled('createProfile').then(function(args) {
501 assertEquals('profile name', args.profileName); 501 assertEquals('profile name', args.profileName);
502 assertEquals('icon1.png', args.profileIconUrl); 502 assertEquals('icon1.png', args.profileIconUrl);
503 assertTrue(args.createShortcut); 503 assertTrue(args.createShortcut);
504 assertFalse(args.isSupervised); 504 assertFalse(args.isSupervised);
505 assertEquals('', args.supervisedUserId); 505 assertEquals('', args.supervisedUserId);
506 assertEquals('', args.custodianProfilePath); 506 assertEquals('', args.custodianProfilePath);
507 }); 507 });
508 }); 508 });
509 }); 509 });
510
511 suite('CreateProfileTestsSupervisedUserCreationCheckBox', function() {
Moe 2016/12/11 22:11:40 nit: CreateProfileTestsForceSigninPolicy
zmin 2016/12/12 20:32:43 Done.
512 setup(function() {
513 browserProxy = new TestProfileBrowserProxy();
514 // Replace real proxy with mock proxy.
515 signin.ProfileBrowserProxyImpl.instance_ = browserProxy;
516 browserProxy.setIcons([{url: 'icon1.png', label: 'icon1'}]);
517 });
518
519 teardown(function(done) {
520 createProfileElement.remove();
521 // Allow asynchronous tasks to finish.
522 setTimeout(done);
523 });
524
525 test('Create profile without supervised checkbox', function () {
Moe 2016/12/11 22:11:40 nit: 'force sign in policy enabled'
zmin 2016/12/12 20:32:43 Done.
526 loadTimeData.overrideValues({
527 isForceSigninEnabled: true,
528 });
529 createProfileElement = createElement();
530 Polymer.dom.flush();
531
532 var createSupervisedUserCheckbox =
533 createProfileElement.$.makeSupervisedCheckbox;
534 assertTrue(createSupervisedUserCheckbox.clientHeight == 0);
535 });
536
537 test('Create profile with supervised checkbox', function () {
Moe 2016/12/11 22:11:40 nit: 'force sign in policy not enabled'
zmin 2016/12/12 20:32:43 Done.
538 loadTimeData.overrideValues({
539 isForceSigninEnabled: false,
540 });
541 createProfileElement = createElement();
542 Polymer.dom.flush();
543
544 var createSupervisedUserCheckbox =
545 createProfileElement.$.makeSupervisedCheckbox;
546 assertTrue(createSupervisedUserCheckbox.clientHeight > 0);
547 });
548 });
510 } 549 }
511 550
512 return { 551 return {
513 registerTests: registerTests, 552 registerTests: registerTests,
514 }; 553 };
515 }); 554 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698