Bug 1546265 - Fixes for the About Dialog and About Preferences BITS download failure tests. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 24 Apr 2019 18:50:39 +0000
changeset 530009 41ac1be62749371f9eefbfd6c3d8ab0747efac8e
parent 530008 c66792afc2c28ae0a555c73f4e34b87435f1f7b6
child 530010 92e638c435da77351cd0d9900d9e0d9bf85a610f
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1546265
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 1546265 - Fixes for the About Dialog and About Preferences BITS download failure tests. r=bytesized Adds a new step parameter for download information named downloadInfo. Adds checks for both nsIIncrementalDownload and BITS download result codes. Makes 8 tests run using BITS for the update download. Adds test tags for bits and internal browser chrome tests. Removes the duplicate logging from UpdateService.jsm when running tests locally. Differential Revision: https://phabricator.services.mozilla.com/D28602
toolkit/mozapps/update/UpdateService.jsm
toolkit/mozapps/update/tests/browser/browser.bits.ini
toolkit/mozapps/update/tests/browser/browser.ini
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_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/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -621,17 +621,19 @@ function getCanUseBits() {
  * Logs a string to the error console. If enabled, also logs to the update
  * messages file.
  * @param   string
  *          The string to write to the error console.
  */
 function LOG(string) {
   if (gLogEnabled) {
     dump("*** AUS:SVC " + string + "\n");
-    Services.console.logStringMessage("AUS:SVC " + string);
+    if (!Cu.isInAutomation) {
+      Services.console.logStringMessage("AUS:SVC " + string);
+    }
 
     if (gLogfileEnabled) {
       if (!gLogfileWritePromise) {
         let logfile = Services.dirsvc.get(KEY_PROFILE_DIR, Ci.nsIFile);
         logfile.append(FILE_UPDATE_MESSAGES);
         gLogfileWritePromise = OS.File.open(logfile.path,
                                             {write: true, append: true})
                                .catch(error => {
--- a/toolkit/mozapps/update/tests/browser/browser.bits.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.bits.ini
@@ -1,13 +1,13 @@
 [DEFAULT]
 skip-if = debug || os != 'win'
 reason = Debug builds leak (Bug 1546287) and BITS is only available on Windows.
 dupe-manifest =
-tags = appupdate
+tags = appupdate bits
 head = head.js
 support-files =
   ../data/shared.js
   ../data/sharedUpdateXML.js
   app_update.sjs
   downloadPage.html
   testConstants.js
 
@@ -19,24 +19,32 @@ prefs =
 
 # About Dialog Application Update Tests
 [browser_aboutDialog_bc_downloaded.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_downloaded.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]
 
 # Doorhanger Application Update Tests
 [browser_doorhanger_bc_downloaded.js]
 [browser_doorhanger_bc_downloaded_staged.js]
 [browser_doorhanger_bc_downloadOptIn.js]
 [browser_doorhanger_bc_downloadOptIn_staging.js]
 [browser_doorhanger_sp_patch_partialApplyFailure_complete.js]
 [browser_doorhanger_sp_patch_partialApplyFailure_complete_staging.js]
--- a/toolkit/mozapps/update/tests/browser/browser.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.ini
@@ -1,11 +1,11 @@
 [DEFAULT]
 dupe-manifest =
-tags = appupdate
+tags = appupdate internal
 head = head.js
 support-files =
   ../data/shared.js
   ../data/sharedUpdateXML.js
   app_update.sjs
   downloadPage.html
   testConstants.js
 prefs =
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
@@ -1,29 +1,39 @@
 /* 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 automatic download.
 add_task(async function aboutDialog_foregroundCheck_downloadAuto() {
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutDialogUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
@@ -7,29 +7,39 @@
 // with an automatic download and update staging.
 add_task(async function aboutDialog_foregroundCheck_downloadAuto_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 updateParams = "&invalidCompleteSize=1";
   await runAboutDialogUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "applying",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: CONTINUE_STAGING,
     },
     {
       panelId: "apply",
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
@@ -3,16 +3,25 @@
 
 "use strict";
 
 // Test for About Dialog foreground check for updates
 // with a manual download.
 add_task(async function aboutDialog_foregroundCheck_downloadOptIn() {
   await UpdateUtils.setAppUpdateAutoEnabled(false);
 
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutDialogUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
@@ -21,16 +30,17 @@ add_task(async function aboutDialog_fore
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
       continueFile: null,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: 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
@@ -8,16 +8,25 @@
 add_task(async function aboutDialog_foregroundCheck_downloadOptIn_staging() {
   await SpecialPowers.pushPrefEnv({
     set: [
       [PREF_APP_UPDATE_STAGING_ENABLED, true],
     ],
   });
   await UpdateUtils.setAppUpdateAutoEnabled(false);
 
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutDialogUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
@@ -26,16 +35,17 @@ add_task(async function aboutDialog_fore
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
       continueFile: null,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "applying",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: CONTINUE_STAGING,
     },
     {
       panelId: "apply",
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
@@ -1,27 +1,39 @@
 /* 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 complete bad size patch.
 add_task(async function aboutDialog_foregroundCheck_completeBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "complete",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
@@ -1,27 +1,39 @@
 /* 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 partial bad size patch.
 add_task(async function aboutDialog_foregroundCheck_partialBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- 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
@@ -1,32 +1,43 @@
 /* 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 partial bad size patch and a complete patch.
 add_task(async function aboutDialog_foregroundCheck_partialBadSize_complete() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[2] = {patchType: "complete",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "complete",
+                       internalResult: "0"};
+  }
+
   let updateParams = "&invalidPartialSize=1";
   await runAboutDialogUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
-    },
-    {
-      panelId: "downloading",
-      checkActiveUpdate: {state: STATE_DOWNLOADING},
-      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- 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
@@ -1,32 +1,45 @@
 /* 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 partial bad size patch and a complete bad size patch.
 add_task(async function aboutDialog_foregroundCheck_partialBadSize_completeBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[2] = {patchType: "complete",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[3] = {patchType: "complete",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
-    },
-    {
-      panelId: "downloading",
-      checkActiveUpdate: {state: STATE_DOWNLOADING},
-      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
@@ -1,29 +1,39 @@
 /* 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 automatic download.
 add_task(async function aboutPrefs_foregroundCheck_downloadAuto() {
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutPrefsUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
@@ -7,29 +7,39 @@
 // with an automatic download and update staging.
 add_task(async function aboutPrefs_foregroundCheck_downloadAuto_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 updateParams = "&invalidCompleteSize=1";
   await runAboutPrefsUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "applying",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: CONTINUE_STAGING,
     },
     {
       panelId: "apply",
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
@@ -3,16 +3,25 @@
 
 "use strict";
 
 // Test for about:preferences foreground check for updates
 // with a manual download.
 add_task(async function aboutPrefs_foregroundCheck_downloadOptIn() {
   await UpdateUtils.setAppUpdateAutoEnabled(false);
 
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutPrefsUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
@@ -21,16 +30,17 @@ add_task(async function aboutPrefs_foreg
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
       continueFile: null,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: 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
@@ -8,16 +8,25 @@
 add_task(async function aboutPrefs_foregroundCheck_downloadOptIn_staging() {
   await SpecialPowers.pushPrefEnv({
     set: [
       [PREF_APP_UPDATE_STAGING_ENABLED, true],
     ],
   });
   await UpdateUtils.setAppUpdateAutoEnabled(false);
 
+  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 updateParams = "&invalidCompleteSize=1";
   await runAboutPrefsUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
@@ -26,16 +35,17 @@ add_task(async function aboutPrefs_foreg
       panelId: "downloadAndInstall",
       checkActiveUpdate: null,
       continueFile: null,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "applying",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: CONTINUE_STAGING,
     },
     {
       panelId: "apply",
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
@@ -1,27 +1,39 @@
 /* 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 complete bad size patch.
 add_task(async function aboutPrefs_foregroundCheck_completeBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "complete",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
+++ b/toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
@@ -1,27 +1,39 @@
 /* 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 partial bad size patch.
 add_task(async function aboutPrefs_foregroundCheck_partialBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- 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
@@ -1,32 +1,43 @@
 /* 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 partial bad size patch and a complete patch.
 add_task(async function aboutPrefs_foregroundCheck_partialBadSize_complete() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[2] = {patchType: "complete",
+                       bitsResult: "0"};
+  } else {
+    downloadInfo[0] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "complete",
+                       internalResult: "0"};
+  }
+
   let updateParams = "&invalidPartialSize=1";
   await runAboutPrefsUpdateTest(updateParams, false, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
-    },
-    {
-      panelId: "downloading",
-      checkActiveUpdate: {state: STATE_DOWNLOADING},
-      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "apply",
       checkActiveUpdate: {state: STATE_PENDING},
       continueFile: null,
     },
   ]);
 });
--- 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
@@ -1,32 +1,45 @@
 /* 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 partial bad size patch and a complete bad size patch.
 add_task(async function aboutPrefs_foregroundCheck_partialBadSize_completeBadSize() {
+  let downloadInfo = [];
+  if (Services.prefs.getBoolPref(PREF_APP_UPDATE_BITS_ENABLED)) {
+    downloadInfo[0] = {patchType: "partial",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[1] = {patchType: "partial",
+                       internalResult: gBadSizeResult};
+    downloadInfo[2] = {patchType: "complete",
+                       bitsResult: gBadSizeResult};
+    downloadInfo[3] = {patchType: "complete",
+                       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, [
     {
       panelId: "checkingForUpdates",
       checkActiveUpdate: null,
       continueFile: CONTINUE_CHECK,
     },
     {
       panelId: "downloading",
       checkActiveUpdate: {state: STATE_DOWNLOADING},
       continueFile: CONTINUE_DOWNLOAD,
-    },
-    {
-      panelId: "downloading",
-      checkActiveUpdate: {state: STATE_DOWNLOADING},
-      continueFile: CONTINUE_DOWNLOAD,
+      downloadInfo,
     },
     {
       panelId: "downloadFailed",
       checkActiveUpdate: null,
       continueFile: null,
     },
   ]);
 });
--- a/toolkit/mozapps/update/tests/browser/head.js
+++ b/toolkit/mozapps/update/tests/browser/head.js
@@ -22,16 +22,18 @@ const MAX_UPDATE_COPY_ATTEMPTS = 10;
 const DATA_URI_SPEC =
   "chrome://mochitests/content/browser/toolkit/mozapps/update/tests/browser/";
 /* import-globals-from testConstants.js */
 Services.scriptloader.loadSubScript(DATA_URI_SPEC + "testConstants.js", this);
 
 var gURLData = URL_HOST + "/" + REL_PATH_DATA;
 const URL_MANUAL_UPDATE = gURLData + "downloadPage.html";
 
+const gBadSizeResult = Cr.NS_ERROR_UNEXPECTED.toString();
+
 /* import-globals-from ../data/shared.js */
 Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this);
 
 let gOriginalUpdateAutoValue = null;
 
 // Set to true to log additional information for debugging. To log additional
 // information for individual tests set gDebugTest to false here and to true in
 // the test's onload function.
@@ -598,16 +600,36 @@ function waitForAboutDialog() {
     };
 
     Services.wm.addListener(listener);
     openAboutDialog();
   });
 }
 
 /**
+ * Return the first UpdatePatch with the given type.
+ *
+ * @param   type
+ *          The type of the patch ("complete" or "partial")
+ * @return  A nsIUpdatePatch object matching the type specified
+ */
+function getPatchOfType(type) {
+  let update = gUpdateManager.activeUpdate;
+  if (update) {
+    for (let i = 0; i < update.patchCount; ++i) {
+      let patch = update.getPatchAt(i);
+      if (patch && patch.type == type) {
+        return patch;
+      }
+    }
+  }
+  return null;
+}
+
+/**
  * 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.
@@ -621,37 +643,59 @@ function runAboutDialogUpdateTest(update
   // code can be changed so URL_HOST already has a trailing /.
   let detailsURL = URL_HOST + "/";
   let aboutDialog;
   function processAboutDialogStep(step) {
     if (typeof(step) == "function") {
       return step();
     }
 
-    const {panelId, checkActiveUpdate, continueFile} = step;
+    const {panelId, checkActiveUpdate, continueFile, downloadInfo} = step;
     return (async function() {
       let updateDeck = aboutDialog.document.getElementById("updateDeck");
       await BrowserTestUtils.waitForCondition(() =>
         (updateDeck.selectedPanel && updateDeck.selectedPanel.id == panelId),
         "Waiting for expected panel ID - got: \"" +
-        updateDeck.selectedPanel.id + "\", expected \"" + panelId + "\"",
+        updateDeck.selectedPanel.id + "\", expected: \"" + panelId + "\"",
         undefined, 200);
       let selectedPanel = updateDeck.selectedPanel;
       is(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 (continueFile) {
+      if (panelId == "downloading") {
+        for (let i = 0; i < downloadInfo.length; ++i) {
+          let info = downloadInfo[i];
+          // The About Dialog tests always specify a continue file.
+          await continueFileHandler(continueFile);
+          let patch = getPatchOfType(info.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";
+            patch.QueryInterface(Ci.nsIWritablePropertyBag);
+            await BrowserTestUtils.waitForCondition(() =>
+              (patch.getProperty(resultName) == info[resultName]),
+              "Waiting for expected patch property " + resultName + " value " +
+              "- got: \"" + patch.getProperty(resultName) + "\", expected: \"" +
+              info[resultName] + "\"", undefined, 200);
+            is(patch.getProperty(resultName), info[resultName],
+               "The patch property " + resultName + " value should equal " +
+               info[resultName]);
+          }
+        }
+      } else if (continueFile) {
         await continueFileHandler(continueFile);
       }
 
       let linkPanels = ["downloadFailed", "manualUpdate", "unsupportedSystem"];
       if (linkPanels.includes(panelId)) {
         // The unsupportedSystem panel uses the update's detailsURL and the
         // downloadFailed and manualUpdate panels use the app.update.url.manual
         // preference.
@@ -734,40 +778,62 @@ function runAboutPrefsUpdateTest(updateP
   // code can be changed so URL_HOST already has a trailing /.
   let detailsURL = URL_HOST + "/";
   let tab;
   function processAboutPrefsStep(step) {
     if (typeof(step) == "function") {
       return step();
     }
 
-    const {panelId, checkActiveUpdate, continueFile} = step;
+    const {panelId, checkActiveUpdate, continueFile, downloadInfo} = step;
     return (async function() {
       await ContentTask.spawn(tab.linkedBrowser, {panelId},
                               async ({panelId}) => {
         let updateDeck = content.document.getElementById("updateDeck");
         await ContentTaskUtils.waitForCondition(() =>
           (updateDeck.selectedPanel && updateDeck.selectedPanel.id == panelId),
           "Waiting for expected panel ID - got: \"" +
-          updateDeck.selectedPanel.id + "\", expected \"" + panelId + "\"",
+          updateDeck.selectedPanel.id + "\", expected: \"" + panelId + "\"",
           undefined, 200);
         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 (continueFile) {
+      if (panelId == "downloading") {
+        for (let i = 0; i < downloadInfo.length; ++i) {
+          let info = downloadInfo[i];
+          // The About Dialog tests always specify a continue file.
+          await continueFileHandler(continueFile);
+          let patch = getPatchOfType(info.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";
+            patch.QueryInterface(Ci.nsIWritablePropertyBag);
+            await BrowserTestUtils.waitForCondition(() =>
+              (patch.getProperty(resultName) == info[resultName]),
+              "Waiting for expected patch property " + resultName + " value " +
+              "- got: \"" + patch.getProperty(resultName) + "\", expected: \"" +
+              info[resultName] + "\"", undefined, 200);
+            is(patch.getProperty(resultName), info[resultName],
+               "The patch property " + resultName + " value should equal " +
+               info[resultName]);
+          }
+        }
+      } else if (continueFile) {
         await continueFileHandler(continueFile);
       }
 
       await ContentTask.spawn(tab.linkedBrowser, {panelId, detailsURL},
                               async ({panelId, detailsURL}) => {
         let linkPanels = ["downloadFailed", "manualUpdate", "unsupportedSystem"];
         if (linkPanels.includes(panelId)) {
           let selectedPanel =