| 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 528f55d9f2411bedeb91f0de148115512f0dbfe7..9446f2f3cccda0cd827e2916e502d192e0aac642 100644
|
| --- a/chrome/test/data/webui/media_router/route_details_tests.js
|
| +++ b/chrome/test/data/webui/media_router/route_details_tests.js
|
| @@ -37,6 +37,16 @@ cr.define('route_details', function() {
|
| assertTrue(details.$['custom-controller'].hasAttribute('hidden'));
|
| };
|
|
|
| + // Checks the default route view is shown.
|
| + var checkJoinButtonIsShown = function() {
|
| + assertFalse(details.$['join-route-button'].hasAttribute('hidden'));
|
| + };
|
| +
|
| + // Checks the default route view is not shown.
|
| + var checkJoinButtonIsNotShown = function() {
|
| + assertTrue(details.$['join-route-button'].hasAttribute('hidden'));
|
| + };
|
| +
|
| // Checks the custom controller is shown.
|
| var checkCustomControllerIsShown = function() {
|
| assertTrue(details.$['route-information'].hasAttribute('hidden'));
|
| @@ -64,9 +74,10 @@ cr.define('route_details', function() {
|
|
|
| // Initialize routes and sinks.
|
| fakeRouteOne = new media_router.Route('route id 1', 'sink id 1',
|
| - 'Video 1', 1, true, 'chrome-extension://123/custom_view.html');
|
| + 'Video 1', 1, true, false,
|
| + 'chrome-extension://123/custom_view.html');
|
| fakeRouteTwo = new media_router.Route('route id 2', 'sink id 2',
|
| - 'Video 2', 2, false);
|
| + 'Video 2', 2, false, true);
|
|
|
| // Allow for the route details to be created and attached.
|
| setTimeout(done);
|
| @@ -81,11 +92,22 @@ cr.define('route_details', function() {
|
| MockInteractions.tap(details.$['close-route-button']);
|
| });
|
|
|
| + // Tests for 'join-route-click' event firing when the
|
| + // 'join-route-button' button is clicked.
|
| + test('join route button click', function(done) {
|
| + details.addEventListener('join-route-click', function() {
|
| + done();
|
| + });
|
| + MockInteractions.tap(details.$['join-route-button']);
|
| + });
|
| +
|
| // Tests the initial expected text.
|
| test('initial text setting', function() {
|
| // <paper-button> text is styled as upper case.
|
| checkSpanText(loadTimeData.getString('stopCastingButton')
|
| .toUpperCase(), 'close-route-button');
|
| + checkSpanText(loadTimeData.getString('joinButton'),
|
| + 'join-route-button');
|
| checkSpanText('', 'route-information');
|
| });
|
|
|
| @@ -101,6 +123,7 @@ cr.define('route_details', function() {
|
| checkSpanText(loadTimeData.getStringF('castingActivityStatus',
|
| fakeRouteOne.description), 'route-information');
|
| checkDefaultViewIsShown();
|
| + checkJoinButtonIsNotShown();
|
|
|
| // Set |route| to a different route.
|
| details.route = fakeRouteTwo;
|
| @@ -108,6 +131,7 @@ cr.define('route_details', function() {
|
| checkSpanText(loadTimeData.getStringF('castingActivityStatus',
|
| fakeRouteTwo.description), 'route-information');
|
| checkDefaultViewIsShown();
|
| + checkJoinButtonIsShown();
|
| });
|
|
|
| // Tests when |route| exists, has a custom controller, and it loads.
|
|
|