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

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html

Issue 1013923002: Fix MSE GC, make it less aggressive, more spec-compliant (Blink CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a basic test for evict frames functionality Created 5 years, 7 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
Index: LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html b/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html
new file mode 100644
index 0000000000000000000000000000000000000000..c351e917dbde2c161146650b2159e650d3908ca9
--- /dev/null
+++ b/LayoutTests/http/tests/media/media-source/mediasource-evict-frames.html
@@ -0,0 +1,40 @@
+<!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>
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ var mimetype = MediaSourceUtil.AUDIO_ONLY_TYPE;
+ var subType = MediaSourceUtil.getSubType(mimetype);
+
+ MediaSourceUtil.fetchManifestAndData(test, subType + '/test-a-192k-44100Hz-1ch-manifest.json', function(type, mediaData)
+ {
+ var sourceBuffer = mediaSource.addSourceBuffer(mimetype);
+ sourceBuffer.mode = 'sequence';
+
+ function onUpdateEnd() {
+ // 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 {
+ sourceBuffer.appendBuffer(mediaData);
+ } catch(ex) {
+ assert_equals(ex.name, 'QuotaExceededError');
+ test.done();
+ }
+ test.expectEvent(sourceBuffer, 'updateend', 'append ended.');
+ test.waitForExpectedEvents(onUpdateEnd);
+ }
+ // Start appending data
+ onUpdateEnd();
+ });
+ }, 'Appending data repeatedly should fill up the buffer and throw a QuotaExceededError when buffer is full.', {timeout: 25000});
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | Source/modules/mediasource/SourceBuffer.h » ('j') | Source/modules/mediasource/SourceBuffer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698