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

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

Issue 2586803002: MD Settings: Fix label visibility in subpage search fields (Closed)
Patch Set: Different approach Created 3 years, 11 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 40555800db6fd07b2779efa027c1237ef2d5eaf0..a69cc9bda6a05e29bfe4e2cc79ac29d0acb3a94d 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
@@ -15,7 +15,7 @@ cr.define('cr_toolbar_search_field', function() {
/** @param {string} term */
function simulateSearch(term) {
field.$.searchInput.value = term;
- field.onSearchInput_();
+ field.onSearchTermInput();
field.onSearchTermSearch();
}
@@ -74,6 +74,7 @@ cr.define('cr_toolbar_search_field', function() {
MockInteractions.tap(field);
simulateSearch('query1');
Polymer.dom.flush();
+ assertTrue(field.hasSearchText);
var clearSearch = field.$$('#clearSearch');
clearSearch.focus();
@@ -81,6 +82,7 @@ cr.define('cr_toolbar_search_field', function() {
assertTrue(field.showingSearch);
assertEquals('', field.getValue());
assertEquals(field.$.searchInput, field.root.activeElement);
+ assertFalse(field.hasSearchText);
});
test('notifies on new searches', function() {
@@ -148,7 +150,9 @@ cr.define('cr_toolbar_search_field', function() {
// Change search value without explicity opening the field first.
// Similar to what happens when pasting or dragging into the input
// field.
+ assertFalse(field.hasSearchText);
simulateSearch('test');
+ assertTrue(field.hasSearchText);
Polymer.dom.flush();
var clearSearch = field.$$('#clearSearch');

Powered by Google App Engine
This is Rietveld 408576698