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

Unified Diff: chrome/test/data/webui/media_router/media_router_container_filter_tests.js

Issue 1880283004: [Media Router WebUI] Put sink list in conditional template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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/media_router/media_router_container_filter_tests.js
diff --git a/chrome/test/data/webui/media_router/media_router_container_filter_tests.js b/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
index e10998346c7572bbf736d0fbc87ee5381605e093..937bb0b07e5930b82a698811cb6994066e2272e1 100644
--- a/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
+++ b/chrome/test/data/webui/media_router/media_router_container_filter_tests.js
@@ -191,47 +191,57 @@ cr.define('media_router_container_filter', function() {
MockInteractions.tap(
container.shadowRoot.getElementById('container-header')
.shadowRoot.getElementById('back-button'));
- checkElementsVisibleWithId(['container-header',
- 'sink-search',
- 'sink-list',
- 'sink-list-view']);
- // When the search button is clicked again, the matching sinks
- // should be shown again. This doesn't prove that the matching
- // worked when returning to the FILTER view though, just that it
- // at least shows some sort of sink list as search results.
- MockInteractions.tap(container.$['sink-search-icon']);
- checkElementsVisibleWithId(['container-header',
- 'search-results',
- 'sink-search',
- 'sink-list-view']);
-
- container.$['sink-search-input'].value = searchTextNone;
- // Clicking the back button should leave |searchTextNone| in the
- // input but return to the SINK_LIST view.
- MockInteractions.tap(
- container.shadowRoot.getElementById('container-header')
- .shadowRoot.getElementById('back-button'));
- checkElementsVisibleWithId(['container-header',
- 'sink-search',
- 'sink-list',
- 'sink-list-view']);
- // When the search button is clicked again, there should be no
- // matches because |searchTextNone| should still be used to
- // filter.
- MockInteractions.tap(container.$['sink-search-icon']);
- checkElementsVisibleWithId(['container-header',
- 'no-search-matches',
- 'sink-search',
- 'sink-list-view']);
- // Pressing the Escape key in FILTER view should return
- // |container| to SINK_LIST view and not exit the dialog.
- MockInteractions.pressAndReleaseKeyOn(
- container, media_router.KEYCODE_ESC);
- checkElementsVisibleWithId(['container-header',
- 'sink-search',
- 'sink-list',
- 'sink-list-view']);
- done();
+ setTimeout(function() {
+ checkElementsVisibleWithId(['container-header',
+ 'sink-search',
+ 'sink-list',
+ 'sink-list-view']);
+ // When the search button is clicked again, the matching sinks
+ // should be shown again. This doesn't prove that the matching
+ // worked when returning to the FILTER view though, just that it
+ // at least shows some sort of sink list as search results.
+ MockInteractions.tap(container.$['sink-search-icon']);
+ setTimeout(function() {
+ checkElementsVisibleWithId(['container-header',
+ 'search-results',
+ 'sink-search',
+ 'sink-list-view']);
+
+ container.$['sink-search-input'].value = searchTextNone;
+ // Clicking the back button should leave |searchTextNone| in
+ // the input but return to the SINK_LIST view.
+ MockInteractions.tap(
+ container.shadowRoot.getElementById('container-header')
+ .shadowRoot.getElementById('back-button'));
+ setTimeout(function() {
+ checkElementsVisibleWithId(['container-header',
+ 'sink-search',
+ 'sink-list',
+ 'sink-list-view']);
+ // When the search button is clicked again, there should be
+ // no matches because |searchTextNone| should still be used
+ // to filter.
+ MockInteractions.tap(container.$['sink-search-icon']);
+ setTimeout(function() {
+ checkElementsVisibleWithId(['container-header',
+ 'no-search-matches',
+ 'sink-search',
+ 'sink-list-view']);
+ // Pressing the Escape key in FILTER view should return
+ // |container| to SINK_LIST view and not exit the dialog.
+ MockInteractions.pressAndReleaseKeyOn(
+ container, media_router.KEYCODE_ESC);
+ setTimeout(function() {
+ checkElementsVisibleWithId(['container-header',
+ 'sink-search',
+ 'sink-list',
+ 'sink-list-view']);
+ done();
+ });
+ });
+ });
+ });
+ });
});
});
});

Powered by Google App Engine
This is Rietveld 408576698