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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html

Issue 2196673002: Convert video-buffer* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
index d9903eb7d0dbb6115dd7818ced91c76bf3a5ce06..9a31cbcd298dffaa6be4cbd3de196c49c31bcb14 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html
@@ -1,34 +1,26 @@
-<html>
-<head>
-</head>
-<body onload="start()">
-<p>Start playing a video with preloading enabled, do a seek near the
- end and check multiple buffered timeranges have been created.</p>
-<video id="video" preload="auto" autobuffer></video>
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
-<script src=../../media-resources/video-test.js></script>
-<script src=../../media-resources/media-file.js></script>
+<!DOCTYPE html>
+<title>Check multiple buffered timeranges with video preload.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<video preload="auto"></video>
<script>
- waitForEvent("ended", ended);
- waitForEventOnce('playing', function() {
- testExpected("video.buffered.length", 1, "==");
- run("video.currentTime = video.duration - 0.5");
- });
+async_test(function(t) {
+ var video = document.querySelector("video");
- function ended() {
- testExpected("video.buffered.length", 2, "==");
- endTest();
- }
+ video.onended = t.step_func_done(function() {
+ assert_equals(video.buffered.length, 2);
+ });
- function start () {
- video = document.getElementById('video');
- var mediaFile = findMediaFile("audio", "../../../media/content/test");
- var type = mimeTypeForExtension(mediaFile.split('.').pop());
- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name=" + mediaFile + "&throttle=100&type=" + type;
+ video.onplaying = t.step_func(function() {
+ video.onplaying = null;
+ video.currentTime = video.duration - 0.5;
+ });
- video.play();
- }
-</script>
-</body>
-</html>
+ // This test needs a large media file to test multiple buffered timeranges.
+ var mediaFile = "../../../media/resources/frame_size_change.webm";
+ var type = mimeTypeForExtension(mediaFile.split(".").pop());
+ video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name=" + mediaFile + "&throttle=100000&type=" + type;
+ video.play();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698