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

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

Issue 2469393004: MD Settings: Preserve search URL param in subpages. (Closed)
Patch Set: Function params nit. Created 4 years, 1 month 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
Index: chrome/test/data/webui/settings/route_tests.js
diff --git a/chrome/test/data/webui/settings/route_tests.js b/chrome/test/data/webui/settings/route_tests.js
index 302f2f57115288b60d16bbec06bbaa64eb0bd60e..eb5b01d1e1c553c139232c4e9b0d43e5e15f2f06 100644
--- a/chrome/test/data/webui/settings/route_tests.js
+++ b/chrome/test/data/webui/settings/route_tests.js
@@ -126,6 +126,20 @@ suite('route', function() {
assertEquals(settings.Route.BASIC, settings.getCurrentRoute());
});
+ test('navigateTo respects removeSearch optional parameter', function() {
+ var params = new URLSearchParams('search=foo');
+ settings.navigateTo(settings.Route.BASIC, params);
+ assertEquals(params.toString(), settings.getQueryParameters().toString());
+
+ settings.navigateTo(
+ settings.Route.SITE_SETTINGS, null, /* removeSearch */ false);
+ assertEquals(params.toString(), settings.getQueryParameters().toString());
+
+ settings.navigateTo(
+ settings.Route.SEARCH_ENGINES, null, /* removeSearch */ true);
+ assertEquals('', settings.getQueryParameters().toString());
+ });
+
test('popstate flag works', function() {
settings.navigateTo(settings.Route.BASIC);
assertFalse(settings.lastRouteChangeWasPopstate());
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.js ('k') | chrome/test/data/webui/settings/settings_menu_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698