Chromium Code Reviews| Index: LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html |
| diff --git a/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html b/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dc23b5d2d256adebf21ac8100444684aede2c44f |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html |
| @@ -0,0 +1,33 @@ |
| +<!DOCTYPE html> |
| +<title>seekable() ranges contain zero when server doesn't support range requests.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="../../media-resources/media-file.js"></script> |
| +<div id="log"></div> |
| +<audio controls></audio> |
| +<script> |
| +async_test(function(t) { |
| + var audio = document.querySelector('audio'); |
| + |
| + audio.onloadeddata = t.step_func(function() { |
| + // Verify seekable range only contains zero. |
| + assert_equals(audio.seekable.length, 1); |
| + assert_equals(audio.seekable.start(0), 0); |
| + assert_equals(audio.seekable.end(0), 0); |
| + |
| + // Verify seeking to a nonzero position results in a seek to zero. |
| + audio.currentTime = 1; |
|
philipj_slow
2014/10/01 10:47:18
Per spec you should be able to assert_equals(audio
|
| + }); |
| + |
| + audio.onseeked = t.step_func(function() { |
| + assert_equals(audio.currentTime, 0); |
| + t.done(); |
| + }); |
| + |
| + var mediaFile = findMediaFile('audio', '../../../../media/content/silence'); |
| + var type = mimeTypeForExtension(mediaFile.split('.').pop()); |
| + |
| + audio.src = 'http://127.0.0.1:8000/media/resources/load-video.php' + |
| + '?norange=true&name=' + mediaFile + '&type=' + type; |
| +}); |
| +</script> |