Bug 1550799 - Add tests for opening the about dialog and about preferences when an update is downloading and when an update is staging. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Mon, 13 May 2019 18:17:53 +0000
changeset 473643 a6445a0726c098e5dda6ac514f3d90a00ff77f45
parent 473642 7b168d837392915c41fe70b506222115659ff078
child 473644 d99a6769beb4ec1e6b58591e3dc7be89861fb0a8
push id36009
push userapavel@mozilla.com
push dateTue, 14 May 2019 04:07:34 +0000
treeherdermozilla-central@96563508f9fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1550799, 1546627
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1550799 - Add tests for opening the about dialog and about preferences when an update is downloading and when an update is staging. r=bytesized This adds tests for opening the about dialog and about preferences when an update is in the middle of being staged which was fixed in bug 1546627. This also adds tests for opening the about dialog and about preferences when an update is in the middle of being downloaded Changed the variable info to data in head.js since SimpleTest already has a function named info. The test entries in browser.ini were reordered so it is easier to compare with the test entries in browser.bits.ini Differential Revision: https://phabricator.services.mozilla.com/D30805
toolkit/mozapps/update/tests/browser/browser.bits.ini
toolkit/mozapps/update/tests/browser/browser.ini
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_cantApply.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_noUpdate.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_otherInstance.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_cantApply.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_noUpdate.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_otherInstance.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/head.js
--- a/toolkit/mozapps/update/tests/browser/browser.bits.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.bits.ini
@@ -13,29 +13,35 @@ support-files =
 
 prefs =
   app.update.BITS.enabled=true
 
 # BITS Download Tests
 #####################
 
 # About Dialog Application Update Tests
+[browser_aboutDialog_bc_downloading.js]
+[browser_aboutDialog_bc_downloading_staging.js]
 [browser_aboutDialog_bc_downloaded.js]
+[browser_aboutDialog_bc_downloaded_staging.js]
 [browser_aboutDialog_bc_downloaded_staged.js]
 [browser_aboutDialog_fc_downloadAuto.js]
 [browser_aboutDialog_fc_downloadAuto_staging.js]
 [browser_aboutDialog_fc_downloadOptIn.js]
 [browser_aboutDialog_fc_downloadOptIn_staging.js]
 [browser_aboutDialog_fc_patch_completeBadSize.js]
 [browser_aboutDialog_fc_patch_partialBadSize.js]
 [browser_aboutDialog_fc_patch_partialBadSize_complete.js]
 [browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js]
 
 # about:preferences Application Update Tests
+[browser_aboutPrefs_bc_downloading.js]
+[browser_aboutPrefs_bc_downloading_staging.js]
 [browser_aboutPrefs_bc_downloaded.js]
+[browser_aboutPrefs_bc_downloaded_staging.js]
 [browser_aboutPrefs_bc_downloaded_staged.js]
 [browser_aboutPrefs_fc_downloadAuto.js]
 [browser_aboutPrefs_fc_downloadAuto_staging.js]
 [browser_aboutPrefs_fc_downloadOptIn.js]
 [browser_aboutPrefs_fc_downloadOptIn_staging.js]
 [browser_aboutPrefs_fc_patch_completeBadSize.js]
 [browser_aboutPrefs_fc_patch_partialBadSize.js]
 [browser_aboutPrefs_fc_patch_partialBadSize_complete.js]
--- a/toolkit/mozapps/update/tests/browser/browser.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.ini
@@ -7,56 +7,62 @@ support-files =
   ../data/sharedUpdateXML.js
   app_update.sjs
   downloadPage.html
   testConstants.js
 prefs =
   app.update.BITS.enabled=false
 
 # About Dialog Application Update Tests
+[browser_aboutDialog_bc_downloading.js]
+[browser_aboutDialog_bc_downloading_staging.js]
 [browser_aboutDialog_bc_downloaded.js]
+[browser_aboutDialog_bc_downloaded_staging.js]
 [browser_aboutDialog_bc_downloaded_staged.js]
