Bug 1133185 - Remove nonstandard let blocks from toolkit/webapps. r=myk

This commit is contained in:
Chris Peterson 2015-02-05 22:27:55 -08:00
parent d5d0478f4b
commit b6b4450ba7
5 changed files with 34 additions and 20 deletions

View File

@ -82,7 +82,8 @@ let runTest = Task.async(function*() {
let request = navigator.mozApps.installPackage(app.manifestURL);
let (deferred = Promise.defer()) {
{
let deferred = Promise.defer();
request.onerror = function() {
deferred.reject(this.error.name);
};
@ -93,13 +94,14 @@ let runTest = Task.async(function*() {
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);

View File

@ -80,8 +80,10 @@ let runTest = Task.async(function*() {
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);
};
@ -92,14 +94,15 @@ let runTest = Task.async(function*() {
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);
@ -112,8 +115,10 @@ let runTest = Task.async(function*() {
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);
};
@ -124,14 +129,15 @@ let runTest = Task.async(function*() {
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);

View File

@ -62,7 +62,8 @@ let runTest = Task.async(function*() {
let request = navigator.mozApps.install(app.manifestURL);
let (deferred = Promise.defer()) {
{
let deferred = Promise.defer();
request.onerror = function() {
deferred.reject(this.error.name);
};

View File

@ -60,7 +60,8 @@ let runTest = Task.async(function*() {
let request = navigator.mozApps.install(app.manifestURL);
let (deferred = Promise.defer()) {
{
let deferred = Promise.defer();
request.onerror = function() {
deferred.reject(this.error.name);
};
@ -76,7 +77,8 @@ let runTest = Task.async(function*() {
}
ok(true, "App launchable");
let (size = 0) {
{
let size = 0;
do {
try {
size = yield dirSize(OS.Path.join(testAppInfo.profileDir.path, "OfflineCache"));
@ -99,7 +101,8 @@ let runTest = Task.async(function*() {
}
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"));

View File

@ -62,7 +62,8 @@ let runTest = Task.async(function*() {
let request = navigator.mozApps.installPackage(app.manifestURL);
let (deferred = Promise.defer()) {
{
let deferred = Promise.defer();
request.onerror = function() {
deferred.reject(this.error.name);
};
@ -73,13 +74,14 @@ let runTest = Task.async(function*() {
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);