Bug 806205 - browser_bug435325.js test fails, r=IanN, a=InvisibleSmiley
authorFrank Wein <mcsmurf@mcsmurf.de>
Thu, 01 Nov 2012 14:43:12 +0100
changeset 12537 34d83739a9e9f4b316bbb81c09c620285dbdf8dc
parent 12536 17463a75b6dee8158c6777656d57777e1a4dc42c
child 12538 b06f46e08996fd7fa05a81b9c96ea00a6bbafd26
push id771
push usermcsmurf@mcsmurf.de
push dateThu, 01 Nov 2012 13:43:47 +0000
treeherdercomm-aurora@34d83739a9e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, InvisibleSmiley
bugs806205, 435325
Bug 806205 - browser_bug435325.js test fails, r=IanN, a=InvisibleSmiley
suite/browser/test/browser/browser_bug435325.js
--- a/suite/browser/test/browser/browser_bug435325.js
+++ b/suite/browser/test/browser/browser_bug435325.js
@@ -1,20 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* Ensure that clicking the button in the Offline mode neterror page makes the browser go online. See bug 435325. */
 
+let proxyPrefValue;
+
 function test() {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
   window.addEventListener("DOMContentLoaded", checkPage, false);
 
-  // Go offline and disable the cache, then try to load the test URL.
+
+  // Tests always connect to localhost, and per bug 87717, localhost is now
+  // reachable in offline mode.  To avoid this, disable any proxy.
+  proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
+  Services.prefs.setIntPref("network.proxy.type", 0);
+
+  // Go offline and disable the proxy and cache, then try to load the test URL.
   Services.io.offline = true;
   Services.prefs.setBoolPref("browser.cache.disk.enable", false);
   Services.prefs.setBoolPref("browser.cache.memory.enable", false);
   content.location = "http://example.com/";
 }
 
 function checkPage() {
   if(content.location == "about:blank") {
@@ -35,13 +43,14 @@ function checkPage() {
 
   ok(!Services.io.offline, "After clicking the Try Again button, we're back " +
                            "online.");
 
   finish();
 }
 
 registerCleanupFunction(function() {
+  Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
   Services.prefs.setBoolPref("browser.cache.disk.enable", true);
   Services.prefs.setBoolPref("browser.cache.memory.enable", true);
   Services.io.offline = false;
   gBrowser.removeCurrentTab();
 });