summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js')
-rw-r--r--toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js b/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
index b50fd4a55..d513f4adf 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
@@ -50,8 +50,9 @@ function makeCancelListener() {
}
// Set up the HTTP server so that we can control when it responds
-var httpReceived = Promise.defer();
+let httpReceived = Promise.defer();
function dataHandler(aRequest, aResponse) {
+ asyncResponse = aResponse;
aResponse.processAsync();
httpReceived.resolve([aRequest, aResponse]);
}
@@ -74,7 +75,7 @@ writeInstallRDFForExtension({
name: "Test Addon 1",
}, profileDir);
-add_task(function* cancel_during_check() {
+add_task(function cancel_during_check() {
startupManager();
let a1 = yield promiseAddonByID("addon1@tests.mozilla.org");
@@ -108,7 +109,7 @@ add_task(function* cancel_during_check() {
// Test that update check is cancelled if the XPI provider shuts down while
// the update check is in progress
-add_task(function* shutdown_during_check() {
+add_task(function shutdown_during_check() {
// Reset our HTTP listener
httpReceived = Promise.defer();
@@ -134,5 +135,8 @@ add_task(function* shutdown_during_check() {
response.write(data);
response.finish();
+ // trying to cancel again should return false, i.e. nothing to cancel
+ do_check_false(a1.cancelUpdate());
+
yield testserver.stop(Promise.defer().resolve);
});