| OLD | NEW |
| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 new media_router.CastMode(0x4, 'Description 2', null), | 118 new media_router.CastMode(0x4, 'Description 2', null), |
| 119 ]; | 119 ]; |
| 120 | 120 |
| 121 fakeCastModeListWithNonDefaultModesOnly = [ | 121 fakeCastModeListWithNonDefaultModesOnly = [ |
| 122 new media_router.CastMode(0x2, 'Description 1', null), | 122 new media_router.CastMode(0x2, 'Description 1', null), |
| 123 new media_router.CastMode(0x4, 'Description 2', null), | 123 new media_router.CastMode(0x4, 'Description 2', null), |
| 124 new media_router.CastMode(0x8, 'Description 3', null), | 124 new media_router.CastMode(0x8, 'Description 3', null), |
| 125 ]; | 125 ]; |
| 126 | 126 |
| 127 fakeRouteList = [ | 127 fakeRouteList = [ |
| 128 new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), | 128 new media_router.Route('id 1', 'sink id 1', |
| 129 new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, false), | 129 'Title 1', 0, true, false), |
| 130 new media_router.Route('id 2', 'sink id 2', |
| 131 'Title 2', 1, false, true), |
| 130 ]; | 132 ]; |
| 131 | 133 |
| 132 fakeRouteListWithLocalRoutesOnly = [ | 134 fakeRouteListWithLocalRoutesOnly = [ |
| 133 new media_router.Route('id 1', 'sink id 1', 'Title 1', 0, true), | 135 new media_router.Route('id 1', 'sink id 1', |
| 134 new media_router.Route('id 2', 'sink id 2', 'Title 2', 1, true), | 136 'Title 1', 0, true, false), |
| 137 new media_router.Route('id 2', 'sink id 2', |
| 138 'Title 2', 1, true, false), |
| 135 ]; | 139 ]; |
| 136 | 140 |
| 137 var castModeBitset = 0x2 | 0x4 | 0x8; | 141 var castModeBitset = 0x2 | 0x4 | 0x8; |
| 138 fakeSinkList = [ | 142 fakeSinkList = [ |
| 139 new media_router.Sink('sink id 1', 'Sink 1', null, | 143 new media_router.Sink('sink id 1', 'Sink 1', null, |
| 140 media_router.SinkIconType.CAST, | 144 media_router.SinkIconType.CAST, |
| 141 media_router.SinkStatus.ACTIVE, castModeBitset), | 145 media_router.SinkStatus.ACTIVE, castModeBitset), |
| 142 new media_router.Sink('sink id 2', 'Sink 2', null, | 146 new media_router.Sink('sink id 2', 'Sink 2', null, |
| 143 media_router.SinkIconType.CAST, | 147 media_router.SinkIconType.CAST, |
| 144 media_router.SinkStatus.ACTIVE, castModeBitset), | 148 media_router.SinkStatus.ACTIVE, castModeBitset), |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 new media_router.Sink('sink id 20', 'Sink 20', null, | 591 new media_router.Sink('sink id 20', 'Sink 20', null, |
| 588 media_router.SinkIconType.CAST, | 592 media_router.SinkIconType.CAST, |
| 589 media_router.SinkStatus.ACTIVE, 0x2 | 0x4 | 0x8), | 593 media_router.SinkStatus.ACTIVE, 0x2 | 0x4 | 0x8), |
| 590 new media_router.Sink('sink id 30', 'Sink 30', null, | 594 new media_router.Sink('sink id 30', 'Sink 30', null, |
| 591 media_router.SinkIconType.CAST, | 595 media_router.SinkIconType.CAST, |
| 592 media_router.SinkStatus.PENDING, 0x4 | 0x8), | 596 media_router.SinkStatus.PENDING, 0x4 | 0x8), |
| 593 ]; | 597 ]; |
| 594 | 598 |
| 595 container.allSinks = newSinks; | 599 container.allSinks = newSinks; |
| 596 container.routeList = [ | 600 container.routeList = [ |
| 597 new media_router.Route('id 1', 'sink id 30', 'Title 1', 1, false), | 601 new media_router.Route('id 1', 'sink id 30', |
| 602 'Title 1', 1, false, false), |
| 598 ]; | 603 ]; |
| 599 | 604 |
| 600 setTimeout(function() { | 605 setTimeout(function() { |
| 601 var sinkList = | 606 var sinkList = |
| 602 container.$['sink-list'].querySelectorAll('paper-item'); | 607 container.$['sink-list'].querySelectorAll('paper-item'); |
| 603 | 608 |
| 604 // Since we haven't selected a cast mode, we don't filter sinks. | 609 // Since we haven't selected a cast mode, we don't filter sinks. |
| 605 assertEquals(3, sinkList.length); | 610 assertEquals(3, sinkList.length); |
| 606 | 611 |
| 607 // Cast mode 1 is selected, and the sink list is filtered. | 612 // Cast mode 1 is selected, and the sink list is filtered. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 }); | 754 }); |
| 750 }); | 755 }); |
| 751 }); | 756 }); |
| 752 }); | 757 }); |
| 753 } | 758 } |
| 754 | 759 |
| 755 return { | 760 return { |
| 756 registerTests: registerTests, | 761 registerTests: registerTests, |
| 757 }; | 762 }; |
| 758 }); | 763 }); |
| OLD | NEW |