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

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: Fix bug found by closure compiler 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..ace4f1bfb663eeb568651480081611520fdbdf25 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,40 @@ 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.allSinks = [
+ new media_router.Sink('sink id 1', 'Sink 1', null, null,
+ media_router.SinkIconType.CAST,
+ media_router.SinkStatus.ACTIVE, 0x1),
+ new media_router.Sink('sink id 2', 'Sink 2', null, null,
+ media_router.SinkIconType.CAST,
+ media_router.SinkStatus.ACTIVE, 0x1 | 0x2),
+ new media_router.Sink('sink id 3', 'Sink 3', null, null,
+ media_router.SinkIconType.CAST,
+ media_router.SinkStatus.ACTIVE, 0x2)
+ ];
+ 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_);
+
+ var sinkList =
+ container.shadowRoot.getElementById('sink-list')
+ .querySelectorAll('paper-item');
+
+ // The sink list contains only sinks compatible with DEFAULT mode.
+ assertEquals(2, sinkList.length);
+ checkElementText('Sink 1', sinkList[0]);
+ checkElementText('Sink 2', sinkList[1]);
+ 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