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

Unified Diff: content/test/data/media/media_source_utils.js

Issue 54053007: Update media tests to unprefixed MSE API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: naming nits Created 7 years, 1 month 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 | « chrome/test/data/media/mse_config_change.html ('k') | content/test/data/media/mse_config_change.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/media_source_utils.js
diff --git a/content/test/data/media/media_source_utils.js b/content/test/data/media/media_source_utils.js
index 50053a5a7fd9f7d41b39277d748ff795d043e43a..7f179b50586c3a9e209ab4329f7ce8c184ea068f 100644
--- a/content/test/data/media/media_source_utils.js
+++ b/content/test/data/media/media_source_utils.js
@@ -44,20 +44,24 @@ function loadMediaSource(mediaFiles, mediaTypes, appendSourceCallbackFn) {
xhr.open('GET', mediaFile);
xhr.responseType = 'arraybuffer';
xhr.addEventListener('load', function(e) {
- console.log('Appending to buffer ' + mediaFile);
- srcBuffer.append(new Uint8Array(e.target.response));
- totalAppended++;
- if (totalAppended == mediaFiles.length) {
- if (appendSourceCallbackFn)
- appendSourceCallbackFn(mediaSource);
- else
- mediaSource.endOfStream();
- }
+ var onUpdateEnd = function(e) {
+ console.log('End of appending buffer from ' + mediaFile);
+ srcBuffer.removeEventListener('updateend', onUpdateEnd);
+ totalAppended++;
+ if (totalAppended == mediaFiles.length) {
+ if (appendSourceCallbackFn)
+ appendSourceCallbackFn(mediaSource);
+ else
+ mediaSource.endOfStream();
+ }
+ };
+ srcBuffer.addEventListener('updateend', onUpdateEnd);
+ srcBuffer.appendBuffer(new Uint8Array(e.target.response));
});
xhr.send();
}
- var mediaSource = new WebKitMediaSource();
- mediaSource.addEventListener('webkitsourceopen', onSourceOpen);
+ var mediaSource = new MediaSource();
+ mediaSource.addEventListener('sourceopen', onSourceOpen);
return mediaSource;
}
« no previous file with comments | « chrome/test/data/media/mse_config_change.html ('k') | content/test/data/media/mse_config_change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698