diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html new file mode 100644 index 000000000..e9b658994 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html @@ -0,0 +1,32 @@ +<!doctype html> +<title>currentTime</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/media.js"></script> +<div id=log></div> +<script> +test(function() { + var v = document.createElement('video'); + assert_equals(v.currentTime, 0); +}, 'currentTime initial value'); + +test(function() { + var v = document.createElement('video'); + assert_equals(v.readyState, v.HAVE_NOTHING); + v.currentTime = Number.MAX_VALUE; + assert_equals(v.currentTime, Number.MAX_VALUE); + assert_false(v.seeking); +}, 'setting currentTime when readyState is HAVE_NOTHING'); + +async_test(function(t) { + var v = document.createElement('video'); + v.src = getVideoURI('/media/movie_5'); + v.onloadedmetadata = t.step_func(function() { + assert_greater_than(v.readyState, v.HAVE_NOTHING); + assert_false(v.seeking); + v.currentTime = 1; + assert_true(v.seeking); + t.done(); + }); +}, 'setting currentTime when readyState is greater than HAVE_NOTHING'); +</script> |