Bug 1133185 - Remove nonstandard let blocks from toolkit/webapps. r=myk
authorChris Peterson <cpeterson@mozilla.com>
Thu, 05 Feb 2015 22:27:55 -0800
changeset 245573 a179c7531bca41c31edb64c26961e382f2306223
parent 245572 fb3723075149b3fd615d848d387a3705c66da6bc
child 245574 4f5b1742339613ccfcb45f18f1abd823426c6e9e
push id779
push userdburns@mozilla.com
push dateTue, 24 Feb 2015 15:12:26 +0000
reviewersmyk
bugs1133185
milestone39.0a1
Bug 1133185 - Remove nonstandard let blocks from toolkit/webapps. r=myk
toolkit/webapps/tests/test_custom_origin.xul
toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
toolkit/webapps/tests/test_install_appcache.xul
toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
--- a/toolkit/webapps/tests/test_custom_origin.xul
+++ b/toolkit/webapps/tests/test_custom_origin.xul
@@ -77,34 +77,36 @@ let runTest = Task.async(function*() {
   if (MAC) {
     yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
   }
 
   confirmNextPopup();
 
   let request = navigator.mozApps.installPackage(app.manifestURL);
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     request.onerror = function() {
       deferred.reject(this.error.name);
     };
     request.onsuccess = deferred.resolve;
     yield deferred.promise;
   }
 
   let appObject = request.result;
   ok(appObject, "app is non-null");
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     appObject.ondownloaderror = function() {
       deferred.reject(appObject.downloadError.name);
     };
     appObject.ondownloadapplied = deferred.resolve;
     yield deferred.promise;
-  };
+  }
 
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
   let exeFile = getFile(testAppInfo.exePath);
 
--- a/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
+++ b/toolkit/webapps/tests/test_custom_origin_uninstall_install.xul
@@ -75,68 +75,74 @@ let runTest = Task.async(function*() {
   // On Mac build servers, we don't have enough privileges to write to /Applications,
   // so we install apps in a user-owned directory.
   if (MAC) {
     yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
   }
 
   confirmNextPopup();
 
-  let (request = navigator.mozApps.installPackage(app.manifestURL)) {
-    let (deferred = Promise.defer()) {
+  {
+    let request = navigator.mozApps.installPackage(app.manifestURL);
+    {
+      let deferred = Promise.defer();
       request.onerror = function() {
         deferred.reject(this.error.name);
       };
       request.onsuccess = deferred.resolve;
       yield deferred.promise;
     }
 
     let appObject = request.result;
     ok(appObject, "app is non-null");
 
-    let (deferred = Promise.defer()) {
+    {
+      let deferred = Promise.defer();
       appObject.ondownloaderror = function() {
         deferred.reject(appObject.downloadError.name);
       };
       appObject.ondownloadapplied = deferred.resolve;
       yield deferred.promise;
-    };
-  };
+    }
+  }
 
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
   yield WebappOSUtils.uninstall(app)
 
   is(WebappOSUtils.launch(app), false, "Launch fails");
 
   confirmNextPopup();
 
-  let (request = navigator.mozApps.installPackage(app.manifestURL)) {
-    let (deferred = Promise.defer()) {
+  {
+    let request = navigator.mozApps.installPackage(app.manifestURL);
+    {
+      let deferred = Promise.defer();
       request.onerror = function() {
         deferred.reject(this.error.name);
       };
       request.onsuccess = deferred.resolve;
       yield deferred.promise;
     }
 
     let appObject = request.result;
     ok(appObject, "app is non-null");
 
-    let (deferred = Promise.defer()) {
+    {
+      let deferred = Promise.defer();
       appObject.ondownloaderror = function() {
         deferred.reject(appObject.downloadError.name);
       };
       appObject.ondownloadapplied = deferred.resolve;
       yield deferred.promise;
-    };
-  };
+    }
+  }
 
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
   let exeFile = getFile(testAppInfo.exePath);
 
--- a/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_hosted_checkforupdates_from_webapp_runtime.xul
@@ -57,17 +57,18 @@ let runTest = Task.async(function*() {
   }
 
   confirmNextPopup();
 
   yield setState("Version", 1);
 
   let request = navigator.mozApps.install(app.manifestURL);
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     request.onerror = function() {
       deferred.reject(this.error.name);
     };
     request.onsuccess = deferred.resolve;
     yield deferred.promise;
   }
 
   let appObject = request.result;
--- a/toolkit/webapps/tests/test_install_appcache.xul
+++ b/toolkit/webapps/tests/test_install_appcache.xul
@@ -55,33 +55,35 @@ let runTest = Task.async(function*() {
   if (MAC) {
     yield setMacRootInstallDir(OS.Path.join(OS.Constants.Path.homeDir, "Applications"));
   }
 
   confirmNextPopup();
 
   let request = navigator.mozApps.install(app.manifestURL);
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     request.onerror = function() {
       deferred.reject(this.error.name);
     };
     request.onsuccess = deferred.resolve;
     yield deferred.promise;
   }
 
   let appObject = request.result;
   ok(appObject, "app is non-null");
 
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
-  let (size = 0) {
+  {
+    let size = 0;
     do {
       try {
         size = yield dirSize(OS.Path.join(testAppInfo.profileDir.path, "OfflineCache"));
       } catch (e) {
         yield wait(1000);
       }
     } while (size == 0);
     ok(size > 100000, "There are some files in the OfflineCache directory");
@@ -94,17 +96,18 @@ let runTest = Task.async(function*() {
   testAppInfo.appProcess.init(exeFile)
   testAppInfo.appProcess.runAsync([], 0, () => appClosed = true);
 
   while (!(yield wasAppSJSAccessed()) && !appClosed) {
     yield wait(1000);
   }
   ok(!appClosed, "App was launched and is still running");
 
-  let (size = 0) {
+  {
+    let size = 0;
     do {
       try {
         size = yield dirSize(OS.Path.join(testAppInfo.cacheDir.path, "OfflineCache"));
       } catch (e) {
         yield wait(1000);
       }
     } while (size == 0);
     ok(size > 100000, "There are some files in the OfflineCache directory");
--- a/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
+++ b/toolkit/webapps/tests/test_packaged_checkforupdates_from_webapp_runtime.xul
@@ -57,34 +57,36 @@ let runTest = Task.async(function*() {
   }
 
   confirmNextPopup();
 
   yield setState("Version", 1);
 
   let request = navigator.mozApps.installPackage(app.manifestURL);
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     request.onerror = function() {
       deferred.reject(this.error.name);
     };
     request.onsuccess = deferred.resolve;
     yield deferred.promise;
   }
 
   let appObject = request.result;
   ok(appObject, "app is non-null");
 
-  let (deferred = Promise.defer()) {
+  {
+    let deferred = Promise.defer();
     appObject.ondownloaderror = function() {
       deferred.reject(appObject.downloadError.name);
     };
     appObject.ondownloadapplied = deferred.resolve;
     yield deferred.promise;
-  };
+  }
 
   while (!WebappOSUtils.isLaunchable(app)) {
     yield wait(1000);
   }
   ok(true, "App launchable");
 
   // Force the update timer to fire in 1 second
   let prefsFile = OS.Path.join(testAppInfo.profileDir.path, "prefs.js");