Bug 934053 - log media element events for debugging. r=cpearce a=testonly
authorJW Wang <jwwang@mozilla.com>
Sun, 01 Feb 2015 18:25:00 +0100
changeset 249735 e081d3fbd502e585aeb9c6e7a977123874fc53d5
parent 249734 9d4e384f97c0154e98f46eff3b4a870abc66baaa
child 249736 39c0f3dac6040520290e15d7cebcc81d62e49506
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, testonly
bugs934053
milestone37.0a2
Bug 934053 - log media element events for debugging. r=cpearce a=testonly
dom/media/test/test_reactivate.html
--- a/dom/media/test/test_reactivate.html
+++ b/dom/media/test/test_reactivate.html
@@ -34,16 +34,29 @@ function playElement(e) {
     }
   }
   setTimeout(reviveElement, 2000);
 }
 
 function loadedAll(elementList) {
   elements = elementList;
 
+  // Log events for debugging.
+  var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
+                "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
+                "waiting", "pause"];
+  function logEvent(e) {
+    info(e.target._name + ": got " + e.type);
+  }
+  elementList.forEach(function(element) {
+    events.forEach(function(evt) {
+      element.addEventListener(evt, logEvent, false);
+    });
+  });
+
   // Blow away the subframe
   document.body.removeChild(document.getElementById("frame"));
 
   // Play elements one by one to avoid hitting bug 847903 on MacOSX.
   playElement(elements.pop());
 }
 </script>
 </pre>