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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 sinkSubtextList[2]); | 369 sinkSubtextList[2]); |
370 done(); | 370 done(); |
371 }); | 371 }); |
372 }); | 372 }); |
373 | 373 |
374 // Tests the expected view when there is only one local active route and | 374 // Tests the expected view when there is only one local active route and |
375 // media_router_container is created for the first time. | 375 // media_router_container is created for the first time. |
376 test('initial view with one local route', function() { | 376 test('initial view with one local route', function() { |
377 container.allSinks = fakeSinkList; | 377 container.allSinks = fakeSinkList; |
378 container.routeList = fakeRouteList; | 378 container.routeList = fakeRouteList; |
| 379 container.maybeShowRouteDetailsOnOpen(); |
379 | 380 |
380 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS); | 381 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS); |
381 }); | 382 }); |
382 | 383 |
383 // Tests the expected view when there are multiple local active routes | 384 // Tests the expected view when there are multiple local active routes |
384 // and media_router_container is created for the first time. | 385 // and media_router_container is created for the first time. |
385 test('initial view with multiple local routes', function() { | 386 test('initial view with multiple local routes', function() { |
386 container.allSinks = fakeSinkList; | 387 container.allSinks = fakeSinkList; |
387 container.routeList = fakeRouteListWithLocalRoutesOnly; | 388 container.routeList = fakeRouteListWithLocalRoutesOnly; |
388 | 389 |
389 checkCurrentView(media_router.MediaRouterView.SINK_LIST); | 390 checkCurrentView(media_router.MediaRouterView.SINK_LIST); |
390 }); | 391 }); |
391 | 392 |
392 // Tests the expected view when there are no local active routes and | 393 // Tests the expected view when there are no local active routes and |
393 // media_router_container is created for the first time. | 394 // media_router_container is created for the first time. |
394 test('initial view with no local route', function() { | 395 test('initial view with no local route', function() { |
395 container.allSinks = fakeSinkList; | 396 container.allSinks = fakeSinkList; |
396 container.routeList = []; | 397 container.routeList = []; |
397 | 398 |
398 checkCurrentView(media_router.MediaRouterView.SINK_LIST); | 399 checkCurrentView(media_router.MediaRouterView.SINK_LIST); |
399 }); | 400 }); |
400 | 401 |
401 // Tests the expected view when there are no local active routes and | 402 // Tests the expected view when there are no local active routes and |
402 // media_router_container is created for the first time. | 403 // media_router_container is created for the first time. |
403 test('view after route is closed remotely', function() { | 404 test('view after route is closed remotely', function() { |
404 container.allSinks = fakeSinkList; | 405 container.allSinks = fakeSinkList; |
405 container.routeList = fakeRouteList; | 406 container.routeList = fakeRouteList; |
| 407 container.maybeShowRouteDetailsOnOpen(); |
406 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS); | 408 checkCurrentView(media_router.MediaRouterView.ROUTE_DETAILS); |
407 | 409 |
408 container.routeList = []; | 410 container.routeList = []; |
409 checkCurrentView(media_router.MediaRouterView.SINK_LIST); | 411 checkCurrentView(media_router.MediaRouterView.SINK_LIST); |
410 }); | 412 }); |
411 | 413 |
412 // Tests for expected visible UI when the view is CAST_MODE_LIST. | 414 // Tests for expected visible UI when the view is CAST_MODE_LIST. |
413 test('cast mode list state visibility', function(done) { | 415 test('cast mode list state visibility', function(done) { |
414 container.showCastModeList_(); | 416 container.showCastModeList_(); |
415 setTimeout(function() { | 417 setTimeout(function() { |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 }); | 785 }); |
784 }); | 786 }); |
785 }); | 787 }); |
786 }); | 788 }); |
787 } | 789 } |
788 | 790 |
789 return { | 791 return { |
790 registerTests: registerTests, | 792 registerTests: registerTests, |
791 }; | 793 }; |
792 }); | 794 }); |
OLD | NEW |