Bug 1105126 - Change test_eme_stream_capture_blocked.html to check loadeddata instead of canplay. r=cpearce
authorAndreas Pehrson <pehrsons@gmail.com>
Mon, 01 Dec 2014 19:24:00 +0100
changeset 218217 6466fd09ff135b3acaba2832a812229dd8004ee0
parent 218216 7d1eff75ad608c186033a016c87785474d16928a
child 218225 d87bd29cb0b284765678ebea588e27862fbb933f
push id52480
push usercbook@mozilla.com
push dateTue, 02 Dec 2014 07:54:16 +0000
treeherdermozilla-inbound@6466fd09ff13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1105126
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1105126 - Change test_eme_stream_capture_blocked.html to check loadeddata instead of canplay. r=cpearce
dom/media/test/test_eme_stream_capture_blocked.html
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked.html
@@ -23,32 +23,30 @@ function startTest(test, token)
   var case1token = token + "_case1";
   var setKeysFailed = function() {
     ok(true, TimeStamp(case1token) + " setMediaKeys failed as expected.");
     manager.finished(case1token);
   };
   var v1 = SetupEME(test, case1token,  { onSetKeysFail: setKeysFailed });
   var context = new AudioContext();
   var node = context.createMediaElementSource(v1);
-  v1.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
   v1.addEventListener("error", bail(case1token + " got error event"));
-  v1.addEventListener("canplay", function(ev) {
-    ok(false, TimeStamp(case1token) + " should never reach canplay, as setMediaKeys should fail");
+  v1.addEventListener("loadeddata", function(ev) {
+    ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
   });
   manager.started(case1token);
   LoadTest(test, v1, case1token);
 
 
   // Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
   var case2token = token + "_case2";
   var v2 = SetupEME(test, case2token);
-  v2.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
   v2.addEventListener("error", bail(case2token + " got error event"));
-  v2.addEventListener("canplay", function(ev) {
-    ok(true, case2token + " should reach canplay");
+  v2.addEventListener("loadeddata", function(ev) {
+    ok(true, case2token + " should reach loadeddata");
     var threw = false;
     try {
       var context = new AudioContext();
       var node = context.createMediaElementSource(v2);
     } catch (e) {
       threw = true;
     }
     ok(threw, "Should throw an error creating a MediaElementSource on an EME video.");
@@ -56,20 +54,19 @@ function startTest(test, token)
   });
   manager.started(case2token);
   LoadTest(test, v2, case2token);
 
 
   // Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
   var case3token = token + "_case3";
   var v3 = SetupEME(test, case3token);
-  v3.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
   v3.addEventListener("error", bail(case3token + " got error event"));
-  v3.addEventListener("canplay", function(ev) {
-    ok(true, TimeStamp(case3token) + " should reach canplay");
+  v3.addEventListener("loadeddata", function(ev) {
+    ok(true, TimeStamp(case3token) + " should reach loadeddata");
     var threw = false;
     try {
       var stream = v3.mozCaptureStreamUntilEnded();
     } catch (e) {
       threw = true;
     }
     ok(threw, TimeStamp(case3token) + " Should throw an error calling mozCaptureStreamUntilEnded an EME video.");
     manager.finished(case3token);