Bug 772077 - Fix randomorange caused by test_browserElement_inproc_ContextmenuEvents.html calling SimpleTest.finish() twice. r=daleharvey
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 09 Jul 2012 23:32:48 -0400
changeset 98781 552418e64261a15c9c51d691d1306ca61ffe2413
parent 98780 56545257892911d994aad63ae7b7415fdaacf4f4
child 98782 255445a0a851bd6313eae7e96d3b0e9dc3591a2b
push id11643
push userjlebar@mozilla.com
push dateTue, 10 Jul 2012 03:33:01 +0000
treeherdermozilla-inbound@552418e64261 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaleharvey
bugs772077
milestone16.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 772077 - Fix randomorange caused by test_browserElement_inproc_ContextmenuEvents.html calling SimpleTest.finish() twice. r=daleharvey
dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
--- a/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
+++ b/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
@@ -110,17 +110,23 @@ function runTest() {
     } else if (ctxCallbackEvents === 2) {
       ok(msg.json.data === 'foo', 'Callback function got fired correctly');
       mm.loadFrameScript('data:,(' + trigger1.toString() + ')();', false);
     } else if (ctxCallbackEvents > 2) {
       ok(false, 'Too many callback events');
     }
   }
 
+  var gotError = false;
   function errorTriggered(msg) {
+    if (gotError) {
+      return;
+    }
+
+    gotError = true;
     ok(true, 'An error in the callback triggers window.onerror');
     SimpleTest.finish();
   }
 
   function iframeLoadedHandler() {
     numIframeLoaded++;
     if (numIframeLoaded === 2) {
       mm = SpecialPowers.getBrowserFrameMessageManager(iframe1);