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

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

Issue 2670963003: MD Settings: in spell-check page, disable add button when input is empty. (Closed)
Patch Set: add edit-dictionary page test Created 3 years, 10 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/languages_page/edit_dictionary_page.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 /** @fileoverview Suite of tests for settings-languages-page. */ 5 /** @fileoverview Suite of tests for settings-languages-page. */
6 6
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 assertFalse(triggerRow.classList.contains('two-line')); 440 assertFalse(triggerRow.classList.contains('two-line'));
441 assertEquals( 441 assertEquals(
442 0, triggerRow.querySelector('.secondary').textContent.length); 442 0, triggerRow.querySelector('.secondary').textContent.length);
443 443
444 languagesPage.set( 444 languagesPage.set(
445 'languages.enabled.0.language.supportsSpellcheck', true); 445 'languages.enabled.0.language.supportsSpellcheck', true);
446 languagesPage.set('languages.enabled.0.spellCheckEnabled', true); 446 languagesPage.set('languages.enabled.0.spellCheckEnabled', true);
447 assertTrue(triggerRow.classList.contains('two-line')); 447 assertTrue(triggerRow.classList.contains('two-line'));
448 assertLT( 448 assertLT(
449 0, triggerRow.querySelector('.secondary').textContent.length); 449 0, triggerRow.querySelector('.secondary').textContent.length);
450 }
451 });
450 452
453 if (!cr.isMac) {
454 test('spellcheck edit dictionary page add word button', function() {
455 assertFalse(!!languagesPage.$$('settings-edit-dictionary-page'));
456 var spellCheckCollapse = languagesPage.$.spellCheckCollapse;
451 MockInteractions.tap( 457 MockInteractions.tap(
452 spellCheckCollapse.querySelector('.list-button:last-of-type')); 458 spellCheckCollapse.querySelector('.list-button:last-of-type'));
dpapad 2017/02/06 22:40:59 Are you sure that this selector works as expected?
scottchen 2017/02/06 23:38:31 The (non-)existence of the subpage is checked befo
453 assertTrue(!!languagesPage.$$('settings-edit-dictionary-page')); 459 var editDictPage = languagesPage.$$('settings-edit-dictionary-page');
454 } 460 assertTrue(!!editDictPage);
455 }); 461 var addWordButton = editDictPage.root.querySelector('paper-button');
462 editDictPage.$.newWord.value = '';
463 assertTrue(!!addWordButton);
464 assertTrue(addWordButton.disabled);
465 editDictPage.$.newWord.value = 'valid word';
466 assertFalse(addWordButton.disabled);
467 });
468 }
456 }.bind(this)); 469 }.bind(this));
457 470
458 // TODO(michaelpg): Test more aspects of the languages UI. 471 // TODO(michaelpg): Test more aspects of the languages UI.
459 472
460 // Run all registered tests. 473 // Run all registered tests.
461 mocha.run(); 474 mocha.run();
462 }); 475 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/languages_page/edit_dictionary_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698