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

Unified Diff: LayoutTests/http/tests/media/audio-seekable-contains-zero-without-ranges.html

Issue 615193004: Add layout tests for seeks to zero on streaming sources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Spaces! Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/resources/load-video.php » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ });
+
+ 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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/resources/load-video.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698