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

Unified Diff: chrome/test/data/webui/settings/settings_subpage_test.js

Issue 2772873002: MD Settings: Allow searching the languages list in "add language" dialog. (Closed)
Patch Set: Fix test. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'));
+ });
+ });
});
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698