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

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

Issue 2862393002: [Media Router] Force DEFAULT cast mode when starting presentations from content. (Closed)
Patch Set: Update unittests Created 3 years, 7 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_cast_mode_list_tests.js
diff --git a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js
index 43b695974823ce343588052f081016836645d57f..a980e49aef42806d286d31c8e83107f75865f2b1 100644
--- a/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js
+++ b/chrome/test/data/webui/media_router/media_router_container_cast_mode_list_tests.js
@@ -58,6 +58,12 @@ cr.define('media_router_container_cast_mode_list', function() {
var fakeCastModeListWithNonDefaultModesOnly = [];
/**
+ * The list of CastModes to show with default mode forced.
+ * @type {!Array<!media_router.CastMode>}
+ */
+ var fakeCastModeListWithDefaultModeForced = [];
+
+ /**
* The blocking issue to show.
* @type {?media_router.Issue}
*/
@@ -92,6 +98,8 @@ cr.define('media_router_container_cast_mode_list', function() {
fakeCastModeList = test_base.fakeCastModeList;
fakeCastModeListWithNonDefaultModesOnly =
test_base.fakeCastModeListWithNonDefaultModesOnly;
+ fakeCastModeListWithDefaultModeForced =
+ test_base.fakeCastModeListWithDefaultModeForced;
fakeNonBlockingIssue = test_base.fakeNonBlockingIssue;
fakeSinkList = test_base.fakeSinkList;
@@ -322,6 +330,20 @@ cr.define('media_router_container_cast_mode_list', function() {
});
});
+ // When a forced cast mode it set, it is used.
+ test('cast mode list respects forced mode', function(done) {
+ container.castModeList = fakeCastModeListWithDefaultModeForced;
+ MockInteractions.tap(container.$['container-header'].
+ $['arrow-drop-icon']);
+ setTimeout(function() {
+ assertEquals(media_router.CastModeType.DEFAULT,
+ container.shownCastModeValue_);
+ assertEquals('Cast google.com', container.headerText);
+ assertFalse(container.userHasSelectedCastMode_);
+ done();
+ });
+ });
+
// Tests that the sink list does not contain any sinks that are not
// compatible with the selected cast mode and are not associated with a
// route.

Powered by Google App Engine
This is Rietveld 408576698