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

Unified Diff: chrome/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: 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
Index: chrome/test/data/media/mse_config_change.html
diff --git a/chrome/test/data/media/mse_config_change.html b/chrome/test/data/media/mse_config_change.html
index 7a44859790e176aa48d804d6e8e9163a843b1846..eabac5edd45e3fa464fe35d572cb6aeec67c9300 100644
--- a/chrome/test/data/media/mse_config_change.html
+++ b/chrome/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 eventHandler = function(e) {
xhwang 2013/11/05 02:18:26 ditto about naming
shadi 2013/11/05 18:52:17 Done.
+ console.log('Second buffer append ended.');
+ srcBuffer.removeEventListener('updateend', eventHandler);
+ 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', eventHandler);
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();
}

Powered by Google App Engine
This is Rietveld 408576698