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

Unified Diff: content/test/data/media/mse_config_change.html

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 | « content/test/data/media/media_source_utils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/mse_config_change.html
diff --git a/content/test/data/media/mse_config_change.html b/content/test/data/media/mse_config_change.html
index 7a44859790e176aa48d804d6e8e9163a843b1846..13f41743f475ab68a3cc4b9d1b9bb638170a0e1d 100644
--- a/content/test/data/media/mse_config_change.html
+++ b/content/test/data/media/mse_config_change.html
@@ -40,18 +40,24 @@
xhr.open("GET", MEDIA_2);
xhr.responseType = 'arraybuffer';
xhr.addEventListener('load', function(e) {
+ var onUpdateEnd = function(e) {
+ console.log('Second buffer append ended.');
+ srcBuffer.removeEventListener('updateend', onUpdateEnd);
+ mediaSource.endOfStream();
+ if (!mediaSource.duration ||
+ Math.abs(mediaSource.duration - TOTAL_DURATION) > DELTA) {
+ failTest('Unexpected mediaSource.duration = ' +
+ mediaSource.duration + ', expected duration = ' +
+ TOTAL_DURATION);
+ return;
+ }
+ video.play();
+ };
+ console.log('Appending next media source at ' + APPEND_TIME + 'sec.');
var srcBuffer = mediaSource.sourceBuffers[0];
+ srcBuffer.addEventListener('updateend', onUpdateEnd);
srcBuffer.timestampOffset = APPEND_TIME;
- srcBuffer.append(new Uint8Array(e.target.response));
- mediaSource.endOfStream();
- if (!mediaSource.duration ||
- Math.abs(mediaSource.duration - TOTAL_DURATION) > DELTA) {
- failTest('Unexpected mediaSource.duration = ' +
- mediaSource.duration + ', expected duration = ' +
- TOTAL_DURATION);
- return;
- }
- video.play();
+ srcBuffer.appendBuffer(new Uint8Array(e.target.response));
});
xhr.send();
}
« no previous file with comments | « content/test/data/media/media_source_utils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698