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

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

Issue 2098213002: Convert video-src-[plus-source, remove, set, source].html tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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-src-plus-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 <body> 2 <title>Test that a "source" element is not used when a bogus "src" attribute is present.</title>
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 3 <script src="../resources/testharness.js"></script>
4 (Please avoid writing new tests using video-test.js) --> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src=video-test.js></script> 5 <script src="media-file.js"></script>
6 <video>
7 <source></source>
8 </video>
9 <script>
10 async_test(function(t) {
11 var video = document.querySelector("video");
6 12
7 <script> 13 video.onloadedmetadata = t.unreached_func();
8 mediaElement.addEventListener('loadedmetadata', function() { 14 video.onloadstart = t.step_func(function () {
9 failTest("'loadedmetadata' event fired" ); 15 var url = video.currentSrc;
10 }, true); 16 assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
17 });
11 18
12 waitForEvent('loadstart', function () { 19 video.onerror = t.step_func(function () {
13 findMediaElement(); 20 var url = video.currentSrc;
14 testExpected("relativeURL(video.currentSrc)", "content/bogus.mpeg"); 21 assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
15 consoleWrite(""); 22 assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
16 }); 23 setTimeout(t.step_func_done(), 200) ;
24 });
17 25
18 waitForEvent('error', function () { 26 document.querySelector("source").src = findMediaFile("video", "content/test" );
19 findMediaElement(); 27 var mediaFile = "content/bogus.mpeg";
20 testExpected("relativeURL(video.currentSrc)", "content/bogus.mpeg"); 28 video.src = mediaFile;
21 testExpected("mediaElement.error.code", MediaError.MEDIA_ERR_SRC_NOT _SUPPORTED); 29 });
22 setTimeout(endTest, 200) ; 30 </script>
23 consoleWrite("");
24 });
25 </script>
26
27 <video src=content/bogus.mpeg controls>
28 <source src=content/test.mp4>
29 </video>
30
31 <p>Test that a &lt;source&gt; element is not used when a bogus 'src' attribute i s present
32 </p>
33
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-src-plus-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698