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

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

Issue 1868983003: [Media Router WebUI] Switch back to sink view after blocking issue is resolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per mfoltz@'s comments. Fix styling bug. 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
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.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/media_router/media_router_container_sink_list_tests.js
diff --git a/chrome/test/data/webui/media_router/media_router_container_sink_list_tests.js b/chrome/test/data/webui/media_router/media_router_container_sink_list_tests.js
index 40260c62167bdb714f9c3a9dc9208118445e3e34..b06253b52fd7efdc9d08eee96fb13e3f250f1319 100644
--- a/chrome/test/data/webui/media_router/media_router_container_sink_list_tests.js
+++ b/chrome/test/data/webui/media_router/media_router_container_sink_list_tests.js
@@ -72,6 +72,7 @@ cr.define('media_router_container_sink_list', function() {
// Get common functions and variables.
var test_base = media_router_container_test_base.init(container);
+ checkCurrentView = test_base.checkCurrentView;
checkElementsVisibleWithId = test_base.checkElementsVisibleWithId;
checkElementText = test_base.checkElementText;
fakeBlockingIssue = test_base.fakeBlockingIssue;
@@ -183,9 +184,11 @@ cr.define('media_router_container_sink_list', function() {
});
// Tests for expected visible UI when the view is SINK_LIST, and there is
- // a non blocking issue.
+ // a non blocking issue. Also tests for expected visible UI when the
+ // issue is cleared.
test('sink list visibility non blocking issue', function(done) {
container.showSinkList_();
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
// Set an non-empty sink list.
container.allSinks = fakeSinkList;
@@ -193,18 +196,29 @@ cr.define('media_router_container_sink_list', function() {
// Set a non-blocking issue. The issue should be shown.
container.issue = fakeNonBlockingIssue;
setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
checkElementsVisibleWithId(['container-header',
'issue-banner',
'sink-list',
'sink-list-view']);
- done();
+ // Replace issue with null.
+ container.issue = null;
+ setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
+ checkElementsVisibleWithId(['container-header',
+ 'sink-list',
+ 'sink-list-view']);
+ done();
+ });
});
});
// Tests for expected visible UI when the view is SINK_LIST, and there is
- // a blocking issue.
+ // a blocking issue. Also tests for expected visible UI when the issue is
+ // cleared.
test('sink list visibility blocking issue', function(done) {
container.showSinkList_();
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
// Set an non-empty sink list.
container.allSinks = fakeSinkList;
@@ -213,10 +227,52 @@ cr.define('media_router_container_sink_list', function() {
// else, hidden.
container.issue = fakeBlockingIssue;
setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.ISSUE);
checkElementsVisibleWithId(['container-header',
'issue-banner',
'sink-list']);
- done();
+ // Replace issue with null.
+ container.issue = null;
+ setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
+ checkElementsVisibleWithId(['container-header',
+ 'sink-list',
+ 'sink-list-view']);
+ done();
+ });
+ });
+ });
+
+ // Tests for expected visible UI when the view is SINK_LIST, and there is
+ // a blocking issue. Also tests for expected visible UI when the issue is
+ // cleared.
+ test('sink list visibility non-blocking replaced with blocking issue',
+ function(done) {
+ container.showSinkList_();
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
+
+ // Set an non-empty sink list.
+ container.allSinks = fakeSinkList;
+
+ // Set a non-blocking issue. The issue should be shown.
+ container.issue = fakeNonBlockingIssue;
+ setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.SINK_LIST);
+ checkElementsVisibleWithId(['container-header',
+ 'issue-banner',
+ 'sink-list',
+ 'sink-list-view']);
+
+ // Set a blocking issue. The issue should be shown, and everything
+ // else, hidden.
+ container.issue = fakeBlockingIssue;
+ setTimeout(function() {
+ checkCurrentView(media_router.MediaRouterView.ISSUE);
+ checkElementsVisibleWithId(['container-header',
+ 'issue-banner',
+ 'sink-list']);
+ done();
+ });
});
});
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698