| Index: chrome/test/data/webui/settings/settings_subpage_test.js
|
| diff --git a/chrome/test/data/webui/settings/settings_subpage_test.js b/chrome/test/data/webui/settings/settings_subpage_test.js
|
| index bd72e78efe2613bddba8350c87e5276b7986842d..4b862b4cd838a2552210cbd12fec984081da0d12 100644
|
| --- a/chrome/test/data/webui/settings/settings_subpage_test.js
|
| +++ b/chrome/test/data/webui/settings/settings_subpage_test.js
|
| @@ -3,45 +3,53 @@
|
| // found in the LICENSE file.
|
|
|
| cr.define('settings_subpage', function() {
|
| - function registerTests() {
|
| - suite('SettingsSubpage', function() {
|
| - test('navigates to parent when there is no history', function() {
|
| - PolymerTest.clearBody();
|
| -
|
| - // Pretend that we initially started on the CERTIFICATES route.
|
| - window.history.replaceState(
|
| - undefined, '', settings.Route.CERTIFICATES.path);
|
| - settings.initializeRouteFromUrl();
|
| - assertEquals(settings.Route.CERTIFICATES, settings.getCurrentRoute());
|
| -
|
| - var subpage = document.createElement('settings-subpage');
|
| - document.body.appendChild(subpage);
|
| -
|
| - MockInteractions.tap(subpage.$$('paper-icon-button'));
|
| - assertEquals(settings.Route.PRIVACY, settings.getCurrentRoute());
|
| - });
|
| + suite('SettingsSubpage', function() {
|
| + test('navigates to parent when there is no history', function() {
|
| + PolymerTest.clearBody();
|
| +
|
| + // Pretend that we initially started on the CERTIFICATES route.
|
| + window.history.replaceState(
|
| + undefined, '', settings.Route.CERTIFICATES.path);
|
| + settings.initializeRouteFromUrl();
|
| + assertEquals(settings.Route.CERTIFICATES, settings.getCurrentRoute());
|
| +
|
| + var subpage = document.createElement('settings-subpage');
|
| + document.body.appendChild(subpage);
|
| +
|
| + MockInteractions.tap(subpage.$$('paper-icon-button'));
|
| + assertEquals(settings.Route.PRIVACY, settings.getCurrentRoute());
|
| + });
|
|
|
| - test('navigates to any route via window.back()', function(done) {
|
| - PolymerTest.clearBody();
|
| + test('navigates to any route via window.back()', function(done) {
|
| + PolymerTest.clearBody();
|
|
|
| - settings.navigateTo(settings.Route.BASIC);
|
| - settings.navigateTo(settings.Route.SYNC);
|
| - assertEquals(settings.Route.SYNC, settings.getCurrentRoute());
|
| + settings.navigateTo(settings.Route.BASIC);
|
| + settings.navigateTo(settings.Route.SYNC);
|
| + assertEquals(settings.Route.SYNC, settings.getCurrentRoute());
|
|
|
| - var subpage = document.createElement('settings-subpage');
|
| - document.body.appendChild(subpage);
|
| + var subpage = document.createElement('settings-subpage');
|
| + document.body.appendChild(subpage);
|
|
|
| - MockInteractions.tap(subpage.$$('paper-icon-button'));
|
| + MockInteractions.tap(subpage.$$('paper-icon-button'));
|
|
|
| - window.addEventListener('popstate', function(event) {
|
| - assertEquals(settings.Route.BASIC, settings.getCurrentRoute());
|
| - done();
|
| - });
|
| + window.addEventListener('popstate', function(event) {
|
| + assertEquals(settings.Route.BASIC, settings.getCurrentRoute());
|
| + done();
|
| });
|
| });
|
| - }
|
| + });
|
| +
|
| + suite('SettingsSubpageSearch', function() {
|
| + test('host autofocus propagates to <input>', function() {
|
| + PolymerTest.clearBody();
|
| + var element = document.createElement('settings-subpage-search');
|
| + element.setAttribute('autofocus', true);
|
| + document.body.appendChild(element);
|
|
|
| - return {
|
| - registerTests: registerTests,
|
| - };
|
| + assertTrue(element.$$('input').hasAttribute('autofocus'));
|
| +
|
| + element.removeAttribute('autofocus');
|
| + assertFalse(element.$$('input').hasAttribute('autofocus'));
|
| + });
|
| + });
|
| });
|
|
|