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

Side by Side Diff: ui/file_manager/video_player/js/test_util.js

Issue 1782363003: Add subtitles track if there is a subtitles file with the same name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 9 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
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/video_player.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * Returns if a video element playing the specified file meet the condition 6 * Returns if a video element playing the specified file meet the condition
7 * which is given by a parameter. 7 * which is given by a parameter.
8 * @param {string} filename Name of video file to be checked. This must be same 8 * @param {string} filename Name of video file to be checked. This must be same
9 * as entry.name() of the video file. 9 * as entry.name() of the video file.
10 * @param {function(!HTMLElement):boolean} testFunction 10 * @param {function(!HTMLElement):boolean} testFunction
11 */ 11 */
12 function testElement(filename, testFunction) { 12 function testElement(filename, testFunction) {
13 for (var appId in window.background.appWindows) { 13 for (var appId in window.background.appWindows) {
14 var contentWindow = window.background.appWindows[appId].contentWindow; 14 var contentWindow = window.background.appWindows[appId].contentWindow;
15 if (contentWindow && 15 if (contentWindow &&
16 contentWindow.document.title === filename) { 16 contentWindow.document.title === filename) {
17 var element = contentWindow.document.querySelector('video[src]'); 17 var element = contentWindow.document.querySelector('video');
18 if (element && testFunction(element)) 18 if (element && testFunction(element))
19 return true; 19 return true;
20 } 20 }
21 } 21 }
22 return false; 22 return false;
23 } 23 }
24 24
25 /** 25 /**
26 * Returns if the specified file is being played. 26 * Returns if the specified file is being played.
27 * 27 *
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 * @param {!Array<string>} urls URLs to be opened. 63 * @param {!Array<string>} urls URLs to be opened.
64 * @param {function(string)} callback Completion callback with the new window's 64 * @param {function(string)} callback Completion callback with the new window's
65 * App ID. 65 * App ID.
66 */ 66 */
67 test.util.async.openVideoPlayer = function(urls, callback) { 67 test.util.async.openVideoPlayer = function(urls, callback) {
68 openVideoPlayerWindow(urls).then(callback); 68 openVideoPlayerWindow(urls).then(callback);
69 }; 69 };
70 70
71 // Register the test utils. 71 // Register the test utils.
72 test.util.registerRemoteTestUtils(); 72 test.util.registerRemoteTestUtils();
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/video_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698