Bug 1362882 - hand cleanup after applying the previous script-generated patch, r=Mossop.
authorFlorian Quèze <florian@queze.net>
Fri, 12 May 2017 14:56:12 +0200
changeset 358076 78bda617988bb349c43871792cf10903d473253b
parent 358075 c143205c3f2025e131b8dd4efa64d53fd7e5ac0b
child 358077 1178b701781de2b1a5afb7b7d6b4954a3a7a51ba
push id31809
push userflorian@queze.net
push dateFri, 12 May 2017 12:59:58 +0000
treeherdermozilla-central@1178b701781d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1362882
milestone55.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 1362882 - hand cleanup after applying the previous script-generated patch, r=Mossop.
browser/components/downloads/test/browser/browser_overflow_anchor.js
browser/components/downloads/test/browser/head.js
browser/experiments/Experiments.jsm
browser/modules/ContentSearch.jsm
browser/modules/test/browser/browser_ContentSearch.js
--- a/browser/components/downloads/test/browser/browser_overflow_anchor.js
+++ b/browser/components/downloads/test/browser/browser_overflow_anchor.js
@@ -93,23 +93,22 @@ function unlockWidth(aItemIDs) {
 
 /**
  * Waits for a node to enter or exit the overflowed state.
  *
  * @param aItem the node to wait for.
  * @param aIsOverflowed if we're waiting for the item to be overflowed.
  */
 function waitForOverflowed(aItem, aIsOverflowed) {
+  if (aItem.overflowed == aIsOverflowed) {
+    return Promise.resolve();
+  }
+
   return new Promise(resolve => {
-    if (aItem.overflowed == aIsOverflowed) {
-      return resolve();
-    }
-
     let observer = new MutationObserver(function(aMutations) {
       if (aItem.overflowed == aIsOverflowed) {
         observer.disconnect();
         resolve();
       }
     });
     observer.observe(aItem.node, {attributes: true});
-
   });
 }
--- a/browser/components/downloads/test/browser/head.js
+++ b/browser/components/downloads/test/browser/head.js
@@ -108,21 +108,21 @@ function promiseWindowClosed(win) {
 
 function promiseFocus() {
   return new Promise(resolve => {
     waitForFocus(resolve);
   });
 }
 
 function promisePanelOpened() {
-  return new Promise(resolve => {
+  if (DownloadsPanel.panel && DownloadsPanel.panel.state == "open") {
+    return Promise.resolve();
+  }
 
-    if (DownloadsPanel.panel && DownloadsPanel.panel.state == "open") {
-      return resolve();
-    }
+  return new Promise(resolve => {
 
     // Hook to wait until the panel is shown.
     let originalOnPopupShown = DownloadsPanel.onPopupShown;
     DownloadsPanel.onPopupShown = function() {
       DownloadsPanel.onPopupShown = originalOnPopupShown;
       originalOnPopupShown.apply(this, arguments);
 
       // Defer to the next tick of the event loop so that we don't continue
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -964,17 +964,17 @@ Experiments.Experiments.prototype = {
         if (xhr.channel instanceof Ci.nsISupportsPriority) {
           xhr.channel.priority = Ci.nsISupportsPriority.PRIORITY_LOWEST;
         }
 
         xhr.timeout = MANIFEST_FETCH_TIMEOUT_MSEC;
         xhr.send(null);
       } catch (e) {
         this._log.error("httpGetRequest() - Error opening request to " + url + ": " + e);
-        return Promise.reject(new Error("Experiments - Error opening XHR for " + url));
+        reject(new Error("Experiments - Error opening XHR for " + url));
       }
     });
   },
 
   /*
    * Path of the cache file we use in the profile.
    */
   get _cacheFilePath() {
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -528,17 +528,17 @@ this.ContentSearch = {
       };
       xhr.onerror = xhr.onabort = xhr.ontimeout = () => {
         resolve(null);
       };
       try {
         // This throws if the URI is erroneously encoded.
         xhr.send();
       } catch (err) {
-        return Promise.resolve(null);
+        resolve(null);
       }
     });
   },
 
   _ensureDataHasProperties(data, requiredProperties) {
     for (let prop of requiredProperties) {
       if (!(prop in data)) {
         throw new Error("Message data missing required property: " + prop);
--- a/browser/modules/test/browser/browser_ContentSearch.js
+++ b/browser/modules/test/browser/browser_ContentSearch.js
@@ -405,12 +405,12 @@ function arrayBufferFromDataURI(uri) {
       resolve(null);
     };
     xhr.onload = () => {
       resolve(xhr.response);
     };
     try {
       xhr.send();
     } catch (err) {
-      return Promise.resolve(null);
+      resolve(null);
     }
   });
 }