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

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

Issue 1897803003: [Media Router WebUI] Switch back to sink view after blocking issue is resolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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 91ad26fd11a02cdce3eea61ace5168e3f736b5ab..60f75f6ee3f31cf1e5f340d10388dc54a4f6a9d2 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;
@@ -178,9 +179,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;
@@ -188,18 +191,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;
@@ -208,10 +222,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