+[browser_aboutDialog_fc_downloadAuto.js]
+[browser_aboutDialog_fc_downloadAuto_staging.js]
+[browser_aboutDialog_fc_downloadOptIn.js]
+[browser_aboutDialog_fc_downloadOptIn_staging.js]
+[browser_aboutDialog_fc_patch_completeBadSize.js]
+[browser_aboutDialog_fc_patch_partialBadSize.js]
+[browser_aboutDialog_fc_patch_partialBadSize_complete.js]
+[browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js]
 [browser_aboutDialog_fc_check_cantApply.js]
 skip-if = os != 'win'
 reason = test must be able to prevent file deletion.
 [browser_aboutDialog_fc_check_malformedXML.js]
 [browser_aboutDialog_fc_check_noUpdate.js]
 [browser_aboutDialog_fc_check_otherInstance.js]
 skip-if = os != 'win'
 reason = Windows only feature.
 [browser_aboutDialog_fc_check_unsupported.js]
-[browser_aboutDialog_fc_downloadAuto.js]
-[browser_aboutDialog_fc_downloadAuto_staging.js]
-[browser_aboutDialog_fc_downloadOptIn.js]
-[browser_aboutDialog_fc_downloadOptIn_staging.js]
-[browser_aboutDialog_fc_patch_completeBadSize.js]
-[browser_aboutDialog_fc_patch_partialBadSize.js]
-[browser_aboutDialog_fc_patch_partialBadSize_complete.js]
-[browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js]
 
 # about:preferences Application Update Tests
+[browser_aboutPrefs_bc_downloading.js]
+[browser_aboutPrefs_bc_downloading_staging.js]
 [browser_aboutPrefs_bc_downloaded.js]
+[browser_aboutPrefs_bc_downloaded_staging.js]
 [browser_aboutPrefs_bc_downloaded_staged.js]
+[browser_aboutPrefs_fc_downloadAuto.js]
+[browser_aboutPrefs_fc_downloadAuto_staging.js]
+[browser_aboutPrefs_fc_downloadOptIn.js]
+[browser_aboutPrefs_fc_downloadOptIn_staging.js]
+[browser_aboutPrefs_fc_patch_completeBadSize.js]
+[browser_aboutPrefs_fc_patch_partialBadSize.js]
+[browser_aboutPrefs_fc_patch_partialBadSize_complete.js]
+[browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js]
 [browser_aboutPrefs_fc_check_cantApply.js]
 skip-if = os != 'win'
 reason = test must be able to prevent file deletion.
 [browser_aboutPrefs_fc_check_malformedXML.js]
 [browser_aboutPrefs_fc_check_noUpdate.js]
 [browser_aboutPrefs_fc_check_otherInstance.js]
 skip-if = os != 'win'
 reason = Windows only feature.
 [browser_aboutPrefs_fc_check_unsupported.js]
