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

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

Issue 2103783002: Convert video-seeking*, video-set* and video-single* 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
OLDNEW
1 <!doctype html> 1 <!DOCTYPE html>
2 <html> 2 <title>Test that a single valid "source" element loads correctly.</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 <video></video>
7 <script src=video-test.js></script> 7 <script>
8 async_test(function(t) {
9 var video = document.querySelector("video");
8 10
9 <script> 11 // The first source should load.
12 var source = document.createElement("source");
13 source.src = findMediaFile("video", "content/test");;
14 video.appendChild(source);
10 15
11 function errorEvent() 16 // The second source is bogus and won't load, but it should never be process ed.
12 { 17 source = document.createElement("source");
13 logResult(false, "*** \"" + relativeURL(video.currentSrc) + "\" should not have been processed!" ); 18 source.src = "content/does-not-exist";
14 consoleWrite(""); 19 source.onerror = t.unreached_func();
15 endTest(); 20 video.appendChild(source);
16 }
17 21
18 function setup() 22 video.onloadedmetadata = t.step_func_done();
19 { 23 });
20 video = document.createElement("video"); 24 </script>
21 video.setAttribute("controls", "controls");
22
23 // The first source should load.
24 var source = document.createElement("source");
25 source.setAttribute("src", findMediaFile("video", "content/test" ));
26 source.setAttribute("type", mimeTypeForFile(source.getAttribute( "src")));
27 video.appendChild(source);
28
29 // The second source is bogus and won't load, but it should neve r be processed.
30 source = document.createElement("source");
31 source.setAttribute("src", findMediaFile("video", "content/does- not-exist"));
32 source.setAttribute("type", mimeTypeForFile(source.getAttribute( "src")));
33 video.appendChild(source);
34
35 document.body.appendChild(video);
36
37 waitForEvent('error', errorEvent);
38 waitForEvent('loadedmetadata', endTest);
39 consoleWrite("");
40 }
41
42 </script>
43 </head>
44 <body onload="setup()">
45
46 <p>Test that a single valid &lt;source&gt; element loads correctly</p>
47
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698