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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-duration-known-after-eos-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 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <title>Tests that duration is known after playback ended.</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <video></video>
7 <script>
8 async_test(function(t) {
9 var video = document.querySelector("video");
2 10
3 <html> 11 video.onended = t.step_func_done(function() {
4 <head> 12 assert_greater_than(video.duration, 0);
5 <title>local video</title> 13 });
6 14
7 <script src=media-file.js></script> 15 video.onplaying = t.step_func(function() {
8 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 16 video.onplaying = null;
9 (Please avoid writing new tests using video-test.js) --> 17 video.currentTime = video.duration - 0.2;
10 <script src=video-test.js></script> 18 });
11 19
12 <script> 20 video.src = findMediaFile("video", "content/test");
13 function ended() 21 video.play();
14 { 22 });
15 testExpected("video.duration", 0, '>'); 23 </script>
16 endTest();
17 }
18
19 function playing()
20 {
21 video.removeEventListener("playing", playing);
22 run("video.currentTime = video.duration - 0.2");
23 }
24
25 function loadedmetadata()
26 {
27 video.addEventListener("ended", ended);
28 video.addEventListener("playing", playing);
29
30 run("video.play()");
31 }
32
33 function start()
34 {
35 findMediaElement();
36
37 video.addEventListener("loadedmetadata", loadedmetadata);
38 video.src = findMediaFile("video", "content/test");
39 consoleWrite("");
40 }
41
42 </script>
43 </head>
44 <body onload="start()">
45 <video controls autobuffer></video>
46 <p>Tests that duration is known after playback ended.</p>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-duration-known-after-eos-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698