Bug 1294833 - Seperate the three track event handlers for debugging. r=jwwang
authorbechen <bechen@mozilla.com>
Mon, 12 Sep 2016 14:44:22 +0800
changeset 339303 1f293c131736fe5e9ce86c27954ca9364a9a6a6d
parent 339302 124402b3d83398f66112b34dfb6085fb41bc5a52
child 339304 a71db5e5d89b7523049f6264451f0cda592f841d
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1294833
milestone51.0a1
Bug 1294833 - Seperate the three track event handlers for debugging. r=jwwang MozReview-Commit-ID: By12tozP1eb
dom/media/test/test_trackelementevent.html
--- a/dom/media/test/test_trackelementevent.html
+++ b/dom/media/test/test_trackelementevent.html
@@ -27,31 +27,39 @@ SpecialPowers.pushPrefEnv({"set": [["med
     trackTwo.src = "bad-signature.vtt";
     trackTwo.kind = "captions";
 
     var trackThree = document.createElement("track");
     trackThree.src = "bad.vtt";
     trackThree.kind = "chapters";
 
     var events = 0;
-    function countEvent() {
-      ok(true, "A load or error event should have happened.");
+    function trackOneEvent() {
+      ok(true, "A load event for trackOne should have happened.");
+      events++ && events == 3 && SimpleTest.finish();
+    }
+    function trackTwoEvent() {
+      ok(true, "An error event for trackTwo should have happened.");
+      events++ && events == 3 && SimpleTest.finish();
+    }
+    function trackThreeEvent() {
+      ok(true, "An error event for trackThree should have happened.");
       events++ && events == 3 && SimpleTest.finish();
     }
 
     function shouldNotBeCalled() {
       ok(false, "Event should not have been called.");
     }
 
-    trackOne.addEventListener("load", countEvent);
+    trackOne.addEventListener("load", trackOneEvent);
     trackOne.addEventListener("error", shouldNotBeCalled)
     trackTwo.addEventListener("load", shouldNotBeCalled);
-    trackTwo.addEventListener("error", countEvent);
+    trackTwo.addEventListener("error", trackTwoEvent);
     trackThree.addEventListener("load", shouldNotBeCalled);
-    trackThree.addEventListener("error", countEvent);
+    trackThree.addEventListener("error", trackThreeEvent);
 
     document.getElementById("content").appendChild(video);
     video.appendChild(trackOne);
     video.appendChild(trackTwo);
     video.appendChild(trackThree);
   }
 );
 </script>