Skip to content

Commit

Permalink
Fix mediasource-liveseekable
Browse files Browse the repository at this point in the history
1. Includes a degenerate <div></div> to enable mediasource_test() to
appendChild to a generated document.body triggered by inclusion of the
div.
2. Updates {set,clear}LiveSeekableRange() behavior verification to no
longer expect exception if updating is currently true for any
SourceBuffer in sourceBuffers. This corresponds to landing the expected
MSE spec change in w3c/media-source#119 to fix
MSE spec issue w3c/media-source#118
3. Includes Chromium+W3C license stamp.
  • Loading branch information
wolenetz committed Jul 13, 2016
1 parent b640de0 commit 3b28941
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions media-source/mediasource-liveseekable.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<!DOCTYPE html>
<!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
<meta charset="utf-8">
<title>Checks setting/clearing the live seekable range and HTMLMediaElement.seekable</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="mediasource-util.js"></script>
<div></div> <!-- included so document.body isn't null, and mediasource_test() can appendChild to it -->
<script>
test(function(test)
{
Expand All @@ -28,9 +30,9 @@
var sourceBuffer = mediaSource.addSourceBuffer(mimetype);
sourceBuffer.appendBuffer(new Uint8Array(0));
assert_true(sourceBuffer.updating, "Updating set when a buffer is appended.");
assert_throws("InvalidStateError", function() { mediaSource.setLiveSeekableRange(0, 1); });
mediaSource.setLiveSeekableRange(0, 1);
test.done();
}, "setLiveSeekableRange throws an InvalidStateError exception if a SourceBuffer is updating");
}, "setLiveSeekableRange does not restrict to not currently updating");


mediasource_test(function(test, mediaElement, mediaSource)
Expand All @@ -40,9 +42,9 @@
var sourceBuffer = mediaSource.addSourceBuffer(mimetype);
sourceBuffer.appendBuffer(new Uint8Array(0));
assert_true(sourceBuffer.updating, "Updating set when a buffer is appended.");
assert_throws("InvalidStateError", function() { mediaSource.clearLiveSeekableRange(); });
mediaSource.clearLiveSeekableRange();
test.done();
}, "clearLiveSeekableRange throws an InvalidStateError exception if a SourceBuffer is updating");
}, "clearLiveSeekableRange does not restrict to not currently updating");


mediasource_test(function(test, mediaElement, mediaSource)
Expand Down Expand Up @@ -133,4 +135,4 @@
});
});
}, 'HTMLMediaElement.seekable returns the union of the buffered range and the live seekable range, when set');
</script>
</script>

0 comments on commit 3b28941

Please sign in to comment.