| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 that focus on | 5 /** @fileoverview Suite of tests for media-router-container that focus on |
| 6 * the MRPM search feature. | 6 * the MRPM search feature. |
| 7 */ | 7 */ |
| 8 cr.define('media_router_container_search', function() { | 8 cr.define('media_router_container_search', function() { |
| 9 function registerTests() { | 9 function registerTests() { |
| 10 suite('MediaRouterContainerSearch', function() { | 10 suite('MediaRouterContainerSearch', function() { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 pseudoSink = new media_router.Sink( | 147 pseudoSink = new media_router.Sink( |
| 148 'pseudo:test', '', null, 'domain.com', | 148 'pseudo:test', '', null, 'domain.com', |
| 149 media_router.SinkIconType.CAST, undefined, | 149 media_router.SinkIconType.CAST, undefined, |
| 150 test_base.castModeBitset); | 150 test_base.castModeBitset); |
| 151 pseudoSink.isPseudoSink = true; | 151 pseudoSink.isPseudoSink = true; |
| 152 foundSink = new media_router.Sink( | 152 foundSink = new media_router.Sink( |
| 153 'found sink id', 'no existing sink', null, pseudoSink.domain, | 153 'found sink id', 'no existing sink', null, pseudoSink.domain, |
| 154 pseudoSink.iconType, undefined, pseudoSink.castModes); | 154 pseudoSink.iconType, undefined, pseudoSink.castModes); |
| 155 fakeSinkListWithPseudoSink = fakeSinkList.concat([pseudoSink]); | 155 fakeSinkListWithPseudoSink = fakeSinkList.concat([pseudoSink]); |
| 156 | 156 |
| 157 setTimeout(done); | 157 // Allow for the media router container to be created, attached, and |
| 158 // listeners registered in an afterNextRender() call. |
| 159 Polymer.RenderStatus.afterNextRender(this, done); |
| 158 }); | 160 }); |
| 159 | 161 |
| 160 test('pseudo sink hidden without filter input', function(done) { | 162 test('pseudo sink hidden without filter input', function(done) { |
| 161 container.allSinks = fakeSinkListWithPseudoSink; | 163 container.allSinks = fakeSinkListWithPseudoSink; |
| 162 | 164 |
| 163 setTimeout(function() { | 165 setTimeout(function() { |
| 164 var sinkList = | 166 var sinkList = |
| 165 container.$$('#sink-list').querySelectorAll('paper-item'); | 167 container.$$('#sink-list').querySelectorAll('paper-item'); |
| 166 assertEquals(fakeSinkList.length, sinkList.length); | 168 assertEquals(fakeSinkList.length, sinkList.length); |
| 167 MockInteractions.tap(container.$['sink-search-icon']); | 169 MockInteractions.tap(container.$['sink-search-icon']); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 searchState.checkForRealSink(fakeSinkList.concat([foundSink]))); | 462 searchState.checkForRealSink(fakeSinkList.concat([foundSink]))); |
| 461 assertEquals(foundSink.id, searchState.checkForRealSink(fakeSinkList)); | 463 assertEquals(foundSink.id, searchState.checkForRealSink(fakeSinkList)); |
| 462 }); | 464 }); |
| 463 }); | 465 }); |
| 464 } | 466 } |
| 465 | 467 |
| 466 return { | 468 return { |
| 467 registerTests: registerTests, | 469 registerTests: registerTests, |
| 468 }; | 470 }; |
| 469 }); | 471 }); |
| OLD | NEW |