-[browser_aboutPrefs_fc_downloadAuto.js]
-[browser_aboutPrefs_fc_downloadAuto_staging.js]
-[browser_aboutPrefs_fc_downloadOptIn.js]
-[browser_aboutPrefs_fc_downloadOptIn_staging.js]
-[browser_aboutPrefs_fc_patch_completeBadSize.js]
-[browser_aboutPrefs_fc_patch_partialBadSize.js]
-[browser_aboutPrefs_fc_patch_partialBadSize_complete.js]
-[browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js]
 [browser_aboutPrefs_settings.js]
 skip-if = os != 'win'
 reason = Tests that update config is properly written to file, which is a Windows-only feature
 
 # Doorhanger Application Update Tests
 [browser_doorhanger_bc_check_cantApply.js]
 skip-if = os != 'win'
 reason = test must be able to prevent file deletion.
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded.js
@@ -1,17 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for About Dialog background check for updates
-// with the update downloaded.
+// with the update downloaded when the About Dialog is opened.
 add_task(async function aboutDialog_backgroundCheck_downloaded() {
-  let updateParams = "";
-  await runAboutDialogUpdateTest(updateParams, true, [
+  let params = {backgroundUpdate: true,
+                waitForUpdateState: STATE_PENDING};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staged.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staged.js
@@ -1,25 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for About Dialog background check for updates
-// with the update downloaded and staged.
+// with the update downloaded and staged when the About Dialog is opened.
 add_task(async function aboutDialog_backgroundCheck_downloaded_staged() {
   await SpecialPowers.pushPrefEnv({
     set: [
       [PREF_APP_UPDATE_STAGING_ENABLED, true],
     ],
   });
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, true, [
+  let params = {queryString: "&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                continueFile: CONTINUE_STAGING,
+                waitForUpdateState: STATE_APPLIED};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_APPLIED},
       continueFile: null,
     },
   ]);
 });
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staging.js
@@ -0,0 +1,32 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for About Dialog background check for updates
+// with the update downloaded and the About Dialog opened during staging.
+add_task(async function aboutDialog_backgroundCheck_downloaded_staging() {
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      [PREF_APP_UPDATE_STAGING_ENABLED, true],
+    ],
+  });
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_PENDING};
+  await runAboutDialogUpdateTest(params, [
+    {
+      panelId: "applying",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: CONTINUE_STAGING,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_APPLIED},
+      continueFile: null,
+    },
+  ]);
+});
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for About Dialog background check for updates
+// with the About Dialog opened during downloading.
+add_task(async function aboutDialog_backgroundCheck_downloading() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: "0"};
+  }
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&useSlowDownloadMar=1&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_DOWNLOADING};
+  await runAboutDialogUpdateTest(params, [
+    {
+      panelId: "downloading",
+      checkActiveUpdate: {state: STATE_DOWNLOADING},
+      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: null,
+    },
+  ]);
+});
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading_staging.js
@@ -0,0 +1,47 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for About Dialog background check for updates
+// with the About Dialog opened during downloading and stages the update.
+add_task(async function aboutDialog_backgroundCheck_downloading_staging() {
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      [PREF_APP_UPDATE_STAGING_ENABLED, true],
+    ],
+  });
+
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: "0"};
+  }
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&useSlowDownloadMar=1&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_DOWNLOADING};
+  await runAboutDialogUpdateTest(params, [
+    {
+      panelId: "downloading",
+      checkActiveUpdate: {state: STATE_DOWNLOADING},
+      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
+    },
+    {
+      panelId: "applying",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: CONTINUE_STAGING,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_APPLIED},
+      continueFile: null,
+    },
+  ]);
+});
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_cantApply.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_cantApply.js
@@ -3,18 +3,18 @@
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // without the ability to apply updates.
 add_task(async function aboutDialog_foregroundCheck_cantApply() {
   lockWriteTestFile();
 
-  let updateParams = "";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "manualUpdate",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_malformedXML.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_malformedXML.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // with a malformed update XML file.
 add_task(async function aboutDialog_foregroundCheck_malformedXML() {
-  let updateParams = "&xmlMalformed=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&xmlMalformed=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "noUpdatesFound",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_noUpdate.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_noUpdate.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // with no update available.
 add_task(async function aboutDialog_foregroundCheck_noUpdate() {
-  let updateParams = "&noUpdates=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&noUpdates=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "noUpdatesFound",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_otherInstance.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_otherInstance.js
@@ -3,17 +3,17 @@
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // with another application instance handling updates.
 add_task(async function aboutDialog_foregroundCheck_otherInstance() {
   setOtherInstanceHandlingUpdates();
 
-  let updateParams = "";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "otherInstanceHandlingUpdates",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_unsupported.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_unsupported.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // with an unsupported update.
 add_task(async function aboutDialog_foregroundCheck_unsupported() {
-  let updateParams = "&unsupported=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&unsupported=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "unsupportedSystem",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
@@ -12,18 +12,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
@@ -18,18 +18,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
@@ -14,18 +14,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn_staging.js
@@ -19,18 +19,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
@@ -12,18 +12,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&completePatchOnly=1&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&completePatchOnly=1&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
@@ -12,18 +12,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "partial",
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&partialPatchOnly=1&invalidPartialSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&partialPatchOnly=1&invalidPartialSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_complete.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_complete.js
@@ -16,18 +16,18 @@ add_task(async function aboutDialog_fore
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: "0"};
   }
 
-  let updateParams = "&invalidPartialSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidPartialSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js
@@ -18,18 +18,18 @@ add_task(async function aboutDialog_fore
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&invalidPartialSize=1&invalidCompleteSize=1";
-  await runAboutDialogUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidPartialSize=1&invalidCompleteSize=1"};
+  await runAboutDialogUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded.js
@@ -1,17 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for about:preferences background check for updates
-// with the update downloaded.
+// with the update downloaded when about:preferences is opened.
 add_task(async function aboutPrefs_backgroundCheck_downloaded() {
-  let updateParams = "";
-  await runAboutPrefsUpdateTest(updateParams, true, [
+  let params = {backgroundUpdate: true,
+                waitForUpdateState: STATE_PENDING};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staged.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staged.js
@@ -1,25 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for about:preferences background check for updates
-// with the update downloaded and staged.
+// with the update downloaded and staged when about:preferences is opened.
 add_task(async function aboutPrefs_backgroundCheck_downloaded_staged() {
   await SpecialPowers.pushPrefEnv({
     set: [
       [PREF_APP_UPDATE_STAGING_ENABLED, true],
     ],
   });
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, true, [
+  let params = {queryString: "&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                continueFile: CONTINUE_STAGING,
+                waitForUpdateState: STATE_APPLIED};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_APPLIED},
       continueFile: null,
     },
   ]);
 });
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staging.js
@@ -0,0 +1,32 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for about:preferences background check for updates
+// with the update downloaded and about:preferences opened during staging.
+add_task(async function aboutPrefs_backgroundCheck_downloaded_staged() {
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      [PREF_APP_UPDATE_STAGING_ENABLED, true],
+    ],
+  });
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_PENDING};
+  await runAboutPrefsUpdateTest(params, [
+    {
+      panelId: "applying",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: CONTINUE_STAGING,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_APPLIED},
+      continueFile: null,
+    },
+  ]);
+});
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for about:preferences background check for updates
+// with about:preferences opened during downloading.
+add_task(async function aboutPrefs_backgroundCheck_downloading() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: "0"};
+  }
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&useSlowDownloadMar=1&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_DOWNLOADING};
+  await runAboutPrefsUpdateTest(params, [
+    {
+      panelId: "downloading",
+      checkActiveUpdate: {state: STATE_DOWNLOADING},
+      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: null,
+    },
+  ]);
+});
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading_staging.js
@@ -0,0 +1,47 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test for about:preferences background check for updates
+// with about:preferences opened during downloading and stages the update.
+add_task(async function aboutPrefs_backgroundCheck_downloading_staging() {
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      [PREF_APP_UPDATE_STAGING_ENABLED, true],
+    ],
+  });
+
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: "0"};
+  }
+
+  // Since the partial should be successful specify an invalid size for the
+  // complete update.
+  let params = {queryString: "&useSlowDownloadMar=1&invalidCompleteSize=1",
+                backgroundUpdate: true,
+                waitForUpdateState: STATE_DOWNLOADING};
+  await runAboutPrefsUpdateTest(params, [
+    {
+      panelId: "downloading",
+      checkActiveUpdate: {state: STATE_DOWNLOADING},
+      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
+    },
+    {
+      panelId: "applying",
+      checkActiveUpdate: {state: STATE_PENDING},
+      continueFile: CONTINUE_STAGING,
+    },
+    {
+      panelId: "apply",
+      checkActiveUpdate: {state: STATE_APPLIED},
+      continueFile: null,
+    },
+  ]);
+});
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_cantApply.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_cantApply.js
@@ -3,18 +3,18 @@
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // without the ability to apply updates.
 add_task(async function aboutPrefs_foregroundCheck_cantApply() {
   lockWriteTestFile();
 
-  let updateParams = "";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "manualUpdate",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_malformedXML.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_malformedXML.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // with a malformed update XML file.
 add_task(async function aboutPrefs_foregroundCheck_malformedXML() {
-  let updateParams = "&xmlMalformed=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&xmlMalformed=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "noUpdatesFound",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_noUpdate.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_noUpdate.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // with no update available.
 add_task(async function aboutPrefs_foregroundCheck_noUpdate() {
-  let updateParams = "&noUpdates=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&noUpdates=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "noUpdatesFound",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_otherInstance.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_otherInstance.js
@@ -3,17 +3,17 @@
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // with another application instance handling updates.
 add_task(async function aboutPrefs_foregroundCheck_otherInstance() {
   setOtherInstanceHandlingUpdates();
 
-  let updateParams = "";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "otherInstanceHandlingUpdates",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_unsupported.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_unsupported.js
@@ -1,18 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // with an unsupported update.
 add_task(async function aboutPrefs_foregroundCheck_unsupported() {
-  let updateParams = "&unsupported=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&unsupported=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "unsupportedSystem",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
@@ -12,18 +12,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
@@ -18,18 +18,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
@@ -14,18 +14,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn_staging.js
@@ -19,18 +19,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: "0"};
   }
 
   // Since the partial should be successful specify an invalid size for the
   // complete update.
-  let updateParams = "&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
@@ -12,18 +12,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&completePatchOnly=1&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&completePatchOnly=1&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
@@ -12,18 +12,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "partial",
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&partialPatchOnly=1&invalidPartialSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&partialPatchOnly=1&invalidPartialSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_complete.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_complete.js
@@ -16,18 +16,18 @@ add_task(async function aboutPrefs_foreg
                        bitsResult: "0"};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: "0"};
   }
 
-  let updateParams = "&invalidPartialSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidPartialSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js
@@ -18,18 +18,18 @@ add_task(async function aboutPrefs_foreg
                        internalResult: gBadSizeResult};
   } else {
     downloadInfo[0] = {patchType: "partial",
                        internalResult: gBadSizeResult};
     downloadInfo[1] = {patchType: "complete",
                        internalResult: gBadSizeResult};
   }
 
-  let updateParams = "&invalidPartialSize=1&invalidCompleteSize=1";
-  await runAboutPrefsUpdateTest(updateParams, false, [
+  let params = {queryString: "&invalidPartialSize=1&invalidCompleteSize=1"};
+  await runAboutPrefsUpdateTest(params, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
--- a/toolkit/mozapps/update/tests/browser/head.js
+++ b/toolkit/mozapps/update/tests/browser/head.js
@@ -614,38 +614,39 @@ function runDoorhangerUpdateTest(updateP
     }
   })();
 }
 
 /**
  * Runs an About Dialog update test. This will set various common prefs for
  * updating and runs the provided list of steps.
  *
- * @param  updateParams
- *         Params which will be sent to app_update.sjs.
- * @param  backgroundUpdate
- *         If true a background check will be performed before opening the About
- *         Dialog.
+ * @param  params
+ *         An object containing parameters used to run the test.
  * @param  steps
  *         An array of test steps to perform. A step will either be an object
  *         containing expected conditions and actions or a function to call.
  * @return A promise which will resolve once all of the steps have been run.
  */
-function runAboutDialogUpdateTest(updateParams, backgroundUpdate, steps) {
+function runAboutDialogUpdateTest(params, steps) {
   let aboutDialog;
   function processAboutDialogStep(step) {
     if (typeof(step) == "function") {
       return step();
     }
 
     const {panelId, checkActiveUpdate, continueFile, downloadInfo} = step;
     return (async function() {
       let updateDeck = aboutDialog.document.getElementById("updateDeck");
+      // Also continue if the selected panel ID is 'apply' since there are no
+      // other panels after 'apply'.
       await TestUtils.waitForCondition(() =>
-        (updateDeck.selectedPanel && updateDeck.selectedPanel.id == panelId),
+        (updateDeck.selectedPanel &&
+         (updateDeck.selectedPanel.id == panelId ||
+          updateDeck.selectedPanel.id == "apply")),
         "Waiting for the expected panel ID: " + panelId, undefined, 200
       ).catch(e => {
         // Instead of throwing let the check below fail the test so the panel
         // ID and the expected panel ID is printed in the log.
         logTestInfo(e);
       });
       let selectedPanel = updateDeck.selectedPanel;
       is(selectedPanel.id, panelId, "The panel ID should equal " + panelId);
@@ -656,39 +657,39 @@ function runAboutDialogUpdateTest(update
            "The active update state should equal " + checkActiveUpdate.state);
       } else {
         ok(!gUpdateManager.activeUpdate,
            "There should not be an active update");
       }
 
       if (panelId == "downloading") {
         for (let i = 0; i < downloadInfo.length; ++i) {
-          let info = downloadInfo[i];
+          let data = downloadInfo[i];
           // The About Dialog tests always specify a continue file.
           await continueFileHandler(continueFile);
-          let patch = getPatchOfType(info.patchType);
+          let patch = getPatchOfType(data.patchType);
           // The update is removed early when the last download fails so check
           // that there is a patch before proceeding.
           let isLastPatch = (i == downloadInfo.length - 1);
           if (!isLastPatch || patch) {
-            let resultName = info.bitsResult ? "bitsResult" : "internalResult";
+            let resultName = data.bitsResult ? "bitsResult" : "internalResult";
             patch.QueryInterface(Ci.nsIWritablePropertyBag);
             await TestUtils.waitForCondition(() =>
-              (patch.getProperty(resultName) == info[resultName]),
+              (patch.getProperty(resultName) == data[resultName]),
               "Waiting for expected patch property " + resultName + " value: " +
-              info[resultName], undefined, 200
+              data[resultName], undefined, 200
             ).catch(e => {
               // Instead of throwing let the check below fail the test so the
               // property value and the expected property value is printed in
               // the log.
               logTestInfo(e);
             });
-            is(patch.getProperty(resultName), info[resultName],
+            is(patch.getProperty(resultName), data[resultName],
                "The patch property " + resultName + " value should equal " +
-               info[resultName]);
+               data[resultName]);
           }
         }
       } else if (continueFile) {
         await continueFileHandler(continueFile);
       }
 
       let linkPanels = ["downloadFailed", "manualUpdate", "unsupportedSystem"];
       if (linkPanels.includes(panelId)) {
@@ -722,28 +723,40 @@ function runAboutDialogUpdateTest(update
       set: [
         [PREF_APP_UPDATE_DISABLEDFORTESTING, false],
         [PREF_APP_UPDATE_URL_MANUAL, gDetailsURL],
       ],
     });
 
     await setupTestUpdater();
 
+    let queryString = params.queryString ? params.queryString : "";
     let updateURL = URL_HTTP_UPDATE_SJS + "?detailsURL=" + gDetailsURL +
-                    updateParams + getVersionParams();
-    if (backgroundUpdate) {
-      if (Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED)) {
-        // Since MOZ_TEST_SKIP_UPDATE_STAGE is checked before
-        // MOZ_TEST_SLOW_SKIP_UPDATE_STAGE in updater.cpp this removes the need
-        // for the continue file to continue staging the update.
-        gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "1");
-      }
+                    queryString + getVersionParams();
+    if (params.backgroundUpdate) {
       setUpdateURL(updateURL);
       gAUS.checkForBackgroundUpdates();
-      await waitForEvent("update-downloaded");
+      if (params.continueFile) {
+        await continueFileHandler(params.continueFile);
+      }
+      if (params.waitForUpdateState) {
+        await TestUtils.waitForCondition(() =>
+          (gUpdateManager.activeUpdate &&
+           gUpdateManager.activeUpdate.state == params.waitForUpdateState),
+          "Waiting for update state: " + params.waitForUpdateState,
+          undefined, 200
+        ).catch(e => {
+          // Instead of throwing let the check below fail the test so the panel
+          // ID and the expected panel ID is printed in the log.
+          logTestInfo(e);
+        });
+        // Display the UI after the update state equals the expected value.
+        is(gUpdateManager.activeUpdate.state, params.waitForUpdateState,
+           "The update state value should equal " + params.waitForUpdateState);
+      }
     } else {
       updateURL += "&slowUpdateCheck=1&useSlowDownloadMar=1";
       setUpdateURL(updateURL);
     }
 
     aboutDialog = await waitForAboutDialog();
     registerCleanupFunction(() => {
       aboutDialog.close();
@@ -754,84 +767,87 @@ function runAboutDialogUpdateTest(update
     }
   })();
 }
 
 /**
  * Runs an about:preferences update test. This will set various common prefs for
  * updating and runs the provided list of steps.
  *
- * @param  updateParams
- *         Params which will be sent to app_update.sjs.
- * @param  backgroundUpdate
- *         If true a background check will be performed before opening the About
- *         Dialog.
+ * @param  params
+ *         An object containing parameters used to run the test.
  * @param  steps
  *         An array of test steps to perform. A step will either be an object
  *         containing expected conditions and actions or a function to call.
  * @return A promise which will resolve once all of the steps have been run.
  */
-function runAboutPrefsUpdateTest(updateParams, backgroundUpdate, steps) {
+function runAboutPrefsUpdateTest(params, steps) {
   let tab;
   function processAboutPrefsStep(step) {
     if (typeof(step) == "function") {
       return step();
     }
 
     const {panelId, checkActiveUpdate, continueFile, downloadInfo} = step;
     return (async function() {
       await ContentTask.spawn(tab.linkedBrowser, {panelId},
                               async ({panelId}) => {
         let updateDeck = content.document.getElementById("updateDeck");
+        // Also continue if the selected panel ID is 'apply' since there are no
+        // other panels after 'apply'.
         await ContentTaskUtils.waitForCondition(() =>
-          (updateDeck.selectedPanel && updateDeck.selectedPanel.id == panelId),
+          (updateDeck.selectedPanel &&
+           (updateDeck.selectedPanel.id == panelId ||
+            updateDeck.selectedPanel.id == "apply")),
           "Waiting for the expected panel ID: " + panelId, undefined, 200
         ).catch(e => {
           // Instead of throwing let the check below fail the test so the panel
-          // ID and the expected panel ID is printed in the log.
-          logTestInfo(e);
+          // ID and the expected panel ID is printed in the log. Use info here
+          // instead of logTestInfo since logTestInfo isn't available in the
+          // content task.
+          info(e);
         });
         is(updateDeck.selectedPanel.id, panelId,
            "The panel ID should equal " + panelId);
       });
 
       if (checkActiveUpdate) {
         ok(!!gUpdateManager.activeUpdate, "There should be an active update");
         is(gUpdateManager.activeUpdate.state, checkActiveUpdate.state,
            "The active update state should equal " + checkActiveUpdate.state);
       } else {
         ok(!gUpdateManager.activeUpdate,
            "There should not be an active update");
       }
 
       if (panelId == "downloading") {
         for (let i = 0; i < downloadInfo.length; ++i) {
-          let info = downloadInfo[i];
+          let data = downloadInfo[i];
           // The About Dialog tests always specify a continue file.
           await continueFileHandler(continueFile);
-          let patch = getPatchOfType(info.patchType);
+          let patch = getPatchOfType(data.patchType);
           // The update is removed early when the last download fails so check
           // that there is a patch before proceeding.
           let isLastPatch = (i == downloadInfo.length - 1);
           if (!isLastPatch || patch) {
-            let resultName = info.bitsResult ? "bitsResult" : "internalResult";
+            let resultName = data.bitsResult ? "bitsResult" : "internalResult";
             patch.QueryInterface(Ci.nsIWritablePropertyBag);
             await TestUtils.waitForCondition(() =>
-              (patch.getProperty(resultName) == info[resultName]),
+              (patch.getProperty(resultName) == data[resultName]),
               "Waiting for expected patch property " + resultName + " value: " +
-              info[resultName], undefined, 200
+              data[resultName], undefined, 200
             ).catch(e => {
               // Instead of throwing let the check below fail the test so the
               // property value and the expected property value is printed in
               // the log.
               logTestInfo(e);
             });
-            is(patch.getProperty(resultName), info[resultName],
+            is(patch.getProperty(resultName), data[resultName],
                "The patch property " + resultName + " value should equal " +
-               info[resultName]);
+               data[resultName]);
           }
         }
       } else if (continueFile) {
         await continueFileHandler(continueFile);
       }
 
       await ContentTask.spawn(tab.linkedBrowser, {panelId, gDetailsURL},
                               async ({panelId, gDetailsURL}) => {
@@ -877,46 +893,63 @@ function runAboutPrefsUpdateTest(updateP
       set: [
         [PREF_APP_UPDATE_DISABLEDFORTESTING, false],
         [PREF_APP_UPDATE_URL_MANUAL, gDetailsURL],
       ],
     });
 
     await setupTestUpdater();
 
+    let queryString = params.queryString ? params.queryString : "";
     let updateURL = URL_HTTP_UPDATE_SJS + "?detailsURL=" + gDetailsURL +
-                    updateParams + getVersionParams();
-    if (backgroundUpdate) {
-      if (Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED)) {
-        // Since MOZ_TEST_SKIP_UPDATE_STAGE is checked before
-        // MOZ_TEST_SLOW_SKIP_UPDATE_STAGE in updater.cpp this removes the need
-        // for the continue file to continue staging the update.
-        gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "1");
-      }
+                    queryString + getVersionParams();
+    if (params.backgroundUpdate) {
       setUpdateURL(updateURL);
       gAUS.checkForBackgroundUpdates();
-      await waitForEvent("update-downloaded");
+      if (params.continueFile) {
+        await continueFileHandler(params.continueFile);
+      }
+      if (params.waitForUpdateState) {
+        // Wait until the update state equals the expected value before
+        // displaying the UI.
+        await TestUtils.waitForCondition(() =>
+          (gUpdateManager.activeUpdate &&
+           gUpdateManager.activeUpdate.state == params.waitForUpdateState),
+          "Waiting for update state: " + params.waitForUpdateState,
+          undefined, 200
+        ).catch(e => {
+          // Instead of throwing let the check below fail the test so the panel
+          // ID and the expected panel ID is printed in the log.
+          logTestInfo(e);
+        });
+        is(gUpdateManager.activeUpdate.state, params.waitForUpdateState,
+           "The update state value should equal " + params.waitForUpdateState);
+      }
     } else {
       updateURL += "&slowUpdateCheck=1&useSlowDownloadMar=1";
       setUpdateURL(updateURL);
     }
 
     tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
                                                       "about:preferences");
     registerCleanupFunction(async () => {
       await BrowserTestUtils.removeTab(tab);
     });
 
+    // Scroll the UI into view so it is easier to troubleshoot tests.
+    await ContentTask.spawn(tab.linkedBrowser, null, async () => {
+      content.document.getElementById("updatesCategory").scrollIntoView();
+    });
+
     for (let step of steps) {
       await processAboutPrefsStep(step);
     }
   })();
 }
 
-
 /**
  * Removes the modified update-settings.ini file so the updater will fail to
  * stage an update.
  */
 function removeUpdateSettingsIni() {
   if (Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED)) {
     let greDir = getGREDir();
     let updateSettingsIniBak = greDir.clone();