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

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

Issue 2343153005: MD Settings: Ensure that after clearing search, the "basic" page is displayed. (Closed)
Patch Set: Fix compilation. Created 4 years, 3 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/browser/resources/settings/settings_main/settings_main.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_main_test.js
diff --git a/chrome/test/data/webui/settings/settings_main_test.js b/chrome/test/data/webui/settings/settings_main_test.js
index d4d71ab81472536bc846e4f9b64c6aa91d00373f..b123dfcbcf0207bd6a970686a5b8509d23230458 100644
--- a/chrome/test/data/webui/settings/settings_main_test.js
+++ b/chrome/test/data/webui/settings/settings_main_test.js
@@ -105,23 +105,44 @@ cr.define('settings_main_page', function() {
});
});
- test('advanced page restored after search results cleared', function() {
- // Simulating searching while the advanced page is collapsed.
- settingsMain.currentRouteChanged(settings.Route.BASIC);
- Polymer.dom.flush();
-
- assertFalse(!!settingsMain.$$('settings-advanced-page'));
-
+ /**
+ * Asserts the visibility of the basic and advanced pages after exiting
+ * search mode.
+ * @param {string} Expected 'display' value for the basic page.
+ * @param {string} Expected 'display' value for the advanced page.
+ * @return {!Promise}
+ */
+ function assertPageVisibilityAfterSearch(
+ expectedBasic, expectedAdvanced) {
searchManager.setMatchesFound(true);
return settingsMain.searchContents('Query1').then(function() {
searchManager.setMatchesFound(false);
return settingsMain.searchContents('');
}).then(function() {
Polymer.dom.flush();
- // Checking that it remains hidden after results are cleared.
assertEquals(
- 'none', settingsMain.$$('settings-advanced-page').style.display);
+ expectedBasic,
+ settingsMain.$$('settings-basic-page').style.display);
+ assertEquals(
+ expectedAdvanced,
+ settingsMain.$$('settings-advanced-page').style.display);
});
+ }
+
+ test('exiting search mode, advanced collapsed', function() {
+ // Simulating searching while the advanced page is collapsed.
+ settingsMain.currentRouteChanged(settings.Route.BASIC);
+ Polymer.dom.flush();
+ return assertPageVisibilityAfterSearch('', 'none');
+ });
+
+ // Ensure that clearing the search results restores both "basic" and
+ // "advanced" page, when the search has been initiated from a subpage
+ // whose parent is the "advanced" page.
+ test('exiting search mode, advanced expanded', function() {
+ settings.navigateTo(settings.Route.SITE_SETTINGS);
+ Polymer.dom.flush();
+ return assertPageVisibilityAfterSearch('', '');
});
test('can collapse advanced on advanced section route', function() {
« no previous file with comments | « chrome/browser/resources/settings/settings_main/settings_main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698