| OLD | NEW |
| 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 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 | 1427 |
| 1428 // Failing on ChromiumOS dbg. https://crbug.com/709442 | 1428 // Failing on ChromiumOS dbg. https://crbug.com/709442 |
| 1429 GEN('#if (defined(OS_WIN) || defined(OS_CHROMEOS)) && !defined(NDEBUG)'); | 1429 GEN('#if (defined(OS_WIN) || defined(OS_CHROMEOS)) && !defined(NDEBUG)'); |
| 1430 GEN('#define MAYBE_NonExistentRoute DISABLED_NonExistentRoute'); | 1430 GEN('#define MAYBE_NonExistentRoute DISABLED_NonExistentRoute'); |
| 1431 GEN('#else'); | 1431 GEN('#else'); |
| 1432 GEN('#define MAYBE_NonExistentRoute NonExistentRoute'); | 1432 GEN('#define MAYBE_NonExistentRoute NonExistentRoute'); |
| 1433 GEN('#endif'); | 1433 GEN('#endif'); |
| 1434 TEST_F('CrSettingsNonExistentRouteTest', 'MAYBE_NonExistentRoute', function() { | 1434 TEST_F('CrSettingsNonExistentRouteTest', 'MAYBE_NonExistentRoute', function() { |
| 1435 suite('NonExistentRoutes', function() { | 1435 suite('NonExistentRoutes', function() { |
| 1436 test('redirect to basic', function() { | 1436 test('redirect to basic', function() { |
| 1437 assertEquals(settings.Route.BASIC, settings.getCurrentRoute()); | 1437 assertEquals(settings.routes.BASIC, settings.getCurrentRoute()); |
| 1438 assertEquals('/', location.pathname); | 1438 assertEquals('/', location.pathname); |
| 1439 }); | 1439 }); |
| 1440 }); | 1440 }); |
| 1441 mocha.run(); | 1441 mocha.run(); |
| 1442 }); | 1442 }); |
| 1443 | 1443 |
| 1444 /** | 1444 /** |
| 1445 * @constructor | 1445 * @constructor |
| 1446 * @extends {SettingsPageBrowserTest} | 1446 * @extends {SettingsPageBrowserTest} |
| 1447 */ | 1447 */ |
| 1448 function CrSettingsRouteDynamicParametersTest() {} | 1448 function CrSettingsRouteDynamicParametersTest() {} |
| 1449 | 1449 |
| 1450 CrSettingsRouteDynamicParametersTest.prototype = { | 1450 CrSettingsRouteDynamicParametersTest.prototype = { |
| 1451 __proto__: CrSettingsBrowserTest.prototype, | 1451 __proto__: CrSettingsBrowserTest.prototype, |
| 1452 | 1452 |
| 1453 /** @override */ | 1453 /** @override */ |
| 1454 browsePreload: 'chrome://md-settings/search?guid=a%2Fb&foo=42', | 1454 browsePreload: 'chrome://md-settings/search?guid=a%2Fb&foo=42', |
| 1455 | 1455 |
| 1456 /** @override */ | 1456 /** @override */ |
| 1457 runAccessibilityChecks: false, | 1457 runAccessibilityChecks: false, |
| 1458 }; | 1458 }; |
| 1459 | 1459 |
| 1460 TEST_F('CrSettingsRouteDynamicParametersTest', 'All', function() { | 1460 TEST_F('CrSettingsRouteDynamicParametersTest', 'All', function() { |
| 1461 suite('DynamicParameters', function() { | 1461 suite('DynamicParameters', function() { |
| 1462 test('get parameters from URL and navigation', function(done) { | 1462 test('get parameters from URL and navigation', function(done) { |
| 1463 assertEquals(settings.Route.SEARCH, settings.getCurrentRoute()); | 1463 assertEquals(settings.routes.SEARCH, settings.getCurrentRoute()); |
| 1464 assertEquals('a/b', settings.getQueryParameters().get('guid')); | 1464 assertEquals('a/b', settings.getQueryParameters().get('guid')); |
| 1465 assertEquals('42', settings.getQueryParameters().get('foo')); | 1465 assertEquals('42', settings.getQueryParameters().get('foo')); |
| 1466 | 1466 |
| 1467 var params = new URLSearchParams(); | 1467 var params = new URLSearchParams(); |
| 1468 params.set('bar', 'b=z'); | 1468 params.set('bar', 'b=z'); |
| 1469 params.set('biz', '3'); | 1469 params.set('biz', '3'); |
| 1470 settings.navigateTo(settings.Route.SEARCH_ENGINES, params); | 1470 settings.navigateTo(settings.routes.SEARCH_ENGINES, params); |
| 1471 assertEquals(settings.Route.SEARCH_ENGINES, settings.getCurrentRoute()); | 1471 assertEquals(settings.routes.SEARCH_ENGINES, settings.getCurrentRoute()); |
| 1472 assertEquals('b=z', settings.getQueryParameters().get('bar')); | 1472 assertEquals('b=z', settings.getQueryParameters().get('bar')); |
| 1473 assertEquals('3', settings.getQueryParameters().get('biz')); | 1473 assertEquals('3', settings.getQueryParameters().get('biz')); |
| 1474 assertEquals('?bar=b%3Dz&biz=3', window.location.search); | 1474 assertEquals('?bar=b%3Dz&biz=3', window.location.search); |
| 1475 | 1475 |
| 1476 window.addEventListener('popstate', function(event) { | 1476 window.addEventListener('popstate', function(event) { |
| 1477 assertEquals('/search', settings.getCurrentRoute().path); | 1477 assertEquals('/search', settings.getCurrentRoute().path); |
| 1478 assertEquals(settings.Route.SEARCH, settings.getCurrentRoute()); | 1478 assertEquals(settings.routes.SEARCH, settings.getCurrentRoute()); |
| 1479 assertEquals('a/b', settings.getQueryParameters().get('guid')); | 1479 assertEquals('a/b', settings.getQueryParameters().get('guid')); |
| 1480 assertEquals('42', settings.getQueryParameters().get('foo')); | 1480 assertEquals('42', settings.getQueryParameters().get('foo')); |
| 1481 done(); | 1481 done(); |
| 1482 }); | 1482 }); |
| 1483 window.history.back(); | 1483 window.history.back(); |
| 1484 }); | 1484 }); |
| 1485 }); | 1485 }); |
| 1486 mocha.run(); | 1486 mocha.run(); |
| 1487 }); | 1487 }); |
| 1488 | 1488 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ | 1711 extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ |
| 1712 '../test_browser_proxy.js', | 1712 '../test_browser_proxy.js', |
| 1713 'test_extension_control_browser_proxy.js', | 1713 'test_extension_control_browser_proxy.js', |
| 1714 'extension_controlled_indicator_tests.js', | 1714 'extension_controlled_indicator_tests.js', |
| 1715 ]), | 1715 ]), |
| 1716 }; | 1716 }; |
| 1717 | 1717 |
| 1718 TEST_F('CrSettingsExtensionControlledIndicatorTest', 'All', function() { | 1718 TEST_F('CrSettingsExtensionControlledIndicatorTest', 'All', function() { |
| 1719 mocha.run(); | 1719 mocha.run(); |
| 1720 }); | 1720 }); |
| OLD | NEW |