| Index: chrome/test/data/webui/media_router/media_router_container_route_tests.js
|
| diff --git a/chrome/test/data/webui/media_router/media_router_container_route_tests.js b/chrome/test/data/webui/media_router/media_router_container_route_tests.js
|
| index 71a41e8814cab291dd83000f511e06619489e615..b8524ebd4e8e7f5bf407d772f7ffba9f39715928 100644
|
| --- a/chrome/test/data/webui/media_router/media_router_container_route_tests.js
|
| +++ b/chrome/test/data/webui/media_router/media_router_container_route_tests.js
|
| @@ -79,6 +79,27 @@ cr.define('media_router_container_route', function() {
|
| */
|
| var fakeSinkList = [];
|
|
|
| + // Mock the browser API.
|
| + var overrideBrowserApi = function() {
|
| + cr.define('media_router.browserApi', function() {
|
| + 'use strict';
|
| +
|
| + function onMediaControllerClosed() {
|
| + container.fire('mock-media-controller-closed');
|
| + }
|
| +
|
| + function onMediaControllerAvailable(routeId) {
|
| + container.fire('mock-media-controller-available',
|
| + {routeId: routeId});
|
| + }
|
| +
|
| + return {
|
| + onMediaControllerClosed: onMediaControllerClosed,
|
| + onMediaControllerAvailable: onMediaControllerAvailable,
|
| + };
|
| + });
|
| + }
|
| +
|
| // Import media_router_container.html before running suite.
|
| suiteSetup(function() {
|
| return PolymerTest.importHtml(
|
| @@ -91,6 +112,7 @@ cr.define('media_router_container_route', function() {
|
| // Initialize a media-router-container before each test.
|
| container = document.createElement('media-router-container');
|
| document.body.appendChild(container);
|
| + overrideBrowserApi();
|
|
|
| // Get common functions and variables.
|
| var test_base = media_router_container_test_base.init(container);
|
| @@ -254,7 +276,8 @@ cr.define('media_router_container_route', function() {
|
|
|
| // Tests for expected visible UI when the view is ROUTE_DETAILS.
|
| test('route details visibility', function(done) {
|
| - container.showRouteDetails_();
|
| + container.showRouteDetails_(
|
| + new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
|
| setTimeout(function() {
|
| checkElementsVisibleWithId(['container-header',
|
| 'device-missing',
|
| @@ -294,7 +317,8 @@ cr.define('media_router_container_route', function() {
|
| // Tests for expected visible UI when the view is ROUTE_DETAILS, and there
|
| // is a non-blocking issue.
|
| test('route details visibility non blocking issue', function(done) {
|
| - container.showRouteDetails_();
|
| + container.showRouteDetails_(
|
| + new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
|
|
|
| // Set a non-blocking issue. The issue should be shown.
|
| container.issue = fakeNonBlockingIssue;
|
| @@ -309,7 +333,8 @@ cr.define('media_router_container_route', function() {
|
| // Tests for expected visible UI when the view is ROUTE_DETAILS, and there
|
| // is a blocking issue.
|
| test('route details visibility with blocking issue', function(done) {
|
| - container.showRouteDetails_();
|
| + container.showRouteDetails_(
|
| + new media_router.Route('id 3', 'sink id 3', 'Title 3', 0, true));
|
|
|
| // Set a blocking issue. The issue should be shown, and everything
|
| // else, hidden.
|
|
|