Bug 993712 - Remove hand-rolled timeout handler from customizableui/test/head.js. r=test-only
authorMike Conley <mconley@mozilla.com>
Wed, 14 May 2014 17:09:34 -0400
changeset 183194 c0d4a7bb2d4153003ed8617f203ff29f985e08fd
parent 183193 1f71b3099720b947bbe8d5b5d5f46f1972dffe36
child 183195 69e3f129484a1de854a4ebd0e010823f3878048a
push idunknown
push userunknown
push dateunknown
reviewerstest-only
bugs993712
milestone32.0a1
Bug 993712 - Remove hand-rolled timeout handler from customizableui/test/head.js. r=test-only I'm trying to smoke out an intermittent orange in bug 993712, and I'm starting to run dry on ideas. I'm having no luck reproducing the bug locally. What I'm trying to do here is cause the orange (when it rears its head) to force a mochitest timeout, which will take a screenshot. I'm hoping that screenshot gives me some clues about what's going on.
browser/components/customizableui/test/head.js
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -452,23 +452,17 @@ function popupHidden(aPopup) {
  *  // ... something that hides a popup
  *  yield popupHiddenPromise;
  */
 function promisePopupEvent(aPopup, aEventSuffix) {
   let deferred = Promise.defer();
   let win = aPopup.ownerDocument.defaultView;
   let eventType = "popup" + aEventSuffix;
 
-  let timeoutId = win.setTimeout(() => {
-    deferred.reject("Context menu (" + aPopup.id + ") did not fire "
-                    + eventType + " within 20 seconds.");
-  }, 20000);
-
   function onPopupEvent(e) {
-    win.clearTimeout(timeoutId);
     aPopup.removeEventListener(eventType, onPopupEvent);
     deferred.resolve();
   };
 
   aPopup.addEventListener(eventType, onPopupEvent);
   return deferred.promise;
 }