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

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

Issue 2811693004: MD Settings: Restore focus after exiting various subpages. (Closed)
Patch Set: Address comments, fix test. Created 3 years, 8 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/printing_page/printing_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 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 Runs the Polymer Settings tests. */ 5 /** @fileoverview Runs the Polymer Settings tests. */
6 6
7 /** @const {string} Path to source root. */ 7 /** @const {string} Path to source root. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 /** 1155 /**
1156 * @constructor 1156 * @constructor
1157 * @extends {SettingsPageBrowserTest} 1157 * @extends {SettingsPageBrowserTest}
1158 */ 1158 */
1159 function CrSettingsRouteDynamicParametersTest() {} 1159 function CrSettingsRouteDynamicParametersTest() {}
1160 1160
1161 CrSettingsRouteDynamicParametersTest.prototype = { 1161 CrSettingsRouteDynamicParametersTest.prototype = {
1162 __proto__: CrSettingsBrowserTest.prototype, 1162 __proto__: CrSettingsBrowserTest.prototype,
1163 1163
1164 /** @override */ 1164 /** @override */
1165 browsePreload: 'chrome://md-settings/people?guid=a%2Fb&foo=42', 1165 browsePreload: 'chrome://md-settings/search?guid=a%2Fb&foo=42',
1166 1166
1167 /** @override */ 1167 /** @override */
1168 runAccessibilityChecks: false, 1168 runAccessibilityChecks: false,
1169 }; 1169 };
1170 1170
1171 TEST_F('CrSettingsRouteDynamicParametersTest', 'All', function() { 1171 TEST_F('CrSettingsRouteDynamicParametersTest', 'All', function() {
1172 suite('DynamicParameters', function() { 1172 suite('DynamicParameters', function() {
1173 test('get parameters from URL and navigation', function(done) { 1173 test('get parameters from URL and navigation', function(done) {
1174 assertEquals(settings.Route.PEOPLE, settings.getCurrentRoute()); 1174 assertEquals(settings.Route.SEARCH, settings.getCurrentRoute());
1175 assertEquals('a/b', settings.getQueryParameters().get('guid')); 1175 assertEquals('a/b', settings.getQueryParameters().get('guid'));
1176 assertEquals('42', settings.getQueryParameters().get('foo')); 1176 assertEquals('42', settings.getQueryParameters().get('foo'));
1177 1177
1178 var params = new URLSearchParams(); 1178 var params = new URLSearchParams();
1179 params.set('bar', 'b=z'); 1179 params.set('bar', 'b=z');
1180 params.set('biz', '3'); 1180 params.set('biz', '3');
1181 settings.navigateTo(settings.Route.SYNC, params); 1181 settings.navigateTo(settings.Route.SEARCH_ENGINES, params);
dpapad 2017/04/11 03:01:01 This test was visiting the /syncSetup subpage, eve
1182 assertEquals(settings.Route.SYNC, settings.getCurrentRoute()); 1182 assertEquals(settings.Route.SEARCH_ENGINES, settings.getCurrentRoute());
1183 assertEquals('b=z', settings.getQueryParameters().get('bar')); 1183 assertEquals('b=z', settings.getQueryParameters().get('bar'));
1184 assertEquals('3', settings.getQueryParameters().get('biz')); 1184 assertEquals('3', settings.getQueryParameters().get('biz'));
1185 assertEquals('?bar=b%3Dz&biz=3', window.location.search); 1185 assertEquals('?bar=b%3Dz&biz=3', window.location.search);
1186 1186
1187 window.addEventListener('popstate', function(event) { 1187 window.addEventListener('popstate', function(event) {
1188 assertEquals('/people', settings.getCurrentRoute().path); 1188 assertEquals('/search', settings.getCurrentRoute().path);
1189 assertEquals(settings.Route.PEOPLE, settings.getCurrentRoute()); 1189 assertEquals(settings.Route.SEARCH, settings.getCurrentRoute());
1190 assertEquals('a/b', settings.getQueryParameters().get('guid')); 1190 assertEquals('a/b', settings.getQueryParameters().get('guid'));
1191 assertEquals('42', settings.getQueryParameters().get('foo')); 1191 assertEquals('42', settings.getQueryParameters().get('foo'));
1192 done(); 1192 done();
1193 }); 1193 });
1194 window.history.back(); 1194 window.history.back();
1195 }); 1195 });
1196 }); 1196 });
1197 mocha.run(); 1197 mocha.run();
1198 }); 1198 });
1199 1199
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ 1422 extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
1423 'test_browser_proxy.js', 1423 'test_browser_proxy.js',
1424 'test_extension_control_browser_proxy.js', 1424 'test_extension_control_browser_proxy.js',
1425 'extension_controlled_indicator_tests.js', 1425 'extension_controlled_indicator_tests.js',
1426 ]), 1426 ]),
1427 }; 1427 };
1428 1428
1429 TEST_F('CrSettingsExtensionControlledIndicatorTest', 'All', function() { 1429 TEST_F('CrSettingsExtensionControlledIndicatorTest', 'All', function() {
1430 mocha.run(); 1430 mocha.run();
1431 }); 1431 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/printing_page/printing_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698