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

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

Issue 2446413002: MD Settings: Ignore whitespace only search queries. (Closed)
Patch Set: Update CL after search URLs landed. 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
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.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_ui_browsertest.js
diff --git a/chrome/test/data/webui/settings/settings_ui_browsertest.js b/chrome/test/data/webui/settings/settings_ui_browsertest.js
index c4d919f1a564090b3063b66d76d2d8223eae8a8b..c3d4fbfea931e56efc9a0097d35f3ca7d7ff2141 100644
--- a/chrome/test/data/webui/settings/settings_ui_browsertest.js
+++ b/chrome/test/data/webui/settings/settings_ui_browsertest.js
@@ -134,6 +134,27 @@ TEST_F('SettingsUIBrowserTest', 'MAYBE_All', function() {
searchField.setValue(value);
assertEquals(value, settings.getQueryParameters().get('search'));
});
+
+ test('whitespace only search query is ignored', function() {
+ toolbar = /** @type {!CrToolbarElement} */ (ui.$$('cr-toolbar'));
+ var searchField = /** @type {CrToolbarSearchFieldElement} */ (
+ toolbar.getSearchField());
+ searchField.setValue(' ');
+ var urlParams = settings.getQueryParameters();
+ assertFalse(urlParams.has('search'));
+
+ searchField.setValue(' foo');
+ urlParams = settings.getQueryParameters();
+ assertEquals('foo', urlParams.get('search'));
+
+ searchField.setValue(' foo ');
+ urlParams = settings.getQueryParameters();
+ assertEquals('foo ', urlParams.get('search'));
+
+ searchField.setValue(' ');
+ urlParams = settings.getQueryParameters();
+ assertFalse(urlParams.has('search'));
+ });
});
mocha.run();
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698