Bug 1325501 - Followup, import xmlhttprequest to fix xpcshell failures a=backout FIREFOX_51_0b12_BUILD1 FIREFOX_51_0b12_RELEASE
authorWes Kocher <wkocher@mozilla.com>
Thu, 05 Jan 2017 15:49:08 -0800
changeset 357103 9ddd4fee07842e72ba49f1583ec5f596f6e60e72
parent 357102 aa6ce690f3d85f4b17679628e32d28ee0fc59c39
child 357104 77005e00cdef605b05b0f4a6ef9ac8e641dcc588
child 357105 a8b844631fef723e0ba2a11ad8d5297d7bc05467
push id6744
push userkwierso@gmail.com
push dateThu, 05 Jan 2017 23:49:23 +0000
treeherdermozilla-beta@9ddd4fee0784 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1325501
milestone51.0
Bug 1325501 - Followup, import xmlhttprequest to fix xpcshell failures a=backout
toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
--- a/toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
@@ -192,17 +192,18 @@ function parseXML(document) {
  *
  * @param  url
  *         The url to download from.
  * @return a promise that resolves to the path of a temporary file or rejects
  *         with a JS exception in case of error.
  */
 function downloadFile(url) {
   return new Promise((resolve, reject) => {
-    let xhr = new XMLHttpRequest();
+    let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
+                  createInstance(Ci.nsISupports);
     xhr.onload = function(response) {
       logger.info("downloadXHR File download. status=" + xhr.status);
       if (xhr.status != 200 && xhr.status != 206) {
         reject(Components.Exception("File download failed", xhr.status));
         return;
       }
       Task.spawn(function* () {
         let f = yield OS.File.openUnique(OS.Path.join(OS.Constants.Path.tmpDir, "tmpaddon"));