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

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

Issue 2077413002: Convert video-duration*, video-error* and video-load* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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 <video controls></video> 1 <!DOCTYPE html>
2 <script src=media-file.js></script> 2 <title>Test media element readystate value on load.</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></video>
6 <script> 7 <script>
7 function testReadyState(expected, endit, op) 8 async_test(function(t) {
8 { 9 var video = document.querySelector("video");
9 testExpected("video.readyState", expected, op); 10 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
10 if (endit) 11 video.onloadstart = t.step_func(function() {});
11 endTest(); 12 video.onloadedmetadata = t.step_func(function() {});
12 } 13 video.onloadeddata = t.step_func(function() {});
14 video.oncanplay = t.step_func(function() {});
15 video.onplay = t.unreached_func();
16 video.onplaying = t.unreached_func();
13 17
14 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); 18 video.oncanplaythrough = t.step_func_done(function () {
15 waitForEvent("loadstart"); 19 assert_equals(video.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
16 waitForEvent("loadedmetadata"); 20 });
17 waitForEvent("loadeddata");
18 waitForEvent("canplay");
19 waitForEventAndFail("play");
20 waitForEventAndFail("playing");
21 waitForEvent("canplaythrough", function () { testReadyState(HTMLMediaElement .HAVE_ENOUGH_DATA, true ); } );
22 21
23 video.src = findMediaFile("video", "content/test"); 22 video.src = findMediaFile("video", "content/test");
24 </script> 23 });
24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698