| Index: chrome/test/data/webui/media_router/route_details_tests.js
|
| diff --git a/chrome/test/data/webui/media_router/route_details_tests.js b/chrome/test/data/webui/media_router/route_details_tests.js
|
| index 2d8d0741f9dd6ba16169181b6ef33dccbfaac771..da0f878d56e811d44be58bbc315fb19bcbb2d887 100644
|
| --- a/chrome/test/data/webui/media_router/route_details_tests.js
|
| +++ b/chrome/test/data/webui/media_router/route_details_tests.js
|
| @@ -95,10 +95,22 @@ cr.define('route_details', function() {
|
| });
|
|
|
| // Tests for 'start-casting-to-route-click' event firing when the
|
| - // 'start-casting-to-route-button' button is clicked.
|
| + // 'start-casting-to-route-button' button is clicked when the current
|
| + // route is joinable.
|
| test('start casting to route button click', function(done) {
|
| details.addEventListener(
|
| 'start-casting-to-route-click', function() { done(); });
|
| + details.route = fakeRouteTwo;
|
| + MockInteractions.tap(details.$['start-casting-to-route-button']);
|
| + });
|
| +
|
| + // Tests for 'cast-new-media-click' event firing when the
|
| + // 'start-casting-to-route-button' button is clicked when the current
|
| + // route is not joinable.
|
| + test('start casting button click starts new media', function(done) {
|
| + details.addEventListener(
|
| + 'cast-new-media-click', function() { done(); });
|
| + details.route = fakeRouteOne;
|
| MockInteractions.tap(details.$['start-casting-to-route-button']);
|
| });
|
|
|
| @@ -117,6 +129,7 @@ cr.define('route_details', function() {
|
| test('route is undefined or set', function() {
|
| // |route| is initially undefined.
|
| assertEquals(undefined, details.route);
|
| + assertEquals(0, details.availableCastModes);
|
| checkDefaultViewIsShown();
|
|
|
| // Set |route|.
|
| @@ -136,6 +149,23 @@ cr.define('route_details', function() {
|
| checkStartCastButtonIsShown();
|
| });
|
|
|
| + // Tests when |availableCastModes| is undefined or set.
|
| + test('route available cast modes undefined or set', function() {
|
| + details.route = fakeRouteOne;
|
| + assertEquals(0, details.availableCastModes);
|
| + assertFalse(details.route.canJoin);
|
| + checkStartCastButtonIsNotShown();
|
| +
|
| + details.availableCastModes = 1;
|
| + checkStartCastButtonIsShown();
|
| +
|
| + details.availableCastModes = 2;
|
| + checkStartCastButtonIsShown();
|
| +
|
| + details.availableCastModes = 3;
|
| + checkStartCastButtonIsShown();
|
| + });
|
| +
|
| // Tests when |route| exists, has a custom controller, and it loads.
|
| test('route has custom controller and loading succeeds', function(done) {
|
| var loadInvoked = false;
|
|
|