Chromium Code Reviews| Index: chrome/test/data/webui/media_router/media_router_container_search_tests.js |
| diff --git a/chrome/test/data/webui/media_router/media_router_container_search_tests.js b/chrome/test/data/webui/media_router/media_router_container_search_tests.js |
| index 53b4d50a625e2bf77dd41763a21582989039d1e5..58d32269469a8ccd8d873e3f38799f93c687241c 100644 |
| --- a/chrome/test/data/webui/media_router/media_router_container_search_tests.js |
| +++ b/chrome/test/data/webui/media_router/media_router_container_search_tests.js |
| @@ -119,6 +119,27 @@ cr.define('media_router_container_search', function() { |
| */ |
| var foundSink = null; |
| + // Mock the browser API. |
| + var overrideBrowserApi = function() { |
|
mark a. foltz
2017/05/12 00:02:47
Can this be moved into the common setup code?
takumif
2017/05/15 17:13:12
Done. Figured out that HTMLElement#dispatchEvent d
|
| + 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, |
| + }; |
| + }); |
| + } |
| + |
| /** |
| * Example pseudo sink. |
| * @type {media_router.Sink} |
| @@ -137,6 +158,7 @@ cr.define('media_router_container_search', function() { |
| // Initialize a media-router-container before each test. |
| container = document.createElement('media-router-container'); |
| document.body.appendChild(container); |
| + overrideBrowserApi(container); |
| // Get common functions and variables. |
| var test_base = media_router_container_test_base.init(container); |