Index: LayoutTests/media/seek-to-currentTime.html |
diff --git a/LayoutTests/media/seek-to-currentTime.html b/LayoutTests/media/seek-to-currentTime.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3291788382e1852ae7d9e0767b6cb42858bd27f |
--- /dev/null |
+++ b/LayoutTests/media/seek-to-currentTime.html |
@@ -0,0 +1,35 @@ |
+<!DOCTYPE html> |
+<!-- original: https://github.com/w3c/web-platform-tests/blob/master/html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html --> |
+<title>seek to currentTime</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="media-file.js"></script> |
+<div id=log></div> |
+<script> |
+// TODO(srirama.m): Remove this test by importing the above web-platform-tests test |
+async_test(function(t) { |
+ var v = document.createElement('video'); |
+ v.src = findMediaFile('video', 'content/test'); |
+ v.onloadedmetadata = t.step_func(function() { |
+ assert_greater_than(v.readyState, v.HAVE_NOTHING, 'readyState'); |
+ assert_greater_than(v.seekable.length, 0, 'seekable ranges'); |
+ assert_false(v.seeking, 'seeking before setting currentTime'); |
+ v.currentTime = v.currentTime; |
+ assert_true(v.seeking, 'seeking after setting currentTime'); |
+ var events = []; |
+ v.onseeking = v.ontimeupdate = v.onseeked = t.step_func(function(e) { |
+ events.push(e.type); |
+ // v.seeking can be true or false in the seeking event, see |
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=24774 |
+ if (e.type != 'seeking') { |
+ assert_equals(v.seeking, false, 'seeking in ' + e.type + ' event'); |
+ } |
+ if (e.type == 'seeked') { |
+ assert_array_equals(events, ['seeking', 'timeupdate', 'seeked'], |
+ 'fired events'); |
+ t.done(); |
+ } |
+ }); |
+ }); |
+}); |
+</script> |