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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-src-blob.html

Issue 2092373002: Convert video-src* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>This tests the ability of the "video" element to load blob URLs. In the b rowser, select a video file.</title>
3 <head> 3 <script src="../resources/testharness.js"></script>
4 <script src=media-file.js></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 5 <script src="media-file.js"></script>
6 (Please avoid writing new tests using video-test.js) --> 6 <input type="file">
7 <script src=video-test.js></script> 7 <video></video>
8 <script> 8 <script>
9 function inputFileChanged(e) { 9 async_test(function(t) {
10 findMediaElement(); 10 var video = document.querySelector("video");
11 var file = e.target.files[0]; 11 var inputFile = document.querySelector("input");
12 waitForEventAndEnd('loadedmetadata');
13 waitForEventAndFail('error');
14 video.src = window.URL.createObjectURL(file);
15 }
16 12
17 function runTest() { 13 inputFile.onchange = t.step_func(function(event) {
18 var inputFile = document.getElementById('file'); 14 video.onloadedmetadata = t.step_func_done();
19 var centerX = inputFile.offsetLeft + inputFile.offsetWidth / 2; 15 video.onerror = t.unreached_func();
20 var centerY = inputFile.offsetTop + inputFile.offsetHeight / 2; 16 video.src = URL.createObjectURL(event.target.files[0]);
21 waitForEvent('change', inputFileChanged, false, false, inputFile ); 17 });
22 18
23 if (window.eventSender) { 19 eventSender.beginDragWithFiles([findMediaFile("video", "content/test")]);
24 eventSender.beginDragWithFiles([findMediaFile("video", "cont ent/test")]); 20 var centerX = inputFile.offsetLeft + inputFile.offsetWidth / 2;
25 eventSender.mouseMoveTo(centerX, centerY); 21 var centerY = inputFile.offsetTop + inputFile.offsetHeight / 2;
26 eventSender.mouseUp(); 22 eventSender.mouseMoveTo(centerX, centerY);
27 } 23 eventSender.mouseUp();
28 } 24 });
29 </script> 25 </script>
30 </head>
31 <body onload="runTest()">
32 <div>
33 This tests the ability of the &lt;video&gt; element to load blob URL s. In the browser, select a video file:
34 <input type="file" name="file" id="file">
35 </div>
36 <video></video>
37 </body>
38 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-src.html ('k') | third_party/WebKit/LayoutTests/media/video-src-blob-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698