Bug 544097 Chaning mochitests to run against mochi.test instead of localhost r=ted, waldo, dwitte p=jmaher. Landed on CLOSED TREE
authorJoel Maher <jmaher@mozilla.com>
Fri, 12 Mar 2010 13:53:36 -0800
changeset 39363 29810a1281ee680225c5b810ff1a4071ec03f5ae
parent 39362 ba56722f2e69feb0dbbd9ddef5309d42fac8a1ff
child 39364 990568a068b1ee9f8a450d3c0a880e25680eaa14
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, waldo, dwitte
bugs544097
milestone1.9.3a3pre
Bug 544097 Chaning mochitests to run against mochi.test instead of localhost r=ted, waldo, dwitte p=jmaher. Landed on CLOSED TREE
accessible/tests/mochitest/tree/test_combobox.xul
browser/base/content/test/browser_bug329212.js
browser/base/content/test/browser_bug416661.js
browser/base/content/test/browser_bug479408.js
browser/base/content/test/browser_relatedTabs.js
browser/base/content/test/test_offlineNotification.html
browser/base/content/test/test_offline_gzip.html
browser/components/feeds/test/chrome/test_423060.xul
browser/components/feeds/test/test_registerHandler.html
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadmonitor.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js
browser/components/search/test/426329.xml
browser/components/search/test/483086-1.xml
browser/components/search/test/483086-2.xml
browser/components/search/test/browser_415700.js
browser/components/search/test/browser_426329.js
browser/components/search/test/browser_483086.js
browser/components/search/test/testEngine.xml
browser/components/sessionstore/test/browser/browser_248970_a.js
browser/components/sessionstore/test/browser/browser_248970_b.js
browser/components/sessionstore/test/browser/browser_339445.js
browser/components/sessionstore/test/browser/browser_423132.js
browser/components/sessionstore/test/browser/browser_447951.js
browser/components/sessionstore/test/browser/browser_459906.js
browser/components/sessionstore/test/browser/browser_461743.js
browser/components/sessionstore/test/browser/browser_463205_sample.html
browser/components/sessionstore/test/browser/browser_463206.js
browser/components/sessionstore/test/browser/browser_464620_a.html
browser/components/sessionstore/test/browser/browser_464620_a.js
browser/components/sessionstore/test/browser/browser_464620_b.html
browser/components/sessionstore/test/browser/browser_464620_b.js
browser/components/sessionstore/test/browser/browser_466937.js
browser/components/sessionstore/test/browser/browser_476161.js
browser/components/sessionstore/test/browser/browser_480893.js
build/automation.py.in
build/leaktest.py.in
build/pgo/server-locations.txt
content/base/test/bug461735-redirect2.sjs
content/base/test/chrome/test_bug421622.xul
content/base/test/file_CSP.sjs
content/base/test/file_CSP_frameancestors_main.js
content/base/test/file_CSP_main.js
content/base/test/file_CrossSiteXHR_inner.html
content/base/test/file_CrossSiteXHR_inner.jar
content/base/test/file_htmlserializer_1_links.html
content/base/test/file_xhtmlserializer_1.xhtml
content/base/test/file_xhtmlserializer_1_links.xhtml
content/base/test/test_CSP.html
content/base/test/test_CrossSiteXHR.html
content/base/test/test_CrossSiteXHR_cache.html
content/base/test/test_XHRDocURI.html
content/base/test/test_bug345339.html
content/base/test/test_bug398243.html
content/base/test/test_bug422403-1.html
content/base/test/test_bug422537.html
content/base/test/test_bug424359-1.html
content/base/test/test_bug461735.html
content/base/test/test_bug475156.html
content/html/content/test/file_bug209275_3.html
content/html/content/test/test_bug209275.xhtml
content/html/content/test/test_bug353415-1.html
content/html/content/test/test_bug353415-2.html
content/html/content/test/test_bug392567.html
content/html/document/test/bug196523-subframe.html
content/html/document/test/test_bug445004.html
content/media/test/dynamic_redirect.sjs
content/media/test/test_delay_load.html
content/media/test/test_mixed_principals.html
content/xbl/test/file_bug379959_cross.html
content/xbl/test/file_bug379959_data.html
content/xbl/test/test_bug379959.html
docshell/test/chrome/bug215405_window.xul
docshell/test/chrome/bug92598_window.xul
docshell/test/chrome/docshell_helpers.js
docshell/test/test_bug369814.html
docshell/test/test_bug529119-1.html
docshell/test/test_bug529119-2.html
docshell/test/test_bug94514.html
dom/tests/mochitest/ajax/offline/445544.cacheManifest
dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest
dom/tests/mochitest/ajax/offline/fallback.cacheManifest
dom/tests/mochitest/ajax/offline/foreign2.html
dom/tests/mochitest/ajax/offline/manifestRedirect.sjs
dom/tests/mochitest/ajax/offline/missingFile.cacheManifest
dom/tests/mochitest/ajax/offline/obsolete.html
dom/tests/mochitest/ajax/offline/overlap.cacheManifest
dom/tests/mochitest/ajax/offline/redirects.sjs
dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest
dom/tests/mochitest/ajax/offline/simpleManifest.notmanifest
dom/tests/mochitest/ajax/offline/test_badManifestMagic.html
dom/tests/mochitest/ajax/offline/test_badManifestMime.html
dom/tests/mochitest/ajax/offline/test_bug460353.html
dom/tests/mochitest/ajax/offline/test_bug474696.html
dom/tests/mochitest/ajax/offline/test_changingManifest.html
dom/tests/mochitest/ajax/offline/test_fallback.html
dom/tests/mochitest/ajax/offline/test_foreign.html
dom/tests/mochitest/ajax/offline/test_identicalManifest.html
dom/tests/mochitest/ajax/offline/test_missingFile.html
dom/tests/mochitest/ajax/offline/test_noManifest.html
dom/tests/mochitest/ajax/offline/test_obsolete.html
dom/tests/mochitest/ajax/offline/test_offlineIFrame.html
dom/tests/mochitest/ajax/offline/test_offlineMode.html
dom/tests/mochitest/ajax/offline/test_overlap.html
dom/tests/mochitest/ajax/offline/test_redirectManifest.html
dom/tests/mochitest/ajax/offline/test_redirectUpdateItem.html
dom/tests/mochitest/ajax/offline/test_refetchManifest.html
dom/tests/mochitest/ajax/offline/test_simpleManifest.html
dom/tests/mochitest/ajax/offline/test_updatingManifest.html
dom/tests/mochitest/ajax/offline/test_xhtmlManifest.xhtml
dom/tests/mochitest/ajax/offline/updatingImplicit.html
dom/tests/mochitest/ajax/offline/updatingManifest.sjs
dom/tests/mochitest/bugs/bug346659-echoer.html
dom/tests/mochitest/bugs/bug346659-opener-echoer.html
dom/tests/mochitest/bugs/bug346659-opener.html
dom/tests/mochitest/bugs/bug346659-parent-echoer.html
dom/tests/mochitest/bugs/bug346659-parent.html
dom/tests/mochitest/bugs/child_bug260264.html
dom/tests/mochitest/bugs/file_bug504862.html
dom/tests/mochitest/bugs/iframe_bug407839-1.html
dom/tests/mochitest/bugs/iframe_bug407839-2.html
dom/tests/mochitest/bugs/iframe_bug409349.html
dom/tests/mochitest/bugs/iframe_bug424093.html
dom/tests/mochitest/bugs/iframe_bug440572.html
dom/tests/mochitest/bugs/iframe_bug463000.html
dom/tests/mochitest/bugs/test_bug132255.html
dom/tests/mochitest/bugs/test_bug346659.html
dom/tests/mochitest/bugs/test_bug465263.html
dom/tests/mochitest/dom-level0/child_ip_address.html
dom/tests/mochitest/dom-level0/idn_child.html
dom/tests/mochitest/dom-level2-html/test_HTMLDocument03.html
dom/tests/mochitest/geolocation/geolocation_common.js
dom/tests/mochitest/localstorage/frameReplace.html
dom/tests/mochitest/localstorage/interOriginFrame.js
dom/tests/mochitest/localstorage/test_localStorageKeyOrder.html
dom/tests/mochitest/sessionstorage/file_http.html
dom/tests/mochitest/sessionstorage/file_https.html
dom/tests/mochitest/sessionstorage/frameReplace.html
dom/tests/mochitest/sessionstorage/interOriginSlave.js
dom/tests/mochitest/sessionstorage/test_sessionStorageClone.html
dom/tests/mochitest/whatwg/postMessage.jar
dom/tests/mochitest/whatwg/postMessage_closed_helper.html
dom/tests/mochitest/whatwg/postMessage_hash.html
dom/tests/mochitest/whatwg/postMessage_helper.html
dom/tests/mochitest/whatwg/postMessage_idn_helper.html
dom/tests/mochitest/whatwg/postMessage_joined_helper.html
dom/tests/mochitest/whatwg/postMessage_onOther.html
dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml
dom/tests/mochitest/whatwg/postMessage_override_helper.html
dom/tests/mochitest/whatwg/postMessage_userpass_helper.html
dom/tests/mochitest/whatwg/test_postMessage.html
dom/tests/mochitest/whatwg/test_postMessage_basehref.html
dom/tests/mochitest/whatwg/test_postMessage_closed.html
dom/tests/mochitest/whatwg/test_postMessage_hash.html
dom/tests/mochitest/whatwg/test_postMessage_jar.html
dom/tests/mochitest/whatwg/test_postMessage_origin.xhtml
dom/tests/mochitest/whatwg/test_postMessage_special.xhtml
dom/tests/mochitest/whatwg/test_postMessage_throw.html
extensions/cookie/test/file_domain_inner.html
extensions/cookie/test/file_domain_inner_inner.html
extensions/cookie/test/file_image_inner.html
extensions/cookie/test/file_image_inner_inner.html
extensions/cookie/test/file_loadflags_inner.html
extensions/cookie/test/file_localhost_inner.html
extensions/cookie/test/file_loopback_inner.html
extensions/cookie/test/file_subdomain_inner.html
extensions/cookie/test/test_same_base_domain_4.html
js/src/xpconnect/tests/mochitest/test_bug504877.html
layout/forms/test/test_bug536567.html
layout/style/test/ccd-quirks.html
modules/libjar/test/mochitest/test_bug403331.html
modules/plugin/test/mochitest/test_getauthenticationinfo.html
netwerk/test/httpserver/httpd.js
security/manager/ssl/tests/mochitest/bugs/test_bug480619.html
security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
testing/mochitest/runtests.py.in
testing/mochitest/server.js
testing/xpcshell/runxpcshelltests.py
toolkit/components/microformats/tests/test_Microformats_hCalendar.html
toolkit/components/microformats/tests/test_Microformats_hCard.html
toolkit/components/passwordmgr/test/pwmgr_common.js
toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
toolkit/components/passwordmgr/test/test_basic_form_observer_foundLogins.html
toolkit/components/passwordmgr/test/test_basic_form_pwonly.html
toolkit/components/passwordmgr/test/test_bug_360493_1.html
toolkit/components/passwordmgr/test/test_bug_427033.html
toolkit/components/passwordmgr/test/test_bug_444968.html
toolkit/components/passwordmgr/test/test_notifications.html
toolkit/components/passwordmgr/test/test_prompt.html
toolkit/components/passwordmgr/test/test_prompt_async.html
toolkit/components/passwordmgr/test/test_xhr.html
toolkit/components/passwordmgr/test/test_xml_load.html
toolkit/components/places/tests/chrome/test_329534.xul
toolkit/components/places/tests/chrome/test_341972a.xul
toolkit/components/places/tests/chrome/test_342484.xul
toolkit/components/places/tests/chrome/test_381357.xul
toolkit/components/places/tests/mochitest/test_bug_461710.html
toolkit/content/tests/browser/browser_bug471962.js
toolkit/mozapps/downloads/tests/chrome/test_unkownContentType_dialog_layout.xul
uriloader/exthandler/tests/mochitest/handlerApps.js
widget/tests/test_bug429954.xul
--- a/accessible/tests/mochitest/tree/test_combobox.xul
+++ b/accessible/tests/mochitest/tree/test_combobox.xul
@@ -170,17 +170,17 @@
         <menupopup>
           <menuitem label="item"/>
           <menuitem label="item"/>
         </menupopup>
       </menulist>
 
       <textbox id="autocomplete" type="autocomplete"
                autocompletesearch="history"
-               value="http://localhost:8888/redirect-a11y.html"/>
+               value="http://mochi.test:8888/redirect-a11y.html"/>
 
       <textbox id="autocomplete2" type="autocomplete">
         <menupopup>
           <menuitem label="item1"/>
         </menupopup>
       </textbox>
     </vbox>
   </hbox>
--- a/browser/base/content/test/browser_bug329212.js
+++ b/browser/base/content/test/browser_bug329212.js
@@ -28,11 +28,11 @@ function test () {
 
     ok(!FillInHTMLTooltip(doc.getElementById("text5"), "should not get title"));
 
     gBrowser.removeCurrentTab();
     finish();
   }, true);
 
   content.location = 
-    "http://localhost:8888/browser/browser/base/content/test/title_test.svg";
+    "http://mochi.test:8888/browser/browser/base/content/test/title_test.svg";
 }
 
