Bug 1343459. Part 2 - remove the 'updateend' handler which might fire before we register it. r?jya draft
authorJW Wang <jwwang@mozilla.com>
Wed, 01 Mar 2017 17:46:42 +0800
changeset 498091 307fec4c919ac3e6fca28712af77200690569005
parent 498090 f76e851cea04cd27c5f1e8203563c14fd01a3ba1
child 549085 c6b1edcf11a616871353d16136bff28df5ff76f0
push id49112
push userjwwang@mozilla.com
push dateTue, 14 Mar 2017 09:36:51 +0000
reviewersjya
bugs1343459
milestone55.0a1
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
dom/media/mediasource/test/test_AudioChange_mp4.html
--- 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();
     })
   });
 });