Bug 1625500 - fix use of .then(x, x) in the tree, r=marionette-reviewers,Standard8,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D68614
This commit is contained in:
@@ -1124,8 +1124,8 @@ add_task(async function testExtensionControlledProxyConfig() {
|
|||||||
async function closeProxyPanel(panelObj) {
|
async function closeProxyPanel(panelObj) {
|
||||||
let dialog = panelObj.panel.document.getElementById("ConnectionsDialog");
|
let dialog = panelObj.panel.document.getElementById("ConnectionsDialog");
|
||||||
dialog.cancelDialog();
|
dialog.cancelDialog();
|
||||||
let panelClosingEvent = await panelObj.closingPromise;
|
await panelObj.closingPromise;
|
||||||
ok(panelClosingEvent, "Proxy panel closed.");
|
is(panelObj.pane.state, "closed", "Proxy panel closed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
|
await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
|
||||||
|
|||||||
@@ -130,13 +130,12 @@ function waitForEvent(aSubject, aEventName, aTimeoutMs, aTarget) {
|
|||||||
eventDeferred.resolve(aEvent);
|
eventDeferred.resolve(aEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
function cleanup(aEventOrError) {
|
function cleanup() {
|
||||||
// unhook listener in case of success or failure
|
// unhook listener in case of success or failure
|
||||||
aSubject.removeEventListener(aEventName, listener);
|
aSubject.removeEventListener(aEventName, listener);
|
||||||
return aEventOrError;
|
|
||||||
}
|
}
|
||||||
aSubject.addEventListener(aEventName, listener);
|
aSubject.addEventListener(aEventName, listener);
|
||||||
return eventDeferred.promise.then(cleanup, cleanup);
|
return eventDeferred.promise.finally(cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPreferencesViaOpenPreferencesAPI(aPane, aOptions) {
|
function openPreferencesViaOpenPreferencesAPI(aPane, aOptions) {
|
||||||
|
|||||||
@@ -2235,7 +2235,7 @@ var SessionStoreInternal = {
|
|||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
}
|
}
|
||||||
}, topic);
|
}, topic);
|
||||||
deferred.promise.then(cleanup, cleanup);
|
deferred.promise.finally(cleanup);
|
||||||
return deferred;
|
return deferred;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6158,10 +6158,7 @@ var SessionStoreInternal = {
|
|||||||
);
|
);
|
||||||
// Ensure that the timer is both canceled once we are done with it
|
// Ensure that the timer is both canceled once we are done with it
|
||||||
// and not garbage-collected until then.
|
// and not garbage-collected until then.
|
||||||
deferred.promise.then(
|
deferred.promise.finally(() => timer.cancel());
|
||||||
() => timer.cancel(),
|
|
||||||
() => timer.cancel()
|
|
||||||
);
|
|
||||||
return deferred;
|
return deferred;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class FaviconLoad {
|
|||||||
this.dataBuffer = null;
|
this.dataBuffer = null;
|
||||||
this.stream = null;
|
this.stream = null;
|
||||||
};
|
};
|
||||||
this._deferred.promise.then(cleanup, cleanup);
|
this._deferred.promise.finally(cleanup);
|
||||||
|
|
||||||
this.dataBuffer = new StorageStream(STREAM_SEGMENT_SIZE, PR_UINT32_MAX);
|
this.dataBuffer = new StorageStream(STREAM_SEGMENT_SIZE, PR_UINT32_MAX);
|
||||||
|
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ MarkupView.prototype = {
|
|||||||
this._briefBoxModelPromise = new Promise(resolve => {
|
this._briefBoxModelPromise = new Promise(resolve => {
|
||||||
_resolve = resolve;
|
_resolve = resolve;
|
||||||
this._briefBoxModelTimer = setTimeout(() => {
|
this._briefBoxModelTimer = setTimeout(() => {
|
||||||
this._hideBoxModel().then(resolve, resolve);
|
this._hideBoxModel().finally(resolve);
|
||||||
}, NEW_SELECTION_HIGHLIGHTER_TIMER);
|
}, NEW_SELECTION_HIGHLIGHTER_TIMER);
|
||||||
});
|
});
|
||||||
this._briefBoxModelPromise.resolve = _resolve;
|
this._briefBoxModelPromise.resolve = _resolve;
|
||||||
|
|||||||
@@ -1891,9 +1891,7 @@ RuleViewTool.prototype = {
|
|||||||
|
|
||||||
if (selectElement) {
|
if (selectElement) {
|
||||||
const done = this.inspector.updating("rule-view");
|
const done = this.inspector.updating("rule-view");
|
||||||
this.view
|
this.view.selectElement(this.inspector.selection.nodeFront).finally(done);
|
||||||
.selectElement(this.inspector.selection.nodeFront)
|
|
||||||
.then(done, done);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ class Scheduler {
|
|||||||
|
|
||||||
dequeue() {
|
dequeue() {
|
||||||
const self = this;
|
const self = this;
|
||||||
const recursive = resolve => {
|
const recursive = () => {
|
||||||
self.dequeue();
|
self.dequeue();
|
||||||
};
|
};
|
||||||
this.busy = true;
|
this.busy = true;
|
||||||
const next = this.queue.shift();
|
const next = this.queue.shift();
|
||||||
if (next) {
|
if (next) {
|
||||||
next().then(recursive, recursive);
|
next().finally(recursive);
|
||||||
} else {
|
} else {
|
||||||
this.busy = false;
|
this.busy = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,8 +87,6 @@ function evaluateExpression(expression, from = "input") {
|
|||||||
|
|
||||||
// Even if the evaluation fails,
|
// Even if the evaluation fails,
|
||||||
// we still need to pass the error response to onExpressionEvaluated.
|
// we still need to pass the error response to onExpressionEvaluated.
|
||||||
const onSettled = res => res;
|
|
||||||
|
|
||||||
const response = await client
|
const response = await client
|
||||||
.evaluateJSAsync(expression, {
|
.evaluateJSAsync(expression, {
|
||||||
frameActor: await webConsoleUI.getFrameActor(),
|
frameActor: await webConsoleUI.getFrameActor(),
|
||||||
@@ -96,7 +94,7 @@ function evaluateExpression(expression, from = "input") {
|
|||||||
selectedTargetFront: toolbox && toolbox.getSelectedTargetFront(),
|
selectedTargetFront: toolbox && toolbox.getSelectedTargetFront(),
|
||||||
mapped,
|
mapped,
|
||||||
})
|
})
|
||||||
.then(onSettled, onSettled);
|
.catch(e => e);
|
||||||
|
|
||||||
return dispatch(onExpressionEvaluated(response));
|
return dispatch(onExpressionEvaluated(response));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ function tryActors(reachables, completed) {
|
|||||||
executeSoon(completed, "tryActors callback " + completed.name);
|
executeSoon(completed, "tryActors callback " + completed.name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
promise.then(callback, callback);
|
promise.catch(e => e).then(callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ function StreamCopier(input, output, length) {
|
|||||||
// fail scenarios, but also emit events (due to the EventEmitter) for other
|
// fail scenarios, but also emit events (due to the EventEmitter) for other
|
||||||
// states, like progress.
|
// states, like progress.
|
||||||
this.then = this._deferred.then.bind(this._deferred);
|
this.then = this._deferred.then.bind(this._deferred);
|
||||||
this.then(this._destroy, this._destroy);
|
this.finally = this._deferred.finally.bind(this._deferred);
|
||||||
|
this.finally(this._destroy);
|
||||||
|
|
||||||
// Stream ready callback starts as |_copy|, but may switch to |_flush| at end
|
// Stream ready callback starts as |_copy|, but may switch to |_flush| at end
|
||||||
// if flushing would block the output stream.
|
// if flushing would block the output stream.
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ function grabHistogramsFromContent(use_counter_middlefix, page_before = null) {
|
|||||||
};
|
};
|
||||||
return BrowserTestUtils.waitForCondition(() => {
|
return BrowserTestUtils.waitForCondition(() => {
|
||||||
return page_before != gather()[0];
|
return page_before != gather()[0];
|
||||||
}).then(gather, gather);
|
}).finally(gather);
|
||||||
}
|
}
|
||||||
|
|
||||||
var check_use_counter_iframe = async function(
|
var check_use_counter_iframe = async function(
|
||||||
|
|||||||
@@ -511,14 +511,9 @@ function testMultipleCacheEntries() {
|
|||||||
|
|
||||||
// Make sure to clean up after each test step.
|
// Make sure to clean up after each test step.
|
||||||
function step(testPromise) {
|
function step(testPromise) {
|
||||||
return testPromise.then(
|
return testPromise.finally(function() {
|
||||||
function() {
|
caches.delete(name);
|
||||||
caches.delete(name);
|
});
|
||||||
},
|
|
||||||
function() {
|
|
||||||
caches.delete(name);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
step(testBasics())
|
step(testBasics())
|
||||||
|
|||||||
@@ -153,6 +153,6 @@ onmessage = function(event) {
|
|||||||
doneTask();
|
doneTask();
|
||||||
} else if (event.data.type == "testBug1239300") {
|
} else if (event.data.type == "testBug1239300") {
|
||||||
var promise = testBug1239300();
|
var promise = testBug1239300();
|
||||||
promise.then(doneTask, doneTask);
|
promise.finally(doneTask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ class RTCPeerConnection {
|
|||||||
this.updateNegotiationNeeded();
|
this.updateNegotiationNeeded();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
p.then(doNextOperation, doNextOperation);
|
p.finally(doNextOperation);
|
||||||
});
|
});
|
||||||
if (this._operations.length == 1) {
|
if (this._operations.length == 1) {
|
||||||
this._operations[0]();
|
this._operations[0]();
|
||||||
|
|||||||
@@ -68,5 +68,5 @@ function check_ogg(v, enabled, finish) {
|
|||||||
.then(verify_opus_support)
|
.then(verify_opus_support)
|
||||||
.then(opus_enable)
|
.then(opus_enable)
|
||||||
.then(opus_disable)
|
.then(opus_disable)
|
||||||
.then(unspported_ogg, unspported_ogg);
|
.finally(unspported_ogg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ if (isParent) {
|
|||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
return db.drop().then(_ => db.close());
|
return db.drop().then(_ => db.close());
|
||||||
});
|
});
|
||||||
setUpServiceInParent(PushService, db).then(run_next_test, run_next_test);
|
setUpServiceInParent(PushService, db).finally(run_next_test);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,6 +352,6 @@ add_test(function test_subscribe_missing_principal() {
|
|||||||
|
|
||||||
if (isParent) {
|
if (isParent) {
|
||||||
add_test(function tearDown() {
|
add_test(function tearDown() {
|
||||||
tearDownServiceInParent(db).then(run_next_test, run_next_test);
|
tearDownServiceInParent(db).finally(run_next_test);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ function cleanup() {
|
|||||||
|
|
||||||
function runTest() {
|
function runTest() {
|
||||||
if (!steps.length) {
|
if (!steps.length) {
|
||||||
registration.unregister().then(cleanup, cleanup);
|
registration.unregister().finally(cleanup);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
Promise.all([
|
Promise.all([
|
||||||
testPermissiveHeader(),
|
testPermissiveHeader(),
|
||||||
testPreciseHeader(),
|
testPreciseHeader(),
|
||||||
]).then(SimpleTest.finish, SimpleTest.finish);
|
]).finally(SimpleTest.finish);
|
||||||
}, (x) => {
|
}, (x) => {
|
||||||
ok(false, "Registration should not succeed, but it did");
|
ok(false, "Registration should not succeed, but it did");
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -32,16 +32,15 @@ addEventListener("message", function workerWrapperOnMessage(e) {
|
|||||||
var data = e.data;
|
var data = e.data;
|
||||||
|
|
||||||
function runTestAndReportToClient(event) {
|
function runTestAndReportToClient(event) {
|
||||||
var done = function(res) {
|
var done = function() {
|
||||||
client.postMessage({ type: "finish", context });
|
client.postMessage({ type: "finish", context });
|
||||||
return res;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// runTest() is provided by the test.
|
// runTest() is provided by the test.
|
||||||
var result = runTest().then(done, done);
|
var promise = runTest().finally(done);
|
||||||
if ("waitUntil" in event) {
|
if ("waitUntil" in event) {
|
||||||
event.waitUntil(result);
|
event.waitUntil(promise);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
client.postMessage({
|
client.postMessage({
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function grabHistogramsFromContent(
|
|||||||
};
|
};
|
||||||
return BrowserTestUtils.waitForCondition(() => {
|
return BrowserTestUtils.waitForCondition(() => {
|
||||||
return counter_before != gather()[0];
|
return counter_before != gather()[0];
|
||||||
}).then(gather, gather);
|
}).finally(gather);
|
||||||
}
|
}
|
||||||
|
|
||||||
var check_use_counter_worker = async function(
|
var check_use_counter_worker = async function(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
async function setup_in_oopif() {
|
async function setup_in_oopif() {
|
||||||
const setup = function() {
|
const setup = function() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
async function setup_in_oopif() {
|
async function setup_in_oopif() {
|
||||||
const setup = function() {
|
const setup = function() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
|
|
||||||
// The actual test
|
// The actual test
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
|
|
||||||
// The actual test
|
// The actual test
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
|
|
||||||
let code_for_oopif_to_run = function() {
|
let code_for_oopif_to_run = function() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ FissionTestHelper.startTestPromise
|
|||||||
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
|
||||||
.then(waitUntilApzStable)
|
.then(waitUntilApzStable)
|
||||||
.then(runAsyncContinuation(test))
|
.then(runAsyncContinuation(test))
|
||||||
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestDone);
|
.finally(FissionTestHelper.subtestDone);
|
||||||
|
|
||||||
|
|
||||||
let code_for_oopif_to_run = function() {
|
let code_for_oopif_to_run = function() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
// inside an iframe which means we have no control over the root APZC.
|
// inside an iframe which means we have no control over the root APZC.
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
// inside an iframe which means we have no control over the root APZC.
|
// inside an iframe which means we have no control over the root APZC.
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
// inside an iframe which means we have no control over the root APZC.
|
// inside an iframe which means we have no control over the root APZC.
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ var subtests = [
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
SimpleTest.ok(true, "Keyboard APZ is disabled");
|
SimpleTest.ok(true, "Keyboard APZ is disabled");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ if (isApzEnabled()) {
|
|||||||
// inside an iframe which means we have no control over the root APZC.
|
// inside an iframe which means we have no control over the root APZC.
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.expectAssertions(0, 2); // from helper_bug1550510.html, bug 1232856
|
SimpleTest.expectAssertions(0, 2); // from helper_bug1550510.html, bug 1232856
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1285070
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (isApzEnabled()) {
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
runSubtestsSeriallyInFreshWindows(subtests)
|
runSubtestsSeriallyInFreshWindows(subtests)
|
||||||
.then(SimpleTest.finish, SimpleTest.finish);
|
.finally(SimpleTest.finish);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ GeckoViewPermission.prototype = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (dispatcher) {
|
if (dispatcher) {
|
||||||
this.getAppPermissions(dispatcher, perms).then(callback, callback);
|
this.getAppPermissions(dispatcher, perms).finally(callback);
|
||||||
} else {
|
} else {
|
||||||
// No dispatcher; just bail.
|
// No dispatcher; just bail.
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ function StreamCopier(input, output, length) {
|
|||||||
// or fail scenarios, but also emit events (due to the EventEmitter)
|
// or fail scenarios, but also emit events (due to the EventEmitter)
|
||||||
// for other states, like progress.
|
// for other states, like progress.
|
||||||
this.then = this._deferred.promise.then.bind(this._deferred.promise);
|
this.then = this._deferred.promise.then.bind(this._deferred.promise);
|
||||||
this.then(this._destroy, this._destroy);
|
this.finally = this._deferred.promise.finally.bind(this._deferred.promise);
|
||||||
|
this.finally(this._destroy);
|
||||||
|
|
||||||
// Stream ready callback starts as |_copy|, but may switch to |_flush|
|
// Stream ready callback starts as |_copy|, but may switch to |_flush|
|
||||||
// at end if flushing would block the output stream.
|
// at end if flushing would block the output stream.
|
||||||
|
|||||||
@@ -1639,7 +1639,7 @@ try {
|
|||||||
|
|
||||||
let complete = false;
|
let complete = false;
|
||||||
let doComplete = () => (complete = true);
|
let doComplete = () => (complete = true);
|
||||||
_TelemetryController.testRegisterJsProbes().then(doComplete, doComplete);
|
_TelemetryController.testRegisterJsProbes().finally(doComplete);
|
||||||
_Services.tm.spinEventLoopUntil(() => complete);
|
_Services.tm.spinEventLoopUntil(() => complete);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -288,10 +288,7 @@ function looseTimer(delay) {
|
|||||||
);
|
);
|
||||||
// Ensure that the timer is both canceled once we are done with it
|
// Ensure that the timer is both canceled once we are done with it
|
||||||
// and not garbage-collected until then.
|
// and not garbage-collected until then.
|
||||||
deferred.promise.then(
|
deferred.promise.finally(() => timer.cancel());
|
||||||
() => timer.cancel(),
|
|
||||||
() => timer.cancel()
|
|
||||||
);
|
|
||||||
return deferred;
|
return deferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ Download.prototype = {
|
|||||||
if (!this._promiseCanceled) {
|
if (!this._promiseCanceled) {
|
||||||
// Start a new cancellation request.
|
// Start a new cancellation request.
|
||||||
this._promiseCanceled = new Promise(resolve => {
|
this._promiseCanceled = new Promise(resolve => {
|
||||||
this._currentAttempt.then(resolve, resolve);
|
this._currentAttempt.finally(resolve);
|
||||||
});
|
});
|
||||||
|
|
||||||
// The download can already be restarted.
|
// The download can already be restarted.
|
||||||
|
|||||||
@@ -1033,7 +1033,7 @@ ParentAPIManager = {
|
|||||||
let remove = () => {
|
let remove = () => {
|
||||||
listenerPromises.delete(promise);
|
listenerPromises.delete(promise);
|
||||||
};
|
};
|
||||||
promise.then(remove, remove);
|
promise.finally(remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
let handler = await promise;
|
let handler = await promise;
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ add_task(async function test_post_unload_promises() {
|
|||||||
|
|
||||||
context.wrapPromise(Promise.resolve("resolved")).then(fail);
|
context.wrapPromise(Promise.resolve("resolved")).then(fail);
|
||||||
|
|
||||||
|
// We care about which way we fail here (if we do), so we don't want to use finally.
|
||||||
|
// eslint-disable-next-line mozilla/use-finally
|
||||||
context.wrapPromise(Promise.reject({ message: "rejected" })).then(fail, fail);
|
context.wrapPromise(Promise.reject({ message: "rejected" })).then(fail, fail);
|
||||||
|
|
||||||
context.unload();
|
context.unload();
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
|||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
do_test_pending();
|
do_test_pending();
|
||||||
OS.File.getCurrentDirectory().then(do_test_finished, do_test_finished);
|
OS.File.getCurrentDirectory().finally(do_test_finished);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ var ClientIDImpl = {
|
|||||||
|
|
||||||
this._loadClientIdTask = this._doLoadClientID();
|
this._loadClientIdTask = this._doLoadClientID();
|
||||||
let clear = () => (this._loadClientIdTask = null);
|
let clear = () => (this._loadClientIdTask = null);
|
||||||
this._loadClientIdTask.then(clear, clear);
|
this._loadClientIdTask.finally(clear);
|
||||||
return this._loadClientIdTask;
|
return this._loadClientIdTask;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ var ClientIDImpl = {
|
|||||||
// Asynchronous calls to getClientID will also be blocked on this.
|
// Asynchronous calls to getClientID will also be blocked on this.
|
||||||
this._removeClientIdTask = this._doRemoveClientID();
|
this._removeClientIdTask = this._doRemoveClientID();
|
||||||
let clear = () => (this._removeClientIdTask = null);
|
let clear = () => (this._removeClientIdTask = null);
|
||||||
this._removeClientIdTask.then(clear, clear);
|
this._removeClientIdTask.finally(clear);
|
||||||
|
|
||||||
await this._removeClientIdTask;
|
await this._removeClientIdTask;
|
||||||
|
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ var SendScheduler = {
|
|||||||
if (!this._sendTask) {
|
if (!this._sendTask) {
|
||||||
this._sendTask = this._doSendTask();
|
this._sendTask = this._doSendTask();
|
||||||
let clear = () => (this._sendTask = null);
|
let clear = () => (this._sendTask = null);
|
||||||
this._sendTask.then(clear, clear);
|
this._sendTask.finally(clear);
|
||||||
} else if (immediately) {
|
} else if (immediately) {
|
||||||
CancellableTimeout.cancelTimeout();
|
CancellableTimeout.cancelTimeout();
|
||||||
}
|
}
|
||||||
@@ -1521,7 +1521,7 @@ var TelemetrySendImpl = {
|
|||||||
*/
|
*/
|
||||||
_trackPendingPingTask(promise) {
|
_trackPendingPingTask(promise) {
|
||||||
let clear = () => this._pendingPingActivity.delete(promise);
|
let clear = () => this._pendingPingActivity.delete(promise);
|
||||||
promise.then(clear, clear);
|
promise.finally(clear);
|
||||||
this._pendingPingActivity.add(promise);
|
this._pendingPingActivity.add(promise);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -856,7 +856,7 @@ var TelemetryStorageImpl = {
|
|||||||
// Make sure to clear |_cleanArchiveTask| once done.
|
// Make sure to clear |_cleanArchiveTask| once done.
|
||||||
let clear = () => (this._cleanArchiveTask = null);
|
let clear = () => (this._cleanArchiveTask = null);
|
||||||
// Since there's no archive cleaning task running, start it.
|
// Since there's no archive cleaning task running, start it.
|
||||||
this._cleanArchiveTask = this._cleanArchive().then(clear, clear);
|
this._cleanArchiveTask = this._cleanArchive().finally(clear);
|
||||||
return this._cleanArchiveTask;
|
return this._cleanArchiveTask;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1541,7 +1541,7 @@ var TelemetryStorageImpl = {
|
|||||||
*/
|
*/
|
||||||
_trackPendingPingSaveTask(promise) {
|
_trackPendingPingSaveTask(promise) {
|
||||||
let clear = () => this._activePendingPingSaves.delete(promise);
|
let clear = () => this._activePendingPingSaves.delete(promise);
|
||||||
promise.then(clear, clear);
|
promise.finally(clear);
|
||||||
this._activePendingPingSaves.add(promise);
|
this._activePendingPingSaves.add(promise);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -602,8 +602,7 @@ Capture.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PageThumbs._store(this.url, data.finalURL, data.imageData, true).then(
|
PageThumbs._store(this.url, data.finalURL, data.imageData, true).finally(
|
||||||
done,
|
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ let loop = function loop(index) {
|
|||||||
loop(index + 1);
|
loop(index + 1);
|
||||||
};
|
};
|
||||||
let result = executeTest(test);
|
let result = executeTest(test);
|
||||||
result.then(next, next);
|
result.finally(next);
|
||||||
};
|
};
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ ConnectionData.prototype = Object.freeze({
|
|||||||
shrinkMemory() {
|
shrinkMemory() {
|
||||||
this._log.info("Shrinking memory usage.");
|
this._log.info("Shrinking memory usage.");
|
||||||
let onShrunk = this._clearIdleShrinkTimer.bind(this);
|
let onShrunk = this._clearIdleShrinkTimer.bind(this);
|
||||||
return this.execute("PRAGMA shrink_memory").then(onShrunk, onShrunk);
|
return this.execute("PRAGMA shrink_memory").finally(onShrunk);
|
||||||
},
|
},
|
||||||
|
|
||||||
discardCachedStatements() {
|
discardCachedStatements() {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var run_promise_tests = function run_promise_tests(tests, cb) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
let result = test();
|
let result = test();
|
||||||
result.then(next, next);
|
result.finally(next);
|
||||||
};
|
};
|
||||||
return loop(0);
|
return loop(0);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user