Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 29 Jan 2013 12:09:11 -0500
changeset 130120 bbc1e6ebad1ec320fd87333f29676e9e5e7a9237
parent 130119 cd02b8d5653c459b1adedcfa916feba47485e8b6 (current diff)
parent 130069 126f887730f5c42c1363f61b0646f8e546bb5a4c (diff)
child 130121 37c3114841858388b84e8762ce5489f4b5e8a0b4
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone21.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
Merge m-c to inbound.
--- a/toolkit/mozapps/update/test/unit/head_update.js.in
+++ b/toolkit/mozapps/update/test/unit/head_update.js.in
@@ -298,16 +298,27 @@ var DEBUG_AUS_TEST = true;
 #include ../shared.js
 
 #ifdef MOZ_MAINTENANCE_SERVICE
 const STATE_APPLIED_PLATFORM = STATE_APPLIED_SVC;
 #else
 const STATE_APPLIED_PLATFORM = STATE_APPLIED;
 #endif
 
+// This makes it possible to run most tests on xulrunner where the update
+// channel default preference is not set.
+if (APP_BIN_NAME == "xulrunner") {
+  try {
+    gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
+  }
+  catch (e) {
+    setUpdateChannel("test_channel");
+  }
+}
+
 /**
  * Nulls out the most commonly used global vars used by tests as appropriate.
  */
 function cleanUp() {
   removeUpdateDirsAndFiles();
 
   // Force the update manager to reload the update data to prevent it from
   // writing the old data to the files that have just been removed.
@@ -331,17 +342,17 @@ function cleanUp() {
     // null out the event handlers to prevent a mFreeCount leak of 1
     gXHR.onerror     = null;
     gXHR.onload      = null;
     gXHR.onprogress  = null;
 
     gXHR             = null;
   }
 
-  gTestserver    = null;
+  gTestserver = null;
 }
 
 /**
  * Sets the most commonly used preferences used by tests
  */
 function setDefaultPrefs() {
   Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
   // Don't display UI for a successful installation. Some apps may not set this
--- a/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
@@ -18,23 +18,28 @@ const FILE_UPDATER_INI_BAK = "updater.in
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
-const APP_TIMER_TIMEOUT = 20000;
+const APP_TIMER_TIMEOUT = 120000;
 
 let gAppTimer;
 let gProcess;
 let gTimeoutRuns = 0;
 
 function run_test() {
+  if (APP_BIN_NAME == "xulrunner") {
+    logTestInfo("Unable to run this test on xulrunner");
+    return;
+  }
+
   do_test_pending();
   do_register_cleanup(end_test);
 
   removeUpdateDirsAndFiles();
 
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
@@ -21,17 +21,17 @@ const FILE_UPDATER_INI_BAK = "updater.in
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
-const APP_TIMER_TIMEOUT = 20000;
+const APP_TIMER_TIMEOUT = 120000;
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
 // Override getUpdatesRootDir on Mac because we need to apply the update
 // inside the bundle directory.
@@ -96,16 +96,21 @@ function symlinkUpdateFilesIntoBundleDir
 
   // Now, make sure that getUpdatesRootDir returns the application bundle
   // directory, to make the various stuff in the test framework to work
   // correctly.
   getUpdatesRootDir = getAppDir;
 }
 
 function run_test() {
+  if (APP_BIN_NAME == "xulrunner") {
+    logTestInfo("Unable to run this test on xulrunner");
+    return;
+  }
+
   do_test_pending();
   do_register_cleanup(end_test);
 
   if (IS_WIN) {
     Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
   }
 
   removeUpdateDirsAndFiles();
--- a/toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
+++ b/toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
@@ -92,16 +92,21 @@ function symlinkUpdateFilesIntoBundleDir
 
   // Now, make sure that getUpdatesRootDir returns the application bundle
   // directory, to make the various stuff in the test framework to work
   // correctly.
   getUpdatesRootDir = getAppDir;
 }
 
 function run_test() {
+  if (APP_BIN_NAME == "xulrunner") {
+    logTestInfo("Unable to run this test on xulrunner");
+    return;
+  }
+
   do_test_pending();
   do_register_cleanup(end_test);
 
   removeUpdateDirsAndFiles();
 
   symlinkUpdateFilesIntoBundleDirectory();
   if (IS_WIN) {
     adjustPathsOnWindows();
--- a/toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
@@ -27,17 +27,17 @@ const FILE_UPDATER_INI_BAK = "updater.in
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
-const APP_TIMER_TIMEOUT = 20000;
+const APP_TIMER_TIMEOUT = 120000;
 
 Components.utils.import("resource://gre/modules/ctypes.jsm");
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
@@ -104,16 +104,21 @@ function symlinkUpdateFilesIntoBundleDir
 
   // Now, make sure that getUpdatesRootDir returns the application bundle
   // directory, to make the various stuff in the test framework to work
   // correctly.
   getUpdatesRootDir = getAppDir;
 }
 
 function run_test() {
+  if (APP_BIN_NAME == "xulrunner") {
+    logTestInfo("Unable to run this test on xulrunner");
+    return;
+  }
+
   do_test_pending();
   do_register_cleanup(end_test);
 
   if (IS_WIN) {
     Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
   }
 
   removeUpdateDirsAndFiles();
--- a/toolkit/mozapps/update/test/unit/test_bug794211.js
+++ b/toolkit/mozapps/update/test/unit/test_bug794211.js
@@ -6,17 +6,16 @@
 /* Offline retry test (Bug 794211) */
 
 // Needs to be in sync w/ nsUpdateService.js
 const NETWORK_ERROR_OFFLINE = 111;
 
 function run_test() {
   do_test_pending();
   do_register_cleanup(end_test);
-  DEBUG_AUS_TEST = true;
 
   logTestInfo("test when an update check fails because the network is " +
               "offline that we check again when the network comes online. " +
               "(Bug 794211)");
   removeUpdateDirsAndFiles();
   setUpdateURLOverride();
   Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, false);
 
--- a/toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
@@ -21,17 +21,17 @@ const FILE_UPDATER_INI_BAK = "updater.in
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
-const APP_TIMER_TIMEOUT = 20000;
+const APP_TIMER_TIMEOUT = 120000;
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
 // Override getUpdatesRootDir on Mac because we need to apply the update
 // inside the bundle directory.
--- a/toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
@@ -27,17 +27,17 @@ const FILE_UPDATER_INI_BAK = "updater.in
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
-const APP_TIMER_TIMEOUT = 20000;
+const APP_TIMER_TIMEOUT = 120000;
 
 Components.utils.import("resource://gre/modules/ctypes.jsm");
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;