Bug 824923 - Stablize WebRTC mochitests against Javascript exceptions to prevent timeouts. r=jesup
authorHenrik Skupin <hskupin@mozilla.com>
Thu, 27 Dec 2012 21:55:52 +0100
changeset 126233 e0d93141fe0cf5c85d4de5b34de40b6c59217cec
parent 126232 d01ebbc522d8b6c0bf2ca0e0921b12b5b2c7352e
child 126234 6d0cc82f292e1c120c6e6f17802799fa773bbf04
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs824923
milestone20.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 824923 - Stablize WebRTC mochitests against Javascript exceptions to prevent timeouts. r=jesup
dom/media/tests/mochitest/head.js
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -19,18 +19,24 @@ function runTest(aCallback, desktopSuppo
 
   // If this is a desktop supported test and we're on android or b2g,
   // indicate that the test is not supported and skip the test
   if(desktopSupportedOnly && (navigator.userAgent.indexOf('Android') > -1 ||
      navigator.platform === '')) {
     ok(true, navigator.userAgent + ' currently not supported');
     SimpleTest.finish();
   } else {
-    SpecialPowers.pushPrefEnv({'set': [['media.peerconnection.enabled', true]]},
-      aCallback);
+    SpecialPowers.pushPrefEnv({'set': [['media.peerconnection.enabled', true]]}, function () {
+      try {
+        aCallback();
+      }
+      catch (err) {
+        unexpectedCallbackAndFinish(err);
+      }
+    });
   }
 }
 
 /**
  * A callback function fired only under unexpected circumstances while
  * running the tests. Kills off the test as well gracefully.
  *
  * @param {String} obj the object fired back from the callback