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

Unified Diff: chrome/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 | « no previous file | chrome/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: chrome/test/data/media/media_source_utils.js
diff --git a/chrome/test/data/media/media_source_utils.js b/chrome/test/data/media/media_source_utils.js
index eefa46eff300721f8e3d4788eb8ebbda981ac3d2..1d32c72893a4c3491115a27365ad4b5d0309cbda 100644
--- a/chrome/test/data/media/media_source_utils.js
+++ b/chrome/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 | « no previous file | chrome/test/data/media/mse_config_change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698