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

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-appendbuffer-quota-exceeded.html

Issue 1304953002: LayoutTests for the new MSE GC behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@mse-gc5
Patch Set: New test case for error event sent from async appendStream Created 5 years, 4 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/media-source/mediasource-appendstream-quota-exceeded.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/media/media-source/mediasource-appendbuffer-quota-exceeded.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-appendbuffer-quota-exceeded.html b/LayoutTests/http/tests/media/media-source/mediasource-appendbuffer-quota-exceeded.html
new file mode 100644
index 0000000000000000000000000000000000000000..a05aae92983c876f6e7c7e7c01f5fcc969968047
--- /dev/null
+++ b/LayoutTests/http/tests/media/media-source/mediasource-appendbuffer-quota-exceeded.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="/w3c/resources/testharness.js"></script>
+ <script src="/w3c/resources/testharnessreport.js"></script>
+ <script src="mediasource-util.js"></script>
+ <link rel='stylesheet' href='/w3c/resources/testharness.css'>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ // Fill up a given SourceBuffer by appending data repeatedly via doAppendDataFunc until
+ // an exception is thrown. The thrown exception is passed to onCaughtExceptionCallback.
+ function fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback) {
+ // We are appending data repeatedly in sequence mode, there should be no gaps.
+ assert_false(sourceBuffer.buffered.length > 1, "unexpected gap in buffered ranges.");
+ try {
+ doAppendDataFunc();
+ } catch(ex) {
+ onCaughtExceptionCallback(ex);
+ }
+ test.expectEvent(sourceBuffer, 'updateend', 'append ended.');
+ test.waitForExpectedEvents(function() { fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback); });
+ }
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ MediaSourceUtil.fetchManifestAndData(test, 'webm/test-a-5min-44100Hz-1ch-manifest.json', function(type, mediaData)
+ {
+ var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_ONLY_TYPE);
+ sourceBuffer.mode = 'sequence';
+
+ fillUpSourceBuffer(test, sourceBuffer,
+ function () { // doAppendDataFunc
+ sourceBuffer.appendBuffer(mediaData);
+ },
+ function (ex) { // onCaughtExceptionCallback
+ assert_equals(ex.name, 'QuotaExceededError');
+ test.done();
+ });
+ });
+ }, 'Appending data repeatedly should fill up the buffer and throw a QuotaExceededError when buffer is full.');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-appendstream-quota-exceeded.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698