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

Side by Side Diff: chrome/test/data/webui/settings/protocol_handlers_tests.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 /** @fileoverview Suite of tests for protocol_handlers. */ 5 /** @fileoverview Suite of tests for protocol_handlers. */
6 suite('ProtocolHandlers', function() { 6 suite('ProtocolHandlers', function() {
7 /** 7 /**
8 * A dummy protocol handler element created before each test. 8 * A dummy protocol handler element created before each test.
9 * @type {ProtocolHandlers} 9 * @type {ProtocolHandlers}
10 */ 10 */
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 * @param {string} button id of the button to test. 109 * @param {string} button id of the button to test.
110 * @param {string} handler name of browserProxy handler to react. 110 * @param {string} handler name of browserProxy handler to react.
111 * @return {!Promise} 111 * @return {!Promise}
112 */ 112 */
113 function testButtonFlow(button, browserProxyHandler) { 113 function testButtonFlow(button, browserProxyHandler) {
114 var menuButtons, functionButton, dialog; 114 var menuButtons, functionButton, dialog;
115 115
116 return initPage() 116 return initPage()
117 .then(function() { 117 .then(function() {
118 // Initiating the elements 118 // Initiating the elements
119 menuButtons = testElement.root.querySelectorAll('paper-icon-button'); 119 menuButtons =
120 testElement.root.querySelectorAll('button.icon-more-vert');
120 functionButton = testElement.$[button]; 121 functionButton = testElement.$[button];
121 dialog = testElement.$$('dialog[is=cr-action-menu]'); 122 dialog = testElement.$$('dialog[is=cr-action-menu]');
122 assertEquals(3, menuButtons.length); 123 assertEquals(3, menuButtons.length);
123 124
124 // Test the button for the first protocol handler 125 // Test the button for the first protocol handler
125 MockInteractions.tap(menuButtons[0]); 126 MockInteractions.tap(menuButtons[0]);
126 assertTrue(dialog.open); 127 assertTrue(dialog.open);
127 128
128 MockInteractions.tap(functionButton); 129 MockInteractions.tap(functionButton);
129 130
(...skipping 25 matching lines...) Expand all
155 test('remove button works', function() { 156 test('remove button works', function() {
156 browserProxy.setProtocolHandlers(protocols); 157 browserProxy.setProtocolHandlers(protocols);
157 return testButtonFlow('removeButton', 'removeProtocolHandler'); 158 return testButtonFlow('removeButton', 'removeProtocolHandler');
158 }); 159 });
159 160
160 test('default button works', function() { 161 test('default button works', function() {
161 browserProxy.setProtocolHandlers(protocols); 162 browserProxy.setProtocolHandlers(protocols);
162 return testButtonFlow('defaultButton', 'setProtocolDefault'); 163 return testButtonFlow('defaultButton', 'setProtocolDefault');
163 }); 164 });
164 }); 165 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/languages_page_tests.js ('k') | chrome/test/data/webui/settings/search_engines_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698