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

Side by Side Diff: chrome/test/data/webui/md_user_manager/create_profile_tests.js

Issue 1920253002: Refactors parse_html_subset() into i18n_behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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 PolymerTest.clearBody(); 8 PolymerTest.clearBody();
9 var createProfileElement = document.createElement('create-profile'); 9 var createProfileElement = document.createElement('create-profile');
10 document.body.appendChild(createProfileElement); 10 document.body.appendChild(createProfileElement);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 test('Sentinel item is the initially selected item', function() { 77 test('Sentinel item is the initially selected item', function() {
78 return browserProxy.whenCalled('getSignedInUsers').then(function() { 78 return browserProxy.whenCalled('getSignedInUsers').then(function() {
79 // Simulate checking the checkbox. 79 // Simulate checking the checkbox.
80 MockInteractions.tap(createProfileElement.$$('paper-checkbox')); 80 MockInteractions.tap(createProfileElement.$$('paper-checkbox'));
81 Polymer.dom.flush(); 81 Polymer.dom.flush();
82 82
83 var dropdownMenu = createProfileElement.$$('paper-dropdown-menu'); 83 var dropdownMenu = createProfileElement.$$('paper-dropdown-menu');
84 var paperMenu = dropdownMenu.querySelector('paper-menu'); 84 var paperMenu = dropdownMenu.querySelector('paper-menu');
85 assertEquals(createProfileElement.i18n('selectAnAccount'), 85 assertEquals(createProfileElement.i18n('selectAnAccount'),
86 paperMenu.selectedItem.textContent.trim()); 86 [paperMenu.selectedItem.textContent.trim()]);
87 }); 87 });
88 }); 88 });
89 89
90 test('Name is non-empty by default', function() { 90 test('Name is non-empty by default', function() {
91 assertEquals('profile name', createProfileElement.$.nameInput.value); 91 assertEquals('profile name', createProfileElement.$.nameInput.value);
92 }); 92 });
93 93
94 test('Create button is disabled if name is empty or invalid', function() { 94 test('Create button is disabled if name is empty or invalid', function() {
95 assertEquals('profile name', createProfileElement.$.nameInput.value); 95 assertEquals('profile name', createProfileElement.$.nameInput.value);
96 assertFalse(createProfileElement.$.nameInput.invalid); 96 assertFalse(createProfileElement.$.nameInput.invalid);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 test('Create button is disabled', function() { 387 test('Create button is disabled', function() {
388 assertTrue(createProfileElement.$.save.disabled); 388 assertTrue(createProfileElement.$.save.disabled);
389 }); 389 });
390 }); 390 });
391 } 391 }
392 392
393 return { 393 return {
394 registerTests: registerTests, 394 registerTests: registerTests,
395 }; 395 };
396 }); 396 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698