Bug 1112588 - Ignore 'stalled' events because the progress timer could time out before receiving any HTTP notifications on slow machines like B2G emulator. r=cpearce, a=test-only
authorJW Wang <jwwang@mozilla.com>
Tue, 13 Jan 2015 22:40:00 +0100
changeset 242888 d185df72bd0e
parent 242887 ca609e2e5bea
child 242889 cd07ffdd30c5
push id4330
push userryanvm@gmail.com
push date2015-01-16 15:19 +0000
treeherdermozilla-beta@0b7d9ce1cdc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, test-only
bugs1112588
milestone36.0
Bug 1112588 - Ignore 'stalled' events because the progress timer could time out before receiving any HTTP notifications on slow machines like B2G emulator. r=cpearce, a=test-only
dom/media/test/test_info_leak.html
--- a/dom/media/test/test_info_leak.html
+++ b/dom/media/test/test_info_leak.html
@@ -46,17 +46,17 @@ function createTestArray() {
     t.type = test.type;
 
     tests.push(t);
   }
   return tests;
 }
 
 function log(msg) {
-  //dump(msg + "\n");
+  info(msg);
   var l = document.getElementById('log');
   l.innerHTML += msg + "<br>";
 }
 
 function finish(v) {
   log("finish: " + v.name);
   clearInterval(v.checkStateInterval);
 
@@ -66,17 +66,25 @@ function finish(v) {
   removeNodeAndSource(v);
 
   manager.finished(v.token);
   v = null;
 }
 
 function listener(evt) {
   var v = evt.target;
-  //log(filename(v.name) + ' got event ' + evt.type);
+  log(filename(v.name) + ': got ' + evt.type);
+
+  // On slow machines like B2G emulator, progress timer could time out before
+  // receiving any HTTP notification. We will ignore the 'stalled' event to
+  // pass the tests.
+  if (evt.type == 'stalled') {
+    return;
+  }
+
   ok(v.eventNum < gExpectedEvents.length, filename(v.name)  + " Too many events received");
   var expected = (v.eventNum < gExpectedEvents.length) ? gExpectedEvents[v.eventNum] : "NoEvent";
   is(evt.type, expected, filename(v.name) + " Events received in wrong order");
   v.eventNum++;
   if (v.eventNum == gExpectedEvents.length) {
     // In one second, move onto the next test. This give a chance for any
     // other events to come in. Note: we don't expect any events to come
     // in, unless we've leaked some info, and 1 second should be enough time