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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
diff --git a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
index a34f2852008ffd403ca66f9190d3a4ed74a0e070..a1c3facd0f2b62d474e87bbfc65888a1137a419e 100644
--- a/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
+++ b/third_party/WebKit/LayoutTests/media/video-duration-known-after-eos.html
@@ -1,48 +1,23 @@
<!DOCTYPE HTML>
-
-<html>
- <head>
- <title>local video</title>
-
- <script src=media-file.js></script>
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=video-test.js></script>
-
- <script>
- function ended()
- {
- testExpected("video.duration", 0, '>');
- endTest();
- }
-
- function playing()
- {
- video.removeEventListener("playing", playing);
- run("video.currentTime = video.duration - 0.2");
- }
-
- function loadedmetadata()
- {
- video.addEventListener("ended", ended);
- video.addEventListener("playing", playing);
-
- run("video.play()");
- }
-
- function start()
- {
- findMediaElement();
-
- video.addEventListener("loadedmetadata", loadedmetadata);
- video.src = findMediaFile("video", "content/test");
- consoleWrite("");
- }
-
- </script>
- </head>
- <body onload="start()">
- <video controls autobuffer></video>
- <p>Tests that duration is known after playback ended.</p>
- </body>
-</html>
+<title>Tests that duration is known after playback ended.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+
+ video.onended = t.step_func_done(function() {
+ assert_greater_than(video.duration, 0);
+ });
+
+ video.onplaying = t.step_func(function() {
+ video.onplaying = null;
+ video.currentTime = video.duration - 0.2;
+ });
+
+ video.src = findMediaFile("video", "content/test");
+ video.play();
+});
+</script>
« 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