Debug tests
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 01 Mar 2017 00:33:43 -0800
changeset 491596 2a9211f25411c3b40944e0a636ebd5ef70454603
parent 491595 2f9a4435f40a6b186393a76048a2e948ade6d78f
child 491597 edec6d4a1aa1c42292c87d15544ee40be565829a
child 558432 6941af69c4abb854080cd7264e3a7a52b327de45
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
milestone54.0a1
Debug tests
browser/base/content/test/simpleUpdate/head.js
--- a/browser/base/content/test/simpleUpdate/head.js
+++ b/browser/base/content/test/simpleUpdate/head.js
@@ -1,16 +1,17 @@
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const IS_MACOSX = ("nsILocalFileMac" in Ci);
 const IS_WIN = ("@mozilla.org/windows-registry-key;1" in Cc);
 
 const KEY_UPDROOT         = "UpdRootD";
 
+const PREF_APP_UPDATE_LOG                            = "app.update.log";
 const PREF_APP_UPDATE_URL                            = "app.update.url";
 const PREF_APP_UPDATE_DOORHANGER                     = "app.update.doorhanger";
 const PREF_APP_UPDATE_CHANNEL                        = "app.update.channel";
 const PREF_APP_UPDATE_ENABLED                        = "app.update.enabled";
 const PREF_APP_UPDATE_IDLETIME                       = "app.update.idletime";
 const PREF_APP_UPDATE_URL_DETAILS                    = "app.update.url.details";
 const PREF_APP_RELEASE_NOTES_URL                     = "app.releaseNotesURL";
 const PREF_APP_UPDATE_URL_MANUAL                     = "app.update.url.manual";
@@ -76,16 +77,18 @@ var gURLData = "http://example.com/brows
 
 const DATA_URI_SPEC = "chrome://mochitests/content/browser/browser/base/content/test/simpleUpdate/";
 
 Services.scriptloader.loadSubScript(DATA_URI_SPEC + "sharedUpdateXML.js", this);
 
 const REL_PATH_DATA = "browser/browser/base/content/test/simpleUpdate/";
 const SERVICE_URL = URL_HOST + "/" + REL_PATH_DATA + FILE_SIMPLE_MAR;
 
+var DEBUG_AUS_TEST = true;
+
 XPCOMUtils.defineLazyGetter(this, "gUpdateService", function test_gAUS() {
   return Cc["@mozilla.org/updates/update-service;1"].
          getService(Ci.nsIApplicationUpdateService).
          QueryInterface(Ci.nsITimerCallback).
          QueryInterface(Ci.nsIObserver).
          QueryInterface(Ci.nsIUpdateCheckListener);
 });
 
@@ -394,16 +397,19 @@ function runUpdateTest(updateParams, che
       cleanUpUpdates();
     });
 
     pushPref("Bool", PREF_APP_UPDATE_ENABLED, true);
     pushPref("Int", PREF_APP_UPDATE_IDLETIME, 0);
     pushPref("Char", PREF_APP_RELEASE_NOTES_URL, "http://example.com/{targetVersion}");
     pushPref("Char", PREF_APP_UPDATE_URL_MANUAL, URL_MANUAL_UPDATE);
     pushPref("Int", PREF_APP_UPDATE_REDOWNLOADPROMPTATTEMPTS, 0);
+    if (DEBUG_AUS_TEST) {
+      pushPref("Bool", PREF_APP_UPDATE_LOG, true);
+    }
 
     let url = URL_HTTP_UPDATE_SJS +
               "?" + updateParams +
               getVersionParams();
 
     setUpdateURL(url);
 
     executeSoon(() => {
@@ -423,16 +429,19 @@ function runUpdateTest(updateParams, che
 }
 
 function runUpdateProcessingTest(updates, steps) {
   return Task.spawn(function*() {
     pushPref("Bool", PREF_APP_UPDATE_ENABLED, true);
     pushPref("Int", PREF_APP_UPDATE_IDLETIME, 0);
     pushPref("Char", PREF_APP_RELEASE_NOTES_URL, "http://example.com/{targetVersion}");
     pushPref("Char", PREF_APP_UPDATE_URL_MANUAL, URL_MANUAL_UPDATE);
+    if (DEBUG_AUS_TEST) {
+      pushPref("Bool", PREF_APP_UPDATE_LOG, true);
+    }
 
     registerCleanupFunction(() => {
       popPrefs();
       gMenuButtonUpdateBadge.reset();
       cleanUpUpdates();
     });
 
     pushPref("Bool", PREF_APP_UPDATE_ENABLED, true);