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

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

Issue 2102433003: Convert video-source* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>Test "source" element.</title>
3 <script src=media-file.js></script> 3 <script src="../resources/testharness.js"></script>
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharnessreport.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="media-file.js"></script>
6 <script src=video-test.js></script> 6 <video>
7 <script> 7 <source></source>
8 </video>
9 <script>
10 async_test(function(t) {
11 var video = document.querySelector("video");
12 var source = document.querySelector("source");
13 var mediaFile = findMediaFile("video", "content/test");
14 source.src = mediaFile;
8 15
9 function test() 16 video.onloadstart = t.step_func_done(function() {
10 { 17 var url = video.currentSrc;
11 var panel = document.getElementById("panel"); 18 assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);
12 var mediaFile = findMediaFile("video", "content/test");
13 19
14 panel.innerHTML = "<video controls><source src='" + mediaFile + "'></video>"; 20 assert_equals(source.getAttribute("src"), mediaFile);
15 21
16 video = mediaElement = document.getElementsByTagName('video')[0] ; 22 url = source.src;
17 waitForEvent("loadstart", function () { 23 assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);
18 testExpected("stripExtension(relativeURL(video.currentSrc))" , stripExtension(mediaFile)); 24 });
19 25 });
20 source = document.querySelector('source'); 26 </script>
21 testExpected("stripExtension(source.getAttribute('src'))", s tripExtension(mediaFile));
22 testExpected("stripExtension(relativeURL(source.src))", stri pExtension(mediaFile));
23
24 endTest();
25 });
26 }
27 </script>
28 </head>
29
30 <body onload="setTimeout(test, 100)">
31
32 <div id=panel></div>
33
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698