chromium/third_party/blink/web_tests/http/tests/media/audio-seekable-contains-zero-without-ranges.html

<!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 = '../../../../media/content/silence.oga';
  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>