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

Side by Side Diff: chrome/test/data/webui/media_router/media_router_container_tests.js

Issue 1415103006: Non-Local Join for Media Router and Presentation API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Fixes 2 Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @fileoverview Suite of tests for media-router-container. */ 5 /** @fileoverview Suite of tests for media-router-container. */
6 cr.define('media_router_container', function() { 6 cr.define('media_router_container', function() {
7 function registerTests() { 7 function registerTests() {
8 suite('MediaRouterContainer', function() { 8 suite('MediaRouterContainer', function() {
9 /** 9 /**
10 * Media Router Container created before each test. 10 * Media Router Container created before each test.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 new media_router.CastMode(2, 'Description 2', null), 123 new media_router.CastMode(2, 'Description 2', null),
124 ]; 124 ];
125 125
126 fakeCastModeListWithNonDefaultModesOnly = [ 126 fakeCastModeListWithNonDefaultModesOnly = [
127 new media_router.CastMode(1, 'Description 1', null), 127 new media_router.CastMode(1, 'Description 1', null),
128 new media_router.CastMode(2, 'Description 2', null), 128 new media_router.CastMode(2, 'Description 2', null),
129 new media_router.CastMode(3, 'Description 3', null), 129 new media_router.CastMode(3, 'Description 3', null),
130 ]; 130 ];
131 131
132 fakeRouteList = [ 132 fakeRouteList = [
133 new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), 133 new media_router.Route('id 1', 'sink id 1',
134 new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, false), 134 'Title 1', 0, true, false),
135 new media_router.Route('id 2', 'sink id 2',
136 'Title 2', 1, false, true),
135 ]; 137 ];
136 138
137 fakeRouteListWithLocalRoutesOnly = [ 139 fakeRouteListWithLocalRoutesOnly = [
138 new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), 140 new media_router.Route('id 1', 'sink id 1',
139 new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, true), 141 'Title 1', 0, true, false),
142 new media_router.Route('id 2', 'sink id 2',
143 'Title 2', 1, true, false),
140 ]; 144 ];
141 145
142 // Note: These need to be in-order by name to prevent shuffling. 146 // Note: These need to be in-order by name to prevent shuffling.
143 // Sorting of sinks by name is tested separately. 147 // Sorting of sinks by name is tested separately.
144 fakeSinkList = [ 148 fakeSinkList = [
145 new media_router.Sink('sink id 1', 'Sink 1', 149 new media_router.Sink('sink id 1', 'Sink 1',
146 media_router.SinkIconType.CAST, 150 media_router.SinkIconType.CAST,
147 media_router.SinkStatus.ACTIVE, [1, 2, 3]), 151 media_router.SinkStatus.ACTIVE, [1, 2, 3]),
148 new media_router.Sink('sink id 2', 'Sink 2', 152 new media_router.Sink('sink id 2', 'Sink 2',
149 media_router.SinkIconType.CAST, 153 media_router.SinkIconType.CAST,
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 new media_router.Sink('sink id 20', 'Sink 20', 508 new media_router.Sink('sink id 20', 'Sink 20',
505 media_router.SinkIconType.CAST, 509 media_router.SinkIconType.CAST,
506 media_router.SinkStatus.ACTIVE, [1, 2, 3]), 510 media_router.SinkStatus.ACTIVE, [1, 2, 3]),
507 new media_router.Sink('sink id 30', 'Sink 30', 511 new media_router.Sink('sink id 30', 'Sink 30',
508 media_router.SinkIconType.CAST, 512 media_router.SinkIconType.CAST,
509 media_router.SinkStatus.PENDING, [2, 3]), 513 media_router.SinkStatus.PENDING, [2, 3]),
510 ]; 514 ];
511 515
512 container.allSinks = newSinks; 516 container.allSinks = newSinks;
513 container.routeList = [ 517 container.routeList = [
514 new media_router.Route('id 1', 'sink id 30', 'Title 1', 1, false), 518 new media_router.Route('id 1', 'sink id 30',
519 'Title 1', 1, false, false),
515 ]; 520 ];
516 521
517 setTimeout(function() { 522 setTimeout(function() {
518 var sinkList = 523 var sinkList =
519 container.$['sink-list'].querySelectorAll('paper-item'); 524 container.$['sink-list'].querySelectorAll('paper-item');
520 525
521 // newSinks[0] got filtered out since it is not compatible with cast 526 // newSinks[0] got filtered out since it is not compatible with cast
522 // mode 1. 527 // mode 1.
523 // 'Sink 20' should be on the list because it contains the selected 528 // 'Sink 20' should be on the list because it contains the selected
524 // cast mode. (sinkList[0] = newSinks[1]) 529 // cast mode. (sinkList[0] = newSinks[1])
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 done(); 623 done();
619 }); 624 });
620 }); 625 });
621 }); 626 });
622 } 627 }
623 628
624 return { 629 return {
625 registerTests: registerTests, 630 registerTests: registerTests,
626 }; 631 };
627 }); 632 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698