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

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

Issue 2235093002: Fix Loading text for settings-dropdown-menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/controls/settings_dropdown_menu.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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-dropdown-menu. */ 5 /** @fileoverview Suite of tests for settings-dropdown-menu. */
6 cr.define('settings_dropdown_menu', function() { 6 cr.define('settings_dropdown_menu', function() {
7 function registerTests() { 7 function registerTests() {
8 suite('SettingsDropdownMenu', function() { 8 suite('SettingsDropdownMenu', function() {
9 /** @type {SettingsDropdownMenu} */ 9 /** @type {SettingsDropdownMenu} */
10 var dropdown; 10 var dropdown;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 {value: 'b', name: 'BBB'}, 85 {value: 'b', name: 'BBB'},
86 {value: 'c', name: 'CCC'}, 86 {value: 'c', name: 'CCC'},
87 {value: 'd', name: 'DDD'}]; 87 {value: 'd', name: 'DDD'}];
88 Polymer.dom.flush(); 88 Polymer.dom.flush();
89 89
90 // "Custom" initially selected. 90 // "Custom" initially selected.
91 assertEquals(dropdown.notFoundValue_, selectable.selected); 91 assertEquals(dropdown.notFoundValue_, selectable.selected);
92 // Pref should not have changed. 92 // Pref should not have changed.
93 assertEquals('f', dropdown.pref.value); 93 assertEquals('f', dropdown.pref.value);
94 }); 94 });
95
96 test('delay setting options', function testDelayedOptions(done) {
97 dropdown.pref = {
98 key: 'test.number2',
99 type: chrome.settingsPrivate.PrefType.NUMBER,
100 value: 200,
101 };
102
103 setTimeout(function() {
104 assertEquals(
105 loadTimeData.getValue('loading'), dropdown.$.dropdownMenu.label);
106 assertTrue(dropdown.$.dropdownMenu.disabled);
107 assertEquals(undefined, selectable.selected);
108
109 dropdown.menuOptions = [{value: 100, name: 'Option 100'},
110 {value: 200, name: 'Option 200'},
111 {value: 300, name: 'Option 300'},
112 {value: 400, name: 'Option 400'}];
113 Polymer.dom.flush();
114
115 // Dropdown menu enables itself and selects the new menu option
116 // correpsonding to the pref value.
117 assertFalse(dropdown.$.dropdownMenu.disabled);
118 assertEquals('200', selectable.selected);
119 done();
120 }, 100);
121 });
95 }); 122 });
96 } 123 }
97 124
98 return { 125 return {
99 registerTests: registerTests, 126 registerTests: registerTests,
100 }; 127 };
101 }); 128 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/controls/settings_dropdown_menu.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698