Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3641)

Unified Diff: chrome/test/data/webui/media_router/media_router_elements_browsertest.js

Issue 2725503002: [Media Router] Custom Controls 4 - Implement details view WebUI (Closed)
Patch Set: Add braces to @implements {Interface} Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/media_router/media_router_elements_browsertest.js
diff --git a/chrome/test/data/webui/media_router/media_router_elements_browsertest.js b/chrome/test/data/webui/media_router/media_router_elements_browsertest.js
index 6be1d6ee431cabf5a898ece3a8d385c64dcbf466..e82cfbadfa3763f97737ca1fc138bdd7bb531bbf 100644
--- a/chrome/test/data/webui/media_router/media_router_elements_browsertest.js
+++ b/chrome/test/data/webui/media_router/media_router_elements_browsertest.js
@@ -30,9 +30,7 @@ MediaRouterElementsBrowserTest.prototype = {
/** @override */
accessibilityIssuesAreErrors: true,
- commandLineSwitches: [{
- switchName: 'media-router', switchValue: '1'
- }],
+ commandLineSwitches: [{switchName: 'media-router', switchValue: '1'}],
// List tests for individual elements. The media-router-container tests are
// split between several files and use common functionality from
@@ -48,12 +46,57 @@ MediaRouterElementsBrowserTest.prototype = {
'media_router_container_test_base.js',
'media_router_header_tests.js',
'media_router_search_highlighter_tests.js',
+ 'route_controls_tests.js',
'route_details_tests.js',
]),
+ /**
+ * Mocks the browser API methods to make them fire events instead.
+ */
+ installMockBrowserApi: function() {
+ cr.define('media_router.browserApi', function() {
+ 'use strict';
+
+ function pauseCurrentMedia() {
+ document.dispatchEvent(new Event('mock-pause-current-media'));
+ }
+
+ function playCurrentMedia() {
+ document.dispatchEvent(new Event('mock-play-current-media'));
+ }
+
+ function seekCurrentMedia(time) {
+ var event =
+ new CustomEvent('mock-seek-current-media', {detail: {time: time}})
+ document.dispatchEvent(event);
+ }
+
+ function setCurrentMediaMute(mute) {
+ var event = new CustomEvent(
+ 'mock-set-current-media-mute', {detail: {mute: mute}});
+ document.dispatchEvent(event);
+ }
+
+ function setCurrentMediaVolume(volume) {
+ var event = new CustomEvent(
+ 'mock-set-current-media-volume', {detail: {volume: volume}});
+ document.dispatchEvent(event);
+ }
+
+ return {
+ pauseCurrentMedia: pauseCurrentMedia,
+ playCurrentMedia: playCurrentMedia,
+ seekCurrentMedia: seekCurrentMedia,
+ setCurrentMediaMute: setCurrentMediaMute,
+ setCurrentMediaVolume: setCurrentMediaVolume,
+ };
+ });
+ },
+
/** @override */
setUp: function() {
PolymerTest.prototype.setUp.call(this);
+ this.installMockBrowserApi();
// Enable when failure is resolved.
// AX_ARIA_02: http://crbug.com/591547
@@ -134,6 +177,12 @@ TEST_F('MediaRouterElementsBrowserTest',
mocha.run();
});
+TEST_F(
+ 'MediaRouterElementsBrowserTest', 'MediaRouterRouteControls', function() {
+ route_controls.registerTests();
+ mocha.run();
+ });
+
TEST_F('MediaRouterElementsBrowserTest', 'MediaRouterRouteDetails', function() {
route_details.registerTests();
mocha.run();

Powered by Google App Engine
This is Rietveld 408576698