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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @fileoverview Runs the Media Router Polymer elements tests. */ 5 /** @fileoverview Runs the Media Router Polymer elements tests. */
6 6
7 /** @const {string} Path to source root. */ 7 /** @const {string} Path to source root. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 12 matching lines...) Expand all
23 23
24 /** @override */ 24 /** @override */
25 browsePreload: 'chrome://media-router/', 25 browsePreload: 'chrome://media-router/',
26 26
27 /** @override */ 27 /** @override */
28 runAccessibilityChecks: true, 28 runAccessibilityChecks: true,
29 29
30 /** @override */ 30 /** @override */
31 accessibilityIssuesAreErrors: true, 31 accessibilityIssuesAreErrors: true,
32 32
33 commandLineSwitches: [{ 33 commandLineSwitches: [{switchName: 'media-router', switchValue: '1'}],
34 switchName: 'media-router', switchValue: '1'
35 }],
36 34
37 // List tests for individual elements. The media-router-container tests are 35 // List tests for individual elements. The media-router-container tests are
38 // split between several files and use common functionality from 36 // split between several files and use common functionality from
39 // media_router_container_test_base.js. 37 // media_router_container_test_base.js.
40 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ 38 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([
41 'issue_banner_tests.js', 39 'issue_banner_tests.js',
42 'media_router_container_cast_mode_list_tests.js', 40 'media_router_container_cast_mode_list_tests.js',
43 'media_router_container_filter_tests.js', 41 'media_router_container_filter_tests.js',
44 'media_router_container_first_run_flow_tests.js', 42 'media_router_container_first_run_flow_tests.js',
45 'media_router_container_route_tests.js', 43 'media_router_container_route_tests.js',
46 'media_router_container_search_tests.js', 44 'media_router_container_search_tests.js',
47 'media_router_container_sink_list_tests.js', 45 'media_router_container_sink_list_tests.js',
48 'media_router_container_test_base.js', 46 'media_router_container_test_base.js',
49 'media_router_header_tests.js', 47 'media_router_header_tests.js',
50 'media_router_search_highlighter_tests.js', 48 'media_router_search_highlighter_tests.js',
49 'route_controls_tests.js',
51 'route_details_tests.js', 50 'route_details_tests.js',
52 ]), 51 ]),
53 52
53 /**
54 * Mocks the browser API methods to make them fire events instead.
55 */
56 installMockBrowserApi: function() {
57 cr.define('media_router.browserApi', function() {
58 'use strict';
59
60 function pauseCurrentMedia() {
61 document.dispatchEvent(new Event('mock-pause-current-media'));
62 }
63
64 function playCurrentMedia() {
65 document.dispatchEvent(new Event('mock-play-current-media'));
66 }
67
68 function seekCurrentMedia(time) {
69 var event =
70 new CustomEvent('mock-seek-current-media', {detail: {time: time}})
71 document.dispatchEvent(event);
72 }
73
74 function setCurrentMediaMute(mute) {
75 var event = new CustomEvent(
76 'mock-set-current-media-mute', {detail: {mute: mute}});
77 document.dispatchEvent(event);
78 }
79
80 function setCurrentMediaVolume(volume) {
81 var event = new CustomEvent(
82 'mock-set-current-media-volume', {detail: {volume: volume}});
83 document.dispatchEvent(event);
84 }
85
86 return {
87 pauseCurrentMedia: pauseCurrentMedia,
88 playCurrentMedia: playCurrentMedia,
89 seekCurrentMedia: seekCurrentMedia,
90 setCurrentMediaMute: setCurrentMediaMute,
91 setCurrentMediaVolume: setCurrentMediaVolume,
92 };
93 });
94 },
95
54 /** @override */ 96 /** @override */
55 setUp: function() { 97 setUp: function() {
56 PolymerTest.prototype.setUp.call(this); 98 PolymerTest.prototype.setUp.call(this);
99 this.installMockBrowserApi();
57 100
58 // Enable when failure is resolved. 101 // Enable when failure is resolved.
59 // AX_ARIA_02: http://crbug.com/591547 102 // AX_ARIA_02: http://crbug.com/591547
60 this.accessibilityAuditConfig.ignoreSelectors( 103 this.accessibilityAuditConfig.ignoreSelectors(
61 'nonExistentAriaRelatedElement', '#input'); 104 'nonExistentAriaRelatedElement', '#input');
62 105
63 // Enable when failure is resolved. 106 // Enable when failure is resolved.
64 // AX_ARIA_04: http://crbug.com/591550 107 // AX_ARIA_04: http://crbug.com/591550
65 this.accessibilityAuditConfig.ignoreSelectors( 108 this.accessibilityAuditConfig.ignoreSelectors(
66 'badAriaAttributeValue', '#input'); 109 'badAriaAttributeValue', '#input');
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 mocha.run(); 170 mocha.run();
128 }); 171 });
129 172
130 TEST_F('MediaRouterElementsBrowserTest', 173 TEST_F('MediaRouterElementsBrowserTest',
131 'MediaRouterSearchHighlighter', 174 'MediaRouterSearchHighlighter',
132 function() { 175 function() {
133 media_router_search_highlighter.registerTests(); 176 media_router_search_highlighter.registerTests();
134 mocha.run(); 177 mocha.run();
135 }); 178 });
136 179
180 TEST_F(
181 'MediaRouterElementsBrowserTest', 'MediaRouterRouteControls', function() {
182 route_controls.registerTests();
183 mocha.run();
184 });
185
137 TEST_F('MediaRouterElementsBrowserTest', 'MediaRouterRouteDetails', function() { 186 TEST_F('MediaRouterElementsBrowserTest', 'MediaRouterRouteDetails', function() {
138 route_details.registerTests(); 187 route_details.registerTests();
139 mocha.run(); 188 mocha.run();
140 }); 189 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698