Bug 1540188 - app update BITS successful download tests. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 23 Apr 2019 16:31:23 +0000
changeset 470514 902921194cfe103f48acb8f4404ca8713a9df7a1
parent 470513 71d205b6e9c7380a9f86736627bbefd8c020c0cd
child 470515 6ed35343aea0f8d44fda91cafd752bd82df530ea
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1540188
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 1540188 - app update BITS successful download tests. r=bytesized Changes the tests to use http://127.0.0.1:8888 so BITS can download updates. Adds a new browser chrome test manifest named browser.bits.ini for BITS tests. Currently only the tests with a successful udate download pass. The other tests will be fixed in different bugs. Currently debug builds leak when downloading with BITS so running these tests on debug builds is disabled. This will be fixed in a different bug. Differential Revision: https://phabricator.services.mozilla.com/D28446
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/testConstants.js
toolkit/mozapps/update/tests/moz.build
--- a/toolkit/mozapps/update/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -589,17 +589,17 @@ function getCanUseBits() {
     LOG("getCanUseBits - Not using BITS. Already in use by another user");
     return "NoBits_OtherUser";
   }
   // Firefox support for passing proxies to BITS is still rudimentary.
   // For now, disable BITS support on configurations that are not using the
   // standard system proxy.
   let defaultProxy = Ci.nsIProtocolProxyService.PROXYCONFIG_SYSTEM;
   if (Services.prefs.getIntPref(PREF_NETWORK_PROXY_TYPE, defaultProxy) !=
-      defaultProxy) {
+      defaultProxy && !Cu.isInAutomation) {
     LOG("getCanUseBits - Not using BITS because of proxy usage");
     return "NoBits_Proxy";
   }
   LOG("getCanUseBits - BITS can be used to download updates");
   return "CanUseBits";
 }
 
 /**
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/browser/browser.bits.ini
@@ -0,0 +1,42 @@
+[DEFAULT]
+skip-if = debug || os != 'win'
+reason = Debug builds leak (Bug 1546287) and BITS is only available on Windows.
+dupe-manifest =
+tags = appupdate
+head = head.js
+support-files =
+  ../data/shared.js
+  ../data/sharedUpdateXML.js
+  app_update.sjs
+  downloadPage.html
+  testConstants.js
+
+prefs =
+  app.update.BITS.enabled=true
+
+# BITS Download Tests
+#####################
+
+# 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]
+
+# 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]
+
+# 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,17 +1,20 @@
 [DEFAULT]
+dupe-manifest =
 tags = appupdate
 head = head.js
 support-files =
   ../data/shared.js
   ../data/sharedUpdateXML.js
   app_update.sjs
   downloadPage.html
   testConstants.js
+prefs =
+  app.update.BITS.enabled=false
 
 # About Dialog Application Update Tests
 [browser_aboutDialog_bc_downloaded.js]
 [browser_aboutDialog_bc_downloaded_staged.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]
--- a/toolkit/mozapps/update/tests/browser/testConstants.js
+++ b/toolkit/mozapps/update/tests/browser/testConstants.js
@@ -1,7 +1,7 @@
 const REL_PATH_DATA = "browser/toolkit/mozapps/update/tests/browser/";
-const URL_HOST = "http://example.com";
+const URL_HOST = "http://127.0.0.1:8888";
 const URL_PATH_UPDATE_XML = "/" + REL_PATH_DATA + "app_update.sjs";
 const URL_HTTP_UPDATE_SJS = URL_HOST + URL_PATH_UPDATE_XML;
 const CONTINUE_CHECK = "continueCheck";
 const CONTINUE_DOWNLOAD = "continueDownload";
 const CONTINUE_STAGING = "continueStaging";
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -4,17 +4,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 HAS_MISC_RULE = True
 
 FINAL_TARGET = '_tests/xpcshell/toolkit/mozapps/update/tests/data'
 
 if not CONFIG['MOZ_SUITE']:
-  BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
+    BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
+    if CONFIG['OS_ARCH'] == 'WINNT':
+        BROWSER_CHROME_MANIFESTS += ['browser/browser.bits.ini']
 
 MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
 
 XPCSHELL_TESTS_MANIFESTS += [
     'unit_aus_update/xpcshell.ini',
     'unit_base_updater/xpcshell.ini'
 ]