--- a/browser/base/content/test/browser_bug416661.js
+++ b/browser/base/content/test/browser_bug416661.js
@@ -6,28 +6,28 @@ function start_test_prefNotSet() {
   is(ZoomManager.zoom, 1, "initial zoom level should be 1");
   FullZoom.enlarge();
 
   //capture the zoom level to test later
   zoomLevel = ZoomManager.zoom;
   isnot(zoomLevel, 1, "zoom level should have changed");
 
   content.location = 
-    "http://localhost:8888/browser/browser/base/content/test/moz.png";
+    "http://mochi.test:8888/browser/browser/base/content/test/moz.png";
 }
 
 function continue_test_prefNotSet () {
   tabElm.linkedBrowser.removeEventListener("load", continue_test_prefNotSet, true);
   tabElm.linkedBrowser.addEventListener("load", end_test_prefNotSet, true);
 
   is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
   FullZoom.reset();
 
   content.location = 
-    "http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
+    "http://mochi.test:8888/browser/browser/base/content/test/zoom_test.html";
 }
 
 function end_test_prefNotSet() {
   tabElm.linkedBrowser.removeEventListener("load", end_test_prefNotSet, true);
   is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted");
 
   // Reset the zoom so that other tests have a fresh zoom level
   FullZoom.reset();
@@ -39,11 +39,11 @@ function end_test_prefNotSet() {
 function test() {
   waitForExplicitFinish();
 
   tabElm = gBrowser.addTab();
   gBrowser.selectedTab = tabElm;
   tabElm.linkedBrowser.addEventListener("load", start_test_prefNotSet, true);
 
   content.location = 
-    "http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
+    "http://mochi.test:8888/browser/browser/base/content/test/zoom_test.html";
 
 }
--- a/browser/base/content/test/browser_bug479408.js
+++ b/browser/base/content/test/browser_bug479408.js
@@ -1,12 +1,12 @@
 function test() {
   waitForExplicitFinish();
   let tab = gBrowser.selectedTab = gBrowser.addTab(
-    "http://localhost:8888/browser/browser/base/content/test/browser_bug479408_sample.html");
+    "http://mochi.test:8888/browser/browser/base/content/test/browser_bug479408_sample.html");
   
   gBrowser.addEventListener("DOMLinkAdded", function(aEvent) {
     gBrowser.removeEventListener("DOMLinkAdded", arguments.callee, true);
     
     executeSoon(function() {
       ok(!tab.linkedBrowser.engines,
          "the subframe's search engine wasn't detected");
       
--- a/browser/base/content/test/browser_relatedTabs.js
+++ b/browser/base/content/test/browser_relatedTabs.js
@@ -40,32 +40,32 @@ function test() {
   // different tab, moving a tab around and closing a tab,
   // returning a list of opened tabs for verifying the expected order.
   // The new tab behaviour is documented in bug 465673
   function tabOpenDance() {
     let tabs = [];
     function addTab(aURL,aReferrer)
       tabs.push(gBrowser.addTab(aURL, {referrerURI: aReferrer}));
 
-    addTab("http://localhost:8888/#0");
+    addTab("http://mochi.test:8888/#0");
     gBrowser.selectedTab = tabs[0];
-    addTab("http://localhost:8888/#1");
-    addTab("http://localhost:8888/#2",gBrowser.currentURI);
-    addTab("http://localhost:8888/#3",gBrowser.currentURI);
+    addTab("http://mochi.test:8888/#1");
+    addTab("http://mochi.test:8888/#2",gBrowser.currentURI);
+    addTab("http://mochi.test:8888/#3",gBrowser.currentURI);
     gBrowser.selectedTab = tabs[tabs.length - 1];
     gBrowser.selectedTab = tabs[0];
-    addTab("http://localhost:8888/#4",gBrowser.currentURI);
+    addTab("http://mochi.test:8888/#4",gBrowser.currentURI);
     gBrowser.selectedTab = tabs[3];
-    addTab("http://localhost:8888/#5",gBrowser.currentURI);
+    addTab("http://mochi.test:8888/#5",gBrowser.currentURI);
     gBrowser.removeTab(tabs.pop());
     addTab("about:blank",gBrowser.currentURI);
     gBrowser.moveTabTo(gBrowser.selectedTab, 1);
-    addTab("http://localhost:8888/#6",gBrowser.currentURI);
+    addTab("http://mochi.test:8888/#6",gBrowser.currentURI);
     addTab();
-    addTab("http://localhost:8888/#7");
+    addTab("http://mochi.test:8888/#7");
 
     return tabs;
   }
 
   function cleanUp(aTabs)
     aTabs.forEach(gBrowser.removeTab, gBrowser);
 
   let tabs = tabOpenDance();
--- a/browser/base/content/test/test_offlineNotification.html
+++ b/browser/base/content/test/test_offlineNotification.html
@@ -99,17 +99,17 @@ function loaded() {
   // off updates, which will eventually lead to getting messages from
   // the children.
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
            getService(Components.interfaces.nsIWindowMediator);
   var win = wm.getMostRecentWindow("navigator:browser");
   var notificationBox = win.gBrowser.getNotificationBox();
 
-  var notification = notificationBox.getNotificationWithValue("offline-app-requested-localhost");
+  var notification = notificationBox.getNotificationWithValue("offline-app-requested-mochi.test");
   notification.childNodes[0].click();
 
   notification = notificationBox.getNotificationWithValue("offline-app-requested-example.com");
   notification.childNodes[0].click();
 }
 
 </script>
 </pre>
--- a/browser/base/content/test/test_offline_gzip.html
+++ b/browser/base/content/test/test_offline_gzip.html
@@ -32,17 +32,17 @@ SimpleTest.waitForExplicitFinish();
 
 function finishTest() {
   // Clean up after ourselves.
   netscape.security.PrivilegeManager
           .enablePrivilege("UniversalXPConnect");
   var pm = Components.classes["@mozilla.org/permissionmanager;1"].
            getService(Components.interfaces.nsIPermissionManager);
 
-  pm.remove("localhost", "offline-app");
+  pm.remove("mochi.test", "offline-app");
   
   window.removeEventListener("message", handleMessageEvents, false);
 
   SimpleTest.finish();  
 }
 
 ////
 // Handle "message" events which are posted from the iframe upon
@@ -98,17 +98,17 @@ function loaded() {
   // the iframe.
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
            getService(Components.interfaces.nsIWindowMediator);
   var win = wm.getMostRecentWindow("navigator:browser");
   var notificationBox = win.gBrowser.getNotificationBox();
 
   var notification = notificationBox
-    .getNotificationWithValue("offline-app-requested-localhost");
+    .getNotificationWithValue("offline-app-requested-mochi.test");
   notification.childNodes[0].click();
 }
 
 </script>
 </pre>
 </body>
 </html>
 
--- a/browser/components/feeds/test/chrome/test_423060.xul
+++ b/browser/components/feeds/test/chrome/test_423060.xul
@@ -24,35 +24,35 @@
       SimpleTest.finish()
 
     /* Turn off the first run UI */
     var prefBranch = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
     prefBranch.setBoolPref("browser.feeds.showFirstRunUI", false);
 
     /* register a handler for the feed type */
     const MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
-    var handlerPage = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/demohandler.html?feedurl=%s";
+    var handlerPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/demohandler.html?feedurl=%s";
     var wccr = Cc[wccrID].getService(Ci.nsIWebContentConverterService);
     wccr.registerContentHandler(MAYBE_FEED, handlerPage, "Demo handler", null);
     var demoHandler = wccr.getWebContentHandlerByURI(MAYBE_FEED, handlerPage);
     wccr.setAutoHandler(MAYBE_FEED, demoHandler);
 
     /* Don't show the preview page */
     prefBranch.setCharPref("browser.feeds.handler", "reader");
 
     function finishUp() {
       var theframe = document.getElementById('theframe');
-      var previewURL = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/demohandler.html?feedurl=http%3A%2F%2Flocalhost%3A8888%2Ftests%2Ftoolkit%2Fcomponents%2Fplaces%2Ftests%2Fchrome%2Fsample_feed.atom";
+      var previewURL = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/demohandler.html?feedurl=http%3A%2F%2Fmochi.test%3A8888%2Ftests%2Ftoolkit%2Fcomponents%2Fplaces%2Ftests%2Fchrome%2Fsample_feed.atom";
       is(theframe.contentDocument.URL, previewURL);
 
       /* remove our demoHandler */
       wccr.setAutoHandler(MAYBE_FEED, null);
       wccr.removeContentHandler(MAYBE_FEED, handlerPage);
       prefBranch.setCharPref("browser.feeds.handler", "ask");
       prefBranch.setBoolPref("browser.feeds.showFirstRunUI", true);
 
       SimpleTest.finish();
     }
   </script>
-  <html:iframe src="http://localhost:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom" height="400px" 
+  <html:iframe src="http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom" height="400px" 
     id="theframe" onload="finishUp();">
   </html:iframe>
-</window>
\ No newline at end of file
+</window>
--- a/browser/components/feeds/test/test_registerHandler.html
+++ b/browser/components/feeds/test/test_registerHandler.html
@@ -35,52 +35,52 @@ https://bugzilla.mozilla.org/show_bug.cg
 
     return true;
   }
 
   ok(navigator.registerProtocolHandler, "navigator.registerProtocolHandler should be defined");
   ok(navigator.registerContentHandler, "navigator.registerContentHandler should be defined");
 
   // testing a generic case
-  is(true, testRegisterHandler(true, "foo", "http://localhost:8888/%s", "Foo handler"), "registering a foo protocol handler should work");
-  is(true, testRegisterHandler(false, "application/rss+xml", "http://localhost:8888/%s", "Foo handler"), "registering a foo content handler should work");
+  is(true, testRegisterHandler(true, "foo", "http://mochi.test:8888/%s", "Foo handler"), "registering a foo protocol handler should work");
+  is(true, testRegisterHandler(false, "application/rss+xml", "http://mochi.test:8888/%s", "Foo handler"), "registering a foo content handler should work");
 
   // testing with wrong uris
-  is(false, testRegisterHandler(true, "foo", "http://localhost:8888/", "Foo handler"), "a protocol handler uri should contain %s");
-  is(false, testRegisterHandler(false, "application/rss+xml", "http://localhost:8888/", "Foo handler"), "a content handler uri should contain %s");
+  is(false, testRegisterHandler(true, "foo", "http://mochi.test:8888/", "Foo handler"), "a protocol handler uri should contain %s");
+  is(false, testRegisterHandler(false, "application/rss+xml", "http://mochi.test:8888/", "Foo handler"), "a content handler uri should contain %s");
 
   // the spec says we should not throw here, but it probably needs to be changed
   is(false, testRegisterHandler(true, "foo", "foo/%s", "Foo handler"), "a protocol handler uri should be valid");
   is(false, testRegisterHandler(false, "application/rss+xml", "foo/%s", "Foo handler"), "a content handler uri should be valid");
 
   // we should only accept to register when the handler has the same host as the current page (bug 402287)
   is(false, testRegisterHandler(true, "foo", "http://remotehost:8888/%s", "Foo handler"), "registering a foo protocol handler with a different host should not work");
   is(false, testRegisterHandler(false, "application/rss+xml", "http://remotehost:8888/%s", "Foo handler"), "registering a foo content handler with a different host should not work");
 
   // restriction to http(s) for the uri of the handler (bug 401343)
   // https should work (http already tested in the generic case)
-  is(true, testRegisterHandler(true, "foo", "https://localhost:8888/%s", "Foo handler"), "registering a foo protocol handler with https scheme should work");
-  is(true, testRegisterHandler(false, "application/rss+xml", "https://localhost:8888/%s", "Foo handler"), "registering a foo content handler with https scheme should work");
+  is(true, testRegisterHandler(true, "foo", "https://mochi.test:8888/%s", "Foo handler"), "registering a foo protocol handler with https scheme should work");
+  is(true, testRegisterHandler(false, "application/rss+xml", "https://mochi.test:8888/%s", "Foo handler"), "registering a foo content handler with https scheme should work");
   // ftp should not work
-  is(false, testRegisterHandler(true, "foo", "ftp://localhost:8888/%s", "Foo handler"), "registering a foo protocol handler with ftp scheme should not work");
-  is(false, testRegisterHandler(false, "application/rss+xml", "ftp://localhost:8888/%s", "Foo handler"), "registering a foo content handler with ftp scheme should not work");
+  is(false, testRegisterHandler(true, "foo", "ftp://mochi.test:8888/%s", "Foo handler"), "registering a foo protocol handler with ftp scheme should not work");
+  is(false, testRegisterHandler(false, "application/rss+xml", "ftp://mochi.test:8888/%s", "Foo handler"), "registering a foo content handler with ftp scheme should not work");
   // chrome should not work 
-  is(false, testRegisterHandler(true, "foo", "chrome://localhost:8888/%s", "Foo handler"), "registering a foo protocol handler with chrome scheme should not work");
-  is(false, testRegisterHandler(false, "application/rss+xml", "chrome://localhost:8888/%s", "Foo handler"), "registering a foo content handler with chrome scheme should not work");
+  is(false, testRegisterHandler(true, "foo", "chrome://mochi.test:8888/%s", "Foo handler"), "registering a foo protocol handler with chrome scheme should not work");
+  is(false, testRegisterHandler(false, "application/rss+xml", "chrome://mochi.test:8888/%s", "Foo handler"), "registering a foo content handler with chrome scheme should not work");
   // foo should not work 
-  is(false, testRegisterHandler(true, "foo", "foo://localhost:8888/%s", "Foo handler"), "registering a foo protocol handler with foo scheme should not work");
-  is(false, testRegisterHandler(false, "application/rss+xml", "foo://localhost:8888/%s", "Foo handler"), "registering a foo content handler with foo scheme should not work");
+  is(false, testRegisterHandler(true, "foo", "foo://mochi.test:8888/%s", "Foo handler"), "registering a foo protocol handler with foo scheme should not work");
+  is(false, testRegisterHandler(false, "application/rss+xml", "foo://mochi.test:8888/%s", "Foo handler"), "registering a foo content handler with foo scheme should not work");
 
   // for security reasons, protocol handlers should never be registered for some schemes (chrome, vbscript, ...) (bug 402788)
-  is(false, testRegisterHandler(true, "chrome", "http://localhost:8888/%s", "chrome handler"), "registering a chrome protocol handler should not work");
-  is(false, testRegisterHandler(true, "vbscript", "http://localhost:8888/%s", "vbscript handler"), "registering a vbscript protocol handler should not work");
-  is(false, testRegisterHandler(true, "javascript", "http://localhost:8888/%s", "javascript handler"), "registering a javascript protocol handler should not work");
-  is(false, testRegisterHandler(true, "moz-icon", "http://localhost:8888/%s", "moz-icon handler"), "registering a moz-icon protocol handler should not work");
+  is(false, testRegisterHandler(true, "chrome", "http://mochi.test:8888/%s", "chrome handler"), "registering a chrome protocol handler should not work");
+  is(false, testRegisterHandler(true, "vbscript", "http://mochi.test:8888/%s", "vbscript handler"), "registering a vbscript protocol handler should not work");
+  is(false, testRegisterHandler(true, "javascript", "http://mochi.test:8888/%s", "javascript handler"), "registering a javascript protocol handler should not work");
+  is(false, testRegisterHandler(true, "moz-icon", "http://mochi.test:8888/%s", "moz-icon handler"), "registering a moz-icon protocol handler should not work");
 
   // for security reasons, content handlers should never be registered for some types (html, ...)
-  is(true, testRegisterHandler(false, "application/rss+xml", "http://localhost:8888/%s", "Foo handler"), "registering rss content handlers should work");
-  is(true, testRegisterHandler(false, "application/atom+xml", "http://localhost:8888/%s", "Foo handler"), "registering atom content handlers should work");
-  todo(false, testRegisterHandler(false, "text/html", "http://localhost:8888/%s", "Foo handler"), "registering html content handlers should not work"); // bug 403798
+  is(true, testRegisterHandler(false, "application/rss+xml", "http://mochi.test:8888/%s", "Foo handler"), "registering rss content handlers should work");
+  is(true, testRegisterHandler(false, "application/atom+xml", "http://mochi.test:8888/%s", "Foo handler"), "registering atom content handlers should work");
+  todo(false, testRegisterHandler(false, "text/html", "http://mochi.test:8888/%s", "Foo handler"), "registering html content handlers should not work"); // bug 403798
 
 </script>
 </pre>
 </body>
 </html>
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadmonitor.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadmonitor.js
@@ -124,17 +124,17 @@ function addDownload(dm, aParams)
     aParams.resultFileName = "download.result";
   if (!("targetFile" in aParams)) {
     let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                  getService(Ci.nsIProperties);
     aParams.targetFile = dirSvc.get("ProfD", Ci.nsIFile);
     aParams.targetFile.append(aParams.resultFileName);
   }
   if (!("sourceURI" in aParams))
-    aParams.sourceURI = "http://localhost:8888/browser/browser/components/privatebrowsing/test/browser/staller.sjs";
+    aParams.sourceURI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/staller.sjs";
   if (!("downloadName" in aParams))
     aParams.downloadName = null;
   if (!("runBeforeStart" in aParams))
     aParams.runBeforeStart = function () {};
 
   const nsIWBP = Ci.nsIWebBrowserPersist;
   let persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
                 .createInstance(Ci.nsIWebBrowserPersist);
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
@@ -38,17 +38,17 @@
 // This test makes sure that the geolocation prompt does not show a remember
 // control inside the private browsing mode.
 
 function test() {
   // initialization
   let pb = Cc["@mozilla.org/privatebrowsing;1"].
            getService(Ci.nsIPrivateBrowsingService);
 
-  const testPageURL = "http://localhost:8888/browser/" +
+  const testPageURL = "http://mochi.test:8888/browser/" +
     "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function () {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
     setTimeout(function() {
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
@@ -46,17 +46,17 @@ function test() {
               getService(Ci.nsIBrowserHistory);
   let histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
                 getService(Ci.nsINavHistoryService).
                 QueryInterface(Ci.nsPIPlacesDatabase);
   let cm = Cc["@mozilla.org/cookiemanager;1"].
            getService(Ci.nsICookieManager);
   waitForExplicitFinish();
 
-  const TEST_URL = "http://localhost:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
+  const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
 
   function cleanup() {
     // delete all history items
     bhist.removeAllPages();
     // delete all cookies
     cm.removeAll();
   }
   cleanup();
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_popupblocker.js
@@ -41,17 +41,17 @@
 function test() {
   // initialization
   let pb = Cc["@mozilla.org/privatebrowsing;1"].
            getService(Ci.nsIPrivateBrowsingService);
 
   let oldPopupPolicy = gPrefService.getBoolPref("dom.disable_open_during_load");
   gPrefService.setBoolPref("dom.disable_open_during_load", true);
 
-  const TEST_URI = "http://localhost:8888/browser/browser/components/privatebrowsing/test/browser/popup.html";
+  const TEST_URI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/popup.html";
 
   waitForExplicitFinish();
 
   function testPopupBlockerMenuItem(expectedDisabled, callback) {
     gBrowser.addEventListener("DOMUpdatePageReport", function() {
       gBrowser.removeEventListener("DOMUpdatePageReport", arguments.callee, false);
       executeSoon(function() {
         let pageReportButton = document.getElementById("page-report-button");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js
@@ -39,17 +39,17 @@
 // from and to private browsing mode.
 
 function test() {
   // initialization
   gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
   let pb = Cc["@mozilla.org/privatebrowsing;1"].
            getService(Ci.nsIPrivateBrowsingService);
 
-  const testPageURL = "http://localhost:8888/browser/" +
+  const testPageURL = "http://mochi.test:8888/browser/" +
     "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html";
   waitForExplicitFinish();
 
   // initialization of expected titles
   let test_title = "Test title";
   let app_name = document.documentElement.getAttribute("title");
   const isOSX = ("nsILocalFileMac" in Ci);
   let page_with_title;
--- a/browser/components/search/test/426329.xml
+++ b/browser/components/search/test/426329.xml
@@ -1,11 +1,11 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                        xmlns:moz="http://www.mozilla.org/2006/browser/search/">
   <ShortName>Bug 426329</ShortName>
   <Description>426329 Search</Description>
   <InputEncoding>utf-8</InputEncoding>
   <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC</Image>
-  <Url type="text/html" method="GET" template="http://localhost:8888/browser/browser/components/search/test/test.html">
+  <Url type="text/html" method="GET" template="http://mochi.test:8888/browser/browser/components/search/test/test.html">
     <Param name="test" value="{searchTerms}"/>
   </Url>
-  <moz:SearchForm>http://localhost:8888/browser/browser/components/search/test/test.html</moz:SearchForm>
+  <moz:SearchForm>http://mochi.test:8888/browser/browser/components/search/test/test.html</moz:SearchForm>
 </OpenSearchDescription>
--- a/browser/components/search/test/483086-1.xml
+++ b/browser/components/search/test/483086-1.xml
@@ -1,10 +1,10 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                        xmlns:moz="http://www.mozilla.org/2006/browser/search/">
   <ShortName>483086a</ShortName>
   <Description>Bug 483086 Test 1</Description>
   <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC</Image>
-  <Url type="text/html" method="GET" template="http://localhost:8888/browser/browser/components/search/test/?search">
+  <Url type="text/html" method="GET" template="http://mochi.test:8888/browser/browser/components/search/test/?search">
     <Param name="test" value="{searchTerms}"/>
   </Url>
   <moz:SearchForm>foo://example.com</moz:SearchForm>
 </OpenSearchDescription>
--- a/browser/components/search/test/483086-2.xml
+++ b/browser/components/search/test/483086-2.xml
@@ -1,10 +1,10 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                        xmlns:moz="http://www.mozilla.org/2006/browser/search/">
   <ShortName>483086b</ShortName>
   <Description>Bug 483086 Test 2</Description>
   <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC</Image>
-  <Url type="text/html" method="GET" template="http://localhost:8888/browser/browser/components/search/test/?search">
+  <Url type="text/html" method="GET" template="http://mochi.test:8888/browser/browser/components/search/test/?search">
     <Param name="test" value="{searchTerms}"/>
   </Url>
   <moz:SearchForm>http://example.com</moz:SearchForm>
 </OpenSearchDescription>
--- a/browser/components/search/test/browser_415700.js
+++ b/browser/components/search/test/browser_415700.js
@@ -51,17 +51,17 @@ function observers(aSubject, aTopic, aDa
       break;
   }
 }
 
 function test() {
   waitForExplicitFinish();
   gObs.addObserver(observers, "browser-search-engine-modified", false);
 
-  gSS.addEngine("http://localhost:8888/browser/browser/components/search/test/testEngine.xml",
+  gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/testEngine.xml",
                 Ci.nsISearchEngine.DATA_XML, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC",
                 false);
 }
 
 function test2() {
   var engine = gSS.getEngineByName("Foo");
   ok(engine, "Engine was added.");
 
--- a/browser/components/search/test/browser_426329.js
+++ b/browser/components/search/test/browser_426329.js
@@ -28,17 +28,17 @@ function test() {
       case "engine-removed":
         obs.removeObserver(observer, "browser-search-engine-modified");
         finish();
         break;
     }
   }
 
   obs.addObserver(observer, "browser-search-engine-modified", false);
-  ss.addEngine("http://localhost:8888/browser/browser/components/search/test/426329.xml",
+  ss.addEngine("http://mochi.test:8888/browser/browser/components/search/test/426329.xml",
                Ci.nsISearchEngine.DATA_XML, "data:image/x-icon,%00",
                false);
 
   var preSelectedBrowser, preTabNo;
   function init() {
     preSelectedBrowser = gBrowser.selectedBrowser;
     preTabNo = gBrowser.mTabs.length;
     searchBar.focus();
--- a/browser/components/search/test/browser_483086.js
+++ b/browser/components/search/test/browser_483086.js
@@ -53,17 +53,17 @@ function test() {
       case "engine-removed":
         gObs.removeObserver(observer, "browser-search-engine-modified");
         test2();
         break;
     }
   }
 
   gObs.addObserver(observer, "browser-search-engine-modified", false);
-  gSS.addEngine("http://localhost:8888/browser/browser/components/search/test/483086-1.xml",
+  gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/483086-1.xml",
                 Ci.nsISearchEngine.DATA_XML, "data:image/x-icon;%00",
                 false);
 }
 
 function test2() {
   function observer(aSubject, aTopic, aData) {
     switch (aData) {
       case "engine-added":
@@ -75,12 +75,12 @@ function test2() {
       case "engine-removed":  
         gObs.removeObserver(observer, "browser-search-engine-modified");
         finish();
         break;
     }
   }
 
   gObs.addObserver(observer, "browser-search-engine-modified", false);
-  gSS.addEngine("http://localhost:8888/browser/browser/components/search/test/483086-2.xml",
+  gSS.addEngine("http://mochi.test:8888/browser/browser/components/search/test/483086-2.xml",
                 Ci.nsISearchEngine.DATA_XML, "data:image/x-icon;%00",
                 false);
 }
--- a/browser/components/search/test/testEngine.xml
+++ b/browser/components/search/test/testEngine.xml
@@ -1,12 +1,12 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                        xmlns:moz="http://www.mozilla.org/2006/browser/search/">
   <ShortName>Foo</ShortName>
   <Description>Foo Search</Description>
   <InputEncoding>utf-8</InputEncoding>
   <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGklEQVQoz2NgGB6AnZ1dUlJSXl4eSDIyMhLW4Ovr%2B%2Fr168uXL69Zs4YoG%2BLi4i5dusTExMTGxsbNzd3f37937976%2BnpmZmagbHR09J49e5YvX66kpATVEBYW9ubNm2nTphkbG7e2tp44cQLIuHfvXm5urpaWFlDKysqqu7v73LlzECMYIiIiHj58mJCQoKKicvXq1bS0NKBgW1vbjh074uPjgeqAXE1NzSdPnvDz84M0AEUvXLgAsW379u1z5swBen3jxo2zZ892cHB4%2BvQp0KlAfwI1cHJyghQFBwfv2rULokFXV%2FfixYu7d%2B8GGqGgoMDKyrpu3br9%2B%2FcDuXl5eVA%2FAEWBfoWHAdAYoNuAYQ0XAeoUERFhGDYAAPoUaT2dfWJuAAAAAElFTkSuQmCC</Image>
-  <Url type="text/html" method="GET" template="http://localhost:8888/browser/browser/components/search/test/?search">
+  <Url type="text/html" method="GET" template="http://mochi.test:8888/browser/browser/components/search/test/?search">
     <Param name="test" value="{searchTerms}"/>
   </Url>
-  <moz:SearchForm>http://localhost:8888/browser/browser/components/search/test/</moz:SearchForm>
+  <moz:SearchForm>http://mochi.test:8888/browser/browser/components/search/test/</moz:SearchForm>
   <moz:Alias>fooalias</moz:Alias>
 </OpenSearchDescription>
--- a/browser/components/sessionstore/test/browser/browser_248970_a.js
+++ b/browser/components/sessionstore/test/browser/browser_248970_a.js
@@ -110,17 +110,17 @@ function test() {
         // private browsing session, add new tab: (B)
         const testURL_B = "http://test1.example.org/";
         let tab_B = gBrowser.addTab(testURL_B);
 
         tab_B.linkedBrowser.addEventListener("load", function (aEvent) {
           this.removeEventListener("load", arguments.callee, true);
 
           // private browsing session, add new tab: (C)
-          const testURL_C = "http://localhost:8888/";
+          const testURL_C = "http://mochi.test:8888/";
           let tab_C = gBrowser.addTab(testURL_C);
 
           tab_C.linkedBrowser.addEventListener("load", function (aEvent) {
             this.removeEventListener("load", arguments.callee, true);
 
             // private browsing session, close tab: (C)
             gBrowser.removeTab(tab_C);
 
--- a/browser/components/sessionstore/test/browser/browser_248970_b.js
+++ b/browser/components/sessionstore/test/browser/browser_248970_b.js
@@ -109,17 +109,17 @@ function test() {
                            getService(Ci.nsISessionStore));
 
   //////////////////////////////////////////////////////////////////
   // Test (B) : Session data restoration between modes            //
   //////////////////////////////////////////////////////////////////
 
   const testURL = "chrome://mochikit/content/browser/" +
   "browser/components/sessionstore/test/browser/browser_248970_b_sample.html";
-  const testURL2 = "http://localhost:8888/browser/" +
+  const testURL2 = "http://mochi.test:8888/browser/" +
   "browser/components/sessionstore/test/browser/browser_248970_b_sample.html";
 
   // get closed tab count
   let count = ss.getClosedTabCount(window);
   let max_tabs_undo = gPrefService.getIntPref("browser.sessionstore.max_tabs_undo");
   ok(0 <= count && count <= max_tabs_undo,
     "getClosedTabCount should return zero or at most max_tabs_undo");
 
--- a/browser/components/sessionstore/test/browser/browser_339445.js
+++ b/browser/components/sessionstore/test/browser/browser_339445.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 339445 **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_339445_sample.html";
   
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     this.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     is(doc.getElementById("storageTestItem").textContent, "PENDING",
        "sessionStorage value has been set");
--- a/browser/components/sessionstore/test/browser/browser_423132.js
+++ b/browser/components/sessionstore/test/browser/browser_423132.js
@@ -58,17 +58,17 @@ function test() {
   cs.removeAll();
 
   let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
 
   // make sure that sessionstore.js can be forced to be created by setting
   // the interval pref to 0
   gPrefService.setIntPref("browser.sessionstore.interval", 0);
 
-  const testURL = "http://localhost:8888/browser/" +
+  const testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_423132_sample.html";
 
   // open a new window
   let newWin = openDialog(location, "_blank", "chrome,all,dialog=no", "about:blank");
 
   // make sure sessionstore saves the cookie data, then close the window
   newWin.addEventListener("load", function (aEvent) {
     newWin.removeEventListener("load", arguments.callee, false);
--- a/browser/components/sessionstore/test/browser/browser_447951.js
+++ b/browser/components/sessionstore/test/browser/browser_447951.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 447951 **/
   
   // test setup
   let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
   waitForExplicitFinish();
-  const baseURL = "http://localhost:8888/browser/" +
+  const baseURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_447951_sample.html#";
     
   let tab = gBrowser.addTab();
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     
     let tabState = { entries: [] };
     let max_entries = gPrefService.getIntPref("browser.sessionhistory.max_entries");
--- a/browser/components/sessionstore/test/browser/browser_459906.js
+++ b/browser/components/sessionstore/test/browser/browser_459906.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 459906 **/
 
   waitForExplicitFinish();
 
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_459906_sample.html";
   let uniqueValue = "<b>Unique:</b> " + Date.now();
 
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 2)
@@ -76,17 +76,17 @@ function test() {
         is(iframes[1].document.body.innerHTML, uniqueValue,
            "rich textarea's content correctly duplicated");
 
         let innerDomain = null;
         try {
           innerDomain = iframes[0].document.domain;
         }
         catch (ex) { /* throws for chrome: documents */ }
-        is(innerDomain, "localhost", "XSS exploit prevented!");
+        is(innerDomain, "mochi.test", "XSS exploit prevented!");
 
         // clean up
         gBrowser.removeTab(tab2);
         gBrowser.removeTab(tab);
 
         finish();
       });
     }, true);
--- a/browser/components/sessionstore/test/browser/browser_461743.js
+++ b/browser/components/sessionstore/test/browser/browser_461743.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 461743 **/
 
   waitForExplicitFinish();
 
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_461743_sample.html";
 
   let frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // Wait for all frames to load completely.
     if (frameCount++ < 2)
       return;
--- a/browser/components/sessionstore/test/browser/browser_463205_sample.html
+++ b/browser/components/sessionstore/test/browser/browser_463205_sample.html
@@ -12,14 +12,14 @@
   frames[2].addEventListener("DOMContentLoaded", function() {
     frames[2].removeEventListener("DOMContentLoaded", arguments.callee, false);
     
     if (frames[2].document.location.href == "data:text/html,mark1") {
       frames[2].document.location = "data:text/html,mark2";
     }
     else {
       frames[1].document.location.hash = "#original";
-      frames[0].document.location = "http://localhost:8888/browser/" +
+      frames[0].document.location = "http://mochi.test:8888/browser/" +
         "browser/components/sessionstore/test/browser/browser_463205_helper.html";
     }
   }, false);
 </script>
 </body>
--- a/browser/components/sessionstore/test/browser/browser_463206.js
+++ b/browser/components/sessionstore/test/browser/browser_463206.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 463206 **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_463206_sample.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 5)
       return;
--- a/browser/components/sessionstore/test/browser/browser_464620_a.html
+++ b/browser/components/sessionstore/test/browser/browser_464620_a.html
@@ -1,17 +1,17 @@
 <!-- Testcase originally by <moz_bug_r_a4@yahoo.com> -->
 
 <title>Test for bug 464620 (injection on input)</title>
 
 <iframe></iframe>
 <iframe onload="setup()"></iframe>
 
 <script>
-  var targetUrl = "http://localhost:8888/browser/" +
+  var targetUrl = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_464620_xd.html";
   var firstPass;
   
   function setup() {
     if (firstPass !== undefined)
       return;
     firstPass = frames[1].location.href == "about:blank";
     if (firstPass) {
--- a/browser/components/sessionstore/test/browser/browser_464620_a.js
+++ b/browser/components/sessionstore/test/browser/browser_464620_a.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 464620 (injection on input) **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_464620_a.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 4)
       return;
--- a/browser/components/sessionstore/test/browser/browser_464620_b.html
+++ b/browser/components/sessionstore/test/browser/browser_464620_b.html
@@ -2,17 +2,17 @@
 
 <title>Test for bug 464620 (injection on DOM node insertion)</title>
 
 <iframe></iframe>
 <iframe></iframe>
 <iframe onload="setup()"></iframe>
 
 <script>
-  var targetUrl = "http://localhost:8888/browser/" +
+  var targetUrl = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_464620_xd.html";
   var firstPass;
   
   function setup() {
     if (firstPass !== undefined)
       return;
     firstPass = frames[2].location.href == "about:blank";
     if (firstPass) {
--- a/browser/components/sessionstore/test/browser/browser_464620_b.js
+++ b/browser/components/sessionstore/test/browser/browser_464620_b.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 464620 (injection on DOM node insertion) **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_464620_b.html";
   
   var frameCount = 0;
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     // wait for all frames to load completely
     if (frameCount++ < 6)
       return;
--- a/browser/components/sessionstore/test/browser/browser_466937.js
+++ b/browser/components/sessionstore/test/browser/browser_466937.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 466937 **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_466937_sample.html";
   let testPath = "/home/user/regular.file";
   
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     doc.getElementById("reverse_thief").value = "/home/user/secret2";
--- a/browser/components/sessionstore/test/browser/browser_476161.js
+++ b/browser/components/sessionstore/test/browser/browser_476161.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   /** Test for Bug 476161 **/
   
   waitForExplicitFinish();
   
-  let testURL = "http://localhost:8888/browser/" +
+  let testURL = "http://mochi.test:8888/browser/" +
     "browser/components/sessionstore/test/browser/browser_476161_sample.html";
   let tab = gBrowser.addTab(testURL);
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     let doc = tab.linkedBrowser.contentDocument;
     
     doc.getElementById("modify1").value += Math.random();
     doc.getElementById("modify2").value += " " + Date.now();
--- a/browser/components/sessionstore/test/browser/browser_480893.js
+++ b/browser/components/sessionstore/test/browser/browser_480893.js
@@ -52,19 +52,19 @@ function test() {
     // click on the "Start New Session" button after about:sessionrestore is loaded
     doc.getElementById("errorCancel").click();
     browser.addEventListener("load", function(aEvent) {
       browser.removeEventListener("load", arguments.callee, true);
       let doc = browser.contentDocument;
 
       is(doc.URL, "about:blank", "loaded page is about:blank");
 
-      // Test that starting a new session loads the homepage (set to http://localhost:8888)
+      // Test that starting a new session loads the homepage (set to http://mochi.test:8888)
       // if Firefox is configured to display a homepage at startup (browser.startup.page = 1)
-      let homepage = "http://localhost:8888/";
+      let homepage = "http://mochi.test:8888/";
       gPrefService.setCharPref("browser.startup.homepage", homepage);
       gPrefService.setIntPref("browser.startup.page", 1);
       gBrowser.loadURI("about:sessionrestore");
       browser.addEventListener("load", function(aEvent) {
         browser.removeEventListener("load", arguments.callee, true);
         let doc = browser.contentDocument;
 
         // click on the "Start New Session" button after about:sessionrestore is loaded
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -269,28 +269,28 @@ user_pref("javascript.options.jit.conten
 user_pref("gfx.color_management.force_srgb", true);
 user_pref("network.manage-offline-status", false);
 user_pref("test.mousescroll", true);
 user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
 user_pref("network.http.prompt-temp-redirect", false);
 user_pref("media.cache_size", 100);
 user_pref("security.warn_viewing_mixed", false);
 
-user_pref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
+user_pref("geo.wifi.uri", "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
 user_pref("geo.wifi.testing", true);
 
 user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
 
 // Make url-classifier updates so rare that they won't affect tests
 user_pref("urlclassifier.updateinterval", 172800);
 // Point the url-classifier to the local testing server for fast failures
-user_pref("browser.safebrowsing.provider.0.gethashURL", "http://localhost:8888/safebrowsing-dummy/gethash");
-user_pref("browser.safebrowsing.provider.0.keyURL", "http://localhost:8888/safebrowsing-dummy/newkey");
-user_pref("browser.safebrowsing.provider.0.lookupURL", "http://localhost:8888/safebrowsing-dummy/lookup");
-user_pref("browser.safebrowsing.provider.0.updateURL", "http://localhost:8888/safebrowsing-dummy/update");
+user_pref("browser.safebrowsing.provider.0.gethashURL", "http://mochi.test:8888/safebrowsing-dummy/gethash");
+user_pref("browser.safebrowsing.provider.0.keyURL", "http://mochi.test:8888/safebrowsing-dummy/newkey");
+user_pref("browser.safebrowsing.provider.0.lookupURL", "http://mochi.test:8888/safebrowsing-dummy/lookup");
+user_pref("browser.safebrowsing.provider.0.updateURL", "http://mochi.test:8888/safebrowsing-dummy/update");
 """
   
     prefs.append(part)
 
     locations = self.readLocations()
 
     # Grant God-power to all the privileged servers on which tests run.
     privileged = filter(lambda loc: "privileged" in loc.options, locations)
--- a/build/leaktest.py.in
+++ b/build/leaktest.py.in
@@ -67,17 +67,35 @@ if __name__ == '__main__':
             automation.log.info("Unable to open logfile " + opts[0][1] + \
                                 "ONLY logging to stdout.")
 
     httpd = EasyServer(("", PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
     t = threading.Thread(target=httpd.serve_forever)
     t.setDaemon(True)
     t.start()
 
-    automation.initializeProfile(PROFILE_DIRECTORY)
+    # since this requires localhost, we cannot use automation.initializeProfile
+    try:
+      os.makedirs(PROFILE_DIRECTORY)
+    except:
+      pass # leaf directory already exists
+
+    prefsFile = open(PROFILE_DIRECTORY + "/" + "user.js", "w")
+    prefsFile.write('user_pref("dom.popup_maximum", -1);')
+    prefsFile.write('user_pref("dom.disable_open_during_load", false);')
+    prefsFile.write('user_pref("browser.shell.checkDefaultBrowser", false);')
+    prefsFile.write('user_pref("browser.warnOnQuit", false);')
+    prefsFile.write('user_pref("dom.allow_scripts_to_close_windows", true);')
+    prefsFile.write('user_pref("capability.principal.codebase.p0.granted", \
+                      "UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
+                       UniversalPreferencesRead UniversalPreferencesWrite UniversalFileRead");\n')
+    prefsFile.write('user_pref("capability.principal.codebase.p0.id", "http://localhost:%s");\n' % PORT)
+    prefsFile.write('user_pref("capability.principal.codebase.p0.subjectName", "");\n')
+    prefsFile.close()
+
     browserEnv = automation.environment()
 
     if not "XPCOM_DEBUG_BREAK" in browserEnv:
         browserEnv["XPCOM_DEBUG_BREAK"] = "stack"
     url = "http://localhost:%d/bloatcycle.html" % PORT
     appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
     status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY,
                                # leaktest builds are slow, give up and
--- a/build/pgo/server-locations.txt
+++ b/build/pgo/server-locations.txt
@@ -70,22 +70,26 @@
 # for custom certification are loaded from build/pgo/ssltunnel/certs
 # directory. When new certificate is added to this dir pgo/ssltunnel
 # must be builded then.
 #
 
 #
 # This is the primary location from which tests run.
 #
-http://localhost:8888   primary,privileged
+http://mochi.test:8888   primary,privileged
 
 #
 # These are a common set of prefixes scattered across one TLD with two ports and
 # another TLD on a single port.
 #
+http://127.0.0.1:80               privileged
+http://127.0.0.1:8888             privileged
+http://test:80                    privileged
+http://mochi.test:8888            privileged
 http://example.org:80                privileged
 http://test1.example.org:80          privileged
 http://test2.example.org:80          privileged
 http://sub1.test1.example.org:80     privileged
 http://sub1.test2.example.org:80     privileged
 http://sub2.test1.example.org:80     privileged
 http://sub2.test2.example.org:80     privileged
 http://example.org:8000              privileged
--- a/content/base/test/bug461735-redirect2.sjs
+++ b/content/base/test/bug461735-redirect2.sjs
@@ -1,4 +1,4 @@
 function handleRequest(request, response) {
   response.setStatusLine(null, 302, "Found");
-  response.setHeader("Location", "http://localhost:8888/tests/content/base/test/bug461735-post-redirect.js", false);
+  response.setHeader("Location", "http://mochi.test:8888/tests/content/base/test/bug461735-post-redirect.js", false);
 }
--- a/content/base/test/chrome/test_bug421622.xul
+++ b/content/base/test/chrome/test_bug421622.xul
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=421622"
      target="_blank">Mozilla Bug 421622</a>
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
 
     /** Test for Bug 421622 **/
-    const SJS_URL = "http://localhost:8888/tests/content/base/test/chrome/bug421622-referer.sjs";
+    const SJS_URL = "http://mochi.test:8888/tests/content/base/test/chrome/bug421622-referer.sjs";
     const REFERER_URL = "http://www.mozilla.org/";
 
     var req = new XMLHttpRequest();
     req.open("GET", SJS_URL, false);
     req.setRequestHeader("Referer", REFERER_URL);
     req.send(null);
 
     is(req.responseText,
--- a/content/base/test/file_CSP.sjs
+++ b/content/base/test/file_CSP.sjs
@@ -17,19 +17,21 @@ function handleRequest(request, response
   if ("main" in query) {
     var xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]  
                    .createInstance(Components.interfaces.nsIXMLHttpRequest);
     //serve the main page with a CSP header!
     // -- anything served from 'self' (localhost:8888) will be allowed,
     // -- anything served from other hosts (example.com:80) will be blocked.
     // -- XHR tests are set up in the file_CSP_main.js file which is sourced.
     response.setHeader("X-Content-Security-Policy", 
-                       "allow 'self'",
+                       "allow mochi.test",
                        false);
-    xhr.open("GET", "http://localhost:8888/tests/content/base/test/file_CSP_main.html", false);
+
+    var proxyURI = "http://" + query["proxy"];
+    xhr.open("GET", proxyURI + "/tests/content/base/test/file_CSP_main.html", false);
     xhr.send(null);
     if(xhr.status == 200) {
       response.write(xhr.responseText);
     }
   } else {
     if ("type" in query) {
       response.setHeader("Content-Type", unescape(query['type']), false);
     } else {
--- a/content/base/test/file_CSP_frameancestors_main.js
+++ b/content/base/test/file_CSP_frameancestors_main.js
@@ -1,20 +1,20 @@
 // Script to populate the test frames in the frame ancestors mochitest.
 //
 function setupFrames() {
 
   var $ = function(v) { return document.getElementById(v); }
   var base = {
         self: '/tests/content/base/test/file_CSP_frameancestors.sjs',
-        a: 'http://localhost:8888/tests/content/base/test/file_CSP_frameancestors.sjs',
+        a: 'http://mochi.test:8888/tests/content/base/test/file_CSP_frameancestors.sjs',
         b: 'http://example.com/tests/content/base/test/file_CSP_frameancestors.sjs'
   };
 
-  var host = { a: 'http://localhost:8888', b: 'http://example.com:80' };
+  var host = { a: 'http://mochi.test:8888', b: 'http://example.com:80' };
 
   var innerframeuri = null;
   var elt = null;
 
   elt = $('aa_allow');
   elt.src = base.a + "?testid=aa_allow&internalframe=aa_a&csp=" + 
             escape("allow 'none'; frame-ancestors " + host.a + "; script-src 'self'");
 
--- a/content/base/test/file_CSP_main.js
+++ b/content/base/test/file_CSP_main.js
@@ -1,14 +1,14 @@
 // some javascript for the CSP XHR tests
 //
 
 try {
   var xhr_good = new XMLHttpRequest();
-  var xhr_good_uri ="http://localhost:8888/tests/content/base/test/file_CSP.sjs?testid=xhr_good";
+  var xhr_good_uri ="http://mochi.test:8888/tests/content/base/test/file_CSP.sjs?testid=xhr_good";
   xhr_good.open("GET", xhr_good_uri, true);
   xhr_good.send(null);
 } catch(e) {}
 
 try {
   var xhr_bad = new XMLHttpRequest();
   var xhr_bad_uri ="http://example.com/tests/content/base/test/file_CSP.sjs?testid=xhr_bad";
   xhr_bad.open("GET", xhr_bad_uri, true);
--- a/content/base/test/file_CrossSiteXHR_inner.html
+++ b/content/base/test/file_CrossSiteXHR_inner.html
@@ -74,17 +74,17 @@ window.addEventListener("message", funct
   }
 
   res.events.push("sending");
   xhr.send(sendData);
 
 }, false);
 
 function post(e, res) {
-  e.source.postMessage(res.toSource(), "http://localhost:8888");
+  e.source.postMessage(res.toSource(), "http://mochi.test:8888");
 }
 
 </script>
 </head>
 <body>
 Inner page
 </body>
-</html>
\ No newline at end of file
+</html>
index 032617c6f4fe3ceb96ecb2df28d5a2910c40f6bb..07397166b22266f5bb20891bd5ce8027071b2465
GIT binary patch
literal 964
zc$^FHW@Zs#U|`^2;9ZerQ+YO5`Wq7igFFWVgA5R+W#**DI~U~_7YApSq(*oI#b@T_
zr55RBl;q}whHx@4@A8}By%~s0E4UdLSza(RFo21>p}zUI4S4qc4qst+Gvm=43zf{W
z4C54s-D2K+vR#V;l$Tw5;IU4{+_(GR_lc9{TE%aln|5G>Yfw$Uh$pYV-n#SY`}2?G
z813FA<9c{<o_W%n=U;Pb4y9Rc*crw*WwVd|jMGa~xg!}4uU~P>>D*4{gG)YLYA;^A
zcCHuu_Q~=5L7E0PXX{*)4SzJ_X!C=<^l$yHn`blaU=5q9!R&H*$Aa8xCt0IkzY1>t
z5#=aWx_hyP)U&)ug|9L@4)o8Jj@%WvWs=v6&||F<`x98EUrJI)m{h@e?UQ<kbxz>Q
zos*+fCv5u8AsG?yh>3Hf@v>EmBqp3WV66ABRh%>Bh?(qyFRjv7BChOt+-0bEv|O*-
zF8aeEr{kv^3UcS)z1v=z`9=8M#>Y|rSeME_S@Z4tENP}T(cOD@&9Mmo*YuogjknDs
zCuz2tdFpwwOi%yl>6wU2xSf&TTKI+eScbFxl8t?fzu2vnT=e~K%7pcIZ4CY^T-0Hi
zFm>u#!?I0ZeI}HuA9*=l{-WUXjR%Dzm3i4e&soi^Y0n}eExkGT{l)k5Fa2Y<;%3`(
zW62MVOW!2t%zO9qXpr}Z6UI9EXCC_I-rHfZCN(`>=bqTn`7>?KlpO!_K~d)Uo^q~-
zG8<k5Y+#jb_$K+L{bRp{$=3y<mdCsD_H0^GD-<FwYASHE?P$W{BipZ>Vls2ey*RCA
z^})%z!j~ne=s%Hmo4RafZkVxcsoSdMDe3j6er;{O@MQM_<BC%26)Ie9OOLf3ndj)M
zaq6I2%>7#T$7|JDUd>&Z@ZtVb#VphFUc3I>Y49+gynJH9R|U=6r<^uF59}`8knj7@
zEztkbT+fBx0TSVRBso+*oSW8gz5T_Hzf(1><aEErW%Q|)gf}eI^b$)<y*>F-)9U5#
zk7&P^oxAOC?2mi($Mzqe;B+&|qiG4}1dgpz8n;CJtar{6NeK&2<CDx>cZhYGz^u!`
z>pg<z{Ia|!`8O_q<@23qWQyL`A8kJ{@$QD}cX|%T)rJP8xnJbp)gIX?7bxtK@$mhX
v{Q=&LOmfV)a+3rD2rvTil12~<f8Jt+<Sn#(72wUv1~G+^AqhzPFoSpi5<RS3
--- a/content/base/test/file_htmlserializer_1_links.html
+++ b/content/base/test/file_htmlserializer_1_links.html
@@ -6,17 +6,17 @@ charset=UTF-8">
 </head><body>
 <p>Hello world</p> <p>
 
        Lorem ipsum dolor sit amet, <strong>consectetuer</strong> 
 adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. 
 Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
  ad 
      litora</span> torquent <a 
-href="http://localhost:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
+href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
  conubia</a> 
 nostra, per inceptos hymenaeos. </p>
 
 
 <ul><li>Nam tellus massa,éàèçù</li><li>
  fringilla 
 aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
 <div> Duis tristique egestas ligula. Mauris quis felis. </div>
@@ -45,9 +45,9 @@ comments -->
  consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br>
 lacus risus pulvinar ante.
 </pre>
 ut gravida eros leo ut libero
 <p></p>
 <noscript>
 <p>Curabitur consectetuer urna a sem. Nunc & non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus</p></noscript>
 <p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus 
-aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
\ No newline at end of file
+aliquet lectus. Nunc vitae eros. Class aptent taciti</p></body></html>
--- a/content/base/test/file_xhtmlserializer_1.xhtml
+++ b/content/base/test/file_xhtmlserializer_1.xhtml
@@ -52,9 +52,9 @@ ut gravida eros <br />leo ut libero
 <p>Nam eu sapien. Sed viverra lacus. Donec quis ipsum. Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti</p>
 <pre xmlns="http://mozilla.org/ns/foo">lacinia <em>libero</em> ullamcorper laoreet.<br/>
  Cras quis<br/>
  nisi at odio<br/>
  consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at pharetra rutrum, <br/>
 lacus risus pulvinar ante.
 </pre>
 </body>
-</html>
\ No newline at end of file
+</html>
--- a/content/base/test/file_xhtmlserializer_1_links.xhtml
+++ b/content/base/test/file_xhtmlserializer_1_links.xhtml
@@ -9,17 +9,17 @@
 <body>
 <p>Hello world</p> <p>
 
        Lorem ipsum dolor sit amet, <strong>consectetuer</strong> 
 adipiscing elit. Nam eu sapien. Sed viverra lacus. Donec quis ipsum. 
 Nunc cursus aliquet lectus. Nunc vitae eros. Class aptent taciti <span>sociosqu
  ad 
      litora</span> torquent <a 
-href="http://localhost:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
+href="http://mochi.test:8888/tests/content/base/test/file_htmlserializer_1_result1.html">per
  conubia</a> 
 nostra, per inceptos hymenaeos. </p>
 
 
 <ul><li>Nam tellus massa,éàèçù</li><li>
  fringilla 
 aliquam,</li><li> fermentum sit amet,</li><li>posuere ac,</li><li> est.</li></ul>
 <div> Duis tristique egestas ligula. Mauris quis felis. </div>
@@ -63,9 +63,9 @@ ullamcorper laoreet.<br/>
  nisi at odio<br/>
  consectetuer molestie. Curabitur consectetuer urna a sem. Nunc non 
 urna. Cras in massa. Vestibulum ante ipsum primis in faucibus orci 
 luctus et ultrices posuere cubilia Curae; Sed sollicitudin, nulla at 
 pharetra rutrum, <br/>
 lacus risus pulvinar ante.
 </pre>
 </body>
-</html>
\ No newline at end of file
+</html>
--- a/content/base/test/test_CSP.html
+++ b/content/base/test/test_CSP.html
@@ -114,14 +114,22 @@ window.testResult = function(testname, r
   window.examiner.remove();
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 // save this for last so that our listeners are registered.
 // ... this loads the testbed of good and bad requests.
-document.getElementById('cspframe').src = 'file_CSP.sjs?main=1';
+
+netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
+var pps = Components.classes["@mozilla.org/network/protocol-proxy-service;1"].getService();
+
+var uri = ios.newURI("http://example.com", null, null);
+var pi = pps.resolve(uri, 0);
+var proxy = pi.host + ":" + pi.port;
+document.getElementById('cspframe').src = 'file_CSP.sjs?main=1&proxy=' + proxy;
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/base/test/test_CrossSiteXHR.html
+++ b/content/base/test/test_CrossSiteXHR.html
@@ -63,17 +63,17 @@ gen = runTest();
 
 function runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
   basePath = "/tests/content/base/test/file_CrossSiteXHR_server.sjs?"
-  baseURL = "http://localhost:8888" + basePath;
+  baseURL = "http://mochi.test:8888" + basePath;
 
   if (!runOriginTests) {
     origins = [];
   }
 
   for each(originEntry in origins) {
     origin = originEntry.origin || originEntry.server;
 
--- a/content/base/test/test_CrossSiteXHR_cache.html
+++ b/content/base/test/test_CrossSiteXHR_cache.html
@@ -414,17 +414,17 @@ function runTest() {
              method: "GET",
              noOrigin: 1,
            },
            { pass: 0,
              method: "DELETE"
            },
            ];
 
-  baseURL = "http://localhost:8888/tests/content/base/test/" +
+  baseURL = "http://mochi.test:8888/tests/content/base/test/" +
              "file_CrossSiteXHR_cache_server.sjs?";
   setStateURL = baseURL + "setState=";
 
   var unique = Date.now();
   for each (test in tests) {
     if (test.newTest) {
       unique++;
       continue;
--- a/content/base/test/test_XHRDocURI.html
+++ b/content/base/test/test_XHRDocURI.html
@@ -26,34 +26,34 @@ SimpleTest.waitForExplicitFinish();
 
 gen = runTest();
 gen.next();
 
 function runTest() {
   is(document.baseURI, "http://example.org/", "wrong doc baseURI");
 
   xhr = new XMLHttpRequest;
-  xhr.open("GET", "http://localhost:8888/tests/content/base/test/file_XHRDocURI.xml");
+  xhr.open("GET", "http://mochi.test:8888/tests/content/base/test/file_XHRDocURI.xml");
   xhr.onreadystatechange = function(e) {
     if (!xhr.responseXML)
       return;
-    is(xhr.responseXML.documentURI, "http://localhost:8888/tests/content/base/test/file_XHRDocURI.xml",
+    is(xhr.responseXML.documentURI, "http://mochi.test:8888/tests/content/base/test/file_XHRDocURI.xml",
        "wrong url");
-    is(xhr.responseXML.baseURI, "http://localhost:8888/tests/content/base/test/file_XHRDocURI.xml",
+    is(xhr.responseXML.baseURI, "http://mochi.test:8888/tests/content/base/test/file_XHRDocURI.xml",
        "wrong base");
     if (xhr.readyState == 4) {
       gen.next();
     }
   };
   xhr.send();
   yield;
 
 
   xhr = new XMLHttpRequest;
-  xhr.open("GET", "http://localhost:8888/tests/content/base/test/file_XHRDocURI.text");
+  xhr.open("GET", "http://mochi.test:8888/tests/content/base/test/file_XHRDocURI.text");
   xhr.onreadystatechange = function(e) {
     is(xhr.responseXML, null, "should not have document");
     if (xhr.readyState == 4)
       gen.next();
   };
   xhr.send();
   yield;
 
--- a/content/base/test/test_bug345339.html
+++ b/content/base/test/test_bug345339.html
@@ -10,17 +10,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=345339">Mozilla Bug 345339</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
  <iframe id="testframe"
-         src="http://localhost:8888/tests/content/base/test/345339_iframe.html">
+         src="http://mochi.test:8888/tests/content/base/test/345339_iframe.html">
  </iframe>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 /** Test for Bug 345339 **/
 SimpleTest.waitForExplicitFinish();
 
 function afterLoad() {
     var iframeDoc = $("testframe").contentDocument;
--- a/content/base/test/test_bug398243.html
+++ b/content/base/test/test_bug398243.html
@@ -9,17 +9,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=398243">Mozilla Bug 398243</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
- <iframe id="testframe" src="http://localhost:8888/tests/content/base/test/formReset.html"></iframe>  
+ <iframe id="testframe" src="http://mochi.test:8888/tests/content/base/test/formReset.html"></iframe>  
 <pre id="test">
 <script class="testbody" type="text/javascript">
 /** Test for Bug 398243 **/
 const enteredText1 = "New value for text input";
 const enteredText2 = "New value for texarea";
 SimpleTest.waitForExplicitFinish();
 
 function afterLoad() {
--- a/content/base/test/test_bug422403-1.html
+++ b/content/base/test/test_bug422403-1.html
@@ -109,17 +109,17 @@ function testHtmlSerializer_1 () {
   out = encoder.encodeToString();
   expected = loadFileContent("file_xhtmlserializer_1_bodyonly.xhtml");
   is(out, expected, "test OutputBodyOnly");
 
 
   //------------ OutputAbsoluteLinks
   encoder.init(doc, "application/xhtml+xml", de.OutputLFLineBreak | de.OutputAbsoluteLinks);
   out = encoder.encodeToString();
-  expected = loadFileContent("file_xhtmlserializer_1_links.xhtml");
+  expected = loadFileContent("file_xhtmlserializer_1_links.xhtml").trim('\n');
   is(out, expected, "test OutputAbsoluteLinks");
 
   //------------ OutputLFLineBreak
   encoder.init(doc, "application/xhtml+xml",de.OutputLFLineBreak);
   out = encoder.encodeToString();
   expected = loadFileContent("file_xhtmlserializer_1_linebreak.xhtml");
   is(out, expected, "test OutputLFLineBreak");
 
--- a/content/base/test/test_bug422537.html
+++ b/content/base/test/test_bug422537.html
@@ -21,17 +21,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 422537 **/
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
 var isupports_string = Components.classes["@mozilla.org/supports-string;1"]
                                  .createInstance(Components.interfaces.nsISupportsString);
 isupports_string.data = "foo";
 
-const url = "http://localhost:8888";
+const url = "http://mochi.test:8888";
 var body = [
   document,
   "foo",
   isupports_string
 ];
 
 for each (var i in body) {
   var xhr = new XMLHttpRequest();
--- a/content/base/test/test_bug424359-1.html
+++ b/content/base/test/test_bug424359-1.html
@@ -115,17 +115,17 @@ function testHtmlSerializer_1 () {
   expected = loadFileContent("file_htmlserializer_1_bodyonly.html");
   isRoughly(out, expected, "test OutputBodyOnly");
 
 
 
   //------------ OutputAbsoluteLinks
   encoder.init(doc, "text/html", de.OutputLFLineBreak | de.OutputAbsoluteLinks);
   out = encoder.encodeToString();
-  expected = loadFileContent("file_htmlserializer_1_links.html");
+  expected = loadFileContent("file_htmlserializer_1_links.html").trim('\n');
   isRoughly(out, expected, "test OutputAbsoluteLinks");
 
   //------------ OutputLFLineBreak
   encoder.init(doc, "text/html",de.OutputLFLineBreak);
   out = encoder.encodeToString();
   expected = loadFileContent("file_htmlserializer_1_linebreak.html");
   isRoughly(out, expected, "test OutputLFLineBreak");
 
--- a/content/base/test/test_bug461735.html
+++ b/content/base/test/test_bug461735.html
@@ -22,16 +22,16 @@ window.onerror = function(message, uri, 
   is(uri, "http://example.com/tests/content/base/test/bug461735-post-redirect.js", "Unexpected error location URI");
   is(line, 0, "Shouldn't have a line here");
 }
 </script>
 <script src="bug461735-redirect1.sjs"></script>
 <script type="application/javascript">
 window.onerror = function(message, uri, line) {
   is(message, "c is not defined", "Should have correct error message");
-  is(uri, "http://localhost:8888/tests/content/base/test/bug461735-post-redirect.js", "Unexpected error location URI");
+  is(uri, "http://mochi.test:8888/tests/content/base/test/bug461735-post-redirect.js", "Unexpected error location URI");
   is(line, 3, "Should have a line here");
 }
 </script>
 <script src="bug461735-redirect2.sjs"></script>
 </pre>
 </body>
 </html>
--- a/content/base/test/test_bug475156.html
+++ b/content/base/test/test_bug475156.html
@@ -9,17 +9,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="drive(tests.shift());">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
-var path = "http://localhost:8888/tests/content/base/test/";
+var path = "http://mochi.test:8888/tests/content/base/test/";
 
 function fromCache(xhr)
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var ch = xhr.channel.QueryInterface(Components.interfaces.nsICachingChannel);
   return ch.isFromCache();  
 }
 
--- a/content/html/content/test/file_bug209275_3.html
+++ b/content/html/content/test/file_bug209275_3.html
@@ -7,17 +7,17 @@
 Initial state
 
 <script>
 function load() {
   // Nuke and rebuild the page.  If document.open() clears the <base> properly,
   // our new <base> will take precedence and the test will pass.
   document.open();
   document.write("<html><body><a id='link' href='/'>A</a>" +
-                 "<base href='http://localhost:8888' /></body></html>");
+                 "<base href='http://mochi.test:8888' /></body></html>");
 
   // Tell our parent to have a look at us.
   parent.gGen.next();
 }
 </script>
 
 </body>
 </html>
--- a/content/html/content/test/test_bug209275.xhtml
+++ b/content/html/content/test/test_bug209275.xhtml
@@ -123,17 +123,17 @@ function run() {
 
   // Load http://example.com/${rand} into an iframe so we can test that changing
   // the document's base changes the visitedness of our links.
   iframe.onload = continueTest;
   iframeCw.location = "http://example.com/" + rand;
   yield; // wait for onload to fire.
 
   // Make sure things are what as we expect them at the beginning.
-  link123HrefIs("http://localhost:8888/", 1);
+  link123HrefIs("http://mochi.test:8888/", 1);
   is($('link4').href, loc + "#", "link 4 test 1");
   is($('link5').href, loc + "#", "link 5 test 1");
 
   // Remove link5 from the document.  We're going to test that its href changes
   // properly when we change our base.
   var link5 = $('link5');
   link5.parentNode.removeChild(link5);
 
@@ -157,25 +157,25 @@ function run() {
     setTimeout(continueTest, 10);
     yield;
   }
   is(getFill($('ellipselink')), visitedFill,
           "Wrong ellipse fill after base change.");
 
   $('base1').href = "foo/";
   // Should be interpreted relative to current URI (not the current base), so
-  // base should now be http://localhost:8888/foo/
+  // base should now be http://mochi.test:8888/foo/
 
-  link123HrefIs("http://localhost:8888/", 3);
+  link123HrefIs("http://mochi.test:8888/", 3);
   is($('link4').href, path + "foo/#", "link 4 test 3");
 
   // Changing base2 shouldn't affect anything, because it's not the first base
   // tag.
   $('base2').href = "http://example.org/bar/";
-  link123HrefIs("http://localhost:8888/", 4);
+  link123HrefIs("http://mochi.test:8888/", 4);
   is($('link4').href, path + "foo/#", "link 4 test 4");
 
   // If we unset base1's href attribute, the document's base should come from
   // base2, whose href is http://example.org/bar/.
   $('base1').removeAttribute("href");
   link123HrefIs("http://example.org/", 5);
   is($('link4').href, "http://example.org/bar/#", "link 4 test 5");
 
@@ -201,23 +201,23 @@ function run() {
   is($('link4').href, "http://base4.example.org/#", "link 4 test 8");
 
   // Now if we remove all the base tags, the base should become the page's URI
   // again.
   $('base2').parentNode.removeChild($('base2'));
   base3.parentNode.removeChild(base3);
   base4.parentNode.removeChild(base4);
 
-  link123HrefIs("http://localhost:8888/", 9);
+  link123HrefIs("http://mochi.test:8888/", 9);
   is($('link4').href, loc + "#", "link 4 test 9");
 
   // Setting the href of base0 shouldn't do anything because it's not in the
   // XHTML namespace.
   $('base0').href = "http://bar.com";
-  link123HrefIs("http://localhost:8888/", 10);
+  link123HrefIs("http://mochi.test:8888/", 10);
   is($('link4').href, loc + "#", "link 4 test 10");
 
   // We load into an iframe a document with a <base href="...">, then remove
   // the document element.  Then we add an <html>, <body>, and <a>, and make
   // sure that the <a> is resolved relative to the page's location, not its
   // original base.  We do this twice, rebuilding the document in a different
   // way each time.
 
@@ -226,25 +226,25 @@ function run() {
   yield; // wait for our child to call us back.
   is(iframeCw.document.getElementById("link").href,
      path + "file_bug209275_1.html#",
      "Wrong href after nuking document.");
 
   iframeCw.location = "file_bug209275_2.html";
   yield; // wait for callback from child
   is(iframeCw.document.getElementById("link").href,
-     "http://localhost:8888/",
+     "http://mochi.test:8888/",
      "Wrong href after nuking document second time.");
 
   // Make sure that document.open() makes the document forget about any <base>
   // tags it has.
   iframeCw.location = "file_bug209275_3.html";
   yield; // wait for callback from child
   is(iframeCw.document.getElementById("link").href,
-     "http://localhost:8888/",
+     "http://mochi.test:8888/",
      "Wrong href after document.open().");
 
   SimpleTest.finish();
   yield;
 }
 
 window.addEventListener("load", function() {
   gGen = run();
--- a/content/html/content/test/test_bug353415-1.html
+++ b/content/html/content/test/test_bug353415-1.html
@@ -27,14 +27,14 @@
 <input name="field12">
 <input type="button" name="field13" value="button">
 </form>
 <script>
 	document.forms[0].submit();
 
 	SimpleTest.waitForExplicitFinish();
         function doCheck(){
-		is(frames['submit_frame'].location.href, "http://localhost:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
+		is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
                 SimpleTest.finish();
 	}
 </script>
 </body>
 </html>
--- a/content/html/content/test/test_bug353415-2.html
+++ b/content/html/content/test/test_bug353415-2.html
@@ -52,14 +52,14 @@
 </tr>
 </table>
 </form>
 <script>
 	document.forms[0].submit();
 
 	SimpleTest.waitForExplicitFinish();
         function doCheck(){
-		is(frames['submit_frame'].location.href, "http://localhost:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
+		is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
                 SimpleTest.finish();
 	}
 </script>
 </body>
 </html>
--- a/content/html/content/test/test_bug392567.html
+++ b/content/html/content/test/test_bug392567.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     <input type="text" name="key" />
   </form>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 392567 **/
 
-var dataUrl = "http://localhost:8888/tests/content/html/content/test/bug392567.jar";
+var dataUrl = "http://mochi.test:8888/tests/content/html/content/test/bug392567.jar";
 var jarUrl = "jar:" + dataUrl + "!/index.html";
 var httpUrl = location.href.replace(/\.html.*/, "_404");
 
 var form = document.forms.testForm;
 var frame = frames.testFrame;
 document.getElementById("testFrame").onload = processTestResult;
 
 // List of tests to run, each test consists of form action URL and expected result URL
--- a/content/html/document/test/bug196523-subframe.html
+++ b/content/html/document/test/bug196523-subframe.html
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
 <script>
   function checkDomain(str, msg) {
     window.parent.postMessage((str == document.domain) + ";" +msg,
-                              "http://localhost:8888/");
+                              "http://mochi.test:8888");
   }
 
   function reportException(msg) {
-    window.parent.postMessage(false + ";" + msg, "http://localhost:8888/");
+    window.parent.postMessage(false + ";" + msg, "http://mochi.test:8888");
   }
 
   var win1;
   try {
     win1 = window.open("", "", "width=100,height=100");
     var otherDomain1 = win1.document.domain;
     win1.close();
     checkDomain(otherDomain1, "Opened document should have our domain");
--- a/content/html/document/test/test_bug445004.html
+++ b/content/html/document/test/test_bug445004.html
@@ -13,17 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445004">Mozilla Bug 445004</a>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 445004 **/
-is(window.location.hostname, "localhost", "Unexpected hostname");
+is(window.location.hostname, "mochi.test", "Unexpected hostname");
 is(window.location.port, "8888", "Unexpected port; fix testcase");
 
 SimpleTest.waitForExplicitFinish();
 
 var loads = 0;
 
 function loadStarted() {
   ++loads;
--- a/content/media/test/dynamic_redirect.sjs
+++ b/content/media/test/dynamic_redirect.sjs
@@ -1,16 +1,16 @@
 // Return seek.ogv file content for the first request with a given key.
 // All subsequent requests return a redirect to a different-origin resource.
 function handleRequest(request, response)
 {
   var key = request.queryString.match(/^key=(.*)$/);
 
   if (getState(key[1]) == "redirect") {
-    var origin = request.host == "localhost" ? "example.org" : "localhost:8888";
+    var origin = request.host == "mochi.test" ? "example.org" : "mochi.test:8888";
     response.setStatusLine(request.httpVersion, 303, "See Other");
     response.setHeader("Location", "http://" + origin + "/tests/content/media/test/seek.ogv");
     response.setHeader("Content-Type", "text/html");
     return;
   }
 
   setState(key[1], "redirect");
 
--- a/content/media/test/test_delay_load.html
+++ b/content/media/test/test_delay_load.html
@@ -72,17 +72,17 @@ function createVideo(id) {
       log('event ' + evt.target.id + " " + evt.type);
     }
 
     for (var i=0; i<gEventTypes.length; i++) {
       var t = gEventTypes[i];
       v.addEventListener(t, listener, false);
     }
   }
-  v.src = "http://localhost:8888/tests/content/media/test/320x240.ogv";
+  v.src = "http://mochi.test:8888/tests/content/media/test/320x240.ogv";
   register(v);
   return v;
 }
 
 // Load, add, then remove.
 var v1 = createVideo("v1");
 v1.load();
 document.body.appendChild(v1);
--- a/content/media/test/test_mixed_principals.html
+++ b/content/media/test/test_mixed_principals.html
@@ -48,17 +48,17 @@ function loaded(id) {
 // fact that Ogg will do a seek to the end of the resource, triggering a new
 // load with the same key which will return a same-origin resource.
 // Loading data from two different origins should be detected by the media
 // cache and result in a null principal so that the canvas usage above fails.
 var key = Math.floor(Math.random()*100000000);
 
 // In v1, try loading from same-origin first and then getting redirected to
 // another origin.
-v1.src = "http://localhost:8888/tests/content/media/test/dynamic_redirect.sjs?key=v1_" + key;
+v1.src = "http://mochi.test:8888/tests/content/media/test/dynamic_redirect.sjs?key=v1_" + key;
 v1.load();
 
 // In v2, try loading cross-origin first and then getting redirected to
 // our origin.
 v2.src = "http://example.org/tests/content/media/test/dynamic_redirect.sjs?key=v2_" + key;
 v2.load();
 
 </script>
--- a/content/xbl/test/file_bug379959_cross.html
+++ b/content/xbl/test/file_bug379959_cross.html
@@ -12,14 +12,14 @@
 }
 </style>
 <body>
 <div id="div1"></div>
 <div id="div2"></div>
 <script>
 onload = function() {
   nodes = document.getAnonymousNodes(document.getElementById('div1'));
-  parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
+  parent.postMessage(nodes ? nodes.length : 0, "http://mochi.test:8888");
   nodes = document.getAnonymousNodes(document.getElementById('div2'));
-  parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
+  parent.postMessage(nodes ? nodes.length : 0, "http://mochi.test:8888");
 }
 </script>
 </html>
--- a/content/xbl/test/file_bug379959_data.html
+++ b/content/xbl/test/file_bug379959_data.html
@@ -7,12 +7,12 @@
   -moz-binding: url(data:text/xml;charset=utf-8,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Cbindings%20id%3D%22xbltestBindings%22%20xmlns%3D%22http%3A//www.mozilla.org/xbl%22%3E%0A%20%20%3Cbinding%20id%3D%22xbltest%22%3E%3Ccontent%3EPASS%3C/content%3E%3C/binding%3E%0A%3C/bindings%3E%0A);
 }
 </style>
 <body>
 <div id="d"></div>
 <script>
 onload = function() {
   nodes = document.getAnonymousNodes(document.getElementById('d'));
-  parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
+  parent.postMessage(nodes ? nodes.length : 0, "http://mochi.test:8888");
 }
 </script>
 </html>
--- a/content/xbl/test/test_bug379959.html
+++ b/content/xbl/test/test_bug379959.html
@@ -24,17 +24,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     <script class="testbody" type="application/javascript;version=1.7">
 SimpleTest.waitForExplicitFinish();
 
 gen = runTest();
 var messages = 0;
 
 function receiveMessage(e)
 {
-  is(e.origin, "http://localhost:8888", "wrong sender!");
+  is(e.origin, "http://mochi.test:8888", "wrong sender!");
   messages++;
   gen.send(e.data);
 }
 
 window.addEventListener("message", receiveMessage, false);
 
 const prefName = "layout.debug.enable_data_xbl";
 
--- a/docshell/test/chrome/bug215405_window.xul
+++ b/docshell/test/chrome/bug215405_window.xul
@@ -47,17 +47,17 @@
 
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok"];
     for each (var import in imports) {
       window[import] = window.opener.wrappedJSObject[import];
     }
 
     const text="MOZILLA";
-    const nostoreURI = "http://localhost:8888/tests/docshell/test/chrome/" +
+    const nostoreURI = "http://mochi.test:8888/tests/docshell/test/chrome/" +
                        "215405_nostore.html";
     const nocacheURI = "https://example.com:443/tests/docshell/test/chrome/" +
                        "215405_nocache.html";
 
     var gBrowser;
     var gTestsIterator;
     var scrollX = 0;
     var scrollY = 0;
--- a/docshell/test/chrome/bug92598_window.xul
+++ b/docshell/test/chrome/bug92598_window.xul
@@ -113,17 +113,17 @@
       } catch (err if err instanceof StopIteration) {
         finish();
       }
     }
 
     function testsIterator() {
       // Load a page with a no-cache header, followed by a simple page
       // On pagehide, first page should report it is not being persisted
-      var test1DocURI = "http://localhost:8888/tests/docshell/test/chrome/92598_nostore.html";
+      var test1DocURI = "http://mochi.test:8888/tests/docshell/test/chrome/92598_nostore.html";
 
       gExpected = [{type: "pagehide", persisted: true},
                    {type: "load", title: "test1"},
                    {type: "pageshow", title: "test1", persisted: false}];
       gBrowser.loadURI(test1DocURI);
       yield;
 
       var test2Doc = "data:text/html,<html><head><title>test2</title></head>" +
--- a/docshell/test/chrome/docshell_helpers.js
+++ b/docshell/test/chrome/docshell_helpers.js
@@ -405,17 +405,17 @@ function enableBFCache(enable) {
   }
 }
 
 /**
  * Returns the full HTTP url for a file in the mochitest docshell test 
  * directory.
  */
 function getHttpUrl(filename) {
-  return "http://localhost:8888/chrome/docshell/test/chrome/" + filename;
+  return "http://mochi.test:8888/chrome/docshell/test/chrome/" + filename;
 }
 
 /**
  * A convenience object with methods that return the current test window, 
  * browser, and document.
  */
 var TestWindow = {};
 TestWindow.getWindow = function () {
--- a/docshell/test/test_bug369814.html
+++ b/docshell/test/test_bug369814.html
@@ -53,17 +53,17 @@ function loadEvent(window, callback)
     window.removeEventListener("load", fn, false);
     callback();
   };
   window.addEventListener("load", fn, false);
 }
 
 function loadTestTarget(callback)
 {
-  gTargetWindow = window.open("http://localhost:8888", "bug369814target");
+  gTargetWindow = window.open("http://mochi.test:8888", "bug369814target");
   loadEvent(gTargetWindow, callback);
 }
 
 function closeTestTarget()
 {
   gTargetWindow.close();
   gTargetWindow = null;
 }
@@ -121,47 +121,47 @@ function anchorTest(test) {
             finishTest();
           }, gLoadTimeout);
         });
     });
 }
 
 var gTests = [
   { "name" : "iframes.html loaded from non-jar type, pref disabled",
-    "url" : "jar:http://localhost:8888/tests/docshell/test/bug369814.zip!/iframes.html",
+    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/iframes.html",
     "pref" : false,
     "pokes" : { },
     "func" : loadErrorTest,
   },
   { "name" : "refresh.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://localhost:8888/tests/docshell/test/bug369814.zip!/refresh.html",
+    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/refresh.html",
     "pref" : true,
     "pokes" : { },
     "func" : refreshTest,
   },
   { "name" : "iframes.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://localhost:8888/tests/docshell/test/bug369814.zip!/iframes.html",
+    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/iframes.html",
     "pref" : true,
     "pokes" : { },
     "func" : iframeTest,
   },
   { "name" : "anchors.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://localhost:8888/tests/docshell/test/bug369814.zip!/anchors.html",
+    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/anchors.html",
     "pref" : true,
     "pokes" : { },
     "func" : anchorTest,
   },
   { "name" : "iframes.html loaded from view-source jar type, pref disabled",
-    "url" : "jar:view-source:http://localhost:8888/tests/docshell/test/bug369814.jar!/iframes.html",
+    "url" : "jar:view-source:http://mochi.test:8888/tests/docshell/test/bug369814.jar!/iframes.html",
     "pref" : false,
     "pokes" : { },
     "func" : loadErrorTest
   },
   { "name" : "iframes.html loaded from view-source jar type, pref enabled",
-    "url" : "jar:view-source:http://localhost:8888/tests/docshell/test/bug369814.jar!/iframes.html",
+    "url" : "jar:view-source:http://mochi.test:8888/tests/docshell/test/bug369814.jar!/iframes.html",
     "pref" : true,
     "pokes" : { },
     "func" : loadErrorTest
   },
 ];
 
 var gNextTest = 0;
 
--- a/docshell/test/test_bug529119-1.html
+++ b/docshell/test/test_bug529119-1.html
@@ -5,17 +5,17 @@
 <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
 <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>        
 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
-var workingURL = "http://localhost:8888/tests/docshell/test/bug529119-window.html";
+var workingURL = "http://mochi.test:8888/tests/docshell/test/bug529119-window.html";
 var faultyURL = "http://some-non-existent-domain-27489274c892748217cn2384.com/";
 
 var w = null;
 var phase = 0;
 var gotWrongPageOnTryAgainClick = false;
 
 function pollForPage(f, w)
 {
--- a/docshell/test/test_bug529119-2.html
+++ b/docshell/test/test_bug529119-2.html
@@ -5,17 +5,17 @@
 <script type="text/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
 <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>        
 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
-var workingURL = "http://localhost:8888/tests/docshell/test/bug529119-window.html";
+var workingURL = "http://mochi.test:8888/tests/docshell/test/bug529119-window.html";
 var faultyURL = "http://some-non-existent-domain-27489274c892748217cn2384.com/";
 
 var w = null;
 var phase = 0;
 
 function pollForPage(expectErrorPage, f, w)
 {
   // Start with polling after a delay, we might mistakenly take the current page
--- a/docshell/test/test_bug94514.html
+++ b/docshell/test/test_bug94514.html
@@ -18,17 +18,17 @@ not get added to global history.
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
-var startURI = "http://localhost:8888/tests/docshell/test/bug94514-postpage.html";
+var startURI = "http://mochi.test:8888/tests/docshell/test/bug94514-postpage.html";
 var postedURI = startURI + "?posted=1";
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 var ios = Cc["@mozilla.org/network/io-service;1"].
--- a/dom/tests/mochitest/ajax/offline/445544.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/445544.cacheManifest
@@ -1,9 +1,9 @@
 CACHE MANIFEST
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 test_bug445544.html
 445544_part1.html
 
 # not including 445544_part2.html
--- a/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest
@@ -1,4 +1,4 @@
 # This doesn't start with the magic cache manifest line.
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
--- a/dom/tests/mochitest/ajax/offline/fallback.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/fallback.cacheManifest
@@ -1,12 +1,12 @@
 CACHE MANIFEST
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 FALLBACK:
 namespace1/ fallback.html
 namespace1/sub/		fallback2.html
 namespace2/ fallbackTop.html
 
 NETWORK:
 onwhitelist.html
--- a/dom/tests/mochitest/ajax/offline/foreign2.html
+++ b/dom/tests/mochitest/ajax/offline/foreign2.html
@@ -1,54 +1,54 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest">
 <head>
 <title>Foreign page 2</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <script class="testbody" type="text/javascript">
 
 function manifestUpdated()
 {
   var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
     .getService(Components.interfaces.nsIApplicationCacheService);
 
   var foreign2cache = appCacheService.chooseApplicationCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
 
   OfflineTest.ok(foreign2cache, "Foreign 2 cache present, chosen for foreign2.html");
-  OfflineTest.is(foreign2cache.groupID, "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest")
+  OfflineTest.is(foreign2cache.groupID, "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest")
 
   var foreign1cache = appCacheService.getActiveCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
   OfflineTest.ok(foreign1cache, "Foreign 1 cache loaded");
   foreign1cache.discard();
 
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 function onLoaded()
 {
   var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
     .getService(Components.interfaces.nsIApplicationCacheService);
 
   var foreign1cache = appCacheService.getActiveCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
   OfflineTest.ok(foreign1cache, "Foreign 1 cache loaded");
 
   var foreign2cache = appCacheService.getActiveCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest");
   OfflineTest.ok(!foreign2cache, "Foreign 2 cache not present");
 
   foreign1cache = appCacheService.chooseApplicationCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
   OfflineTest.ok(!foreign1cache, "foreign2.html not chosen from foreign1 cache");
 
   try
   {
     OfflineTest.ok(applicationCache.status == Components.interfaces.nsIDOMOfflineResourceList.UNCACHED,
         "there is no associated application cache");
   }
   catch (ex)
--- a/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs
+++ b/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs
@@ -1,6 +1,6 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updating.cacheManifest");
+  response.setHeader("Location", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updating.cacheManifest");
   response.setHeader("Content-Type", "text/cache-manifest");
 }
--- a/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest
@@ -1,7 +1,7 @@
 CACHE MANIFEST
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 # The following item doesn't exist, and will cause an update error.
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/doesntExist.html
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/doesntExist.html
--- a/dom/tests/mochitest/ajax/offline/obsolete.html
+++ b/dom/tests/mochitest/ajax/offline/obsolete.html
@@ -45,17 +45,17 @@ applicationCache.oncached = function() {
   applicationCache.oncached = fail;
   applicationCache.onupdateready = fail;
   applicationCache.onnoupdate = fail;
   applicationCache.onerror = fail;
   applicationCache.onobsolete = obsolete;
 
   // Make the obsoleting.sjs return 404 NOT FOUND code
   var req = new XMLHttpRequest();
-  req.open("GET", "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
+  req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
   var channel = req.channel
     .QueryInterface(Components.interfaces.nsIApplicationCacheChannel);
   channel.chooseApplicationCache = false;
   channel.inheritApplicationCache = false;
   req.send("");
   req.onreadystatechange = function() {
     if (req.readyState == 4) {
       applicationCache.update();
--- a/dom/tests/mochitest/ajax/offline/overlap.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/overlap.cacheManifest
@@ -1,13 +1,13 @@
 CACHE MANIFEST
 
 CACHE:
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 NETWORK:
 bogus/specific/
 
 FALLBACK:
 # Fall back for a bogus namespace
 bogus/ fallback.html
--- a/dom/tests/mochitest/ajax/offline/redirects.sjs
+++ b/dom/tests/mochitest/ajax/offline/redirects.sjs
@@ -1,34 +1,34 @@
 ver1manifest =
   "CACHE MANIFEST\n" +
   "# v1\n" +
   "\n" +
-  "http://localhost:8888/tests/SimpleTest/SimpleTest.js\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
+  "http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
 
 ver2manifest =
   "CACHE MANIFEST\n" +
   "# v2\n" +
   "\n" +
-  "http://localhost:8888/tests/SimpleTest/SimpleTest.js\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
+  "http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
 
 ver3manifest =
   "CACHE MANIFEST\n" +
   "# v3\n" +
   "\n" +
-  "http://localhost:8888/tests/SimpleTest/SimpleTest.js\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
+  "http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
 
 function handleRequest(request, response)
 {
   var match = request.queryString.match(/^state=(.*)$/);
   if (match)
   {
     response.setStatusLine(request.httpVersion, 204, "No content");
     setState("state", match[1]);
--- a/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest
+++ b/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest
@@ -1,12 +1,12 @@
 CACHE MANIFEST
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 # The following item doesn't have the same scheme as the manifest, and
 # will be ignored.
-https://localhost:8888/MochiKit/packed.js
+https://mochi.test:8888/MochiKit/packed.js
 
 # The following item is not a valid URI and will be ignored
 bad:/uri/invalid
 
--- a/dom/tests/mochitest/ajax/offline/simpleManifest.notmanifest
+++ b/dom/tests/mochitest/ajax/offline/simpleManifest.notmanifest
@@ -1,13 +1,13 @@
 CACHE MANIFEST
 
-http://localhost:8888/tests/SimpleTest/SimpleTest.js
-http://localhost:8888/MochiKit/packed.js
-http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
+http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
+http://mochi.test:8888/MochiKit/packed.js
+http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
 
 # The following item doesn't have the same scheme as the manifest, and
 # will be ignored.
-https://localhost:8888/MochiKit/packed.js
+https://mochi.test:8888/MochiKit/packed.js
 
 # The following item is not a valid URI and will be ignored
 bad:/uri/invalid
 
--- a/dom/tests/mochitest/ajax/offline/test_badManifestMagic.html
+++ b/dom/tests/mochitest/ajax/offline/test_badManifestMagic.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest">
 <head>
 <title>bad manifest magic</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -12,19 +12,19 @@
 var gGotChecking = false;
 
 function handleError() {
   OfflineTest.ok(gGotChecking, "Expected checking event");
   OfflineTest.ok(true, "Expected error event");
 
   // These items are listed in the manifest, but the error should have
   // prevented them from being committed to the cache.
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", false);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
 
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 
 if (OfflineTest.setup()) {
   // Don't expect a bunch of events.
--- a/dom/tests/mochitest/ajax/offline/test_badManifestMime.html
+++ b/dom/tests/mochitest/ajax/offline/test_badManifestMime.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.notmanifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.notmanifest">
 <head>
 <title>bad manifest content type</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -12,19 +12,19 @@
 var gGotChecking = false;
 
 function handleError() {
   OfflineTest.ok(gGotChecking, "Expected checking event");
   OfflineTest.ok(true, "Expected error event");
 
   // These items are listed in the manifest, but the error should have
   // prevented them from being committed to the cache.
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", false);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
 
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 if (OfflineTest.setup()) {
   // Don't expect a bunch of events.
   applicationCache.ondownloading = OfflineTest.failEvent;
--- a/dom/tests/mochitest/ajax/offline/test_bug460353.html
+++ b/dom/tests/mochitest/ajax/offline/test_bug460353.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
 <head>
 <title>Bug 460353</title>
 
 <!--
   This test checks that each iframe creates its own
   scope. Actually, we just check that it loads and updates
   its associated cache. There is no check that the cache is the
   expected one, there is no API to gain that information.
@@ -76,18 +76,18 @@ function finish()
   var Ci = Components.interfaces;
   var pm = Cc["@mozilla.org/permissionmanager;1"]
            .getService(Ci.nsIPermissionManager);
   var uri = Cc["@mozilla.org/network/io-service;1"]
             .getService(Ci.nsIIOService)
             .newURI(window.location.href, null, null);
   pm.remove(uri.host, "offline-app");
 
-  cleanCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest");
-  cleanCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs");
+  cleanCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest");
+  cleanCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs");
 
   SimpleTest.finish();
 }
 
 function cleanCache(manifestURL)
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
--- a/dom/tests/mochitest/ajax/offline/test_bug474696.html
+++ b/dom/tests/mochitest/ajax/offline/test_bug474696.html
@@ -1,22 +1,21 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
 <head>
 <title>Fallback on different origin redirect test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <script class="testbody" type="text/javascript">
-
 function manifestUpdated()
 {
-  fallbackFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/redirectToDifferentOrigin.sjs";
+  fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/redirectToDifferentOrigin.sjs";
   // Invokes load of fallback.html
 }
 
 function onFallbackLoad(fallbackIdentification)
 {
   OfflineTest.is(fallbackIdentification, 1, "Got correct fallback for namespace1");
 
   OfflineTest.teardown();
--- a/dom/tests/mochitest/ajax/offline/test_changingManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_changingManifest.html
@@ -1,24 +1,24 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
 <head>
 <title>changing manifest test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <script type="text/javascript">
 
 var gGotChecking = false;
 var gGotDownloading = false;
 
-var g1SecUrl =  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/changing1Sec.sjs";
-var g1HourUrl = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/changing1Hour.sjs";
+var g1SecUrl =  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changing1Sec.sjs";
+var g1HourUrl = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changing1Hour.sjs";
 
 var gCacheContents = null;
 
 function finish()
 {
   OfflineTest.teardown();
   OfflineTest.finish();
 }
--- a/dom/tests/mochitest/ajax/offline/test_fallback.html
+++ b/dom/tests/mochitest/ajax/offline/test_fallback.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
 <head>
 <title>Fallback entry test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -21,73 +21,73 @@ var gManifestUpdated = false;
 var gStep = 1;
 var gChildLoad = false;
 var gTopWindow = null;
 var gCompleteTimeout = null;
 
 function manifestUpdated()
 {
   gManifestUpdated = true;
-  fallbackFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
+  fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
   // Invokes load of fallback.html
 }
 
 function onFallbackLoad(fallbackIdentification)
 {
   switch (gStep)
   {
     case 001:
       OfflineTest.ok(!gChildLoad, "offline child not load before cache update");
       gChildLoad = true;
       // no break
 
     case 101:
       OfflineTest.is(fallbackIdentification, 1, "fallback for namespace1/ in step " + gStep);
 
-      fallbackFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html";
+      fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html";
       // Invokes load of fallback.html
       break;
 
     case 002:
     case 102:
       OfflineTest.is(fallbackIdentification, 1, "fallback for namespace1/, sub namespace in name of the frame in step " + gStep);
 
-      fallbackFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
+      fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
       // Invokes load of fallback2.html
       break;
 
     case 003:
     case 103:
       OfflineTest.is(fallbackIdentification, 2, "fallback for namespace1/sub/ in step " + gStep);
 
-      fallbackFrame.location = "HTTP://LOCALHOST:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
+      fallbackFrame.location = "HTTP://MOCHI.TEST:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
       // Invokes load of fallback2.html
       break;
 
     case 004:
     case 104:
       OfflineTest.is(fallbackIdentification, 2, "fallback for namespace1/sub/ in step " + gStep);
 
       // Try opening a non-existing page as a top level document. It must
       // fall to fallbackTop.html that identifies it self as '100'.
       gCompleteTimeout = window.setTimeout(function() {
         OfflineTest.ok(false, "Fallback page displayed for top level document");
         finalize();
       }, 3000);
 
-      gTopWindow = window.open("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
+      gTopWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
       // Invokes load of fallbackTop.html
 
       break;
 
     case 005:
       // Try all over again. This checks there are no entries for non-existing
       // pages created/leaked. That would prevent fallback load.
       gStep = 100;
-      fallbackFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
+      fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
       // Invokes load of fallback1.html, again, from the start
       // no break
 
     case 105:
       OfflineTest.is(fallbackIdentification, 100, "fallback for namespace2/, invoked by a top level document " + gStep);
 
       gTopWindow.close();
       gTopWindow = null;
@@ -103,20 +103,20 @@ function onFallbackLoad(fallbackIdentifi
 
   ++gStep;
 }
 
 function finalize()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html", false);
 
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 if (OfflineTest.setup()) {
@@ -125,11 +125,11 @@ if (OfflineTest.setup()) {
   applicationCache.oncached = OfflineTest.priv(manifestUpdated);
 }
 
 </script>
 
 </head>
 
 <body>
-<iframe name="fallbackFrame" src="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html"></iframe>
+<iframe name="fallbackFrame" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html"></iframe>
 </body>
 </html>
--- a/dom/tests/mochitest/ajax/offline/test_foreign.html
+++ b/dom/tests/mochitest/ajax/offline/test_foreign.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest">
 <head>
 <title>Foreign test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -21,22 +21,22 @@
  */
 
 function manifestUpdated()
 {
   var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
     .getService(Components.interfaces.nsIApplicationCacheService);
 
   foreign1cache = appCacheService.chooseApplicationCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
 
   OfflineTest.ok(foreign1cache, "foreign2.html chosen from foreign1 cache");
-  OfflineTest.is(foreign1cache.groupID, "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest")
+  OfflineTest.is(foreign1cache.groupID, "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest")
 
-  window.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html";
+  window.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html";
 }
 
 SimpleTest.waitForExplicitFinish();
 
 if (OfflineTest.setup()) {
   applicationCache.onerror = OfflineTest.failEvent;
   applicationCache.onupdateready = OfflineTest.failEvent;
   applicationCache.onnoupdate = OfflineTest.failEvent;
--- a/dom/tests/mochitest/ajax/offline/test_identicalManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_identicalManifest.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
 <head>
 <title>identical manifest test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -15,43 +15,43 @@ var gGotDownloading = false;
 function noUpdate()
 {
   OfflineTest.ok(gGotChecking, "Should get a checking event");
   OfflineTest.ok(!gGotDownloading, "Should not get a downloading event");
 
   // The document that requested the manifest should be in the cache
   OfflineTest.checkCache(window.location.href, true);
 
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", true);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
   
   OfflineTest.teardown();
 
   OfflineTest.finish();
 }
 
 function manifestUpdated()
 {
   OfflineTest.ok(gGotChecking, "Should get a checking event");
   OfflineTest.ok(gGotDownloading, "Should get a downloading event");
 
   // The manifest itself should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
 
   // The document that requested the manifest should be in the cache
   OfflineTest.checkCache(window.location.href, true);
 
   // The entries from the manifest should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", true);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
   // The bad entries from the manifest should not be in the cache
-  OfflineTest.checkCache("https://localhost:8888/MochiKit/packed.js", false);
+  OfflineTest.checkCache("https://mochi.test:8888/MochiKit/packed.js", false);
   OfflineTest.checkCache("bad:/uri/invalid", false);
 
   // Now make sure applicationCache.update() does what we expect.
   applicationCache.oncached = OfflineTest.failEvent;
   applicationCache.onnoupdate = OfflineTest.priv(noUpdate);
   
   gGotChecking = false;
   gGotDownloading = false;
--- a/dom/tests/mochitest/ajax/offline/test_missingFile.html
+++ b/dom/tests/mochitest/ajax/offline/test_missingFile.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest">
 <head>
 <title>missing manifest file test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -14,19 +14,19 @@ var gGotDownloading = false;
 
 function handleError() {
   OfflineTest.ok(gGotChecking, "Expected checking event");
   OfflineTest.ok(gGotDownloading, "Expected downloading event");
   OfflineTest.ok(true, "Expected error event");
 
   // These items are listed in the manifest, but the error should have
   // prevented them from being committed to the cache.
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", false);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", false);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false);
 
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 if (OfflineTest.setup()) {
   // Don't expect any "success" events.
   applicationCache.onupdateready = function() { OfflineTest.failEvent("updateready"); }
--- a/dom/tests/mochitest/ajax/offline/test_noManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_noManifest.html
@@ -20,19 +20,19 @@ function expectInvalidState(fn, desc) {
 
   ok(gotInvalidState, desc);
 }
 
 is(typeof(applicationCache), "object");
 is(applicationCache.mozLength, 0, "applicationCache.mozLength should be 0");
 is(applicationCache.status, 0, "applicationCache.status should be 0 (UNCACHED)");
 
-expectInvalidState(function() { applicationCache.mozAdd("http://localhost:8888/MochiKit/packed.js"); },
+expectInvalidState(function() { applicationCache.mozAdd("http://mochi.test:8888/MochiKit/packed.js"); },
                    "applicationCache.mozAdd should throw INVALID_STATE_ERR");
-expectInvalidState(function() { applicationCache.mozRemove("http://localhost:8888/MochiKit/packed.js"); },
+expectInvalidState(function() { applicationCache.mozRemove("http://mochi.test:8888/MochiKit/packed.js"); },
                    "applicationCache.mozRemove should throw INVALID_STATE_ERR");
 expectInvalidState(function() { applicationCache.update(); },
                    "applicationCache.update should throw INVALID_STATE_ERR");
 expectInvalidState(function() { applicationCache.swapCache(); },
                    "applicationCache.update should throw INVALID_STATE_ERR");
 
 
 </script>
--- a/dom/tests/mochitest/ajax/offline/test_obsolete.html
+++ b/dom/tests/mochitest/ajax/offline/test_obsolete.html
@@ -19,17 +19,17 @@ var pm = Cc["@mozilla.org/permissionmana
         .getService(Ci.nsIPermissionManager);
 var uri = Cc["@mozilla.org/network/io-service;1"]
          .getService(Ci.nsIIOService)
          .newURI(window.location.href, null, null);
 pm.add(uri, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
 
 // Make the obsoleting.sjs return a valid manifest
 var req = new XMLHttpRequest();
-req.open("GET", "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
+req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
 req.setRequestHeader("Content-Type", "text/cache-manifest");
 req.send("");
 req.onreadystatechange = function() {
   if (req.readyState == 4) {
     // now this will properly load the manifest.
     gTestWin = window.open("obsolete.html");
   }
 }
--- a/dom/tests/mochitest/ajax/offline/test_offlineIFrame.html
+++ b/dom/tests/mochitest/ajax/offline/test_offlineIFrame.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
 <head>
 <title>offline iframe test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -13,22 +13,22 @@ function childFinished()
 {
   OfflineTest.teardown();
   OfflineTest.finish();
 }
 
 function manifestUpdated()
 {
   // The manifest itself should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
 
   // The entries from the manifest should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", true);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
   window.frames["offlineChild"].doneLoading();
 }
 
 if (OfflineTest.setup()) {
   applicationCache.onerror = OfflineTest.failEvent;
 
   applicationCache.oncached = OfflineTest.priv(manifestUpdated);
--- a/dom/tests/mochitest/ajax/offline/test_offlineMode.html
+++ b/dom/tests/mochitest/ajax/offline/test_offlineMode.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
 <head>
 <title>Offline mode test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -23,65 +23,65 @@ var gGotExplicitVersion = 0;
 var gGotImplicitVersion = 0;
 var gGotDynamicVersion = 0;
 var gGotOnError = false;
 
 // test
 
 function manifestUpdated()
 {
-  applicationCache.mozAdd("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
-  OfflineTest.waitForAdd("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", dynamicAdded);
+  applicationCache.mozAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
+  OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", dynamicAdded);
 }
 
 function dynamicAdded()
 {
-  aFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
+  aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
 }
 
 // Called by the dynamically added iframe on load
 function notwhitelistOnLoad()
 {
   gGotDynamicVersion = 1;
-  aFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs";
+  aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs";
 }
 
 // Called by the explicit iframe on load
 function frameLoad(version)
 {
   gGotExplicitVersion = version;
-  gImplicitWindow = window.open("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
+  gImplicitWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
 }
 
 // Called by the implicit window on load
 function implicitLoaded(aWindow, errorOccured)
 {
   aWindow.close();
 
   gGotImplicitVersion = 1;
-  OfflineTest.waitForAdd("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", implicitAdded);
+  OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", implicitAdded);
 }
 
 function implicitAdded()
 {
   OfflineTest.priv(finalize)();
 }
 
 function finalize()
 {
   window.clearTimeout(gCompleteTimeout);
 
   var ioserv = Cc["@mozilla.org/network/io-service;1"]
       .getService(Ci.nsIIOService);
 
   if (!ioserv.offline)
   {
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", true);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", true);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
 
     OfflineTest.is(gGotExplicitVersion, 1, "Explicit entry loaded");
     OfflineTest.is(gGotImplicitVersion, 1, "Implicit entry loaded");
     OfflineTest.is(gGotDynamicVersion, 1, "Dynamic entry loaded");
 
     gGotExplicitVersion = 0;
     gGotImplicitVersion = 0;
     gGotDynamicVersion = 0;
@@ -90,30 +90,30 @@ function finalize()
     // Delete HTTP cache to ensure we are going from offline cache
     var sessionServ = Cc["@mozilla.org/network/cache-service;1"]
       .getService(Ci.nsICacheService);
     cacheSession = sessionServ.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, Ci.nsICache.STREAM_BASED);
     function doomHTTPCacheEntry(entryKey) {
       entry = cacheSession.openCacheEntry(entryKey, Ci.nsICache.ACCESS_WRITE, false)
       entry.doom();
     }
-    doomHTTPCacheEntry("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
-    doomHTTPCacheEntry("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs");
-    doomHTTPCacheEntry("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
+    doomHTTPCacheEntry("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
+    doomHTTPCacheEntry("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs");
+    doomHTTPCacheEntry("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
 
 
     ioserv.offline = true;
 
     gCompleteTimeout = window.setTimeout(OfflineTest.priv(finalize), 10000);
 
     // remove error handling. in offline mode
     // is correct to get error message
     applicationCache.onerror = function() {gGotOnError = true;}
 
-    aFrame.location = "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
+    aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
     // Starts the chain all over again but in offline mode.
   }
   else
   {
     gImplicitWindow.close();
 
     ioserv.offline = false;
 
--- a/dom/tests/mochitest/ajax/offline/test_overlap.html
+++ b/dom/tests/mochitest/ajax/offline/test_overlap.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/overlap.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/overlap.cacheManifest">
 <head>
 <title>overlapping namespaces test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
--- a/dom/tests/mochitest/ajax/offline/test_redirectManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_redirectManifest.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs">
 <head>
 <title>Fail update on manifest redirection test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
--- a/dom/tests/mochitest/ajax/offline/test_redirectUpdateItem.html
+++ b/dom/tests/mochitest/ajax/offline/test_redirectUpdateItem.html
@@ -1,74 +1,74 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs">
 <head>
 <title>Entries redirection handling during update test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <script class="testbody" type="text/javascript">
 
 var gCurrentManifestVersion = 1;
 
 function manifestCached()
 {
   OfflineTest.checkCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false);
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false);
   OfflineTest.checkCache(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs", true);
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs", true);
   OfflineTest.is(gCurrentManifestVersion, 1, "Cached event for manifest version one");
 
   // Now add one dynamic entry (now with content overriden redirect sjs)
   applicationCache.mozAdd(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs");
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs");
 
   // Wait for the dynamic entry be added to the cache...
   OfflineTest.waitForAdd(
-    "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
+    "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
     function() {
       // ...check it is there...
       OfflineTest.checkCache(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", true);
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", true);
 
       // ...revert state of the dynamic entry on the server, now we get the redirect...
       OfflineTest.setSJSState(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
         "");
 
       // ...update manifest to the new version on the server...
       OfflineTest.setSJSState(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
         "second");
       gCurrentManifestVersion = 2;
 
       // ...and finally invoke the cache update.
       applicationCache.update();
     });
 }
 
 function manifestUpdated()
 {
   switch (gCurrentManifestVersion)
   {
     case 2:
       // Check the dynamic entry was removed from the cache (because of the redirect)...
       OfflineTest.checkCache(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false);
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false);
 
       // ...return back redirect for the explicit entry...
       OfflineTest.setSJSState(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
         "");
 
       // ...update the manifest to the third version...
       OfflineTest.setSJSState(
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
         "third");
       gCurrentManifestVersion = 3;
 
       // ...and invoke the cache update, now we must get error.
       applicationCache.update();
       break;
 
     case 3:
@@ -107,20 +107,20 @@ SimpleTest.waitForExplicitFinish();
 
 if (OfflineTest.setup()) {
   applicationCache.onerror = OfflineTest.priv(manifestError);
   applicationCache.onupdateready = OfflineTest.priv(manifestUpdated);
   applicationCache.oncached = OfflineTest.priv(manifestCached);
 
   // Override sjs redirects on the server, it will now return 200 OK and the content
   OfflineTest.setSJSState(
-      "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
+      "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
       "on");
   OfflineTest.setSJSState(
-      "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
+      "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
       "on");
 }
 
 </script>
 
 </head>
 
 <body>
--- a/dom/tests/mochitest/ajax/offline/test_refetchManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_refetchManifest.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
 <head>
 <title>refetch manifest test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 
 <script type="text/javascript">
--- a/dom/tests/mochitest/ajax/offline/test_simpleManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_simpleManifest.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
 <head>
 <title>simple manifest test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -13,85 +13,85 @@ var gGotChecking = false;
 var gGotDownloading = false;
 
 ok(applicationCache.mozItems.length == 0,
    "applicationCache.mozItems should be available and empty before associating with a cache.");
 
 function addFinished()
 {
   // Check that the entry was added successfully
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
                          true);
 
   OfflineTest.ok(applicationCache.mozLength == 1, "applicationCache should have one dynamic entry (deprecated API)");
-  OfflineTest.ok(applicationCache.mozItem(0) == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  OfflineTest.ok(applicationCache.mozItem(0) == "http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
     "applicationCache's dynamic entry should be the one we expect (deprecated API)");
 
   OfflineTest.ok(applicationCache.mozItems.length == 1, "applicationCache should have one dynamic entry");
-  OfflineTest.ok(applicationCache.mozItems[0] == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  OfflineTest.ok(applicationCache.mozItems[0] == "http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
     "applicationCache's dynamic entry should be the one we expect");
 
-  OfflineTest.ok(applicationCache.mozHasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
+  OfflineTest.ok(applicationCache.mozHasItem("http://mochi.test:8888/tests/SimpleTest/EventUtils.js"),
                  "applicationCache.mozHasItem() should see the dynamic entry");
 
   // Now test that removes work
-  applicationCache.mozRemove("http://localhost:8888/tests/SimpleTest/EventUtils.js");
+  applicationCache.mozRemove("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
 
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
                          false);
   OfflineTest.ok(applicationCache.mozLength == 0,
                  "applicationCache should have no dynamic entries (deprecated API)");
   OfflineTest.ok(applicationCache.mozItems.length == 0,
                  "applicationCache should have no dynamic entries");
-  OfflineTest.ok(!applicationCache.mozHasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
+  OfflineTest.ok(!applicationCache.mozHasItem("http://mochi.test:8888/tests/SimpleTest/EventUtils.js"),
                  "applicationCache.mozHasItem() should not see the removed dynamic entry");
 
   // We're done
 
   OfflineTest.teardown();
 
   OfflineTest.finish();
 }
 
 function manifestUpdated()
 {
   OfflineTest.ok(gGotChecking, "Should get a checking event");
   OfflineTest.ok(gGotDownloading, "Should get a downloading event");
 
   // The manifest itself should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true);
 
   // The document that requested the manifest should be in the cache
   OfflineTest.checkCache(window.location.href, true);
 
   // The entries from the manifest should be in the cache
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", true);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
   // The bad entries from the manifest should not be in the cache
-  OfflineTest.checkCache("https://localhost:8888/MochiKit/packed.js", false);
+  OfflineTest.checkCache("https://mochi.test:8888/MochiKit/packed.js", false);
   OfflineTest.checkCache("bad:/uri/invalid", false);
 
   OfflineTest.is(applicationCache.status, 1, "Cache status should be 1 (CACHED)");
 
   try {
     applicationCache.swapCache();
     OfflineTest.ok(false, "application.swapCache() should fail after initial update.");
   } catch(ex) {
     OfflineTest.ok(true, "application.swapCache() should fail after initial update.");
   }
 
   // XXX: make sure that the previous version went away after the swapCache().
 
   // Now add a file using the applicationCache API
-  applicationCache.mozAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js");
+  applicationCache.mozAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
 
   // Wait for the add() to be downloaded
-  OfflineTest.waitForAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  OfflineTest.waitForAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
                          OfflineTest.priv(addFinished));
 }
 
 if (OfflineTest.setup()) {
   OfflineTest.ok(applicationCache instanceof EventTarget,
                  "applicationCache should be an event target");
 
   applicationCache.onerror = OfflineTest.failEvent;
--- a/dom/tests/mochitest/ajax/offline/test_updatingManifest.html
+++ b/dom/tests/mochitest/ajax/offline/test_updatingManifest.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
 <head>
 <title>Cache update test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
@@ -114,156 +114,156 @@ function manifestCached()
 
   reloadLocations([fallbackFrame1, fallbackFrame2]);
   waitForLocations([fallbackFrame1, fallbackFrame2],
       fallbackLoaded);
 }
 
 function fallbackLoaded()
 {
-  applicationCache.mozAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js");
-  OfflineTest.waitForAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js",
+  applicationCache.mozAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
+  OfflineTest.waitForAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
       dynamicLoaded);
 }
 
 function dynamicLoaded()
 {
-  window.open("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
+  window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
   // window.onload invokes implicitLoaded()
 }
 
 function implicitLoaded(aWindow, errorOccured)
 {
   aWindow.close();
 
   OfflineTest.ok(!errorOccured, "No error on new implicit page manifest update");
 
-  OfflineTest.waitForAdd("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html",
+  OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html",
       implicitCached);
 }
 
 function implicitCached()
 {
   // Checking first version of the manifest + another implict page caching
 
   // Explicit entries
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", false);
-  OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false);
+  OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
   // Fallback entries
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true);
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
 
   // Whitelist entries
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
-  checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
+  checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
 
   // Implicit entries
-  OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
 
   // Dynamic entries
-  OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js", true);
+  OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true);
 
   // Fallback URI selection check
-  checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
-      "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
-  checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
-      "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
+  checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
+      "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
+  checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
+      "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
 
   // Cache object status
   OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.IDLE,
       "we have associated application cache (1)");
 
   OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1");
 
   ++gStep;
 
-  OfflineTest.setSJSState("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "second");
+  OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "second");
 
   applicationCache.update();
   // Invokes manifestUpdated()
 }
 
 function manifestUpdated()
 {
   OfflineTest.ok(gStep == 1 || gStep == 2);
 
   switch (gStep)
   {
   case 1:
     // Processing second version of the manifest.
 
     // Explicit entries
-    OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", true);
-    OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
     // Fallback entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true);
 
     // Whitelist entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", false);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", false);
 
     // Implicit entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
 
     // Dynamic entries
-    OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true);
 
     // Fallback URI selection check
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
 
     // Cache object status
     OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.UPDATEREADY,
         "we have associated application cache and update is pending (2)");
 
     ++gStep;
 
-    OfflineTest.setSJSState("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "third");
-    OfflineTest.setSJSState("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", "second");
+    OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "third");
+    OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", "second");
 
     gGotFrameVersion = 0;
     gCallOnUpdatingFrameLoad = function() {applicationCache.update();};
     updatingFrame.location.reload();
 
     break;
 
   case 2:
     // Processing third version of the manifest.
 
     // Explicit entries
-    OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/SimpleTest.js", false);
-    OfflineTest.checkCache("http://localhost:8888/MochiKit/packed.js", true);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false);
+    OfflineTest.checkCache("http://mochi.test:8888/MochiKit/packed.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
 
     // Fallback entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true);
 
     // Whitelist entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false);
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
 
     // Implicit entries
-    OfflineTest.checkCache("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true);
 
     // Dynamic entries
-    OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js", true);
+    OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true);
 
     // Fallback URI selection check
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
         "", false);
-    checkFallbackAndWhitelisting("http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
-        "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
+    checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
+        "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
 
     // Cache object status
     OfflineTest.is(applicationCache.status, Components.interfaces.nsIDOMOfflineResourceList.UPDATEREADY,
         "we have associated application cache and update is pending (3)");
 
     OfflineTest.is(gGotFrameVersion, 1, "IFrame version 1 because cache was not swapped");
 
     ++gStep;
@@ -312,14 +312,14 @@ if (OfflineTest.setup()) {
   applicationCache.oncached = OfflineTest.priv(manifestCached);
 }
 
 </script>
 
 </head>
 
 <body>
-  <iframe name="updatingFrame" src="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"></iframe>
-  <iframe name="fallbackFrame1" src="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html"></iframe>
-  <iframe name="fallbackFrame2" src="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html"></iframe>
-  <iframe name="whitelistFrame" src="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html"></iframe>
+  <iframe name="updatingFrame" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"></iframe>
+  <iframe name="fallbackFrame1" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html"></iframe>
+  <iframe name="fallbackFrame2" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html"></iframe>
+  <iframe name="whitelistFrame" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html"></iframe>
 </body>
 </html>
--- a/dom/tests/mochitest/ajax/offline/test_xhtmlManifest.xhtml
+++ b/dom/tests/mochitest/ajax/offline/test_xhtmlManifest.xhtml
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
 <head>
 <title>xhtml manifest test</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
--- a/dom/tests/mochitest/ajax/offline/updatingImplicit.html
+++ b/dom/tests/mochitest/ajax/offline/updatingImplicit.html
@@ -1,9 +1,9 @@
-<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
 <head>
 <title>Updating implicit</title>
 
 <script type="text/javascript" src="/MochiKit/packed.js"></script>
 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
 
 <script type="text/javascript">
 
--- a/dom/tests/mochitest/ajax/offline/updatingManifest.sjs
+++ b/dom/tests/mochitest/ajax/offline/updatingManifest.sjs
@@ -1,42 +1,42 @@
 ver1manifest =
   "CACHE MANIFEST\n" +
   "# v1\n" +
   "\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs\n" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs\n" +
   "\n" +
   "FALLBACK:\n" +
   "namespace1/ fallback.html\n" +
   "\n" +
   "NETWORK:\n" +
   "onwhitelist.html\n";
 
 ver2manifest =
   "CACHE MANIFEST\n" +
   "# v2\n" +
   "\n" +
-  "http://localhost:8888/tests/SimpleTest/SimpleTest.js\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
+  "http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
   "\n" +
   "FALLBACK:\n" +
   "namespace1/ fallback.html\n" +
   "namespace1/sub/ fallback2.html\n";
 
 ver3manifest =
   "CACHE MANIFEST\n" +
   "# v3\n" +
   "\n" +
-  "http://localhost:8888/MochiKit/packed.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
-  "http://localhost:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
+  "http://mochi.test:8888/MochiKit/packed.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
+  "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
   "\n" +
   "FALLBACK:\n" +
   "namespace1/sub fallback2.html\n" +
   "\n" +
   "NETWORK:\n" +
   "onwhitelist.html\n";
 
 function handleRequest(request, response)
--- a/dom/tests/mochitest/bugs/bug346659-echoer.html
+++ b/dom/tests/mochitest/bugs/bug346659-echoer.html
@@ -1,4 +1,4 @@
 <script>
-  window.opener.postMessage("1 - " + window.x, "http://localhost:8888/");
+  window.opener.postMessage("1 - " + window.x, "http://mochi.test:8888");
   window.close();
 </script>
--- a/dom/tests/mochitest/bugs/bug346659-opener-echoer.html
+++ b/dom/tests/mochitest/bugs/bug346659-opener-echoer.html
@@ -1,6 +1,6 @@
 <script>
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite");
-  window.opener.opener.postMessage(window.opener.testNum + " - " + window.x, "http://localhost:8888/");
+  window.opener.opener.postMessage(window.opener.testNum + " - " + window.x, "http://mochi.test:8888");
   window.opener.close();
   window.close();
 </script>
--- a/dom/tests/mochitest/bugs/bug346659-opener.html
+++ b/dom/tests/mochitest/bugs/bug346659-opener.html
@@ -3,13 +3,13 @@
     function postBack() {
       var s = decodeURIComponent(window.location.search.substring(1));
       var cmd = JSON.parse(s);
       if ("load" in cmd) {
         window.testNum = cmd.load;
       } else if ("write" in cmd) {
         window.testNum = cmd.write;
       }
-      window.opener.postMessage(s, "http://localhost:8888/");
+      window.opener.postMessage(s, "http://mochi.test:8888");
     }
     var childWin = window.open();
   </script>
 </body>
--- a/dom/tests/mochitest/bugs/bug346659-parent-echoer.html
+++ b/dom/tests/mochitest/bugs/bug346659-parent-echoer.html
@@ -1,5 +1,5 @@
 <script>
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite");
-  window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://localhost:8888/");
+  window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://mochi.test:8888");
   window.parent.close();
 </script>
--- a/dom/tests/mochitest/bugs/bug346659-parent.html
+++ b/dom/tests/mochitest/bugs/bug346659-parent.html
@@ -5,13 +5,13 @@
       childWin = window.frames[0];
       var s = decodeURIComponent(window.location.search.substring(1));
       var cmd = JSON.parse(s);
       if ("load" in cmd) {
         window.testNum = cmd.load;
       } else if ("write" in cmd) {
         window.testNum = cmd.write;
       }
-      window.opener.postMessage(s, "http://localhost:8888/");
+      window.opener.postMessage(s, "http://mochi.test:8888");
     }
   </script>
   <iframe></iframe>
 </body>
--- a/dom/tests/mochitest/bugs/child_bug260264.html
+++ b/dom/tests/mochitest/bugs/child_bug260264.html
@@ -1,13 +1,13 @@
 <html>
   <head>
     <script type="application/javascript" src="utils_bug260264.js"></script>
   </head>
   <body>
     <iframe id="frame"></iframe>
     <script type="application/javascript">
       document.getElementById("frame").src =
-        alter_file(alter_host(location.href, "localhost:8888"),
+        alter_file(alter_host(location.href, "mochi.test:8888"),
                    "grandchild_bug260264.html");
     </script>
   </body>
 </html>
--- a/dom/tests/mochitest/bugs/file_bug504862.html
+++ b/dom/tests/mochitest/bugs/file_bug504862.html
@@ -1,22 +1,22 @@
 <html>
 <body>
 <script>
 window.returnValue = 3;
 
-if (location.toString().match(/^http:\/\/localhost:8888/)) {
+if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
   // Test that we got the right arguments.
   opener.is(window.dialogArguments, "my args",
             "dialog did not get the right arguments.");
 
   // Load a different url, and test that it doesn't see the arguments.
   window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, null, 'subsequent dialog document did not get the right arguments.'); close();\">';";
 } else {
   // Post a message containing our arguments to the opener to test
   // that this cross origing dialog does *not* see the passed in
   // arguments.
   opener.postMessage("args: " + window.dialogArguments,
-                     "http://localhost:8888");
+                     "http://mochi.test:8888");
 
   close();
 }
 </script>
--- a/dom/tests/mochitest/bugs/iframe_bug407839-1.html
+++ b/dom/tests/mochitest/bugs/iframe_bug407839-1.html
@@ -51,18 +51,17 @@ function run()
   }
 
   try {
     storage = globalStorage[""];
     message += "\n passed globalStorage[\"\"]";
   }
   catch (ex) {
   }
-
-  window.parent.postMessage(message, "http://localhost:8888");
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/iframe_bug407839-2.html
+++ b/dom/tests/mochitest/bugs/iframe_bug407839-2.html
@@ -18,17 +18,17 @@ function run()
 
   try {
     storage = globalStorage["sub1.ält.example.org"];
   }
   catch (ex) {
     message += "\n failed globalStorage[sub1.ält.example.org]";
   }
 
-  window.parent.postMessage(message, "http://localhost:8888");
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/iframe_bug409349.html
+++ b/dom/tests/mochitest/bugs/iframe_bug409349.html
@@ -46,18 +46,18 @@ function run()
   }
   
   try {
     storage = globalStorage["X.0.0.1"];
     message += "\n passed globalStorage[\"X.0.0.1\"]";
   }
   catch (ex) {
   }
-  
-  window.parent.postMessage(message, "http://localhost:8888");
+
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/iframe_bug424093.html
+++ b/dom/tests/mochitest/bugs/iframe_bug424093.html
@@ -26,17 +26,17 @@ function run()
 
   try {
     storage = globalStorage["example.org"];
   }
   catch (ex) {
     message += "\n failed globalStorage[\"example.org\"]";
   }
 
-  window.parent.postMessage(message, "http://localhost:8888");
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/iframe_bug440572.html
+++ b/dom/tests/mochitest/bugs/iframe_bug440572.html
@@ -2,16 +2,16 @@
 <body>
 <script>
 
 var success = 0;
 
 try {
   parent[name].success = 1;
 } catch (e) {
-  parent.postMessage(e, "http://localhost:8888");
+  parent.postMessage(e, "http://mochi.test:8888");
 }
 
-parent.postMessage(success ? "success" : "failure", "http://localhost:8888");
+parent.postMessage(success ? "success" : "failure", "http://mochi.test:8888");
 </script>
 <p>Move on, nothing to see here...</p>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/iframe_bug463000.html
+++ b/dom/tests/mochitest/bugs/iframe_bug463000.html
@@ -136,17 +136,17 @@ function run()
         message += "\n Pair-B existed unexpectedly";
       else
         message += "\n Unexpected exception encountered while checking Pair-B (2): " + ex;
     }
   }
 
   prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
 
-  window.parent.postMessage(message, "http://localhost:8888");
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug132255.html
+++ b/dom/tests/mochitest/bugs/test_bug132255.html
@@ -3,17 +3,17 @@
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=132255
 -->
 <head>
   <title>Test for Bug 132255</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <base href="http://localhost:8888/tests/dom/tests/mochitest/">
+  <base href="http://mochi.test:8888/tests/dom/tests/mochitest/">
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=132255">Mozilla Bug 132255</a>
 <p id="display">
   <iframe src="javascript:'<a href=\'foo.html\'>test-anchor</a>'"></iframe>
   <iframe src="javascript:'<base href=\'http://example.com/\'><a href=\'foo.html\'>test-anchor</a>'"></iframe>
 </p>
 <div id="content" style="display: none">
--- a/dom/tests/mochitest/bugs/test_bug346659.html
+++ b/dom/tests/mochitest/bugs/test_bug346659.html
@@ -65,19 +65,19 @@ function handleCmd(evt) {
     win.childWin.location.href = loc;
     wins[testNum] = null;
   } else if ("write" in cmd) {
     var testNum = cmd.write;
     var win = wins[testNum];
     win.childWin.x = testNum;
     try {
       if (win.childWin.opener == win) {
-        win.childWin.document.write('<script>window.opener.opener.postMessage(window.opener.testNum + " - " + window.x, "http://localhost:8888/"); window.opener.close(); window.close();<' + '/script>');
+        win.childWin.document.write('<script>window.opener.opener.postMessage(window.opener.testNum + " - " + window.x, "http://mochi.test:8888/"); window.opener.close(); window.close();<' + '/script>');
       } else {
-        win.childWin.document.write('<script>window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://localhost:8888/"); window.parent.close();<' + '/script>');
+        win.childWin.document.write('<script>window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://mochi.test:8888/"); window.parent.close();<' + '/script>');
       }
     } catch (e if (e.name == "NS_ERROR_DOM_SECURITY_ERR" && e.code == 1000)) {
       // Security error on cross-site write() is fine
       if (win.childWin.opener == win) {
         win.childWin.close();
       }
       win.close()
       handleTestEnd();
@@ -167,27 +167,27 @@ win = window.open("");
 win.x = 2;
 win.document.write('<script> window.opener.postMessage("2 - " + window.x, window.location.href); window.close(); </' + 'script>');
 
 wins[3] = window.open('bug346659-opener.html?{"load":3}');
 wins[4] = window.open('bug346659-opener.html?{"write":4}');
 wins[5] = window.open('bug346659-parent.html?{"load":5}');
 wins[6] = window.open('bug346659-parent.html?{"write":6}');
 
-is(location.host, "localhost:8888", "Unexpected host");
+is(location.host, "mochi.test:8888", "Unexpected host");
 
 function startSecondBatch() {
-  var baseurl = window.location.href.replace(/localhost:8888/, "example.com");
+  var baseurl = window.location.href.replace(/mochi\.test:8888/, "example.com");
   wins[7] = window.open(r(baseurl, 'bug346659-opener.html?{"load":7}'));
   wins[8] = window.open(r(baseurl, 'bug346659-opener.html?{"write":8}'));
   wins[9] = window.open(r(baseurl, 'bug346659-parent.html?{"load":9}'));
   wins[10] = window.open(r(baseurl, 'bug346659-parent.html?{"write":10}'));
 }
 
 function startThirdBatch() {
-  var baseurl = window.location.href.replace(/localhost:8888/, "example.com");
+  var baseurl = window.location.href.replace(/mochi\.test:8888/, "example.com");
   wins[11] = window.open(r(baseurl, 'bug346659-opener.html?{"load":11,"xsite":true}'));
   wins[12] = window.open(r(baseurl, 'bug346659-parent.html?{"load":12,"xsite":true}'));
 }
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug465263.html
+++ b/dom/tests/mochitest/bugs/test_bug465263.html
@@ -7,41 +7,41 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 465263</title>
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=465263">Mozilla Bug 465263</a>
 <p id="display">
-  <iframe src="http://localhost:8888/"></iframe>
-  <iframe src="http://localhost:8888/"></iframe>
-  <iframe src="http://localhost:8888/"></iframe>
-  <iframe src="http://localhost:8888/"></iframe>
+  <iframe src="http://mochi.test:8888"></iframe>
+  <iframe src="http://mochi.test:8888"></iframe>
+  <iframe src="http://mochi.test:8888"></iframe>
+  <iframe src="http://mochi.test:8888"></iframe>
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 465263 **/
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   window.frames[0].location.hash = '';
-  is(window.frames[0].location.href, "http://localhost:8888/#",
+  is(window.frames[0].location.href, "http://mochi.test:8888/#",
      "Should have '#' in href now");
   window.frames[1].location.hash = '#';
-  is(window.frames[1].location.href, "http://localhost:8888/#",
+  is(window.frames[1].location.href, "http://mochi.test:8888/#",
      "Should have only one '#' in href");
   window.frames[2].location.hash = 'foo';
-  is(window.frames[2].location.href, "http://localhost:8888/#foo",
+  is(window.frames[2].location.href, "http://mochi.test:8888/#foo",
      "Should have '#foo' in href");
   window.frames[3].location.hash = '#foo';
-  is(window.frames[3].location.href, "http://localhost:8888/#foo",
+  is(window.frames[3].location.href, "http://mochi.test:8888/#foo",
      "Should have only one '#' in href here too");
   SimpleTest.finish();
 });
 
 
 
 
 </script>
--- a/dom/tests/mochitest/dom-level0/child_ip_address.html
+++ b/dom/tests/mochitest/dom-level0/child_ip_address.html
@@ -22,17 +22,17 @@ function run()
   }
   catch (e)
   {
     domain = document.domain;
     if (domain !== "127.0.0.1")
       message += " ip-address-mutated-on-throw(" + domain + ")";
   }
 
-  window.parent.postMessage(message, "http://localhost:8888");
+  window.parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
   </script>
 </head>
 <body>
 <h1 id="location">Somewhere!</h1>
 </body>
--- a/dom/tests/mochitest/dom-level0/idn_child.html
+++ b/dom/tests/mochitest/dom-level0/idn_child.html
@@ -7,17 +7,17 @@
 function run()
 {
   var target = document.getElementById("location");
   target.textContent = location.hostname + ":" + (location.port || 80);
 }
 
 function receiveMessage(evt)
 {
-  if (evt.origin !== "http://localhost:8888")
+  if (evt.origin !== "http://mochi.test:8888")
     return;
 
   var message = evt.data + "-response";
 
   var domain = document.domain;
   if (/test$/.test(domain))
   {
     // XXX should really be IDN (bug 414090)
--- a/dom/tests/mochitest/dom-level2-html/test_HTMLDocument03.html
+++ b/dom/tests/mochitest/dom-level2-html/test_HTMLDocument03.html
@@ -88,17 +88,17 @@ function HTMLDocument03() {
       
       var docRef = null;
       if (typeof(this.doc) != 'undefined') {
         docRef = this.doc;
       }
       doc = load(docRef, "doc", "document");
       vdomain = doc.domain;
 
-      assertEquals("domainLink","localhost",vdomain);
+      assertEquals("domainLink","mochi.test",vdomain);
        
 }
 
 </script>
 </head>
 <body>
 <h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLDocument03</h2>
 <p>&lt;test name='HTMLDocument03' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;metadata&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;HTMLDocument03&lt;/title&gt;
--- a/dom/tests/mochitest/geolocation/geolocation_common.js
+++ b/dom/tests/mochitest/geolocation/geolocation_common.js
@@ -1,36 +1,36 @@
 
 
 function start_sending_garbage()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-  prefs.setCharPref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs?action=respond-garbage");
+  prefs.setCharPref("geo.wifi.uri", "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs?action=respond-garbage");
 }
 
 function stop_sending_garbage()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-  prefs.setCharPref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
+  prefs.setCharPref("geo.wifi.uri", "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
 }
 
 function stop_geolocationProvider()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-  prefs.setCharPref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs?action=stop-responding");
+  prefs.setCharPref("geo.wifi.uri", "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs?action=stop-responding");
 }
 
 function resume_geolocationProvider()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-  prefs.setCharPref("geo.wifi.uri", "http://localhost:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
+  prefs.setCharPref("geo.wifi.uri", "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
 }
 
 function check_geolocation(location) {
 
   ok(location, "Check to see if this location is non-null");
 
   ok("timestamp" in location, "Check to see if there is a timestamp");
 
--- a/dom/tests/mochitest/localstorage/frameReplace.html
+++ b/dom/tests/mochitest/localstorage/frameReplace.html
@@ -4,27 +4,27 @@
 
 <script type="text/javascript">
 
 var shell;
 
 function ok(a, message)
 {
   if (!a)
-    shell.postMessage("FAILURE: " + message, "http://localhost:8888");
+    shell.postMessage("FAILURE: " + message, "http://mochi.test:8888");
   else
-    shell.postMessage(message, "http://localhost:8888");
+    shell.postMessage(message, "http://mochi.test:8888");
 }
 
 function is(a, b, message)
 {
   if (a != b)
-    shell.postMessage("FAILURE: " + message + ", expected "+b+" got "+a, "http://localhost:8888");
+    shell.postMessage("FAILURE: " + message + ", expected "+b+" got "+a, "http://mochi.test:8888");
   else
-    shell.postMessage(message + ", expected "+b+" got "+a, "http://localhost:8888");
+    shell.postMessage(message + ", expected "+b+" got "+a, "http://mochi.test:8888");
 }
 
 function doTest()
 {
   var query = location.search.substring(1);
   var queries = query.split("&");
 
   var action = queries[0];
@@ -56,17 +56,17 @@ function doTest()
       is(localStorage.getItem("C"), null, "'A' is null");
       break;
 
     case "clean":
       localStorage.clear();
       break;
   }
 
-  shell.postMessage(action + "_done", "http://localhost:8888");
+  shell.postMessage(action + "_done", "http://mochi.test:8888");
 }
 
 </script>
 
 </head>
 <body onload="doTest();">
 </body>
 </html>
--- a/dom/tests/mochitest/localstorage/interOriginFrame.js
+++ b/dom/tests/mochitest/localstorage/interOriginFrame.js
@@ -1,11 +1,11 @@
 function postMsg(message)
 {
-  parent.postMessage(message, "http://localhost:8888");
+  parent.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("message", onMessageReceived, false);
 
 function onMessageReceived(event)
 {
   if (event.data == "step") {
     var performed = false;
--- a/dom/tests/mochitest/localstorage/test_localStorageKeyOrder.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageKeyOrder.html
@@ -49,17 +49,17 @@ function startTest()
     is(localStorage.d, "40", "d = 40");
     is(localStorage.e, "50", "e = 50");
     is(localStorage.length, 5, "length = 5");
 
     for (var i = 0; i < localStorage.length; ++i)
       is(keyNames[i], localStorage.key(i), "key "+keyNames[i]+" on same index");
 
     keyNamesStringify = "[\"" + keyNames.join("\",\"") + "\"]";
-    frame.location = "http://localhost:8888/tests/dom/tests/mochitest/localstorage/frameOrder.html?" +
+    frame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/localstorage/frameOrder.html?" +
       keyNamesStringify;
   }
   catch (ex)
   {
     localStorage.clear();
     throw ex;
   }
 }
--- a/dom/tests/mochitest/sessionstorage/file_http.html
+++ b/dom/tests/mochitest/sessionstorage/file_http.html
@@ -1,17 +1,17 @@
 <html>
 <head>
 <script>
 
 window.addEventListener("message", onMessageReceived, false);
 
 function postMsg(msg)
 {
-  parent.postMessage(msg, "http://localhost:8888");
+  parent.postMessage(msg, "http://mochi.test:8888");
 }
 
 function onMessageReceived(event)
 {
   if (event.data == "check") {
     postMsg(sessionStorage.getItem("foo"));
 
     var gotValue = "threw";
--- a/dom/tests/mochitest/sessionstorage/file_https.html
+++ b/dom/tests/mochitest/sessionstorage/file_https.html
@@ -1,15 +1,15 @@
 <html>
 <head>
 <script>
 function start()
 {
   sessionStorage.setItem("foo-https", "secure");
   parent.postMessage(sessionStorage.getItem("foo-https"),
-                     "http://localhost:8888");
+                     "http://mochi.test:8888");
 }
 </script>
 </head>
 <body onload="start();">
 secure
 </body>
 </html>
--- a/dom/tests/mochitest/sessionstorage/frameReplace.html
+++ b/dom/tests/mochitest/sessionstorage/frameReplace.html
@@ -4,27 +4,27 @@
 
 <script type="text/javascript">
 
 var shell;
 
 function ok(a, message)
 {
   if (!a)
-    shell.postMessage("FAILURE: " + message, "http://localhost:8888");
+    shell.postMessage("FAILURE: " + message, "http://mochi.test:8888");
   else
-    shell.postMessage(message, "http://localhost:8888");
+    shell.postMessage(message, "http://mochi.test:8888");
 }
 
 function is(a, b, message)
 {
   if (a != b)
-    shell.postMessage("FAILURE: " + message + ", expected "+b+" got "+a, "http://localhost:8888");
+    shell.postMessage("FAILURE: " + message + ", expected "+b+" got "+a, "http://mochi.test:8888");
   else
-    shell.postMessage(message + ", expected "+b+" got "+a, "http://localhost:8888");
+    shell.postMessage(message + ", expected "+b+" got "+a, "http://mochi.test:8888");
 }
 
 function doTest()
 {
   var query = location.search.substring(1);
   var queries = query.split("&");
 
   var action = queries[0];
@@ -59,17 +59,17 @@ function doTest()
     case "clean":
       is(sessionStorage.getItem("A"), "1", "'A' is '1'");
       is(sessionStorage.getItem("B"), "2", "'A' is '2'");
       is(sessionStorage.getItem("C"), "3", "'A' is '3'");
       sessionStorage.clear();
       break;
   }
 
-  shell.postMessage(action + "_done", "http://localhost:8888");
+  shell.postMessage(action + "_done", "http://mochi.test:8888");
 }
 
 </script>
 
 </head>
 <body onload="doTest();">
 </body>
 </html>
--- a/dom/tests/mochitest/sessionstorage/interOriginSlave.js
+++ b/dom/tests/mochitest/sessionstorage/interOriginSlave.js
@@ -1,11 +1,11 @@
 function postMsg(message)
 {
-  opener.postMessage(message, "http://localhost:8888");
+  opener.postMessage(message, "http://mochi.test:8888");
 }
 
 window.addEventListener("message", onMessageReceived, false);
 
 function onMessageReceived(event)
 {
   //alert("slave got event: "+event.data);
   if (event.data == "step") {
--- a/dom/tests/mochitest/sessionstorage/test_sessionStorageClone.html
+++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageClone.html
@@ -27,17 +27,17 @@ function doNextTest()
   currentStep = 1;
   doStep();
 
   switch (currentTest)
   {
     case 1:
       // Open a window from the same origin and check data
       // are copied but not further modified on our side
-      slaveOrigin = "http://localhost:8888";
+      slaveOrigin = "http://mochi.test:8888";
       slave = window.open(slaveOrigin + slavePath + "frameEqual.html");
       break;
 
     case 2:
       slave.close();
       // Open a window from a different origin and check data
       // are NOT copied and not modified on our side
       slaveOrigin = "http://example.com";
index e7861c7da512b3b2e1566bfa5e99f95b9fcb66fb..d4ee4abc3d19283fd89574bc21bd8a9b7ba571c4
GIT binary patch
literal 616
zc$^FHW@Zs#U|`^2IJME!X8jU<-&KqZ3^SM+7(^Ik7z*->OMFv{ixbmR<FgWr^fF3v
zb3#Kn8JN3Oio9EZxU_<sfsy3}P&t@r4YuvSZNPK)ueO9Q-=xjew-ujPyfAfctmBQf
zS|uj@I>Ec?hy`!e-}g(E)X#18cztx*&wG!RUBfn)&!4}q?)Rp~X}{K;TlJZH=_=!f
zE|by-Yv~utZ3^Wa=P#{qFc7e?3rlr!$;sGL#!^zUL+sK{Kl4djOrLI+N#W|Uy8X^q
z_<z%JwyzC~^ZJ<2Zl1r!*yH@h2WvPvvIU}ZOETUkd3~H==#a0ti2L<dKj|53C9eqW
z42}G@EwfZ`;cE7}BXb@atkjj@WY0hQPH$o{BlnI=Q4KSSCuz1%QVDKzxD;Ge7;Sn;
zf0p{Y_^yNRYMa&1Hk+N2<5IVk+NC>7V!ex%WQMW9>%Cs@{ylujRlTw7th}tz|EcpI
zy}I;y^Se)F%jGx6N1ADQEcJUOU!q|0qWGe^;>JIZZ%yAYHP#``zgcj?H@*37jney_
z9|Z<%yZQa1l)Sm@vGd!HM}#`L@Ea_;d6U0tQ`=?twDijwV!Gm~Dg7H?g}!mC<FtIu
z85j59;o17Emuo^|PMm!9WWM+UALnzwgO{<c+815g^SXpTYVCQm*Z$v<GLBvN?IAHS
zHR{0q0B=SnIc8ijFTnr;KrX|QMi2{oI$(vQ1GF>{;LXYg(ap#Z1*Cs~j9~x(<;eS+
--- a/dom/tests/mochitest/whatwg/postMessage_closed_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_closed_helper.html
@@ -10,17 +10,17 @@ function receiveMessage(evt)
 
 window.addEventListener("message", receiveMessage, false);
 
 function setup()
 {
   var query = location.search.substring(1);
 
   if (query == "opener")
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
 }
 
 window.addEventListener("load", setup, false);
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/dom/tests/mochitest/whatwg/postMessage_hash.html
+++ b/dom/tests/mochitest/whatwg/postMessage_hash.html
@@ -2,29 +2,29 @@
 <html>
 <head>
   <title>Hashed kid for test_postMessage_hash.html</title>
   <script type="application/javascript">
 function receiveMessage(evt)
 {
   var response = "response-message";
 
-  if (window.location.href !== "http://localhost:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash")
+  if (window.location.href !== "http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash")
     response += " kid-at-wrong-uri(" + window.location.href + ")";
 
-  if (evt.origin !== "http://localhost:8888")
+  if (evt.origin !== "http://mochi.test:8888")
     response += " wrong-origin(" + evt.origin + ")";
   if (evt.source !== window.parent)
     response += " wrong-source";
   if (evt.data !== "from-parent")
     response += " wrong-data(" + evt.data + ")";
   if (evt.lastEventId !== "")
     response += " wrong-lastEventId(" + evt.lastEventId + ")";
 
-  window.parent.postMessage(response, "http://localhost:8888");
+  window.parent.postMessage(response, "http://mochi.test:8888");
 }
 
 window.addEventListener("message", receiveMessage, false);
   </script>
 </head>
 <body>
 <p>Kid iframe</p>
 </body>
--- a/dom/tests/mochitest/whatwg/postMessage_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_helper.html
@@ -42,27 +42,27 @@
       }
       else if (data == "post-to-other-cross-domain")
       {
         receiveCross(evt, response);
       }
       else
       {
         response += " unexpected-message-to(" + window.location.href + ")";
-        window.parent.postMessage(response, "http://localhost:8888");
+        window.parent.postMessage(response, "http://mochi.test:8888");
         return;
       }
     }
 
     function receiveSame(evt, response)
     {
       var source = evt.source;
       try
       {
-        if (evt.origin != "http://localhost:8888")
+        if (evt.origin != "http://mochi.test:8888")
           response += " unexpected-origin(" + evt.origin + ")";
           
         try
         {
           var threw = false;
           var privateVariable = source.privateVariable;
         }
         catch (e)
@@ -77,17 +77,17 @@
       {
         source.postMessage(response, evt.origin);
       }
     }
 
     function receiveCross(evt, response)
     {
       var source = evt.source;
-      if (evt.origin != "http://localhost:8888")
+      if (evt.origin != "http://mochi.test:8888")
         response += " unexpected-origin(" + evt.origin + ")";
         
       try
       {
         var threw = false;
         var privateVariable = source.privateVariable;
       }
       catch (e)
--- a/dom/tests/mochitest/whatwg/postMessage_idn_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_idn_helper.html
@@ -4,17 +4,17 @@
   <title>postMessage IDN test page</title>
   <script type="application/javascript">
     function receiveMessage(evt)
     {
       var response = "idn-response";
 
       if (!(evt instanceof MessageEvent))
         response += " not-a-MessageEvent";
-      if (evt.origin !== "http://localhost:8888")
+      if (evt.origin !== "http://mochi.test:8888")
         response += " wrong-sender-origin(" + evt.origin + ")";
       if (evt.data !== "idn-message")
         response += " wrong-data(" + evt.data + ")";
       if (evt.lastEventId !== "")
         response += " wrong-lastEventId(" + evt.lastEventId + ")";
       if (evt.source !== window.parent)
         response += " wrong-source";
       if (evt.target !== window)
--- a/dom/tests/mochitest/whatwg/postMessage_joined_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_joined_helper.html
@@ -9,29 +9,29 @@ http://sub1.test1.example.org/tests/dom/
   <script type="application/javascript">
     function receiveMessage(evt)
     {
       var response, target, providedOrigin;
       var data = evt.data;
       if (data === "subframe-test-finished")
       {
         target = window.parent;
-        providedOrigin = "http://localhost:8888";
+        providedOrigin = "http://mochi.test:8888";
         response = "test-passed";
       }
       else if (data === "start-test")
       {
         target = window.frames.innermost;
         providedOrigin = "http://example.org";
         response = "start-test";
       }
       else
       {
         target = window.parent;
-        providedOrigin = "http://localhost:8888";
+        providedOrigin = "http://mochi.test:8888";
         response = "not reached";
       }
 
       if (evt.lastEventId !== "")
         response += " wrong-lastEventId(" + evt.lastEventId + ")";
 
       if (evt.type !== "message")
         response += " wrong-type(" + evt.type + ")";
@@ -46,17 +46,17 @@ http://sub1.test1.example.org/tests/dom/
       {
         response += " unexpected-trusted-event";
       }
 
       var origin;
       if (data == "subframe-test-finished")
         origin = "http://example.org";
       else if (data === "start-test")
-        origin = "http://localhost:8888";
+        origin = "http://mochi.test:8888";
       else
         origin = "unreached";
 
       if (evt.origin !== origin)
       {
         response += " wrong-origin(" + evt.origin + ")";
         response += " location(" + window.location.href + ")";
       }
--- a/dom/tests/mochitest/whatwg/postMessage_onOther.html
+++ b/dom/tests/mochitest/whatwg/postMessage_onOther.html
@@ -45,17 +45,17 @@
     //   http://test1.example.com
     //
     // and not
     //
     //   http://example.com
 
     function receiveSubDomain(evt)
     {
-      if (evt.origin !== "http://localhost:8888")
+      if (evt.origin !== "http://mochi.test:8888")
       {
         fail("wrong top-domain origin: " + evt.origin);
         return;
       }
       if (evt.data !== "start-test")
       {
         fail("wrong top-domain message: " + evt.origin);
         return;
@@ -85,17 +85,17 @@
       }
 
       document.domain = "example.com";
       window.parent.subDomainFrame.testSiblingPostMessage();
     }
 
     function testSiblingPostMessage()
     {
-      window.parent.postMessage("test-finished", "http://localhost:8888");
+      window.parent.postMessage("test-finished", "http://mochi.test:8888");
     }
 
     function setup()
     {
       var target = document.getElementById("location");
       target.textContent = location.hostname + ":" + (location.port || 80);
     }
 
--- a/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml
+++ b/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml
@@ -2,24 +2,24 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>postMessage origin-testing helper page</title>
   <script type="application/javascript"><![CDATA[
 function receiveMessage(evt)
 {
   var response = "PASS";
 
-  if (evt.origin !== "http://localhost:8888")
+  if (evt.origin !== "http://mochi.test:8888")
     response += " wrong-origin(" + evt.origin + ")";
   if (evt.source !== window.parent)
     response += " wrong-source";
   if (evt.data !== "PASS")
     response += " wrong-data(" + evt.data + ")";
 
-  window.parent.postMessage(response, "http://localhost:8888");
+  window.parent.postMessage(response, "http://mochi.test:8888");
 }
 
 window.addEventListener("message", receiveMessage, false);
 
 
 // Aids for identifying origins
 
 function setup()
--- a/dom/tests/mochitest/whatwg/postMessage_override_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_override_helper.html
@@ -17,17 +17,17 @@
       {
         window.dispatchEvent = function(evt)
         {
           window.parent.postMessage("FAIL", "*");
           throw "dispatchEvent threw";
         };
       }
 
-      window.parent.postMessage(evt.data, "http://localhost:8888");
+      window.parent.postMessage(evt.data, "http://mochi.test:8888");
     }
     
     function setup()
     {
       var target = document.getElementById("location");
       target.textContent = location.hostname + ":" + (location.port || 80);
     }
 
--- a/dom/tests/mochitest/whatwg/postMessage_userpass_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_userpass_helper.html
@@ -1,31 +1,32 @@
 <!DOCTYPE html>
 <html>
 <head>
   <title>Username/password page for postMessage tests</title>
   <script type="application/javascript">
+
 function sendMessage(evt)
 {
   var msg = "child-message";
 
-  if (evt.origin !== "http://localhost:8888")
+  if (evt.origin !== "http://mochi.test:8888")
     msg += " wrong-origin(" + evt.origin + ")";
   if (evt.data !== "parent-message")
     msg += " wrong-data(" + evt.data + ")";
   if (evt.lastEventId !== "")
     msg += " wrong-lastEventId(" + evt.lastEventId + ")";
   if (evt.source !== window.parent)
     msg += " wrong-source";
 
   // It would be good to guarantee that we've been opened with a userinfo of
   // "bobhope:password", but Gecko elides that from the content-visible URL,
   // and I can't find another way to actually detect this programmatically.
 
-  window.parent.postMessage(msg, "http://localhost:8888");
+  window.parent.postMessage(msg, "http://mochi.test:8888");
 }
 
 window.addEventListener("message", sendMessage, false);
   </script>
 </head>
 <body>
 <p>Kid iframe</p>
 </body>
--- a/dom/tests/mochitest/whatwg/test_postMessage.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage.html
@@ -10,17 +10,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="browserFu.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=postMessage">Mozilla Bug 387706</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
-<iframe src="http://localhost:8888/tests/dom/tests/mochitest/whatwg/postMessage_helper.html"
+<iframe src="http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_helper.html" 
         name="otherSameDomain"></iframe>
 <iframe src="http://example.org:8000/tests/dom/tests/mochitest/whatwg/postMessage_helper.html"
         name="otherCrossDomain"></iframe>
 
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 /** Test for Bug 387706 **/
@@ -101,39 +101,39 @@ function messageReceiver(evt)
 
 
 /******************
  * SELF-RESPONDER *
  ******************/
 
 function respondToSelf(evt)
 {
-  is(evt.origin, "http://localhost:8888", "event has wrong origin");
+  is(evt.origin, "http://mochi.test:8888", "event has wrong origin");
   is(evt.source, window, "we posted this message!");
   
   evt.source.postMessage("post-to-self-response", evt.origin);
 }
 
 
 /*************
  * RECEIVERS *
  *************/
 
 function receiveSelf(evt)
 {
-  is(evt.origin, "http://localhost:8888", "event has wrong origin");
+  is(evt.origin, "http://mochi.test:8888", "event has wrong origin");
   is(evt.source, window, "we posted this message!");
 
   window.frames.otherSameDomain.postMessage("post-to-other-same-domain",
-                                            "http://localhost:8888");
+                                            "http://mochi.test:8888");
 }
 
 function receiveOtherSameDomain(evt)
 {
-  is(evt.origin, "http://localhost:8888",
+  is(evt.origin, "http://mochi.test:8888",
      "same-domain response event has wrong origin");
   is(evt.source, window.frames.otherSameDomain,
      "wrong source for same-domain message!");
 
   window.frames.otherCrossDomain.postMessage("post-to-other-cross-domain",
                                             "http://example.org:8000");
 }
 
@@ -150,17 +150,17 @@ function receiveOtherCrossDomain(evt)
 
 
 /**************
  * TEST SETUP *
  **************/
 
 function start()
 {
-  window.postMessage("post-to-self", "http://localhost:8888");
+  window.postMessage("post-to-self", "http://mochi.test:8888");
 }
 
 window.addEventListener("load", start, false);
 window.addEventListener("message", messageReceiver, false);
 
 </script>
 </pre>
 </body>
--- a/dom/tests/mochitest/whatwg/test_postMessage_basehref.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_basehref.html
@@ -19,29 +19,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script class="testbody" type="application/javascript">
 /** Test for Bug 414815 **/
 
 SimpleTest.waitForExplicitFinish();
 
 function receiveMessage(evt)
 {
-  is(evt.origin, "http://localhost:8888", "wrong sender");
+  is(evt.origin, "http://mochi.test:8888", "wrong sender");
   ok(evt.source === window, "wrong source");
 
   is(evt.data, "generate-event", "wrong data");
   is(evt.lastEventId, "", "wrong lastEventId");
 
   SimpleTest.finish();
 }
 
 window.addEventListener("message", receiveMessage, false);
 
 function run()
 {
-  window.postMessage("generate-event", "http://localhost:8888");
+  window.postMessage("generate-event", "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/whatwg/test_postMessage_closed.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_closed.html
@@ -16,17 +16,17 @@
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 function receiveMessage(evt)
 {
-  is(evt.origin, "http://localhost:8888", "wrong origin");
+  is(evt.origin, "http://mochi.test:8888", "wrong origin");
   ok(evt.source === openedWindow, "wrong source");
   is(evt.lastEventId, "", "postMessage creates events with empty lastEventId");
 
   is(evt.data, "message", "wrong data");
   if (evt.data !== "message")
     return; // prevent recursion if bugs
 
   evt.source.close();
--- a/dom/tests/mochitest/whatwg/test_postMessage_hash.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_hash.html
@@ -8,39 +8,39 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <base href="http://example.com/" />
 </head>
 <body>
 <p>(no bug; this is a preemptive test)</p>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
-<iframe src="http://localhost:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash"
-        name="kid"></iframe>
+<iframe src="http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_hash.html#hash"
+        name="kid"</iframe>
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 function receiveMessage(evt)
 {
-  is(evt.origin, "http://localhost:8888", "wrong origin");
+  is(evt.origin, "http://mochi.test:8888", "wrong origin");
   ok(evt.source === window.frames.kid, "wrong source");
   is(evt.lastEventId, "", "postMessage creates events with empty lastEventId");
 
   is(evt.data, "response-message", "wrong data");
 
   SimpleTest.finish();
 }
 
 window.addEventListener("message", receiveMessage, false);
 
 function run()
 {
-  window.frames.kid.postMessage("from-parent", "http://localhost:8888");
+  window.frames.kid.postMessage("from-parent", "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/whatwg/test_postMessage_jar.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_jar.html
@@ -4,47 +4,47 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=430251
 -->
 <head>
   <title>postMessage's interaction with pages at jar: URIs</title>
   <script type="text/javascript" src="/MochiKit/packed.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
   <script type="text/javascript" src="browserFu.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-  <base href="http://example.com/" />
+  <base href="http://mochi.test:8888/" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=430251">Mozilla Bug 430251</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
-<iframe src="jar:http://example.com/tests/dom/tests/mochitest/whatwg/postMessage.jar!/postMessage_jar.html"
+<iframe src="jar:http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage.jar!/postMessage_jar.html"
         name="kid"></iframe>
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 /** Test for Bug 430251 **/
 
 SimpleTest.waitForExplicitFinish();
 
 function receiveMessage(evt)
 {
-  is(evt.origin, "http://example.com", "wrong sender");
+  is(evt.origin, "http://mochi.test:8888", "wrong sender");
   ok(evt.source === window.frames.kid, "wrong source");
 
   is(evt.data, "finish-test", "wrong data");
   is(evt.lastEventId, "", "wrong lastEventId");
 
   SimpleTest.finish();
 }
 
 window.addEventListener("message", receiveMessage, false);
 
 function run()
 {
-  window.frames.kid.postMessage("start-test", "http://example.com");
+  window.frames.kid.postMessage("start-test", "http://mochi.test:8888");
 }
 
 window.addEventListener("load", run, false);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/whatwg/test_postMessage_origin.xhtml
+++ b/dom/tests/mochitest/whatwg/test_postMessage_origin.xhtml
@@ -10,23 +10,23 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="browserFu.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=417075">Mozilla Bug 417075</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
-<iframe src="http://localhost:8888/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
+<iframe src="http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="sameDomain"></iframe>
 <iframe src="http://example.com/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="otherDomain"></iframe>
 <iframe src="http://example.org:8000/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="otherDomainPort"></iframe>
-<iframe src="ftp://localhost:27534/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
+<iframe src="ftp://mochi.test:27534/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="localNoExist"></iframe>
 
 <iframe src="http://sub1.παράδειγμα.δοκιμή/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="idnKidWhitelist"></iframe>
 
 <iframe src="http://sub1.exämple.test/tests/dom/tests/mochitest/whatwg/postMessage_origin_helper.xhtml"
         id="idnKidNoWhitelist"></iframe>
 
@@ -79,17 +79,17 @@ var tests =
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR
    },
    {
      args: ["TODO", " http://localhost:8888"],
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR,
 
-     returnOrigin: "http://localhost:8888",
+     returnOrigin: "http://mochi.test:8888",
      hasThrowsNoExceptionBug: true
    },
    {
      args: ["NOT-RECEIVED", "hä"],
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR
    },
    {
@@ -117,45 +117,45 @@ var tests =
 
      hasThrowsNoExceptionBug: true
    },
    {
      args: ["TODO", "http://\nlocalhost:8888"],
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR,
 
-     returnOrigin: "http://localhost:8888",
+     returnOrigin: "http://mochi.test:8888",
      hasThrowsNoExceptionBug: true
    },
    {
      args: ["TODO", "http://localhost:8888\0"],
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR,
 
-     returnOrigin: "http://localhost:8888",
+     returnOrigin: "http://mochi.test:8888",
      hasThrowsNoExceptionBug: true
    },
    {
      args: ["TODO", "http://localhost:8888\n"],
      source: "sameDomain",
      code: DOMException.SYNTAX_ERR,
 
-     returnOrigin: "http://localhost:8888",
+     returnOrigin: "http://mochi.test:8888",
      hasThrowsNoExceptionBug: true
    },
    // 15
    {
      args: ["PASS", "*"],
      source: "sameDomain",
-     returnOrigin: "http://localhost:8888"
+     returnOrigin: "http://mochi.test:8888"
    },
    {
-     args: ["PASS", "http://localhost:8888"],
+     args: ["PASS", "http://mochi.test:8888"],
      source: "sameDomain",
-     returnOrigin: "http://localhost:8888"
+     returnOrigin: "http://mochi.test:8888"
    },
    {
      args: ["PASS", "http://example.com"],
      source: "otherDomain",
      returnOrigin: "http://example.com"
    },
    {
      args: ["PASS", "http://example.com/"],
@@ -231,28 +231,28 @@ var tests =
      expectNoCallback: true
    },
    {
      args: ["PASS", "http://example.org"],
      source: "otherDomain",
      expectNoCallback: true
    },
    {
-     args: ["PASS", "ftp://localhost:8888"],
+     args: ["PASS", "ftp://mochi.test:8888"],
      source: "sameDomain",
      expectNoCallback: true
    },
    {
-     args: ["PASS", "http://localhost:8888"],
+     args: ["PASS", "http://mochi.test:8888"],
      source: "sameDomain",
-     returnOrigin: "http://localhost:8888"
+     returnOrigin: "http://mochi.test:8888"
    },
    // 35
    {
-     args: ["PASS", "http://localhost:27534"],
+     args: ["PASS", "http://mochi.test:27534"],
      source: "sameDomain",
      expectNoCallback: true
    },
    {
      args: ["PASS", "http://sub1.παράδειγμα.δοκιμή"],
      source: "idnKidWhitelist",
      returnOrigin: "http://sub1.παράδειγμα.δοκιμή"
    },
@@ -478,17 +478,17 @@ function removeListener(listener)
 }
 
 function oddballTests(callback)
 {
   var called = false;
 
   function eventChecks(evt)
   {
-    is(evt.origin, "http://localhost:8888", "wrong sender");
+    is(evt.origin, "http://mochi.test:8888", "wrong sender");
     is(evt.data, "PASS", "wrong data");
     is(evt.lastEventId, "",
        "postMessage creates events with empty lastEventId");
     ok(evt.source === window, "wrong source");
     called = true;
   }
 
   var listener = registerMessageListener(eventChecks, function()
@@ -500,20 +500,20 @@ function oddballTests(callback)
     listener = registerMessageListener(eventChecks, function()
     {
       is(called, true, "should have been called");
 
       removeListener(listener);
       callback();
     });
     
-    window.postMessage("PASS", "http://localhost:8888");
+    window.postMessage("PASS", "http://mochi.test:8888");
   });
 
-  window.postMessage("PASS", "http://localhost:8888");
+  window.postMessage("PASS", "http://mochi.test:8888");
 }
 
 function run()
 {
   oddballTests(function()
   {
     allTests(function()
     {
--- a/dom/tests/mochitest/whatwg/test_postMessage_special.xhtml
+++ b/dom/tests/mochitest/whatwg/test_postMessage_special.xhtml
@@ -125,38 +125,38 @@ function messageReceiver(evt)
     {
       // This isn't clarified in HTML5 yet, but the origin for a document which
       // has been open()ed is the origin of the calling code, somewhat loosely
       // speaking.  For the specific case of about:blank it's also possible
       // that the origin is determined by the code that opens the window.  It's
       // not codified yet which of these two causes the identifier tokens on
       // the event generated by the new window to be those of this window, but
       // in either case this is what they should be.
-      is(evt.origin, "http://localhost:8888",
+      is(evt.origin, "http://mochi.test:8888",
          "wrong origin for event from about:blank");
       is(evt.source, aboutBlankWindow, "wrong source");
 
       // ...and onto the next test
       aboutBlankResponseReceived = true;
       setupBlank2();
     }
     else if (evt.data === "about:blank2-response")
     {
-      is(evt.origin, "http://localhost:8888",
+      is(evt.origin, "http://mochi.test:8888",
          "wrong origin for event from about:blank #2");
       is(evt.source, aboutBlank2Window, "wrong source");
       aboutBlank2ResponseReceived = true;
 
       setupData();
     }
     else if (evt.data === "data-response")
     {
       // HTML5 defines the origin of a data: URI as the origin of the window or
       // script that opened the data: URI.
-      is(evt.origin, "http://localhost:8888",
+      is(evt.origin, "http://mochi.test:8888",
          "wrong origin for event from data URL (should be the origin of the " +
          "window/script that opened the URL, in this case the origin of this " +
          "file)");
       is(evt.source, dataWindow, "wrong source");
 
       dataResponseReceived = true;
       finish();
     }
@@ -180,27 +180,27 @@ function getContents(description, respon
     "  <title>about:blank</title>\n" +
     "  <script type='application/javascript'>\n" +
     "function receive(evt)\n" +
     "{\n" +
     "  var response = '" + responseText + "';\n" +
     "\n" +
     "  if (evt.source !== window.parent)\n" +
     "    response += ' wrong-source';\n" +
-    "  if (evt.origin !== 'http://localhost:8888')\n" +
+    "  if (evt.origin !== 'http://mochi.test:8888')\n" +
     "    response += ' wrong-origin(' + evt.origin + ')';\n" +
     "  if (evt.data !== 'from-opener')\n" +
     "    response += ' wrong-data(' + evt.data + ')';\n" +
     "\n" +
-    "  window.parent.postMessage(response, 'http://localhost:8888');\n" +
+    "  window.parent.postMessage(response, 'http://mochi.test:8888');\n" +
     "}\n" +
     "\n" +
     "function ready()\n" +
     "{\n" +
-    "  window.parent.postMessage('next-test', 'http://localhost:8888');\n" +
+    "  window.parent.postMessage('next-test', 'http://mochi.test:8888');\n" +
     "}\n" +
     "\n" +
     "window.addEventListener('load', ready, false);\n" +
     "window.addEventListener('message', receive, false);\n" +
     "  </script>\n" +
     "</head>\n" +
     "<body><p>" + description + "</p></body>\n" +
     "</html>";
@@ -317,39 +317,39 @@ function nextTest()
     default:
       ok(false, "unreached");
       break;
   }
 }
 
 function testBlank()
 {
-  aboutBlankWindow.postMessage("from-opener", "http://localhost:8888");
+  aboutBlankWindow.postMessage("from-opener", "http://mochi.test:8888");
 }
 
 function testBlank2()
 {
   // For some reason we can't access this across browsers prior to the iframe
   // loading, so set its value here.
   aboutBlank2Window = window.frames[1];
 
   var doc = aboutBlank2Window.document;
 
   doc.body.textContent = "This was about:blank #2";
 
   var script = doc.createElement("script");
   script.textContent =
     "window.parent.postMessage('about:blank2-response', " +
-    "                          'http://localhost:8888');";
+    "                          'http://mochi.test:8888');";
   doc.body.appendChild(script);
 }
 
 function testData()
 {
-  dataWindow.postMessage("from-opener", "http://localhost:8888");
+  dataWindow.postMessage("from-opener", "http://mochi.test:8888");
 }
 
 window.addEventListener("message", messageReceiver, false);
 
 addLoadEvent(setupBlank);
 ]]></script>
 </pre>
 </body>
--- a/dom/tests/mochitest/whatwg/test_postMessage_throw.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_throw.html
@@ -9,33 +9,33 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=postMessage">Mozilla Bug 387706</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
-<iframe src="http://localhost:8888/tests/dom/tests/mochitest/whatwg/postMessage_throw_helper.html"
+<iframe src="http://mochi.test:8888/tests/dom/tests/mochitest/whatwg/postMessage_throw_helper.html"
         name="sameDomain"></iframe>
 <iframe src="http://example.org:8000/tests/dom/tests/mochitest/whatwg/postMessage_throw_helper.html"
         name="crossDomain"></iframe>
 
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 /** Test for Bug 387706 **/
 
 SimpleTest.waitForExplicitFinish();
 
 function atLoad()
 {
   try
   {
-    sameDomain.postMessage("foo", "http://localhost:8888");
+    sameDomain.postMessage("foo", "http://mochi.test:8888");
     ok(true, "should not have thrown for same-domain exception");
   }
   catch (e)
   {
     ok(false, "uh-oh, threw a same-domain exception: " + e);
   }
 
   setTimeout(next, 0);
--- a/extensions/cookie/test/file_domain_inner.html
+++ b/extensions/cookie/test/file_domain_inner.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     document.cookie = "can=has";
 
     // send a message to our test document, to say we're done loading
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 <body>
 <iframe name="frame1" src="http://example.org/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
 </body>
 </html>
--- a/extensions/cookie/test/file_domain_inner_inner.html
+++ b/extensions/cookie/test/file_domain_inner_inner.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta2=tag2">
   <script type="text/javascript">
     document.cookie = "can2=has2";
 
     // send a message to our test document, to say we're done loading
-    window.parent.opener.postMessage("message", "http://localhost:8888");
+    window.parent.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 </head>
 <body>
 </body>
 </html>
--- a/extensions/cookie/test/file_image_inner.html
+++ b/extensions/cookie/test/file_image_inner.html
@@ -1,15 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     document.cookie = "can=has";
 
     // send a message to our test document, to say we're done loading
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 </head>
 <body>
 <iframe name="frame1" src="http://example.org/tests/extensions/cookie/test/file_image_inner_inner.html"></iframe>
 </body>
 </html>
--- a/extensions/cookie/test/file_image_inner_inner.html
+++ b/extensions/cookie/test/file_image_inner_inner.html
@@ -4,17 +4,17 @@
   <link rel="stylesheet" type="text/css" media="all" href="http://example.org/tests/extensions/cookie/test/test1.css" />
   <link rel="stylesheet" type="text/css" media="all" href="http://example.com/tests/extensions/cookie/test/test2.css" />
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta2=tag2">
   <script type="text/javascript">
     function runTest() {
       document.cookie = "can2=has2";
 
       // send a message to our test document, to say we're done loading
-      window.parent.opener.postMessage("message", "http://localhost:8888");
+      window.parent.opener.postMessage("message", "http://mochi.test:8888");
     }
   </script>
 </head>
 <body>
 <img src="http://example.org/tests/extensions/cookie/test/image1.png" onload="runTest()" />
 <img src="http://example.com/tests/extensions/cookie/test/image2.png" onload="runTest()" />
 </body>
 </html>
--- a/extensions/cookie/test/file_loadflags_inner.html
+++ b/extensions/cookie/test/file_loadflags_inner.html
@@ -2,16 +2,16 @@
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     function runTest() {
       document.cookie = "can=has";
 
       // send a message to our test document, to say we're done loading
-      window.opener.postMessage("f_lf_i msg data", "http://localhost:8888");
+      window.opener.postMessage("f_lf_i msg data", "http://mochi.test:8888");
     }
   </script>
 </head>
 <body>
 <img src="http://example.org/tests/extensions/cookie/test/image1.png" onload="runTest()" />
 </body>
 </html>
--- a/extensions/cookie/test/file_localhost_inner.html
+++ b/extensions/cookie/test/file_localhost_inner.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     document.cookie = "can=has";
 
     // send a message to our test document, to say we're done loading
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 <body>
-<iframe name="frame1" src="http://localhost:8888/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
+<iframe name="frame1" src="http://mochi.test:8888/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
 </body>
 </html>
--- a/extensions/cookie/test/file_loopback_inner.html
+++ b/extensions/cookie/test/file_loopback_inner.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     document.cookie = "can=has";
 
     // send a message to our test document, to say we're done loading
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 <body>
 <iframe name="frame1" src="http://127.0.0.1:8888/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
 </body>
 </html>
--- a/extensions/cookie/test/file_subdomain_inner.html
+++ b/extensions/cookie/test/file_subdomain_inner.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Set-Cookie" CONTENT="meta=tag">
   <script type="text/javascript">
     document.cookie = "can=has";
 
     // send a message to our test document, to say we're done loading
-    window.opener.postMessage("message", "http://localhost:8888");
+    window.opener.postMessage("message", "http://mochi.test:8888");
   </script>
 <body>
 <iframe name="frame1" src="http://test2.example.org/tests/extensions/cookie/test/file_domain_inner_inner.html"></iframe>
 </body>
 </html>
--- a/extensions/cookie/test/test_same_base_domain_4.html
+++ b/extensions/cookie/test/test_same_base_domain_4.html
@@ -1,16 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test for Cross domain access to properties</title>
   <script type="text/javascript" src="/MochiKit/packed.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
-<body onload="setupTest('http://localhost:8888/tests/extensions/cookie/test/file_localhost_inner.html', 5, 2)">
+<body onload="setupTest('http://mochi.test:8888/tests/extensions/cookie/test/file_localhost_inner.html', 5, 2)">
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="text/javascript" src="file_testcommon.js">
 </script>
 </pre>
 </body>
 </html>
--- a/js/src/xpconnect/tests/mochitest/test_bug504877.html
+++ b/js/src/xpconnect/tests/mochitest/test_bug504877.html
@@ -38,17 +38,17 @@ function go() {
 
             is(ifr.blat, 42, "able to set random properties")
             is(ifr.getblat(), 42, "setting properties propagates");
             is(ifr.foopy, 42, "able to use UniversalXPConnect to get random properties");
 
             loc.replace; // resolves the property onto the wrapper.
          })();
 
-        loc.replace("http://localhost:8888/");
+        loc.replace("http://mochi.test:8888/");
         ok(true, "able to set location on the cross origin(!) frame");
     }
 
     function test2() {
         SimpleTest.finish();
     }
 
     switch (++p) {
--- a/layout/forms/test/test_bug536567.html
+++ b/layout/forms/test/test_bug536567.html
@@ -24,19 +24,19 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cm = Components.manager;
 
 var ioSvc = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
 var prefSvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
 var obSvc = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
-if ("@mozilla.org/privatebrowsing;1" in Cc) {
+if ("@mozilla.org/privatebrowsing;1" in Cc) {
   var pbSvc = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
-}
+}
 
 var tmpDir = dirSvc.get("TmpD", Ci.nsILocalFile);
 prefSvc.setBoolPref("browser.privatebrowsing.keep_current_session", true);
 
 function newDir() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
   var dir = tmpDir.clone();
@@ -45,17 +45,17 @@ function newDir() {
   dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0700);
   return dir;
 }
 
 var dirs = [];
 for(var i = 0; i < 6; i++) {
   dirs.push(newDir());
 }
-var domains = ['http://localhost:8888', 'http://example.org:80', 'http://example.com:80'];
+var domains = ['http://mochi.test:8888', 'http://example.org:80', 'http://example.com:80'];
 /*
  * These tests take 3 args each:
  * - which domain to load
  * - the filePicker displayDirectory we expect to be set
  * - the file to pick (in most cases this will show up in the next test,
  *   as indicated by the comments)
  */
 var tests = [
--- a/layout/style/test/ccd-quirks.html
+++ b/layout/style/test/ccd-quirks.html
@@ -50,19 +50,19 @@ p + p { left: 22px }
 @import url("ccd.sjs?JA2iq");
 @import url("ccd.sjs?JA3iq");
 @import url("http://example.org/tests/layout/style/test/ccd.sjs?JB1iq");
 @import url("http://example.org/tests/layout/style/test/ccd.sjs?JB2iq");
 @import url("http://example.org/tests/layout/style/test/ccd.sjs?JB3iq");
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1iq");
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2iq");
 @import url("redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3iq");
-@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD1iq");
-@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD2iq");
-@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD3iq");
+@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1iq");
+@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2iq");
+@import url("http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3iq");
 </style>
 
 <!-- link directives -->
 <link rel="stylesheet" href="ccd.sjs?IA1lq">
 <link rel="stylesheet" href="ccd.sjs?IA2lq">
 <link rel="stylesheet" href="ccd.sjs?IA3lq">
 <link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB1lq">
 <link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?IB2lq">
@@ -77,19 +77,19 @@ p + p { left: 22px }
 <link rel="stylesheet" href="ccd.sjs?JA2lq">
 <link rel="stylesheet" href="ccd.sjs?JA3lq">
 <link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB1lq">
 <link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB2lq">
 <link rel="stylesheet" href="http://example.org/tests/layout/style/test/ccd.sjs?JB3lq">
 <link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC1lq">
 <link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC2lq">
 <link rel="stylesheet" href="redirect.sjs?http://example.org/tests/layout/style/test/ccd.sjs?JC3lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD1lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD2lq">
-<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://localhost:8888/tests/layout/style/test/ccd.sjs?JD3lq">
+<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD1lq">
+<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD2lq">
+<link rel="stylesheet" href="http://example.org/tests/layout/style/test/redirect.sjs?http://mochi.test:8888/tests/layout/style/test/ccd.sjs?JD3lq">
 
 </head><body>
 <div></div>
 <div></div>
 <div><p id="IA1i"></p><p id="IA1l"></p></div>
 <div><p id="IA2i"></p><p id="IA2l"></p></div>
 <div><p id="IA3i"></p><p id="IA3l"></p></div>
 <div></div>
--- a/modules/libjar/test/mochitest/test_bug403331.html
+++ b/modules/libjar/test/mochitest/test_bug403331.html
@@ -29,17 +29,17 @@ function runTest() {
     // If properly redirected, we'll be able to access elements in the loaded
     // document.
     var item = testFrame.contentDocument.getElementById('testitem');
     is(item.textContent, "testcontents", "Should be able to access the child document");
 
     SimpleTest.finish();
   }
 
-  testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://localhost:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
+  testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
 }
 
 addLoadEvent(runTest);
 
 </script>
 </pre>
 
 </body>
--- a/modules/plugin/test/mochitest/test_getauthenticationinfo.html
+++ b/modules/plugin/test/mochitest/test_getauthenticationinfo.html
@@ -19,57 +19,57 @@ Test for NPN_GetAuthenticationInfo
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 
 function iframeLoad() {
   var plugin = iframe.contentDocument.getElementById("embedtest");
   // valid request
-  is(plugin.getAuthInfo("http", "localhost", 8888, "basic", "testrealm"), 
+  is(plugin.getAuthInfo("http", "mochi.test", 8888, "basic", "testrealm"), 
       "user1|password1", 
       "correct user/pass retrieved");
   try {
     // invalid request -- wrong host
     is(plugin.getAuthInfo("http", "example.com", 8888, "basic", "testrealm"), 
         "user1|password1", 
         "correct user/pass retrieved");
     ok(false, "no exception was thrown");
   }
   catch (err) {
     ok(true, "expected exception caught");
   }
   try {
     // invalid request -- wrong port
-    is(plugin.getAuthInfo("http", "localhost", 90, "basic", "testrealm"), 
+    is(plugin.getAuthInfo("http", "mochi.test", 90, "basic", "testrealm"), 
         "user1|password1", 
         "correct user/pass retrieved");
     ok(false, "no exception was thrown");
   }
   catch (err) {
     ok(true, "expected exception caught");
   }
   try {
     // invalid request -- wrong realm
-    is(plugin.getAuthInfo("http", "localhost", 8888, "basic", "wrongrealm"), 
+    is(plugin.getAuthInfo("http", "mochi.test", 8888, "basic", "wrongrealm"), 
         "user1|password1", 
         "correct user/pass retrieved");
     ok(false, "no exception was thrown");
   }
   catch (err) {
     ok(true, "expected exception caught");
   }
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 var iframe = document.getElementById("iframe");
 var am = Cc["@mozilla.org/network/http-auth-manager;1"].
          getService(Ci.nsIHttpAuthManager);
-am.setAuthIdentity("http", "localhost", 8888, "basic", "testrealm", "", 
-    "localhost", "user1", "password1");
+am.setAuthIdentity("http", "mochi.test", 8888, "basic", "testrealm", "", 
+    "mochi.test", "user1", "password1");
 iframe.onload = iframeLoad;
-iframe.src = "http://localhost:8888/tests/toolkit/components/passwordmgr/" +
+iframe.src = "http://mochi.test:8888/tests/toolkit/components/passwordmgr/" +
     "test/authenticate.sjs?user=user1&pass=password1&realm=testrealm&plugin=1";
 
 </script>
 </body>
 </html>
--- a/netwerk/test/httpserver/httpd.js
+++ b/netwerk/test/httpserver/httpd.js
@@ -497,39 +497,51 @@ nsHttpServer.prototype =
 
   // NSIHTTPSERVER
 
   //
   // see nsIHttpServer.start
   //
   start: function(port)
   {
+    this._start(port, "localhost")
+  },
+
+  _start: function(port, host)
+  {
     if (this._socket)
       throw Cr.NS_ERROR_ALREADY_INITIALIZED;
 
     this._port = port;
     this._doQuit = this._socketClosed = false;
 
+    this._host = host;
+
     // The listen queue needs to be long enough to handle
     // network.http.max-connections-per-server concurrent connections,
     // plus a safety margin in case some other process is talking to
     // the server as well.
     var prefs = getRootPrefBranch();
     var maxConnections =
       prefs.getIntPref("network.http.max-connections-per-server") + 5;
 
     try
     {
+      var loopback = true;
+      if (this._host != "127.0.0.1" && this._host != "localhost") {
+        var loopback = false;
+      }
+
       var socket = new ServerSocket(this._port,
-                                    true, // loopback only
+                                    loopback, // true = localhost, false = everybody
                                     maxConnections);
       dumpn(">>> listening on port " + socket.port + ", " + maxConnections +
             " pending connections");
       socket.asyncListen(this);
-      this._identity._initialize(port, true);
+      this._identity._initialize(port, host, true);
       this._socket = socket;
     }
     catch (e)
     {
       dumpn("!!! could not start server on port " + port + ": " + e);
       throw Cr.NS_ERROR_NOT_AVAILABLE;
     }
   },
@@ -916,17 +928,17 @@ ServerIdentity.prototype =
     if (this._primaryScheme == scheme &&
         this._primaryHost == host &&
         this._primaryPort == port &&
         this._defaultPort !== -1)
     {
       // Always keep at least one identity in existence at any time, unless
       // we're in the process of shutting down (the last condition above).
       this._primaryPort = -1;
-      this._initialize(this._defaultPort, false);
+      this._initialize(this._defaultPort, host, false);
     }
 
     return present;
   },
 
   //
   // see nsIHttpServerIdentity.has
   //
@@ -982,58 +994,61 @@ ServerIdentity.prototype =
 
 
   // PRIVATE IMPLEMENTATION
 
   /**
    * Initializes the primary name for the corresponding server, based on the
    * provided port number.
    */
-  _initialize: function(port, addSecondaryDefault)
+  _initialize: function(port, host, addSecondaryDefault)
   {
+    this._host = host;
     if (this._primaryPort !== -1)
-      this.add("http", "localhost", port);
+      this.add("http", host, port);
     else
       this.setPrimary("http", "localhost", port);
     this._defaultPort = port;
 
     // Only add this if we're being called at server startup
-    if (addSecondaryDefault)
+    if (addSecondaryDefault && host != "127.0.0.1")
       this.add("http", "127.0.0.1", port);
   },
 
   /**
    * Called at server shutdown time, unsets the primary location only if it was
    * the default-assigned location and removes the default location from the
    * set of locations used.
    */
   _teardown: function()
   {
-    // Not the default primary location, nothing special to do here
-    this.remove("http", "127.0.0.1", this._defaultPort);
-
+    if (this._host != "127.0.0.1") {
+      // Not the default primary location, nothing special to do here
+      this.remove("http", "127.0.0.1", this._defaultPort);
+    }
+    
     // This is a *very* tricky bit of reasoning here; make absolutely sure the
     // tests for this code pass before you commit changes to it.
     if (this._primaryScheme == "http" &&
-        this._primaryHost == "localhost" &&
+        this._primaryHost == this._host &&
         this._primaryPort == this._defaultPort)
     {
       // Make sure we don't trigger the readding logic in .remove(), then remove
       // the default location.
       var port = this._defaultPort;
       this._defaultPort = -1;
-      this.remove("http", "localhost", port);
+      this.remove("http", this._host, port);
 
       // Ensure a server start triggers the setPrimary() path in ._initialize()
       this._primaryPort = -1;
     }
     else
     {
       // No reason not to remove directly as it's not our primary location
-      this.remove("http", "localhost", this._defaultPort);
+      this.remove("http", this._host, this._defaultPort);
     }
   },
 
   /**
    * Ensures scheme, host, and port are all valid with respect to RFC 2396.
    *
    * @throws NS_ERROR_ILLEGAL_VALUE
    *   if any argument doesn't match the corresponding production
--- a/security/manager/ssl/tests/mochitest/bugs/test_bug480619.html
+++ b/security/manager/ssl/tests/mochitest/bugs/test_bug480619.html
@@ -47,17 +47,17 @@ var sink = {
       tearDown = true;
       Cc["@mozilla.org/security/sdr;1"].
         getService(Ci.nsISecretDecoderRing).
         logoutAndTeardown();
     }
   }
 };
 
-var transport = socketTransportService.createTransport(["ssl"], 1, "localhost", 4443, null);
+var transport = socketTransportService.createTransport(["ssl"], 1, "127.0.0.1", 4443, null);
 
 transport.setEventSink(sink, currentThread);
 
 var inStream = transport.openInputStream(0, 0, 0)
                         .QueryInterface(Ci.nsIAsyncInputStream);
 
 inStream.asyncWait(reader, Ci.nsIAsyncInputStream.WAIT_CLOSURE_ONLY, 0, currentThread);
 
--- a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
@@ -102,17 +102,17 @@ function onMessageReceived(event)
       else
         SimpleTest.ok(!event.data.match(failureRegExp), event.data);
       break;
   }
 }
 
 function postMsg(message)
 {
-  opener.postMessage(message, "http://localhost:8888");
+  opener.postMessage(message, "http://mochi.test:8888");
 }
 
 function finish()
 {
   if (history.length == 1 && !bypassNavigationTest)
   {
     window.setTimeout(function()
     {
--- a/testing/mochitest/runtests.py.in
+++ b/testing/mochitest/runtests.py.in
@@ -221,28 +221,30 @@ class MochitestServer:
 
   def __init__(self, automation, options, profileDir, shutdownURL):
     self._automation = automation
     self._closeWhenDone = options.closeWhenDone
     self._utilityPath = options.utilityPath
     self._xrePath = options.xrePath
     self._profileDir = profileDir
     self.shutdownURL = shutdownURL
+    self.webServer = "127.0.0.1"
 
   def start(self):
     "Run the Mochitest server, returning the process ID of the server."
     
     env = self._automation.environment(xrePath = self._xrePath)
     env["XPCOM_DEBUG_BREAK"] = "warn"
     if self._automation.IS_WIN32:
       env["PATH"] = env["PATH"] + ";" + self._xrePath
 
     args = ["-g", self._xrePath,
             "-v", "170",
             "-f", "./" + "httpd.js",
+            '-e', 'const _SERVER_ADDR="' + self.webServer + '";',
             "-f", "./" + "server.js"]
 
     xpcshell = os.path.join(self._utilityPath,
                             "xpcshell" + self._automation.BIN_SUFFIX)
     self._process = self._automation.Process([xpcshell] + args, env = env)
     pid = self._process.pid
     if pid < 0:
       print "Error starting server."
@@ -271,17 +273,17 @@ class MochitestServer:
       c.close()
       self._process.wait()
     except:
       self._process.kill()
 
 
 class Mochitest(object):
   # Path to the test script on the server
-  TEST_SERVER_HOST = "localhost:8888"
+  TEST_SERVER_HOST = "mochi.test:8888"
   TEST_PATH = "/tests/"
   CHROME_PATH = "/redirect.html";
   A11Y_PATH = "/redirect-a11y.html"
   urlOpts = []
   runSSLTunnel = True
  
   oldcwd = os.getcwd()
 
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -45,16 +45,18 @@
 // not connected to a network.
 let (ios = Cc["@mozilla.org/network/io-service;1"]
            .getService(Ci.nsIIOService2)) {
   ios.manageOfflineStatus = false;
   ios.offline = false;
 }
 
 const SERVER_PORT = 8888;
+var gServerAddress = "127.0.0.1";
+
 var server; // for use in the shutdown handler, if necessary
 
 //
 // HTML GENERATION
 //
 var tags = ['A', 'ABBR', 'ACRONYM', 'ADDRESS', 'APPLET', 'AREA', 'B', 'BASE',
             'BASEFONT', 'BDO', 'BIG', 'BLOCKQUOTE', 'BODY', 'BR', 'BUTTON',
             'CAPTION', 'CENTER', 'CITE', 'CODE', 'COL', 'COLGROUP', 'DD',
@@ -145,17 +147,39 @@ var serverBasePath;
 
 //
 // SERVER SETUP
 //
 function runServer()
 {
   serverBasePath = __LOCATION__.parent;
   server = createMochitestServer(serverBasePath);
-  server.start(SERVER_PORT);
+
+  //verify server address
+  //if a.b.c.d or 'localhost'
+  if (typeof(_SERVER_ADDR) != "undefined") {
+    if (_SERVER_ADDR == "localhost") {
+      gServerAddress = _SERVER_ADDR;      
+    } else {
+      var quads = _SERVER_ADDR.split('.');
+      if (quads.length == 4) {
+        var invalid = false;
+        for (var i=0; i < 4; i++) {
+          if (quads[i] < 0 || quads[i] > 255)
+            invalid = true;
+        }
+        if (!invalid)
+          gServerAddress = _SERVER_ADDR;
+        else
+          dumpn("WARNING: invalid server address ('" + _SERVER_ADDR + "'), using localhost");
+      }
+    }
+  }
+
+  server._start(SERVER_PORT, gServerAddress);
 
   // touch a file in the profile directory to indicate we're alive
   var foStream = Cc["@mozilla.org/network/file-output-stream;1"]
                    .createInstance(Ci.nsIFileOutputStream);
   var serverAlive = Cc["@mozilla.org/file/local;1"]
                       .createInstance(Ci.nsILocalFile);
   serverAlive.initWithFile(serverBasePath);
   serverAlive.append("mochitesttestingprofile");
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -210,16 +210,17 @@ class XPCShellTests(object):
         else: # not in this dir? skip it
           continue
 
       cmdH = ", ".join(['"' + f.replace('\\', '/') + '"'
                  for f in testHeadFiles])
       cmdT = ", ".join(['"' + f.replace('\\', '/') + '"'
                  for f in testTailFiles])
       cmdH = xpcsCmd + \
+                ['-e', 'const _SERVER_ADDR = "localhost";'] + \
                 ['-e', 'const _HEAD_FILES = [%s];' % cmdH] + \
                 ['-e', 'const _TAIL_FILES = [%s];' % cmdT]
 
       # Now execute each test individually.
       for test in testfiles:
         # The test file will have to be loaded after the head files.
         cmdT = ['-e', 'const _TEST_FILE = ["%s"];' %
                 os.path.join(testdir, test).replace('\\', '/')]
--- a/toolkit/components/microformats/tests/test_Microformats_hCalendar.html
+++ b/toolkit/components/microformats/tests/test_Microformats_hCalendar.html
@@ -225,17 +225,17 @@ function test_hCard() {
 
   is(hcalendar.dtstart, "2005-10-05", "05-calendar-simple - dtstart");
   is(hcalendar.dtend, "2005-10-08", "05-calendar-simple - dtend");
   is(hcalendar.url, "http://www.web2con.com/", "05-calendar-simple - url");
   is(hcalendar.summary, "Web 2.0 Conference", "05-calendar-simple - summary");
   is(hcalendar.location, "Argent Hotel, San Francisco, CA", "05-calendar-simple - location");
 
   hcalendar = new hCalendar(document.getElementById("06-component-vevent-uri-relative"));
-  is(hcalendar.url, "http://localhost:8888/squidlist/calendar/12279/2006/1/15", "06-component-vevent-uri-relative - url");
+  is(hcalendar.url, "http://mochi.test:8888/squidlist/calendar/12279/2006/1/15", "06-component-vevent-uri-relative - url");
   is(hcalendar.summary, "Bad Movie Night - Gigli (blame mike spiegelman)", "06-component-vevent-uri-relative - summary");
   is(hcalendar.dtstart, "2006-01-15T00:00:00", "06-component-vevent-uri-relative - dtstart");
 
   hcalendar = new hCalendar(document.getElementById("07-component-vevent-description-simple"));
   is(hcalendar.description, "Project xyz Review Meeting Minutes", "07-component-vevent-description-simple - description");
 
   hcalendar = new hCalendar(document.getElementById("08-component-vevent-multiple-classes"));
   is(hcalendar.dtstart, "2005-10-05", "08-component-vevent-multiple-classes - dtstart");
--- a/toolkit/components/microformats/tests/test_Microformats_hCard.html
+++ b/toolkit/components/microformats/tests/test_Microformats_hCard.html
@@ -83,23 +83,23 @@
       <span class="given-name">John</span> <span class="family-name">Doe</span></span>
       <a class="url" href="http://example.com/foo">my website</a>
       <a class="url" href="http://example.com/bar">my other website</a>
   </p>
 
   <p class="vcard" id="12-img-src-url">
     <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span>
     <!-- take the @src, ignore the @type -->
-    <img class="url" src="http://localhost:8888/tests/browser/microformats/test/picture.png" type="image/png" />
+    <img class="url" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png" />
   </p>
 
   <p class="vcard" id="13-photo-logo">
     <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span>
     <!-- take the @src, ignore the @type -->
-    <img class="photo logo" src="http://localhost:8888/tests/browser/microformats/test/picture.png" type="image/png" />
+    <img class="photo logo" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png" />
   </p>
 
   <p class="vcard" id="14-img-src-data-url">
     <span class="fn n"><span class="given-name">John</span> <span class="family-name">Doe</span></span>
     <img class="photo logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg=="/>
   </p>
 
   <p class="vcard" id="15-honorific-additional-single">
@@ -127,28 +127,28 @@
 
   <p class="vcard" id="17-email-not-uri">
     <span class="fn">John Doe</span>
     <span class="email">john@example.com</span>
   </p>
 
   <p class="vcard" id="18-object-data-http-uri">
     <span class="fn">John Doe</span>
-    <object class="url photo logo" data="http://localhost:8888/tests/browser/microformats/test/picture.png" type="image/png"></object>
+    <object class="url photo logo" data="http://mochi.test:8888/tests/browser/microformats/test/picture.png" type="image/png"></object>
   </p>
 
   <p class="vcard" id="19-object-data-data-uri">
     <span class="fn">John Doe</span>
     <object class="photo logo" data="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==" />
   </p>
 
   <p class="vcard" id="20-image-alt">
 <!-- only testing 'fn' here, but you should be able to parse any text value out of the img@alt -->
 <!-- also note, the fn should only be used to infer n, when there's no explicit n in the hcard -->
-    <img class="fn photo logo" src="http://localhost:8888/tests/browser/microformats/test/picture.png" alt="John Doe" />
+    <img class="fn photo logo" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="John Doe" />
   </p>
   
   <div class="vcard" id="21-tel">
     <p class="fn">John Doe</p>v
     <p class="tel">+1.415.555.1231</p>
     <p class="tel">
       <span class="type">home</span>
       <span class="value">+1 415 555 1232</span>
@@ -378,25 +378,25 @@
   <div class="vcard" id="30-fn-org.1">
     <div class="fn org">W3C</div>
   </div>
   <div class="vcard" id="30-fn-org.2">
     <div class="fn">Dan Connolly</div>
     <div class="org">W3C</div>
   </div>
   <div class="vcard" id="30-fn-org.3">
-    <img class="fn" src="http://localhost:8888/tests/browser/microformats/test/picture.png" alt="W3C" />
+    <img class="fn" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="W3C" />
     <div class="org">W3C</div>
   </div>
   <div class="vcard" id="30-fn-org.4">
-    <img class="fn org" src="http://localhost:8888/tests/browser/microformats/test/picture.png"
+    <img class="fn org" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png"
          alt="World Wide Web Consortium" />
   </div>
   <div class="vcard" id="30-fn-org.5">
-    <object data="http://localhost:8888/tests/browser/microformats/test/w3c_home">
+    <object data="http://mochi.test:8888/tests/browser/microformats/test/w3c_home">
       <abbr class="fn org" title="World Wide Web Consortium">W3C</abbr>
     </object>
   </div>
   
   <p id="email1"><a href="mailto:correct@example.com" class="email">my email</a></p>
   <p id="email2"><a href="mailto:incorrect@example.com" class="email">my email</a></p>
   <div class="vcard" id="31-include.1">
     <a class="url fn" href="http://suda.co.uk/">Brian Suda</a>
@@ -443,17 +443,17 @@
       <area class="org" href="http://example.com/" alt="Joe Public" />
     </map>
   </div>
   <div class="vcard" id="33-area.3">
     <map id="mailto-test-3">
       <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/>
       <area class="url" href="http://example.com/" alt="my website!" />
     </map>
-    <img class="org" src="http://localhost:8888/tests/browser/microformats/test/picture.png" alt="Joe Public" />
+    <img class="org" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="Joe Public" />
   </div>
   <div class="vcard" id="33-area.4">
     <map id="mailto-test-4">
       <area class="fn email" href="mailto:joe@example.com" alt="Joe Public"/>
       <area class="url" href="http://example.com/" alt="my website!" />
     </map>
     <div class="org">Joe Public</div>
   </div>
@@ -491,17 +491,17 @@
     <span class="title">Microformat Brainstormer</span>
   </div>
 
   <p class="vcard" id="36-categories.1">
     <span class="fn">john doe</span>,
     <abbr class="category" title="C1">C1a</abbr>
     <a class="category" href="http://example.com" title="C2">C2a</a>
     <a class="category" href="http://example.com/C3" rel="tag" title="C3a">C3b</a>
-    <img class="category" src="http://localhost:8888/tests/browser/microformats/test/picture.png" alt="C4"/>
+    <img class="category" src="http://mochi.test:8888/tests/browser/microformats/test/picture.png" alt="C4"/>
     <a class="category" href="http://example.com/C5/" rel="tag" title="C5a">C5b</a>
     <a class="category" href="http://example.com/C6?tag=false" rel="tag" title="C6a">C6b</a>
     <a class="category" href="http://example.com/C7#anchor" rel="tag" title="C7a">C7b</a>
     <a class="category" href="http://example.com/C8?tag=trailing-slash/" rel="tag" title="C8a">C8b</a>
     <a class="category" href="http://example.com/C9/?tag=trailing-slash/" rel="tag" title="C9a">C9b</a>
   </p>
   <div class="vcard" id="36-categories.2">
     <span class="fn n">
@@ -529,21 +529,21 @@
   </p>
 
   <div class="vcard" id="38-uid.1">
     <span class="fn">Ryan King</span>
     <a class="url uid" href="http://theryanking.com/contact/">My other hCard</a>
   </div>
   <div class="vcard" id="38-uid.2">
     <span class="fn">Ryan King</span>
-    <object class="url uid" data="http://localhost:8888/tests/browser/microformats/test/contact/">My other hCard</object>
+    <object class="url uid" data="http://mochi.test:8888/tests/browser/microformats/test/contact/">My other hCard</object>
   </div>
   <div class="vcard" id="38-uid.3">
     <span class="fn">Ryan King</span>
-    <img class="url uid" src="http://localhost:8888/tests/browser/microformats/test/contact/" alt="my other hcard" />
+    <img class="url uid" src="http://mochi.test:8888/tests/browser/microformats/test/contact/" alt="my other hcard" />
   </div>
   <div class="vcard" id="38-uid.4">
     <span class="fn">Ryan King</span>
     <map id="foo"><area class="url uid" href="http://theryanking.com/contact/" alt="my other hcard" /></map>
   </div>
 
   <div class="vcard" id="39-noteHTML">
     <a class="fn">Joe Public</a>
@@ -686,40 +686,40 @@ function test_hCard() {
   is(hcard.email[0].value, "brian@example.com", "06-mailto-2 - email");
 
   hcard = new hCard(document.getElementById("07-relative-url"));
 
   is(hcard.fn, "John Doe", "07-relative-url - fn");
   is(hcard.n["given-name"][0], "John", "07-relative-url - given-name");
   is(hcard.n["family-name"][0], "Doe", "07-relative-url - family-name");
 //  is(hcard.url[0], "http://microformats.org/home/blah", "07-relative-url - url");
-  is(hcard.url, "http://localhost:8888/home/blah", "07-relative-url - url");
+  is(hcard.url, "http://mochi.test:8888/home/blah", "07-relative-url - url");
 
   hcard = new hCard(document.getElementById("11-multiple-urls"));
 
   is(hcard.fn, "John Doe", "11-multiple-urls - fn");
   is(hcard.n["given-name"][0], "John", "11-multiple-urls - given-name");
   is(hcard.n["family-name"][0], "Doe", "11-multiple-urls - family-name");
   is(hcard.url[0], "http://example.com/foo", "11-multiple-urls - url");
   is(hcard.url[1], "http://example.com/bar", "11-multiple-urls - url");
 
   hcard = new hCard(document.getElementById("12-img-src-url"));
 
   is(hcard.fn, "John Doe", "12-img-src-url - fn");
   is(hcard.n["given-name"][0], "John", "12-img-src-url - given-name");
   is(hcard.n["family-name"][0], "Doe", "12-img-src-url - family-name");
-  is(hcard.url[0], "http://localhost:8888/tests/browser/microformats/test/picture.png", "12-img-src-url - url");
+  is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "12-img-src-url - url");
 
   hcard = new hCard(document.getElementById("13-photo-logo"));
 
   is(hcard.fn, "John Doe", "13-photo-logo - fn");
   is(hcard.n["given-name"][0], "John", "13-photo-logo - given-name");
   is(hcard.n["family-name"][0], "Doe", "13-photo-logo - family-name");
-  is(hcard.logo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo");
-  is(hcard.photo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo");
+  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo");
+  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo");
 
   hcard = new hCard(document.getElementById("14-img-src-data-url"));
 
   is(hcard.fn, "John Doe", "14-img-src-data-url - fn");
   is(hcard.n["given-name"][0], "John", "14-img-src-data-url - given-name");
   is(hcard.n["family-name"][0], "Doe", "14-img-src-data-url - family-name");
   is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo");
   is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo");
@@ -752,36 +752,36 @@ function test_hCard() {
   is(hcard.n["family-name"][0], "Doe", "17-email-not-uri - family-name");
   is(hcard.email[0].value, "john@example.com", "17-email-not-uri - email");
 
   hcard = new hCard(document.getElementById("18-object-data-http-uri"));
 
   is(hcard.fn, "John Doe", "18-object-data-http-uri - fn");
   is(hcard.n["given-name"][0], "John", "18-object-data-http-uri - given-name");
   is(hcard.n["family-name"][0], "Doe", "18-object-data-http-uri - family-name");
-  is(hcard.logo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo");
-  is(hcard.photo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo");
-  is(hcard.url, "http://localhost:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url");
+  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo");
+  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo");
+  is(hcard.url, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url");
 
   hcard = new hCard(document.getElementById("19-object-data-data-uri"));
 
   is(hcard.fn, "John Doe", "19-object-data-data-uri - fn");
   is(hcard.n["given-name"][0], "John", "19-object-data-data-uri - given-name");
   is(hcard.n["family-name"][0], "Doe", "19-object-data-data-uri - family-name");
   is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo");
   is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo");
 
 
   hcard = new hCard(document.getElementById("20-image-alt"));
 
   is(hcard.fn, "John Doe", "20-image-alt - fn");
   is(hcard.n["given-name"][0], "John", "20-image-alt - given-name");
   is(hcard.n["family-name"][0], "Doe", "20-image-alt - family-name");
-  is(hcard.logo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo");
-  is(hcard.photo, "http://localhost:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo");
+  is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo");
+  is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo");
 
   hcard = new hCard(document.getElementById("21-tel"));
 
   is(hcard.fn, "John Doe", "21-tel - fn");
   is(hcard.n["given-name"][0], "John", "21-tel - given-name");
   is(hcard.n["family-name"][0], "Doe", "21-tel - family-name");
   is(hcard.tel[0].value, "+1.415.555.1231", "21-tel - tel");
   is(hcard.tel[1].value, "+1 415 555 1232", "21-tel - tel");
@@ -1143,26 +1143,26 @@ function test_hCard() {
   is(hcard.uid, "http://theryanking.com/contact/", "38-uid.1 - uid");
   is(hcard.url[0], "http://theryanking.com/contact/", "38-uid.1 - url");
 
   hcard = new hCard(document.getElementById("38-uid.2"));
 
   is(hcard.fn, "Ryan King", "38-uid.2 - fn");
   is(hcard.n["given-name"][0], "Ryan", "38-uid.2 - given-name");
   is(hcard.n["family-name"][0], "King", "38-uid.2 - family-name");
-  is(hcard.uid, "http://localhost:8888/tests/browser/microformats/test/contact/", "38-uid.2 - uid");
-  is(hcard.url[0], "http://localhost:8888/tests/browser/microformats/test/contact/", "38-uid.2 - url");
+  is(hcard.uid, "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.2 - uid");
+  is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.2 - url");
 
   hcard = new hCard(document.getElementById("38-uid.3"));
 
   is(hcard.fn, "Ryan King", "38-uid.3 - fn");
   is(hcard.n["given-name"][0], "Ryan", "38-uid.3 - given-name");
   is(hcard.n["family-name"][0], "King", "38-uid.3 - family-name");
-  is(hcard.uid, "http://localhost:8888/tests/browser/microformats/test/contact/", "38-uid.3 - uid");
-  is(hcard.url[0], "http://localhost:8888/tests/browser/microformats/test/contact/", "38-uid.3 - url");
+  is(hcard.uid, "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.3 - uid");
+  is(hcard.url[0], "http://mochi.test:8888/tests/browser/microformats/test/contact/", "38-uid.3 - url");
 
   hcard = new hCard(document.getElementById("38-uid.4"));
 
   is(hcard.fn, "Ryan King", "38-uid.4 - fn");
   is(hcard.n["given-name"][0], "Ryan", "38-uid.4 - given-name");
   is(hcard.n["family-name"][0], "King", "38-uid.4 - family-name");
   is(hcard.uid, "http://theryanking.com/contact/", "38-uid.4 - uid");
   is(hcard.url[0], "http://theryanking.com/contact/", "38-uid.4 - url");
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/pwmgr_common.js
@@ -148,17 +148,17 @@ function commonInit() {
         //todo(false, "Warning: wasn't expecting disabled hosts to be present.");
         for each (var host in disabledHosts)
             pwmgr.setLoginSavingEnabled(host, true);
     }
 
     // Add a login that's used in multiple tests
     var login = Components.classes["@mozilla.org/login-manager/loginInfo;1"].
                 createInstance(Components.interfaces.nsILoginInfo);
-    login.init("http://localhost:8888", "http://localhost:8888", null,
+    login.init("http://mochi.test:8888", "http://mochi.test:8888", null,
                "testuser", "testpass", "uname", "pword");
     pwmgr.addLogin(login);
 
     // Last sanity check
     logins = pwmgr.getAllLogins();
     is(logins.length, 1, "Checking for successful init login");
     disabledHosts = pwmgr.getAllDisabledHosts();
     is(disabledHosts.length, 0, "Checking for no disabled hosts");
--- a/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
+++ b/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
@@ -97,62 +97,62 @@ ok(pwmgr != null, "nsLoginManager servic
 var nsLoginInfo =
 Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                        Components.interfaces.nsILoginInfo, "init");
 ok(nsLoginInfo != null, "nsLoginInfo constructor");
 
 
 // login0 has no username, so should be filtered out from the autocomplete list.
 var login0 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete:8888", null,
+    "http://mochi.test:8888", "http://autocomplete:8888", null,
     "", "user0pass", "", "pword");
 
 var login1 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete:8888", null,
+    "http://mochi.test:8888", "http://autocomplete:8888", null,
     "tempuser1", "temppass1", "uname", "pword");
 
 var login2 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete:8888", null,
+    "http://mochi.test:8888", "http://autocomplete:8888", null,
     "testuser2", "testpass2", "uname", "pword");
 
 var login3 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete:8888", null,
+    "http://mochi.test:8888", "http://autocomplete:8888", null,
     "testuser3", "testpass3", "uname", "pword");
 
 var login4 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete:8888", null,
+    "http://mochi.test:8888", "http://autocomplete:8888", null,
     "zzzuser4", "zzzpass4", "uname", "pword");
 
 // login 5 only used in the single-user forms
 var login5 = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete2", null,
+    "http://mochi.test:8888", "http://autocomplete2", null,
     "singleuser5", "singlepass5", "uname", "pword");
 
 var login6A = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete3", null,
+    "http://mochi.test:8888", "http://autocomplete3", null,
     "form7user1", "form7pass1", "uname", "pword");
 var login6B = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete3", null,
+    "http://mochi.test:8888", "http://autocomplete3", null,
     "form7user2", "form7pass2", "uname", "pword");
 
 var login7  = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete4", null,
+    "http://mochi.test:8888", "http://autocomplete4", null,
     "form8user", "form8pass", "uname", "pword");
 
 var login8A = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete5", null,
+    "http://mochi.test:8888", "http://autocomplete5", null,
     "form9userAB", "form9pass", "uname", "pword");
 
 var login8B = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete5", null,
+    "http://mochi.test:8888", "http://autocomplete5", null,
     "form9userAAB", "form9pass", "uname", "pword");
 
 // login8C is added later
 var login8C = new nsLoginInfo(
-    "http://localhost:8888", "http://autocomplete5", null,
+    "http://mochi.test:8888", "http://autocomplete5", null,
     "form9userAABz", "form9pass", "uname", "pword");
 // try/catch in case someone runs the tests manually, twice.
 try {
     pwmgr.addLogin(login0);
     pwmgr.addLogin(login1);
     pwmgr.addLogin(login2);
     pwmgr.addLogin(login3);
     pwmgr.addLogin(login4);
@@ -391,25 +391,25 @@ function runTest(testNum) {
     // Setting uname.value didn't seem to work either. This works with a human
     // driver, so I'm not sure what's up.
 
 
     case 50:
         // Delete the first entry (of 4), "tempuser1"
         doKey("down");
         var numLogins;
-        numLogins = pwmgr.countLogins("http://localhost:8888", "http://autocomplete:8888", null);
+        numLogins = pwmgr.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
         is(numLogins, 5, "Correct number of logins before deleting one");
 
         // On OS X, shift-backspace and shift-delete work, just delete does not.
         // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
         doKey("delete", shiftModifier);
 
         checkACForm("", "");
-        numLogins = pwmgr.countLogins("http://localhost:8888", "http://autocomplete:8888", null);
+        numLogins = pwmgr.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
         is(numLogins, 4, "Correct number of logins after deleting one");
         doKey("return");
         checkACForm("testuser2", "testpass2");
 
         // Trigger autocomplete popup
         restoreForm();
         doKey("down");
         break;
@@ -426,17 +426,17 @@ function runTest(testNum) {
         break;
 
     case 52:
         // Delete the second entry (of 3), "testuser3"
         doKey("down");
         doKey("down");
         doKey("delete", shiftModifier);
         checkACForm("", "");
-        numLogins = pwmgr.countLogins("http://localhost:8888", "http://autocomplete:8888", null);
+        numLogins = pwmgr.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
         is(numLogins, 3, "Correct number of logins after deleting one");
         doKey("return");
         checkACForm("zzzuser4", "zzzpass4");
 
         // Trigger autocomplete popup
         restoreForm();
         doKey("down");
         break;
@@ -453,17 +453,17 @@ function runTest(testNum) {
         break;
 
     case 54:
         // Delete the last entry (of 2), "zzzuser4"
         doKey("down");
         doKey("down");
         doKey("delete", shiftModifier);
         checkACForm("", "");
-        numLogins = pwmgr.countLogins("http://localhost:8888", "http://autocomplete:8888", null);
+        numLogins = pwmgr.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
         is(numLogins, 2, "Correct number of logins after deleting one");
         doKey("return");
         checkACForm("testuser2", "testpass2");
 
         // Trigger autocomplete popup
         restoreForm();
         doKey("down");
         break;
@@ -480,17 +480,17 @@ function runTest(testNum) {
         break;
 
     case 56:
         // Delete the only remaining entry, "testuser2"
         doKey("down");
         doKey("delete", shiftModifier);
         //doKey("return");
         checkACForm("", "");
-        numLogins = pwmgr.countLogins("http://localhost:8888", "http://autocomplete:8888", null);
+        numLogins = pwmgr.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
         is(numLogins, 1, "Correct number of logins after deleting one");
         pwmgr.removeLogin(login0); // remove the login that's not shown in the list.
         testNum = 99;
         break;
 
 
     /* Tests for single-user forms with autocomplete=off */
 
--- a/toolkit/components/passwordmgr/test/test_basic_form_observer_foundLogins.html
+++ b/toolkit/components/passwordmgr/test/test_basic_form_observer_foundLogins.html
@@ -74,20 +74,20 @@ const Cu = Components.utils;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 // Configure the login manager with two logins for one of the forms
 // so we can do a multiple logins test.
 var nsLoginInfo =
   new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                              Components.interfaces.nsILoginInfo);
 var login1 = new nsLoginInfo();
-login1.init("http://localhost:8888", "http://www.example.com", null,
+login1.init("http://mochi.test:8888", "http://www.example.com", null,
             "testuser1", "testpass1", "uname", "pword");
 var login2 = new nsLoginInfo();
-login2.init("http://localhost:8888", "http://www.example.com", null,
+login2.init("http://mochi.test:8888", "http://www.example.com", null,
             "testuser2", "testpass2", "uname", "pword");
 var pwmgr = Cc["@mozilla.org/login-manager;1"].
             getService(Ci.nsILoginManager);
 pwmgr.addLogin(login1);
 pwmgr.addLogin(login2);
 
 var TestObserver = {
   results: {},
--- a/toolkit/components/passwordmgr/test/test_basic_form_pwonly.html
+++ b/toolkit/components/passwordmgr/test/test_basic_form_pwonly.html
@@ -10,67 +10,67 @@
 <body>
 Login Manager test: forms and logins without a username.
 <p id="display"></p>
 
 <div id="content" style="display: none">
 
 
 <!-- simple form: no username field, 1 password field -->
-<form id='form1' action='http://localhost:1111/formtest.js'> 1
+<form id='form1' action='http://mochi.test:1111/formtest.js'> 1
     <input type='password' name='pname' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 <!-- simple form: no username field, 2 password fields -->
-<form id='form2' action='http://localhost:1111/formtest.js'> 2
+<form id='form2' action='http://mochi.test:1111/formtest.js'> 2
     <input type='password' name='pname1' value=''>
     <input type='password' name='pname2' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 <!-- simple form: no username field, 3 password fields -->
-<form id='form3' action='http://localhost:1111/formtest.js'> 3
+<form id='form3' action='http://mochi.test:1111/formtest.js'> 3
     <input type='password' name='pname1' value=''>
     <input type='password' name='pname2' value=''>
     <input type='password' name='pname3' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 <!-- 4 password fields, should be ignored. -->
-<form id='form4' action='http://localhost:1111/formtest.js'> 4
+<form id='form4' action='http://mochi.test:1111/formtest.js'> 4
     <input type='password' name='pname1' value=''>
     <input type='password' name='pname2' value=''>
     <input type='password' name='pname3' value=''>
     <input type='password' name='pname4' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 
 
 <!-- 1 username field -->
-<form id='form5' action='http://localhost:1111/formtest.js'> 5
+<form id='form5' action='http://mochi.test:1111/formtest.js'> 5
     <input type='text'     name='uname' value=''>
     <input type='password' name='pname' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 
 <!-- 1 username field, with a value set -->
-<form id='form6' action='http://localhost:1111/formtest.js'> 6
+<form id='form6' action='http://mochi.test:1111/formtest.js'> 6
     <input type='text'     name='uname' value='someuser'>
     <input type='password' name='pname' value=''>
 
     <button type='submit'>Submit</button>
     <button type='reset'> Reset </button>
 </form>
 
 
@@ -203,20 +203,20 @@ ok(nsLoginInfo != null, "nsLoginInfo con
 // will apply. pwlogin2 uses the normal formSubmitURL, so that we can test
 // forms with a mix of username and non-username logins that might apply.
 //
 // Note: pwlogin2 is deleted at the end of the test.
 
 pwlogin1 = new nsLoginInfo();
 pwlogin2 = new nsLoginInfo();
 
-pwlogin1.init("http://localhost:8888", "http://localhost:1111", null,
+pwlogin1.init("http://mochi.test:8888", "http://mochi.test:1111", null,
     "", "1234", "uname", "pword");
 
-pwlogin2.init("http://localhost:8888", "http://localhost:8888", null,
+pwlogin2.init("http://mochi.test:8888", "http://mochi.test:8888", null,
     "", "1234", "uname", "pword");
 
 try {
     pwmgr.addLogin(pwlogin1);
     pwmgr.addLogin(pwlogin2);
 } catch (e) {
     ok(false, "addLogin threw: " + e);
 }
--- a/toolkit/components/passwordmgr/test/test_bug_360493_1.html
+++ b/toolkit/components/passwordmgr/test/test_bug_360493_1.html
@@ -17,35 +17,35 @@ Login Manager test: 360493
     <input  type="text"       name="uname">
     <input  type="password"   name="pword">
 
     <button type="submit">Submit</button>
     <button type="reset"> Reset </button>
   </form>
 
   <!-- fully specify the action URL -->
-  <form id="form2" action="http://localhost:8888/tests/toolkit/components/passwordmgr/test/formtest.js">
+  <form id="form2" action="http://mochi.test:8888/tests/toolkit/components/passwordmgr/test/formtest.js">
     <input  type="text"       name="uname">
     <input  type="password"   name="pword">
 
     <button type="submit">Submit</button>
     <button type="reset"> Reset </button>
   </form>
 
   <!-- fully specify the action URL, and change the path -->
-  <form id="form3" action="http://localhost:8888/zomg/wtf/bbq/passwordmgr/test/formtest.js">
+  <form id="form3" action="http://mochi.test:8888/zomg/wtf/bbq/passwordmgr/test/formtest.js">
     <input  type="text"       name="uname">
     <input  type="password"   name="pword">
 
     <button type="submit">Submit</button>
     <button type="reset"> Reset </button>
   </form>
 
   <!-- fully specify the action URL, and change the path and filename -->
-  <form id="form4" action="http://localhost:8888/zomg/wtf/bbq/passwordmgr/test/not_a_test.js">
+  <form id="form4" action="http://mochi.test:8888/zomg/wtf/bbq/passwordmgr/test/not_a_test.js">
     <input  type="text"       name="uname">
     <input  type="password"   name="pword">
 
     <button type="submit">Submit</button>
     <button type="reset"> Reset </button>
   </form>
 
   <!-- specify the action URL relative to the current document-->
--- a/toolkit/components/passwordmgr/test/test_bug_427033.html
+++ b/toolkit/components/passwordmgr/test/test_bug_427033.html
@@ -50,17 +50,17 @@ ok(Ci_pwmgr != null, "Access Ci.nsILogin
 
 var pwmgr = Cc_pwmgr.getService(Ci_pwmgr);
 ok(pwmgr != null, "pwmgr getService()");
 
 var jslogin = Components.classes["@mozilla.org/login-manager/loginInfo;1"].
               createInstance(Components.interfaces.nsILoginInfo);
 ok(jslogin != null, "create a login");
 
-jslogin.init("http://localhost:8888", "javascript:", null,
+jslogin.init("http://mochi.test:8888", "javascript:", null,
               "jsuser", "jspass123", "uname", "pword");
 
 try {
     pwmgr.addLogin(jslogin);
 } catch (e) {
     ok(false, "addLogin threw: " + e);
 }
 
--- a/toolkit/components/passwordmgr/test/test_bug_444968.html
+++ b/toolkit/components/passwordmgr/test/test_bug_444968.html
@@ -85,26 +85,26 @@ login1B  = Cc["@mozilla.org/login-manage
            createInstance(Ci.nsILoginInfo);
 login2A  = Cc["@mozilla.org/login-manager/loginInfo;1"].
            createInstance(Ci.nsILoginInfo);
 login2B  = Cc["@mozilla.org/login-manager/loginInfo;1"].
            createInstance(Ci.nsILoginInfo);
 login2C  = Cc["@mozilla.org/login-manager/loginInfo;1"].
            createInstance(Ci.nsILoginInfo);
 
-login1A.init("http://localhost:8888", "http://bug444968-1", null,
+login1A.init("http://mochi.test:8888", "http://bug444968-1", null,
             "testuser1A", "testpass1A", "", "");
-login1B.init("http://localhost:8888", "http://bug444968-1", null,
+login1B.init("http://mochi.test:8888", "http://bug444968-1", null,
             "", "testpass1B", "", "");
 
-login2A.init("http://localhost:8888", "http://bug444968-2", null,
+login2A.init("http://mochi.test:8888", "http://bug444968-2", null,
             "testuser2A", "testpass2A", "", "");
-login2B.init("http://localhost:8888", "http://bug444968-2", null,
+login2B.init("http://mochi.test:8888", "http://bug444968-2", null,
             "", "testpass2B", "", "");
-login2C.init("http://localhost:8888", "http://bug444968-2", null,
+login2C.init("http://mochi.test:8888", "http://bug444968-2", null,
             "testuser2C", "testpass2C", "", "");
 
 pwmgr.addLogin(login1A);
 pwmgr.addLogin(login1B);
 pwmgr.addLogin(login2A);
 pwmgr.addLogin(login2B);
 pwmgr.addLogin(login2C);
 
--- a/toolkit/components/passwordmgr/test/test_notifications.html
+++ b/toolkit/components/passwordmgr/test/test_notifications.html
@@ -107,31 +107,31 @@ function checkTest() {
         break;
 
       case 2:
         // Same subtest, this time click Never
         is(gotUser, "notifyu1", "Checking submitted username");
         is(gotPass, "notifyp1", "Checking submitted password");
         bar = getNotificationBar(notifyBox, "password-save");
         ok(bar, "got notification bar");
-        is(true, pwmgr.getLoginSavingEnabled("http://localhost:8888"),
+        is(true, pwmgr.getLoginSavingEnabled("http://mochi.test:8888"),
            "Checking for login saving enabled");
         clickNotificationButton(bar, kNeverButton);
         break;
 
       case 3:
         // Same subtest, make sure Never took effect
         is(gotUser, "notifyu1", "Checking submitted username");
         is(gotPass, "notifyp1", "Checking submitted password");
         bar = getNotificationBar(notifyBox, "password-save");
         ok(!bar, "checking for no notification bar");
-        is(false, pwmgr.getLoginSavingEnabled("http://localhost:8888"),
+        is(false, pwmgr.getLoginSavingEnabled("http://mochi.test:8888"),
            "Checking for login saving disabled");
         // reenable login saving.
-        pwmgr.setLoginSavingEnabled("http://localhost:8888", true);
+        pwmgr.setLoginSavingEnabled("http://mochi.test:8888", true);
         break;
 
       case 4:
         // Same subtest, this time click Remember
         is(gotUser, "notifyu1", "Checking submitted username");
         is(gotPass, "notifyp1", "Checking submitted password");
         bar = getNotificationBar(notifyBox, "password-save");
         ok(bar, "got notification bar");
@@ -382,23 +382,23 @@ ok(pwmgr != null, "Access pwmgr");
 var prefs = Cc["@mozilla.org/preferences-service;1"].
             getService(Ci.nsIPrefService);
 ok(prefs != null, "Access prefs");
 prefs = prefs.getBranch("signon.");
 ok(prefs != null, "Access pref branch");
 
 var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                                              Ci.nsILoginInfo, "init");
-var login1 = new nsLoginInfo("http://localhost:8888", "http://localhost:8888", null,
+var login1 = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
                              "notifyu1", "notifyp1", "user", "pass");
-var login2 = new nsLoginInfo("http://localhost:8888", "http://localhost:8888", null,
+var login2 = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
                              "", "notifyp1", "", "pass");
-var login1B = new nsLoginInfo("http://localhost:8888", "http://localhost:8888", null,
+var login1B = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
                               "notifyu1B", "notifyp1B", "user", "pass");
-var login2B = new nsLoginInfo("http://localhost:8888", "http://localhost:8888", null,
+var login2B = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
                               "", "notifyp1B", "", "pass");
 
 var iframe = document.getElementById("iframe");
 iframe.onload = handleLoad;
 
 // The notification box (not *bar*) is a constant, per-tab container. So, we
 // only need to fetch it once.
 var notifyBox = getNotificationBox(window.top);
--- a/toolkit/components/passwordmgr/test/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/test_prompt.html
@@ -58,21 +58,21 @@ function initLogins() {
   login2B.init("http://example2.com", null, "http://example2.com",
                "user2name", "user2pass", "", "");
   login2C.init("http://example2.com", null, "http://example2.com",
                "user3.name@host", "user3pass", "", "");
   login2D.init("http://example2.com", null, "http://example2.com",
                "100@beef", "user3pass", "", "");
   login2E.init("http://example2.com", null, "http://example2.com",
                "100%beef", "user3pass", "", "");
-  login3A.init("http://localhost:8888", null, "mochitest",
+  login3A.init("http://mochi.test:8888", null, "mochitest",
                "mochiuser1", "mochipass1", "", "");
-  login3B.init("http://localhost:8888", null, "mochitest2",
+  login3B.init("http://mochi.test:8888", null, "mochitest2",
                "mochiuser2", "mochipass2", "", "");
-  login4.init("http://localhost:8888", null, "mochitest3",
+  login4.init("http://mochi.test:8888", null, "mochitest3",
                "mochiuser3", "mochipass3-old", "", "");
 
   pwmgr.addLogin(login1);
   pwmgr.addLogin(login2A);
   pwmgr.addLogin(login2B);
   pwmgr.addLogin(login2C);
   pwmgr.addLogin(login2D);
   pwmgr.addLogin(login2E);
@@ -375,17 +375,17 @@ function handleLoad() {
         is(password, "mochipass1-new", "Checking for echoed password");
 
         // Check for the notification bar, and change the password.
         bar = getNotificationBar(notifyBox, "password-change");
         ok(bar, "got notification bar");
         clickNotificationButton(bar, kChangeButton);
 
         // Housekeeping: change it back
-        tmpLogin.init("http://localhost:8888", null, "mochitest",
+        tmpLogin.init("http://mochi.test:8888", null, "mochitest",
                       "mochiuser1", "mochipass1-new", "", "");
         pwmgr.modifyLogin(tmpLogin, login3A);
 
         // Same as last test, but for a realm we haven't already authenticated
         // to (but have an existing saved login for, so that we'll trigger
         // a change-password notification bar.
         startCallbackTimer();
         iframe.src = "authenticate.sjs?user=mochiuser3&pass=mochipass3-new&realm=mochitest3";
@@ -399,17 +399,17 @@ function handleLoad() {
 
         // Check for the notification bar, and change the password.
         bar = getNotificationBar(notifyBox, "password-change");
         ok(bar, "got notification bar");
         clickNotificationButton(bar, kChangeButton);
 
         // Housekeeping: change it back to the original login4. Actually,
         // just delete it and we'll re-add it as the next test.
-        tmpLogin.init("http://localhost:8888", null, "mochitest3",
+        tmpLogin.init("http://mochi.test:8888", null, "mochitest3",
                       "mochiuser3", "mochipass3-new", "", "");
         pwmgr.removeLogin(tmpLogin);
         // Clear cached auth from this subtest, and avoid leaking due to bug 459620.
         var authMgr = Cc['@mozilla.org/network/http-auth-manager;1'].
                       getService(Ci.nsIHttpAuthManager);
         authMgr.clearAll();
 
         // Trigger a new prompt, so we can test adding a new login.
--- a/toolkit/components/passwordmgr/test/test_prompt_async.html
+++ b/toolkit/components/passwordmgr/test/test_prompt_async.html
@@ -83,25 +83,33 @@
             function addLogin(host, realm, user, pass) {
                 var login = Cc["@mozilla.org/login-manager/loginInfo;1"].
                                         createInstance(Ci.nsILoginInfo);
                 login.init(host, null, realm, user, pass, "", "");
                 pwmgr.addLogin(login);
                 logins.push(login);
             }
 
-            addLogin("moz-proxy://127.0.0.1:8888", "proxy_realm",
+            //need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
+            var ios = Cc["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
+            var pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].getService();
+
+            var uri = ios.newURI("http://example.com", null, null);
+            var pi = pps.resolve(uri, 0);
+            var mozproxy = "moz-proxy://" + pi.host + ":" + pi.port;
+
+            addLogin(mozproxy, "proxy_realm",
                      "proxy_user", "proxy_pass");
-            addLogin("moz-proxy://127.0.0.1:8888", "proxy_realm2",
+            addLogin(mozproxy, "proxy_realm2",
                      "proxy_user2", "proxy_pass2");
-            addLogin("moz-proxy://127.0.0.1:8888", "proxy_realm3",
+            addLogin(mozproxy, "proxy_realm3",
                      "proxy_user3", "proxy_pass3");
-            addLogin("moz-proxy://127.0.0.1:8888", "proxy_realm4",
+            addLogin(mozproxy, "proxy_realm4",
                      "proxy_user4", "proxy_pass4");
-            addLogin("moz-proxy://127.0.0.1:8888", "proxy_realm5",
+            addLogin(mozproxy, "proxy_realm5",
                      "proxy_user5", "proxy_pass5");
             addLogin("http://example.com", "mochirealm",
                      "user1name", "user1pass");
             addLogin("http://example.org", "mochirealm2",
                      "user2name", "user2pass");
             addLogin("http://example.com", "mochirealm3",
                      "user3name", "user3pass");
             addLogin("http://example.com", "mochirealm4",
@@ -261,17 +269,17 @@
                     "proxy_pass=proxy_pass4&"+
                     "proxy_realm=proxy_realm4&"+
                     "huge=1";
                 break;
 
             case 6:
                 // Reload the frame from the previous step and let the proxy
                 // authentication pass but WWW fail. We expect two dialogs
-                // and an unathentiocated page content load.
+                // and an unathenticated page content load.
                 ok(true, "doTest testNum 6");
                 expectedLoads = 1;
                 expectedDialogs = 2;
                 iframe1.contentDocument.location.reload();
                 break;
 
             case 7:
                 // Reload again and let pass all authentication dialogs.
--- a/toolkit/components/passwordmgr/test/test_xhr.html
+++ b/toolkit/components/passwordmgr/test/test_xhr.html
@@ -28,19 +28,19 @@ function initLogins() {
   pwmgr = Cc["@mozilla.org/login-manager;1"].
           getService(Ci.nsILoginManager);
 
   login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
             createInstance(Ci.nsILoginInfo);
   login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
             createInstance(Ci.nsILoginInfo);
 
-  login1.init("http://localhost:8888", null, "xhr",
+  login1.init("http://mochi.test:8888", null, "xhr",
                "xhruser1", "xhrpass1", "", "");
-  login2.init("http://localhost:8888", null, "xhr2",
+  login2.init("http://mochi.test:8888", null, "xhr2",
                "xhruser2", "xhrpass2", "", "");
 
   pwmgr.addLogin(login1);
   pwmgr.addLogin(login2);
 }
 
 function finishTest() {
   ok(true, "finishTest removing testing logins...");
--- a/toolkit/components/passwordmgr/test/test_xml_load.html
+++ b/toolkit/components/passwordmgr/test/test_xml_load.html
@@ -28,19 +28,19 @@ function initLogins() {
   pwmgr = Cc["@mozilla.org/login-manager;1"].
           getService(Ci.nsILoginManager);
 
   login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
             createInstance(Ci.nsILoginInfo);
   login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
             createInstance(Ci.nsILoginInfo);
 
-  login1.init("http://localhost:8888", null, "xml",
+  login1.init("http://mochi.test:8888", null, "xml",
                "xmluser1", "xmlpass1", "", "");
-  login2.init("http://localhost:8888", null, "xml2",
+  login2.init("http://mochi.test:8888", null, "xml2",
                "xmluser2", "xmlpass2", "", "");
 
   pwmgr.addLogin(login1);
   pwmgr.addLogin(login2);
 }
 
 function finishTest() {
   ok(true, "finishTest removing testing logins...");
--- a/toolkit/components/places/tests/chrome/test_329534.xul
+++ b/toolkit/components/places/tests/chrome/test_329534.xul
@@ -42,24 +42,24 @@ var secondFolderId = 0;
 var firstLoadTime = 0;
 var firstURL = "";
 var secondURL = "";
 
 // stop updating livemarks
 lmsvc.stopUpdateLivemarks();
 
 // add 2 feeds
-const FEED1 = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/rss_as_html.rss";
+const FEED1 = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/rss_as_html.rss";
 gLivemarkId1 = lmsvc.createLivemarkFolderOnly( toolbarFolderId, "foo",
-                                             uri("http:/localhost:8888/"),
+                                             uri("http:/mochi.test:8888/"),
                                              uri(FEED1), -1);
 
-const FEED2 = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
+const FEED2 = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
 gLivemarkId2 = lmsvc.createLivemarkFolderOnly( toolbarFolderId, "bar",
-                                             uri("http:/localhost:8888/"),
+                                             uri("http:/mochi.test:8888/"),
                                              uri(FEED2), -1);
 
 var observer =
 {
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsINavBookmarkObserver) ||
         iid.equals(Ci.nsISupports))
       return this;
--- a/toolkit/components/places/tests/chrome/test_341972a.xul
+++ b/toolkit/components/places/tests/chrome/test_341972a.xul
@@ -61,18 +61,18 @@ var observer =
       SimpleTest.finish();
     }
   },
   onItemAnnotationRemoved: function(aItemId, aAnnotationName) {},
   onPageAnnotationSet: function(aUri, aAnnotationName) {},
   onPageAnnotationRemoved: function(aUri, aAnnotationName) {}
 };
 
-const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
-const INITIALSITESPEC = "http://localhost:8888/";
+const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
+const INITIALSITESPEC = "http://mochi.test:8888/";
 const FEEDSITESPEC = "http://example.org/"; 
 
 gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
                                              uri(INITIALSITESPEC),
                                              uri(FEEDSPEC), -1);
 annosvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 
--- a/toolkit/components/places/tests/chrome/test_342484.xul
+++ b/toolkit/components/places/tests/chrome/test_342484.xul
@@ -78,19 +78,19 @@ function runTest() {
     ok(goodItems.indexOf(node.uri) != -1, "livemark item created with bad uri " + node.uri);
   }
 
   rootNode.containerOpen = false;
   bmsvc.removeItem(gLivemarkId);
   SimpleTest.finish();
 }
 
-const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/bad_links.atom";
+const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/bad_links.atom";
 
 gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
-                                             uri("http:/localhost/"),
+                                             uri("http:/mochi.test/"),
                                              uri(FEEDSPEC), -1);
 bmsvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 ]]>
 </script>
 
 </window>
--- a/toolkit/components/places/tests/chrome/test_381357.xul
+++ b/toolkit/components/places/tests/chrome/test_381357.xul
@@ -62,19 +62,19 @@ var observer =
   onBeforeItemRemoved: function(){},
   onItemRemoved: function(){},
   onItemChanged: function(){},
   onItemVisited: function(){},
   onItemMoved: function(){},
 
 };
 
-const FEEDSPEC = "http://localhost:8888/tests/toolkit/components/places/tests/chrome/rss_as_html.rss";
+const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/rss_as_html.rss";
 
 gLivemarkId = lmsvc.createLivemarkFolderOnly(toolbarFolderId, "foo",
-                                             uri("http:/localhost/"),
+                                             uri("http:/mochi.test/"),
                                              uri(FEEDSPEC), -1);
 bmsvc.addObserver(observer, false);
 lmsvc.reloadLivemarkFolder(gLivemarkId);
 ]]>
 </script>
 
 </window>
--- a/toolkit/components/places/tests/mochitest/test_bug_461710.html
+++ b/toolkit/components/places/tests/mochitest/test_bug_461710.html
@@ -55,17 +55,17 @@ function waitForTrue(fn, onWaitComplete)
         }
       }, 20);
 }
 
 const kRed = "rgb(255, 0, 0)";
 const kBlue = "rgb(0, 0, 255)";
 
 var testpath = document.location.pathname + "/../bug_461710/";
-var prefix = "http://localhost:8888" + testpath;
+var prefix = "http://mochi.test:8888" + testpath;
 var subtests = [
                    "visited_page.html",   // 1
                    "link_page.html",      // 2
                    "link_page-2.html",    // 3
                    "link_page-3.html"     // 4
                ];
 
 
--- a/toolkit/content/tests/browser/browser_bug471962.js
+++ b/toolkit/content/tests/browser/browser_bug471962.js
@@ -48,17 +48,17 @@ function test() {
   Components.classes["@mozilla.org/moz/jssubscript-loader;1"].
    getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(
    "chrome://mochikit/content/browser/toolkit/content/tests/browser/common/_loadAll.js",
    this);
 
   // --- Test implementation ---
 
   const kBaseUrl =
-        "http://localhost:8888/browser/toolkit/content/tests/browser/data/";
+        "http://mochi.test:8888/browser/toolkit/content/tests/browser/data/";
 
   function FramePostData_TestGenerator() {
     // Display the outer page, and wait for it to be loaded. Loading the URI
     // doesn't generally raise any exception, but if an error page is
     // displayed, an exception will occur later during the test.
     gBrowser.addEventListener("pageshow", testRunner.continueTest, false);
     gBrowser.loadURI(kBaseUrl + "post_form_outer.sjs");
     yield;
--- a/toolkit/mozapps/downloads/tests/chrome/test_unkownContentType_dialog_layout.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_unkownContentType_dialog_layout.xul
@@ -57,24 +57,24 @@
   <script type="application/javascript">
   <![CDATA[
 
 const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
 
 let testIndex = -1;
 let tests = [
   { // This URL will trigger the simple UI, where only the Save an Cancel buttons are available
-    url: "http://localhost:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif",
+    url: "http://mochi.test:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif",
     elements: {
       basicBox: { collapsed: false },
       normalBox: { collapsed: true }
     }
   },
   { // This URL will trigger the full UI
-    url: "http://localhost:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt",
+    url: "http://mochi.test:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt",
     elements: {
       basicBox: { collapsed: true },
       normalBox: { collapsed: false }
     }
   }
 ];
 
 let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
--- a/uriloader/exthandler/tests/mochitest/handlerApps.js
+++ b/uriloader/exthandler/tests/mochitest/handlerApps.js
@@ -43,17 +43,17 @@ function test() {
   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); 
 
   // set up the web handler object
   var webHandler = 
     Components.classes["@mozilla.org/uriloader/web-handler-app;1"].
     createInstance(Components.interfaces.nsIWebHandlerApp);
   webHandler.name = "Test Web Handler App";
   webHandler.uriTemplate =
-      "http://localhost:8888/tests/uriloader/exthandler/tests/mochitest/" + 
+      "http://mochi.test:8888/tests/uriloader/exthandler/tests/mochitest/" + 
       "handlerApp.xhtml?uri=%s";
   
   // set up the uri to test with
   var ioService = Components.classes["@mozilla.org/network/io-service;1"].
     getService(Components.interfaces.nsIIOService);
   var uri = ioService.newURI(testURI, null, null);
 
   // create a window, and launch the handler in it
--- a/widget/tests/test_bug429954.xul
+++ b/widget/tests/test_bug429954.xul
@@ -37,13 +37,12 @@ SimpleTest.waitForFocus(function () {
   var maxWidth = win.outerWidth, maxHeight = win.outerHeight;
   win.restore();
 
   window.open("window_bug429954.xul", "_blank", 
               "chrome,resizable,width=" + maxWidth + ",height=" + maxHeight +
               "screenX=" + maxX + "screenY=" + maxY);
 });
 
-
 ]]>
 </script>
 
 </window>