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

Side by Side Diff: chrome/test/data/webui/settings/startup_urls_page_test.js

Issue 2653023003: MD Settings: Update some dialogs to accept Enter key. (Closed)
Patch Set: add a test for one of them Created 3 years, 11 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
« no previous file with comments | « chrome/browser/resources/settings/search_engines_page/search_engine_dialog.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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('settings_startup_urls_page', function() { 5 cr.define('settings_startup_urls_page', function() {
6 /** 6 /**
7 * @constructor 7 * @constructor
8 * @implements {settings.StartupUrlsPageBrowserProxy} 8 * @implements {settings.StartupUrlsPageBrowserProxy}
9 * @extends {settings.TestBrowserProxy} 9 * @extends {settings.TestBrowserProxy}
10 */ 10 */
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 test('AddStartupPage', function() { 176 test('AddStartupPage', function() {
177 document.body.appendChild(dialog); 177 document.body.appendChild(dialog);
178 return testProxyCalled('addStartupPage'); 178 return testProxyCalled('addStartupPage');
179 }); 179 });
180 180
181 test('EditStartupPage', function() { 181 test('EditStartupPage', function() {
182 dialog.model = createSampleUrlEntry(); 182 dialog.model = createSampleUrlEntry();
183 document.body.appendChild(dialog); 183 document.body.appendChild(dialog);
184 return testProxyCalled('editStartupPage'); 184 return testProxyCalled('editStartupPage');
185 }); 185 });
186
187 test('Enter key submits', function() {
188 document.body.appendChild(dialog);
189
190 // Input a URL and force validation.
191 var inputElement = dialog.$.url;
192 inputElement.value = 'foo.com';
193 pressSpace(inputElement);
194
195 return browserProxy.whenCalled('validateStartupPage').then(function() {
196 MockInteractions.keyEventOn(
197 inputElement, 'keypress', 13, undefined, 'Enter');
198
199 return browserProxy.whenCalled('addStartupPage');
200 });
201 });
186 }); 202 });
187 203
188 suite('StartupUrlsPage', function() { 204 suite('StartupUrlsPage', function() {
189 /** @type {?SettingsStartupUrlsPageElement} */ 205 /** @type {?SettingsStartupUrlsPageElement} */
190 var page = null; 206 var page = null;
191 207
192 var browserProxy = null; 208 var browserProxy = null;
193 209
194 setup(function() { 210 setup(function() {
195 browserProxy = new TestStartupUrlsPageBrowserProxy(); 211 browserProxy = new TestStartupUrlsPageBrowserProxy();
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 test('Editable', function() { 352 test('Editable', function() {
337 assertFalse(!!element.editable); 353 assertFalse(!!element.editable);
338 assertFalse(!!element.$$('#dots')); 354 assertFalse(!!element.$$('#dots'));
339 355
340 element.editable = true; 356 element.editable = true;
341 Polymer.dom.flush(); 357 Polymer.dom.flush();
342 assertTrue(!!element.$$('#dots')); 358 assertTrue(!!element.$$('#dots'));
343 }); 359 });
344 }); 360 });
345 }); 361 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/search_engines_page/search_engine_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698