Bug 1343459. Part 2 - remove the 'updateend' handler which might fire before we register it. r?jya
Note the race is uncovered by P1 which kinda change the order of events.
MozReview-Commit-ID: 3INYvJVUhSG
--- a/dom/media/mediasource/test/test_AudioChange_mp4.html
+++ b/dom/media/mediasource/test/test_AudioChange_mp4.html
@@ -48,21 +48,18 @@ runWithMSE(function(ms, el) {
})
.then(function() {
ok(true, "got canplay event");
el.play();
return fetchAndLoad(audiosb, 'aac51-48000-128000-', ['init'], '.mp4');
})
.then(fetchAndLoad.bind(null, audiosb, 'aac51-48000-128000-', ['2'], '.m4s'))
.then(function() {
- var promises = [];
ms.endOfStream();
- promises.push(once(el, 'ended'));
- promises.push(once(audiosb, 'updateend'));
- return Promise.all(promises);
+ return once(el, 'ended');
})
.then(function() {
ok(el.currentTime >= 6, "played to the end");
SimpleTest.finish();
})
});
});