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

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

Issue 2060353005: Convert video-autoplay*, video-black* and video-buffered* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit 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
Index: third_party/WebKit/LayoutTests/media/video-buffered.html
diff --git a/third_party/WebKit/LayoutTests/media/video-buffered.html b/third_party/WebKit/LayoutTests/media/video-buffered.html
index edc02f4d2ebd5a402ed385adfe52783828465610..b7b60706bb85115e9465b703e9a8b7170d6acc98 100644
--- a/third_party/WebKit/LayoutTests/media/video-buffered.html
+++ b/third_party/WebKit/LayoutTests/media/video-buffered.html
@@ -1,26 +1,29 @@
-<video controls></video>
-<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>
+<!DOCTYPE html>
+<title>Test video buffering properties.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
<script>
- testExpected("video.buffered.length", 0);
- testDOMException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.start(0)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.end(0)", "DOMException.INDEX_SIZE_ERR");
- waitForEvent('canplaythrough',
- function ()
- {
- testExpected("video.buffered.length", 1);
- testExpected("video.buffered.start(0)", 0);
- testExpected("video.buffered.end(0)", 0, '>');
- testDOMException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.start(1)", "DOMException.INDEX_SIZE_ERR");
- testDOMException("video.buffered.end(1)", "DOMException.INDEX_SIZE_ERR");
- endTest();
- }
- );
+async_test(function(t) {
+ var video = document.querySelector("video");
+
+ assert_equals(video.buffered.length, 0);
+ assert_throws("IndexSizeError", function() { video.buffered.start(-1); });
+ assert_throws("IndexSizeError", function() { video.buffered.end(-1); });
+ assert_throws("IndexSizeError", function() { video.buffered.start(0); });
+ assert_throws("IndexSizeError", function() { video.buffered.end(0); });
+
+ video.oncanplaythrough = t.step_func_done(function () {
+ assert_equals(video.buffered.length, 1);
+ assert_equals(video.buffered.start(0), 0);
+ assert_greater_than(video.buffered.end(0), 0);
+ assert_throws("IndexSizeError", function() { video.buffered.start(-1); });
+ assert_throws("IndexSizeError", function() { video.buffered.end(-1); });
+ assert_throws("IndexSizeError", function() { video.buffered.start(1); });
+ assert_throws("IndexSizeError", function() { video.buffered.end(1); });
+ });
+
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698