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

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

Issue 2311093002: MD WebUI: Use dom-if to control hidden elements in <cr-toolbar> (Closed)
Patch Set: Fix tests 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
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 cd78095e7b4be79481070302f4c5fd3387f9d66d..f3553c660e602efb176570711d9e0f80c03ad6ae 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
@@ -55,9 +55,10 @@ cr.define('cr_toolbar_search_field', function() {
test('notifies on new searches', function() {
MockInteractions.tap(field);
simulateSearch('query1');
+ Polymer.dom.flush();
assertEquals('query1', field.getValue());
- MockInteractions.tap(field.$.clearSearch);
+ MockInteractions.tap(field.$$('#clearSearch'));
assertFalse(field.showingSearch);
assertEquals('', field.getValue());
@@ -92,11 +93,13 @@ cr.define('cr_toolbar_search_field', function() {
// Similar to what happens when pasting or dragging into the input
// field.
simulateSearch('test');
+ Polymer.dom.flush();
- assertFalse(field.$.clearSearch.hidden);
+ var clearSearch = field.$$('#clearSearch');
+ assertFalse(clearSearch.hidden);
assertTrue(field.showingSearch);
- MockInteractions.tap(field.$.clearSearch);
+ MockInteractions.tap(clearSearch);
assertFalse(field.showingSearch);
});
});

Powered by Google App Engine
This is Rietveld 408576698