Bug 679157: browser_select_confirm.js tests fail on aurora. r=Unfocused
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 15 Aug 2011 16:10:53 -0700
changeset 75337 01ce7e95d7b7dff50e519345295ffa383e595e67
parent 75336 7f2895987cb7126473f1cf65154a0226b4bd479d
child 75338 b02e49916a3e3a9e2afde0ae250414455e2e49e2
push id21006
push userkhuey@mozilla.com
push dateTue, 16 Aug 2011 10:55:53 +0000
treeherdermozilla-central@35657230a209 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs679157
milestone8.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 679157: browser_select_confirm.js tests fail on aurora. r=Unfocused
toolkit/mozapps/extensions/test/browser/browser_bug557956.js
toolkit/mozapps/extensions/test/browser/head.js
--- a/toolkit/mozapps/extensions/test/browser/browser_bug557956.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug557956.js
@@ -25,33 +25,31 @@ const URI_EXTENSION_UPDATE_DIALOG = "chr
 function test() {
   requestLongerTimeout(2);
   waitForExplicitFinish();
 
   run_next_test();
 }
 
 function end_test() {
-  Services.prefs.clearUserPref("extensions.update.url");
-
   // Test generates a lot of available installs so just cancel them all
   AddonManager.getAllInstalls(function(aInstalls) {
     aInstalls.forEach(function(aInstall) {
       aInstall.cancel();
     });
 
     finish();
   });
 }
 
 function install_test_addons(aCallback) {
   var installs = [];
 
   // Use a blank update URL
-  Services.prefs.setCharPref("extensions.update.url", TESTROOT + "missing.rdf");
+  Services.prefs.setCharPref(PREF_UPDATEURL, TESTROOT + "missing.rdf");
 
   ["browser_bug557956_1",
    "browser_bug557956_2",
    "browser_bug557956_3",
    "browser_bug557956_4",
    "browser_bug557956_5",
    "browser_bug557956_6",
    "browser_bug557956_7",
@@ -64,17 +62,17 @@ function install_test_addons(aCallback) 
 
   var listener = {
     installCount: 0,
 
     onInstallEnded: function() {
       this.installCount++;
       if (this.installCount == installs.length) {
         // Switch to the test update URL
-        Services.prefs.setCharPref("extensions.update.url", TESTROOT + "browser_bug557956.rdf");
+        Services.prefs.setCharPref(PREF_UPDATEURL, TESTROOT + "browser_bug557956.rdf");
 
         aCallback();
       }
     }
   };
 
   installs.forEach(function(aInstall) {
     aInstall.addListener(listener);
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -15,43 +15,46 @@ pathParts.splice(pathParts.length - 1);
 pathParts.push("browser");
 
 const RELATIVE_DIR = pathParts.slice(4).join("/") + "/";
 
 const TESTROOT = "http://example.com/" + RELATIVE_DIR;
 const TESTROOT2 = "http://example.org/" + RELATIVE_DIR;
 const CHROMEROOT = pathParts.join("/") + "/";
 const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
+const PREF_UPDATEURL = "extensions.update.url";
 
 const MANAGER_URI = "about:addons";
 const INSTALL_URI = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
 const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
 const PREF_SEARCH_MAXRESULTS = "extensions.getAddons.maxResults";
 
 var gPendingTests = [];
 var gTestsRun = 0;
 var gTestStart = null;
 
 var gUseInContentUI = !gTestInWindow && ("switchToTabHavingURI" in window);
 
 var gDiscoveryURL = Services.prefs.getCharPref(PREF_DISCOVERURL);
+var gUpdateURL = Services.prefs.getCharPref(PREF_UPDATEURL);
 
 // Turn logging on for all tests
 Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true);
 // Turn off remote results in searches
 Services.prefs.setIntPref(PREF_SEARCH_MAXRESULTS, 0);
 registerCleanupFunction(function() {
   Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
   try {
     Services.prefs.clearUserPref(PREF_SEARCH_MAXRESULTS);
   }
   catch (e) {
   }
 
   Services.prefs.setCharPref(PREF_DISCOVERURL, gDiscoveryURL);
+  Services.prefs.setCharPref(PREF_UPDATEURL, gUpdateURL);
 
   // Throw an error if the add-ons manager window is open anywhere
   var windows = Services.wm.getEnumerator("Addons:Manager");
   if (windows.hasMoreElements())
     ok(false, "Found unexpected add-ons manager window still open");
   while (windows.hasMoreElements())
     windows.getNext().QueryInterface(Ci.nsIDOMWindow).close();