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

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

Issue 2848973003: MD Settings: convert paper-icon-button to paper-icon-button-light. (Closed)
Patch Set: move unrelated fix to another CL Created 3 years, 6 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('settings_search_engines_page', function() { 5 cr.define('settings_search_engines_page', function() {
6 /** 6 /**
7 * @param {string} name 7 * @param {string} name
8 * @param {boolean} canBeDefault 8 * @param {boolean} canBeDefault
9 * @param {boolean} canBeEdited 9 * @param {boolean} canBeEdited
10 * @param {boolean} canBeRemoved 10 * @param {boolean} canBeRemoved
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 assertEquals( 169 assertEquals(
170 searchEngine.keyword, 170 searchEngine.keyword,
171 entry.root.querySelector('#keyword-column').textContent); 171 entry.root.querySelector('#keyword-column').textContent);
172 assertEquals( 172 assertEquals(
173 searchEngine.url, 173 searchEngine.url,
174 entry.root.querySelector('#url-column').textContent); 174 entry.root.querySelector('#url-column').textContent);
175 }); 175 });
176 176
177 test('Remove_Enabled', function() { 177 test('Remove_Enabled', function() {
178 // Open action menu. 178 // Open action menu.
179 MockInteractions.tap(entry.$$('paper-icon-button')); 179 MockInteractions.tap(entry.$$('button'));
180 var menu = entry.$$('dialog[is=cr-action-menu]'); 180 var menu = entry.$$('dialog[is=cr-action-menu]');
181 assertTrue(menu.open); 181 assertTrue(menu.open);
182 182
183 var deleteButton = entry.$.delete; 183 var deleteButton = entry.$.delete;
184 assertTrue(!!deleteButton); 184 assertTrue(!!deleteButton);
185 assertFalse(deleteButton.hidden); 185 assertFalse(deleteButton.hidden);
186 MockInteractions.tap(deleteButton); 186 MockInteractions.tap(deleteButton);
187 return browserProxy.whenCalled('removeSearchEngine').then( 187 return browserProxy.whenCalled('removeSearchEngine').then(
188 function(modelIndex) { 188 function(modelIndex) {
189 assertFalse(menu.open); 189 assertFalse(menu.open);
190 assertEquals(entry.engine.modelIndex, modelIndex); 190 assertEquals(entry.engine.modelIndex, modelIndex);
191 }); 191 });
192 }); 192 });
193 193
194 test('MakeDefault_Enabled', function() { 194 test('MakeDefault_Enabled', function() {
195 // Open action menu. 195 // Open action menu.
196 MockInteractions.tap(entry.$$('paper-icon-button')); 196 MockInteractions.tap(entry.$$('button'));
197 var menu = entry.$$('dialog[is=cr-action-menu]'); 197 var menu = entry.$$('dialog[is=cr-action-menu]');
198 assertTrue(menu.open); 198 assertTrue(menu.open);
199 199
200 var makeDefaultButton = entry.$.makeDefault; 200 var makeDefaultButton = entry.$.makeDefault;
201 assertTrue(!!makeDefaultButton); 201 assertTrue(!!makeDefaultButton);
202 MockInteractions.tap(makeDefaultButton); 202 MockInteractions.tap(makeDefaultButton);
203 return browserProxy.whenCalled('setDefaultSearchEngine').then( 203 return browserProxy.whenCalled('setDefaultSearchEngine').then(
204 function(modelIndex) { 204 function(modelIndex) {
205 assertFalse(menu.open); 205 assertFalse(menu.open);
206 assertEquals(entry.engine.modelIndex, modelIndex); 206 assertEquals(entry.engine.modelIndex, modelIndex);
207 }); 207 });
208 }); 208 });
209 209
210 // Test that clicking the "edit" button brings up a dialog. 210 // Test that clicking the "edit" button brings up a dialog.
211 test('Edit_Enabled', function() { 211 test('Edit_Enabled', function() {
212 // Open action menu. 212 // Open action menu.
213 MockInteractions.tap(entry.$$('paper-icon-button')); 213 MockInteractions.tap(entry.$$('button'));
214 var menu = entry.$$('dialog[is=cr-action-menu]'); 214 var menu = entry.$$('dialog[is=cr-action-menu]');
215 assertTrue(menu.open); 215 assertTrue(menu.open);
216 216
217 var engine = entry.engine; 217 var engine = entry.engine;
218 var editButton = entry.$.edit; 218 var editButton = entry.$.edit;
219 assertTrue(!!editButton); 219 assertTrue(!!editButton);
220 assertFalse(editButton.hidden); 220 assertFalse(editButton.hidden);
221 MockInteractions.tap(editButton); 221 MockInteractions.tap(editButton);
222 return browserProxy.whenCalled('searchEngineEditStarted').then( 222 return browserProxy.whenCalled('searchEngineEditStarted').then(
223 function(modelIndex) { 223 function(modelIndex) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 389
390 setup(function() { 390 setup(function() {
391 browserProxy = new TestExtensionControlBrowserProxy(); 391 browserProxy = new TestExtensionControlBrowserProxy();
392 settings.ExtensionControlBrowserProxyImpl.instance_ = browserProxy; 392 settings.ExtensionControlBrowserProxyImpl.instance_ = browserProxy;
393 PolymerTest.clearBody(); 393 PolymerTest.clearBody();
394 entry = document.createElement('settings-omnibox-extension-entry'); 394 entry = document.createElement('settings-omnibox-extension-entry');
395 entry.set('engine', createSampleOmniboxExtension()); 395 entry.set('engine', createSampleOmniboxExtension());
396 document.body.appendChild(entry); 396 document.body.appendChild(entry);
397 397
398 // Open action menu. 398 // Open action menu.
399 MockInteractions.tap(entry.$$('paper-icon-button')); 399 MockInteractions.tap(entry.$$('button'));
400 }); 400 });
401 401
402 teardown(function() { entry.remove(); }); 402 teardown(function() { entry.remove(); });
403 403
404 test('Manage', function() { 404 test('Manage', function() {
405 var manageButton = entry.$.manage; 405 var manageButton = entry.$.manage;
406 assertTrue(!!manageButton); 406 assertTrue(!!manageButton);
407 MockInteractions.tap(manageButton); 407 MockInteractions.tap(manageButton);
408 return browserProxy.whenCalled('manageExtension').then( 408 return browserProxy.whenCalled('manageExtension').then(
409 function(extensionId) { 409 function(extensionId) {
(...skipping 15 matching lines...) Expand all
425 425
426 return { 426 return {
427 registerTests: function() { 427 registerTests: function() {
428 registerDialogTests(); 428 registerDialogTests();
429 registerSearchEngineEntryTests(); 429 registerSearchEngineEntryTests();
430 registerOmniboxExtensionEntryTests(); 430 registerOmniboxExtensionEntryTests();
431 registerPageTests(); 431 registerPageTests();
432 }, 432 },
433 }; 433 };
434 }); 434 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698