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

Unified Diff: chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js

Issue 2057353002: WebUI: cr-search-field, do not call delegate if search query did not change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments. Created 4 years, 6 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
Index: chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
diff --git a/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js b/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
index 8f5d3f0c4b06e74f42072b3b61b8d82e49dd9970..f93743f117d6c25b390ad190132c6fa0aa9655e2 100644
--- a/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
+++ b/chrome/test/data/webui/cr_elements/cr_toolbar_search_field_tests.js
@@ -72,16 +72,20 @@ cr.define('cr_toolbar_search_field', function() {
assertNotEquals(field.$.searchInput, field.root.activeElement);
});
- test('passes searches correctly', function() {
+ test('notifies on new searches', function() {
MockInteractions.tap(field);
- simulateSearch('test');
- assertEquals('test', field.getValue());
+ simulateSearch('query1');
+ assertEquals('query1', field.getValue());
MockInteractions.tap(field.$.clearSearch);
assertFalse(field.showingSearch);
assertEquals('', field.getValue());
- assertEquals(['test', ''].join(), delegate.searches.join());
+ simulateSearch('query2');
+ // Expecting identical query to be ignored.
+ simulateSearch('query2');
+
+ assertEquals(['query1', '', 'query2'].join(), delegate.searches.join());
});
test('blur does not close field when a search is active', function() {

Powered by Google App Engine
This is Rietveld 408576698