Backout bugs 586754, 574189, 584611 due to orange. a=backout
authorJonas Sicking <jonas@sicking.cc>
Fri, 20 Aug 2010 11:08:43 -0700
changeset 51034 4192ba38ebee43f3f76c31d492ae0f58e07e9d89
parent 51033 fae9fc14a22a9fd70f56544181e689b1af72f0f6
child 51035 3608833562ed87e3c8bc94ed72b9eb050f6ebc3f
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)
reviewersbackout
bugs586754, 574189, 584611
milestone2.0b5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout bugs 586754, 574189, 584611 due to orange. a=backout
browser/components/places/tests/Makefile.in
browser/components/places/tests/unit/head_bookmarks.js
chrome/test/Makefile.in
config/rules.mk
content/events/test/test_bug415498.xul
content/events/test/test_bug508479.html
content/events/test/test_draggableprop.html
content/events/test/test_dragstart.html
content/html/content/test/test_bug417760.html
content/test/Makefile.in
content/xtf/test/Makefile.in
content/xul/content/test/test_bug398289.html
content/xul/templates/tests/chrome/templates_shared.js
content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul
content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul
content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul
content/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul
content/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul
content/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul
content/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul
content/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul
content/xul/templates/tests/chrome/test_tmpl_storage_rule.xul
content/xul/templates/tests/chrome/test_tmpl_storage_simple.xul
content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul
content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul
content/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul
content/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul
content/xul/templates/tests/chrome/test_tmpl_storage_tree.xul
content/xul/templates/tests/test_bug441785.xul
content/xul/templates/tests/test_sortservice.xul
docshell/test/chrome/bug293235_window.xul
docshell/test/chrome/bug294258_window.xul
docshell/test/chrome/bug298622_window.xul
docshell/test/chrome/bug301397_window.xul
docshell/test/chrome/bug303267_window.xul
docshell/test/chrome/bug321671_window.xul
docshell/test/chrome/bug360511_window.xul
docshell/test/chrome/bug396649_window.xul
docshell/test/chrome/window.template.txt
docshell/test/test_bug529119-1.html
docshell/test/test_bug529119-2.html
dom/tests/Makefile.in
dom/tests/mochitest/general/test_focusrings.xul
dom/tests/mochitest/whatwg/test_postMessage_chrome.html
editor/libeditor/html/tests/test_contenteditable_focus.html
editor/libeditor/html/tests/test_contenteditable_text_input_handling.html
editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
editor/libeditor/html/tests/test_root_element_replacement.html
editor/libeditor/html/tests/test_select_all_without_body.html
editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
embedding/Makefile.in
gfx/tests/Makefile.in
intl/locale/src/unix/tests/Makefile.in
intl/locale/tests/Makefile.in
intl/locale/tests_multilocale/Makefile.in
intl/strres/tests/Makefile.in
intl/uconv/tests/Makefile.in
intl/unicharutil/tests/Makefile.in
ipc/testshell/Makefile.in
js/jetpack/tests/Makefile.in
js/src/config/rules.mk
js/src/xpconnect/tests/Makefile.in
js/src/xpconnect/tests/chrome/test_bug503926.xul
modules/libjar/test/Makefile.in
modules/libjar/test/chrome/test_bug386153.html
modules/libjar/zipwriter/test/Makefile.in
modules/libpref/test/Makefile.in
modules/plugin/test/Makefile.in
modules/plugin/test/mochitest/test_bug532208.html
modules/plugin/test/mochitest/test_cocoa_focus.html
modules/plugin/test/mochitest/test_cocoa_window_focus.html
modules/plugin/test/mochitest/test_cookies.html
modules/plugin/test/mochitest/test_crash_nested_loop.html
modules/plugin/test/mochitest/test_crashing.html
modules/plugin/test/mochitest/test_crashing2.html
modules/plugin/test/mochitest/test_enumerate.html
modules/plugin/test/mochitest/test_hanging.html
modules/plugin/test/mochitest/test_instantiation.html
modules/plugin/test/mochitest/test_multipleinstanceobjects.html
modules/plugin/test/mochitest/test_newstreamondestroy.html
modules/plugin/test/mochitest/test_npobject_getters.html
modules/plugin/test/mochitest/test_streamNotify.html
netwerk/cookie/Makefile.in
netwerk/test/Makefile.in
netwerk/test/httpserver/Makefile.in
parser/xml/test/Makefile.in
rdf/tests/Makefile.in
security/manager/ssl/tests/Makefile.in
security/manager/ssl/tests/mochitest/bugs/test_bug480509.html
security/manager/ssl/tests/mochitest/bugs/test_bug483440.html
security/manager/ssl/tests/mochitest/bugs/test_bug484111.html
storage/test/Makefile.in
testing/mochitest/Makefile.in
testing/mochitest/browser-test.js
testing/mochitest/chrome-harness.js
testing/mochitest/server.js
testing/mochitest/tests/SimpleTest/tests/test_synthesizeDragStart.xul
testing/mochitest/tests/SimpleTest/tests/test_synthesizeDrop.xul
testing/xpcshell/example/Makefile.in
toolkit/components/autocomplete/tests/Makefile.in
toolkit/components/commandlines/test/Makefile.in
toolkit/components/contentprefs/tests/Makefile.in
toolkit/components/ctypes/tests/Makefile.in
toolkit/components/ctypes/tests/test_ctypes.xul
toolkit/components/downloads/test/Makefile.in
toolkit/components/places/tests/Makefile.in
toolkit/components/places/tests/chrome/test_329534.xul
toolkit/components/urlformatter/tests/Makefile.in
toolkit/content/tests/Makefile.in
toolkit/content/tests/chrome/RegisterUnregisterChrome.js
toolkit/content/tests/chrome/rtlchrome/rtl.manifest
toolkit/content/tests/chrome/test_bug437844.xul
toolkit/content/tests/chrome/test_righttoleft.xul
toolkit/content/tests/widgets/test_button.xul
toolkit/content/tests/widgets/test_deck.xul
toolkit/content/tests/widgets/test_props.xul
toolkit/content/tests/widgets/test_richlist_direction.xul
toolkit/content/tests/widgets/test_statusbar.xul
toolkit/crashreporter/test/Makefile.in
toolkit/mozapps/downloads/tests/Makefile.in
toolkit/mozapps/downloads/tests/chrome/test_backspace_key_removes.xul
toolkit/mozapps/downloads/tests/chrome/test_basic_functionality.xul
toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul
toolkit/mozapps/downloads/tests/chrome/test_bug_429247.xul
toolkit/mozapps/downloads/tests/chrome/test_bug_462172.xul
toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul
toolkit/mozapps/downloads/tests/chrome/test_clear_button_disabled.xul
toolkit/mozapps/downloads/tests/chrome/test_close_download_manager.xul
toolkit/mozapps/downloads/tests/chrome/test_close_on_last_window.xul
toolkit/mozapps/downloads/tests/chrome/test_delete_key_removes.xul
toolkit/mozapps/downloads/tests/chrome/test_esc_key_closes_clears.xul
toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul
toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul
toolkit/mozapps/downloads/tests/chrome/test_pause_button_state.xul
toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul
toolkit/mozapps/downloads/tests/chrome/test_removeDownload_updates_ui.xul
toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul
toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul
toolkit/mozapps/downloads/tests/chrome/test_search_keys.xul
toolkit/mozapps/downloads/tests/chrome/test_select_all.xul
toolkit/mozapps/downloads/tests/chrome/test_space_key_pauses_resumes.xul
toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_downloadstates.xul
toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_service.xul
toolkit/mozapps/downloads/tests/chrome/test_ui_stays_open_on_alert_clickback.xul
toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul
toolkit/mozapps/extensions/test/Makefile.in
toolkit/mozapps/extensions/test/browser/browser_dragdrop.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/update/test/Makefile.in
toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
toolkit/mozapps/update/test/chrome/test_0081_error_patchApplyFailure_partial_only.xul
toolkit/mozapps/update/test/chrome/test_0082_error_patchApplyFailure_complete_only.xul
toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
toolkit/mozapps/update/test/chrome/test_0091_installed.xul
toolkit/mozapps/update/test/chrome/test_0092_finishedBackground.xul
toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
toolkit/mozapps/update/test/chrome/test_9999_cleanup.xul
toolkit/mozapps/update/test_timermanager/Makefile.in
toolkit/xre/test/test_fpuhandler.html
uriloader/exthandler/tests/Makefile.in
xpcom/tests/Makefile.in
--- a/browser/components/places/tests/Makefile.in
+++ b/browser/components/places/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = browser/components/places/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_browser_places
 
 XPCSHELL_TESTS = unit
 
 DIRS = browser chrome perf
--- a/browser/components/places/tests/unit/head_bookmarks.js
+++ b/browser/components/places/tests/unit/head_bookmarks.js
@@ -40,17 +40,17 @@
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 
 // Import common head.
-let (commonFile = do_get_file("../../../../../toolkit/components/places/tests/head_common.js", false)) {
+let (commonFile = do_get_file("../../test_places/head_common.js", false)) {
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
 // Put any other stuff relative to this test folder below.
 
 
 XPCOMUtils.defineLazyGetter(this, "PlacesUIUtils", function() {
--- a/chrome/test/Makefile.in
+++ b/chrome/test/Makefile.in
@@ -33,17 +33,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
-relativesrcdir = chrome/test
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_chrome
 
 XPCSHELL_TESTS = unit \
                  $(NULL)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -142,82 +142,82 @@ endif
 
 ################################################################################
 # Testing frameworks support
 ################################################################################
 
 ifdef ENABLE_TESTS
 
 ifdef XPCSHELL_TESTS
-#ifndef MODULE
-#$(error Must define MODULE when defining XPCSHELL_TESTS.)
-#endif
+ifndef MODULE
+$(error Must define MODULE when defining XPCSHELL_TESTS.)
+endif
 
 testxpcobjdir = $(DEPTH)/_tests/xpcshell
 
 # Test file installation
 ifneq (,$(filter WINNT os2-emx,$(HOST_OS_ARCH)))
 # Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
 TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
 else
 TEST_INSTALLER = $(INSTALL)
 endif
 
 define _INSTALL_TESTS
-$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir)
+$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(MODULE)/$(dir)
 
 endef # do not remove the blank line!
 
 SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
 
 libs::
 	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
 	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py \
           $(testxpcobjdir)/all-test-dirs.list \
-          $(addprefix $(relativesrcdir)/,$(XPCSHELL_TESTS))
+          $(addprefix $(MODULE)/,$(XPCSHELL_TESTS))
 
 testxpcsrcdir = $(topsrcdir)/testing/xpcshell
 
 # Execute all tests in the $(XPCSHELL_TESTS) directories.
 # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
 xpcshell-tests:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           $(EXTRA_TEST_ARGS) \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 # Execute a single test, specified in $(SOLO_FILE), but don't automatically
 # start the test. Instead, present the xpcshell prompt so the user can
 # attach a debugger and then start the test.
 check-interactive:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           --test-path=$(SOLO_FILE) \
           --profile-name=$(MOZ_APP_NAME) \
           --interactive \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 # Execute a single test, specified in $(SOLO_FILE)
 check-one:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           --test-path=$(SOLO_FILE) \
           --profile-name=$(MOZ_APP_NAME) \
           --verbose \
           $(EXTRA_TEST_ARGS) \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 endif # XPCSHELL_TESTS
 
 ifdef CPP_UNIT_TESTS
 
 # Compile the tests to $(DIST)/bin.  Make lots of niceties available by default
 # through TestHarness.h, by modifying the list of includes and the libs against
 # which stuff links.
--- a/content/events/test/test_bug415498.xul
+++ b/content/events/test/test_bug415498.xul
@@ -9,32 +9,28 @@ https://bugzilla.mozilla.org/show_bug.cg
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   onload="init()">
 
   <title>Test for Bug 415498</title>
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/chrome-harness.js"></script>
 <body  xmlns="http://www.w3.org/1999/xhtml">
   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=415498">Mozilla Bug 415498</a>
 
   <p id="display"></p>
 
   <pre id="test">
   <script class="testbody" type="application/javascript"><![CDATA[
 
     /** Test for Bug 415498 **/
-    if (Cc === undefined) {
-      var Cc = Components.classes;
-      var Ci = Components.interfaces;
-    }
-    var Cr = Components.results;
+    const Cc = Components.classes;
+    const Ci = Components.interfaces;
+    const Cr = Components.results;
 
     SimpleTest.waitForExplicitFinish();
 
     var gTestsIterator;
     var gConsole;
     var gConsoleListener;
     var gMessages = [];
 
@@ -71,27 +67,25 @@ https://bugzilla.mozilla.org/show_bug.cg
     function testsIterator() {
 
       var browser = $("browser");
       browser.addEventListener("load", function() {
         setTimeout(nextTest, 0)
       }, false);
 
       // 1) This document uses addEventListener to register a method throwing an exception
-      var chromeDir = getRootDirectory(window.location.href);
-      browser.loadURI(chromeDir + "bug415498-doc1.html");
+      browser.loadURI("chrome://mochikit/content/chrome/content/events/test/bug415498-doc1.html");
       yield;
 
       ok(verifyErrorReceived("NS_ERROR_DOM_HIERARCHY_REQUEST_ERR"),
          "Error message not reported in event listener callback!");
       gMessages = [];
 
       // 2) This document sets window.onload to register a method throwing an exception
-      var chromeDir = getRootDirectory(window.location.href);
-      browser.loadURI(chromeDir + "bug415498-doc2.html");
+      browser.loadURI("chrome://mochikit/content/chrome/content/events/test/bug415498-doc2.html");
       yield;
 
       ok(verifyErrorReceived("NS_ERROR_DOM_HIERARCHY_REQUEST_ERR"),
          "Error message not reported in window.onload!");
     }
     
     function verifyErrorReceived(errorString) {
       for (var i = 0; i < gMessages.length; i++) {
--- a/content/events/test/test_bug508479.html
+++ b/content/events/test/test_bug508479.html
@@ -1,12 +1,12 @@
 <html>
 <head>
   <title>Tests for the dragstart event</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>      
 
 <script>
   
 var gGotHandlingDrop = false;
 var gGotNotHandlingDrop = false;
--- a/content/events/test/test_draggableprop.html
+++ b/content/events/test/test_draggableprop.html
@@ -1,16 +1,16 @@
 <html>
 <head>
   <title>Tests for the draggable property on HTML elements</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript" 
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" 
-          src="/tests/SimpleTest/SimpleTest.js"></script>      
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>      
 
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 
 <span id="elem1">One</span>
 <span id="elem2" draggable="true">Two</span>
--- a/content/events/test/test_dragstart.html
+++ b/content/events/test/test_dragstart.html
@@ -1,12 +1,12 @@
 <html>
 <head>
   <title>Tests for the dragstart event</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript" src="/MochiKit/packed.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>      
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>      
 
 <!--
  This test checks the dragstart event and the DataTransfer object
   -->
  
--- a/content/html/content/test/test_bug417760.html
+++ b/content/html/content/test/test_bug417760.html
@@ -1,28 +1,28 @@
 <!DOCTYPE html>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=417760
 -->
 <head>
   <title>cannot focus() img with tabindex="-1"</title>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
   <style type="text/css">
     img {
       border: 5px solid white;
     }
     img:focus {
       border: 5px solid black;
     }
   </style>
 
 
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="text/javascript">
     function checkFocus(aExpected, aTabIndex)
     {
       elemCurr = document.activeElement.getAttribute("id");
       is(elemCurr, aExpected, "Element with tabIndex " + aTabIndex 
          + " did not receive focus!");
     }
--- a/content/test/Makefile.in
+++ b/content/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = content/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_content
 
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/content/xtf/test/Makefile.in
+++ b/content/xtf/test/Makefile.in
@@ -44,17 +44,16 @@
 # for detailed instructions.
 #
 
 # Note: DEPTH should be set to the relative path to mozilla/
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = content/xtf/test
 
 include $(DEPTH)/config/autoconf.mk
 
 # Note: set the test module's name to test_<yourmodule>
 MODULE		= test_xtf
 
 XPCSHELL_TESTS  = unit
 
--- a/content/xul/content/test/test_bug398289.html
+++ b/content/xul/content/test/test_bug398289.html
@@ -3,17 +3,17 @@
 <head>
   <title>Test for bug 398289</title>
   <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body style="height: 100%" onload="setTimeout(onBodyLoad, 0);">
-  <iframe id="test" src="398289-resource.xul" width="100%" height="100%">
+  <iframe id="test" src="chrome://mochikit/content/chrome/content/xul/content/test/398289-resource.xul" width="100%" height="100%">
   </iframe>
 
   <script class="testbody" type="text/javascript">
     var snap1, snap2;
   
     SimpleTest.waitForExplicitFinish();
   
     function onBodyLoad() {
--- a/content/xul/templates/tests/chrome/templates_shared.js
+++ b/content/xul/templates/tests/chrome/templates_shared.js
@@ -430,42 +430,8 @@ function compareConsoleMessages()
    var out = {};
    consoleService.getMessageArray(out, {});
    var messages = out.value || [];
    is(messages.length, expectedConsoleMessages.length, "correct number of logged messages");
    for (var m = 0; m < messages.length; m++) {
      is(messages[m].message, expectedConsoleMessages.shift(), "logged message " + (m + 1));
    }
 }
-
-function copyToProfile(filename)
-{
-  if (Cc === undefined) {
-    var Cc = Components.classes;
-    var Ci = Components.interfaces;
-  }
-
-  var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-                         .getService(Ci.mozIJSSubScriptLoader);
-  loader.loadSubScript("chrome://mochikit/content/chrome-harness.js");
-
-  var file = Cc["@mozilla.org/file/directory_service;1"]
-                       .getService(Ci.nsIProperties)
-                       .get("ProfD", Ci.nsIFile);
-  file.append(filename);
-
-  var parentURI = getResolvedURI(getRootDirectory(window.location.href));
-  if (parentURI.JARFile) {
-    parentURI = extractJarToTmp(parentURI);
-  } else {
-    var fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].
-                      getService(Ci.nsIFileProtocolHandler);
-    parentURI = fileHandler.getFileFromURLSpec(parentURI.spec);
-  }
-
-  parentURI = parentURI.QueryInterface(Ci.nsILocalFile);
-  parentURI.append(filename);
-  try {
-    var retVal = parentURI.copyToFollowingLinks(file.parent, filename);
-  } catch (ex) {
-    ok(false, "Cannot copy files to profile due to: " + ex);
-  }
-}
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul
@@ -30,25 +30,24 @@ var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput = <output></output>;
 
 
 Components.classes["@mozilla.org/consoleservice;1"]
           .getService(Components.interfaces.nsIConsoleService)
           .reset();
 
-copyToProfile('animals.sqlite');
 expectedConsoleMessages.push("Error parsing template: the given named parameter is unknown in the SQL query");
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = ? ORDER BY name
             <param name="bar">2</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul
@@ -30,26 +30,24 @@ var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput = <output></output>;
 
 
 Components.classes["@mozilla.org/consoleservice;1"]
           .getService(Components.interfaces.nsIConsoleService)
           .reset();
 
-copyToProfile('animals.sqlite');
-
 expectedConsoleMessages.push("Error parsing template: the type of a query parameter is wrong");
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = ? ORDER BY name
             <param type="mysupertype">2</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul
@@ -30,26 +30,24 @@ var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput = <output></output>;
 
 
 Components.classes["@mozilla.org/consoleservice;1"]
           .getService(Components.interfaces.nsIConsoleService)
           .reset();
 
-copyToProfile('animals.sqlite');
-
 expectedConsoleMessages.push("Error parsing template: a query parameter cannot be bound to the SQL query");
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
                 SELECT * FROM animals WHERE species_id = :spec ORDER BY name
             <param name="spec" type="int32">5</param>
             <param>L%</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul
@@ -29,28 +29,26 @@ var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =<output></output>;
 
 Components.classes["@mozilla.org/consoleservice;1"]
           .getService(Components.interfaces.nsIConsoleService)
           .reset();
 
-copyToProfile('animals.sqlite');
-
 expectedConsoleMessages.push("Error parsing template: syntax error in the SQL query");
 
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
               flex="1" rows="8"
-              datasources="profile:animals.sqlite" ref="." querytype="storage">
+              datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animalssssssss WHERE species_id = 2 ORDER BY 
         </query>
         <action>
             <listitem uri="?" label="?name"  />
         </action>
     </template>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul
@@ -17,17 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
 
 function test_storage_template()
 {
   var root = document.getElementById("root");
   expectedOutput = <output></output>;
   checkResults(root, 0);
 
   document.getElementById("species-id").textContent = '2';
@@ -63,17 +62,17 @@ var expectedOutput =
 
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
              SELECT * FROM animals WHERE species_id = :spec ORDER BY name
             <param id="species-id" name="spec" type="int32" />
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage simple listbox";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -38,17 +36,17 @@ var expectedOutput =
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
               flex="1" rows="8"
-              datasources="profile:animals.sqlite" ref="." querytype="storage">
+              datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = 2 ORDER BY name
         </query>
         <action>
             <listitem uri="?" label="?name"  />
         </action>
     </template>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage listbox with multiqueries";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -45,17 +43,17 @@ var expectedOutput =
     <listitem anyid="true" label="Bird: Raven"/>
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <queryset>
             <query>SELECT * FROM animals WHERE species_id = 5 ORDER BY name</query>
             <rule>
                 <where subject="?id" rel="greater" value="12"/>
                 <action>
                     <listitem uri="?" label="Mammal: ?name"  style="font-weight:bold"/>
                 </action>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul
@@ -15,18 +15,16 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
-
-copyToProfile('animals.sqlite');
 SimpleTest.waitForExplicitFinish();
 
 
 function test_storage_template()
 {
   var root = document.getElementById("root1");
   expectedOutput = <output>
     <listitem anyid="true" label="Barn Owl"/>
@@ -76,87 +74,87 @@ var expectedOutput =
     <listitem anyid="true" label="aardvark"/>
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root1" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = ? ORDER BY name
             <param>2</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
     </template>
 </listbox>
 
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root2" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = ? ORDER BY name
             <param type="int32">2</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
     </template>
 </listbox>
 
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root3" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
                 SELECT * FROM animals WHERE species_id = :spec AND name like ? ORDER BY name
             <param name="spec" type="int32">5</param>
             <param>L%</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
     </template>
 </listbox>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root4" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
                 SELECT * FROM animals WHERE species_id = ?3 AND name like ?1 ORDER BY name
             <param index="3" type="int32">5</param>
             <param index="1">L%</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
     </template>
 </listbox>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root5" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
                 SELECT * FROM animals WHERE species_id = ?3 AND name like :pattern ORDER BY name
             <param name="pattern">L%</param>
             <param index="3" type="int32">5</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
     </template>
 </listbox>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root6" 
-              flex="1"  datasources="profile:animals.sqlite" ref="." querytype="storage">
+              flex="1"  datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = ? ORDER BY name
             <param type="int32">2qsdqsd</param>
         </query>
         <action>
             <listitem uri="?" label="?name"/>
         </action>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_rule.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_rule.xul
@@ -15,19 +15,17 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
-
 SimpleTest.waitForExplicitFinish();
-copyToProfile('animals.sqlite');
 
 var testid ="storage listbox with rule";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
@@ -39,17 +37,17 @@ var expectedOutput =
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <listbox  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
               flex="1" rows="8"
-              datasources="profile:animals.sqlite" ref="." querytype="storage">
+              datasources="animals.sqlite" ref="." querytype="storage">
     <template>
         <query>
             SELECT * FROM animals WHERE species_id = 5 ORDER BY name
         </query>
         <rule>
             <where subject="?id" rel="greater" value="10"/>
             <action>
                 <listitem uri="?" label="?name" />
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_simple.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_simple.xul
@@ -15,17 +15,16 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
-copyToProfile('animals.sqlite');
 SimpleTest.waitForExplicitFinish();
 
 var testid ="storage simple";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
@@ -36,17 +35,17 @@ var expectedOutput =
   <button anyid="true" label="Raven / Corvus corax"/>
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-      datasources="profile:animals.sqlite" querytype="storage" ref=".">
+      datasources="animals.sqlite" querytype="storage" ref=".">
 <template>
     <query>SELECT * FROM animals WHERE species_id = 2 ORDER BY name</query>
     <action>
         <button uri="?" label="?name / ?specimen"/>
     </action>
 </template>
 </vbox>
 
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage sort integer asc";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -54,17 +52,17 @@ var changes = [];
 ]]>
 </script>
 
 <grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     <columns>
         <column flex="1"/>
         <column flex="3"/>
     </columns>
-    <rows id="root" datasources="profile:animals.sqlite" querytype="storage" ref="."
+    <rows id="root" datasources="animals.sqlite" querytype="storage" ref="."
          sort="?id" sortDirection="ascending">
         <template>
             <query>SELECT id, name FROM animals</query>
             <action>
                 <row uri="?">
                     <label value="?id"/>
                     <label value="?name"/>
                 </row>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage sort integer desc";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -54,17 +52,17 @@ var changes = [];
 ]]>
 </script>
 
 <grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     <columns>
         <column flex="1"/>
         <column flex="3"/>
     </columns>
-    <rows id="root" datasources="profile:animals.sqlite" querytype="storage" ref="."
+    <rows id="root" datasources="animals.sqlite" querytype="storage" ref="."
          sort="?id" sortDirection="descending">
         <template>
             <query>SELECT id, name FROM animals</query>
             <action>
                 <row uri="?">
                     <label value="?id"/>
                     <label value="?name"/>
                 </row>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage sort string asc";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -54,17 +52,17 @@ var changes = [];
 ]]>
 </script>
 
 <grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     <columns>
         <column flex="1"/>
         <column flex="3"/>
     </columns>
-    <rows id="root" datasources="profile:animals.sqlite" querytype="storage" ref="."
+    <rows id="root" datasources="animals.sqlite" querytype="storage" ref="."
          sort="?name" sortDirection="ascending">
         <template>
             <query>SELECT id, name FROM animals</query>
             <action>
                 <row uri="?">
                     <label value="?id"/>
                     <label value="?name"/>
                 </row>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage sort string desc";
 var queryType = "storage";
 var isTreeBuilder = false;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -54,17 +52,17 @@ var changes = [];
 ]]>
 </script>
 
 <grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
     <columns>
         <column flex="1"/>
         <column flex="3"/>
     </columns>
-    <rows id="root" datasources="profile:animals.sqlite" querytype="storage" ref="."
+    <rows id="root" datasources="animals.sqlite" querytype="storage" ref="."
          sort="?name" sortDirection="descending">
         <template>
             <query>SELECT id, name FROM animals</query>
             <action>
                 <row uri="?">
                     <label value="?id"/>
                     <label value="?name"/>
                 </row>
--- a/content/xul/templates/tests/chrome/test_tmpl_storage_tree.xul
+++ b/content/xul/templates/tests/chrome/test_tmpl_storage_tree.xul
@@ -17,18 +17,16 @@
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script src="templates_shared.js"/>
 
 <script>
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 
-copyToProfile('animals.sqlite');
-
 var testid ="storage tree";
 var queryType = "storage";
 var isTreeBuilder = true;
 var needsOpen = false;
 var notWorkingYet = false;
 var notWorkingYetDynamic = false;
 var expectedOutput =
 <output>
@@ -90,17 +88,17 @@ var expectedOutput =
   </treechildren>
 </output>;
 
 var changes = [];
 ]]>
 </script>
 
 <tree   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 
-        flex="1" datasources="profile:animals.sqlite" ref="*" querytype="storage" flags="dont-build-content">
+        flex="1" datasources="animals.sqlite" ref="*" querytype="storage" flags="dont-build-content">
     <treecols>
         <treecol id="species" primary="true" label="Species" flex="2"/>
         <treecol id="name" label="Common name" flex="2"/>
         <treecol id="specimen" label="Specimen" flex="3"/>
         <treecol id="id" label="id" flex="1"/>
     </treecols>
     <template>
         <query>
--- a/content/xul/templates/tests/test_bug441785.xul
+++ b/content/xul/templates/tests/test_bug441785.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0" ?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <tree flex="20" id="t" ref="urn:data:row" datasources="rdf:null" seltype="single">
      <treecols> 
       <treecol flex="1" id="id" label="id" sort="rdf:http://dummy/rdf#id" />
       <splitter class="tree-splitter"/>
       <treecol flex="1" id="title" label="title" sort="rdf:http://dummy/rdf#title" sortActive="true" sortDirection="ascending" /><splitter class="tree-splitter"/>
      </treecols>
--- a/content/xul/templates/tests/test_sortservice.xul
+++ b/content/xul/templates/tests/test_sortservice.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0" ?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <vbox id="box"/>
 
 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script type="application/javascript" src="/MochiKit/packed.js"></script>
--- a/docshell/test/chrome/bug293235_window.xul
+++ b/docshell/test/chrome/bug293235_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 293235 test">
 
   <script type="application/javascript"
     src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
 
   <script type="application/javascript"><![CDATA[
     const Ci = Components.interfaces;
     const Cc = Components.classes;
     Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
--- a/docshell/test/chrome/bug294258_window.xul
+++ b/docshell/test/chrome/bug294258_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 294258 test">
 
   <script type="application/javascript"
   src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
 
     ////
--- a/docshell/test/chrome/bug298622_window.xul
+++ b/docshell/test/chrome/bug298622_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 298622 test">
 
   <script type="application/javascript"
     src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
     // Global variable that holds a reference to the find bar.
     var gFindBar;
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
--- a/docshell/test/chrome/bug301397_window.xul
+++ b/docshell/test/chrome/bug301397_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 301397 test">
 
   <script type="application/javascript"
     src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
 
     ////
--- a/docshell/test/chrome/bug303267_window.xul
+++ b/docshell/test/chrome/bug303267_window.xul
@@ -4,17 +4,17 @@
 <window id="303267Test"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 303267 test">
 
   <script type="application/javascript"  
-  src="docshell_helpers.js">
+  src="chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
 
     ////
--- a/docshell/test/chrome/bug321671_window.xul
+++ b/docshell/test/chrome/bug321671_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 321671 test">
 
   <script type="application/javascript"
     src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
     
     // Maximum number of entries in the bfcache for this session history.
--- a/docshell/test/chrome/bug360511_window.xul
+++ b/docshell/test/chrome/bug360511_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 360511 test">
 
   <script type="application/javascript"
           src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
 
     ////
--- a/docshell/test/chrome/bug396649_window.xul
+++ b/docshell/test/chrome/bug396649_window.xul
@@ -5,17 +5,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug 396649 test">
 
   <script type="application/javascript"
           src=
-  "docshell_helpers.js">
+  "chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
     
     // Maximum number of entries in the bfcache for this session history.
--- a/docshell/test/chrome/window.template.txt
+++ b/docshell/test/chrome/window.template.txt
@@ -4,17 +4,17 @@
 <window id="303267Test"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="setTimeout(nextTest,0);"
         title="bug {BUGNUMBER} test">
 
   <script type="application/javascript"
-  src="docshell_helpers.js">
+  src="chrome://mochikit/content/chrome/docshell/test/chrome/docshell_helpers.js">
   </script>
 
   <script type="application/javascript"><![CDATA[
   
     // Define the generator-iterator for the tests.
     var tests = testIterator();
 
     ////
--- a/docshell/test/test_bug529119-1.html
+++ b/docshell/test/test_bug529119-1.html
@@ -1,15 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <title>Test bug 529119</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" />
+<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://mochi.test:8888/tests/docshell/test/bug529119-window.html";
 var faultyURL = "http://some-nonexistent-domain-27489274c892748217cn2384.com/";
 
--- a/docshell/test/test_bug529119-2.html
+++ b/docshell/test/test_bug529119-2.html
@@ -1,15 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <title>Test bug 529119</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" />
+<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://mochi.test:8888/tests/docshell/test/bug529119-window.html";
 var faultyURL = "http://some-nonexistent-domain-27489274c892748217cn2384.com/";
 
--- a/dom/tests/Makefile.in
+++ b/dom/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = dom/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_dom
 
 DIRS		+= mochitest \
 		$(NULL)
 XPCSHELL_TESTS = unit
--- a/dom/tests/mochitest/general/test_focusrings.xul
+++ b/dom/tests/mochitest/general/test_focusrings.xul
@@ -1,21 +1,21 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <script type="application/javascript"
-        src="/MochiKit/packed.js"></script>
+        src="chrome://mochikit/content/MochiKit/packed.js"></script>
 <script type="application/javascript"
-        src="/tests/SimpleTest/SimpleTest.js"></script>
+        src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 <script type="application/javascript"
-        src="/tests/SimpleTest/EventUtils.js"></script>
+        src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 <script type="application/javascript"
-        src="/tests/SimpleTest/WindowSnapshot.js"></script>
+        src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
 
 <html:style xmlns:html="http://www.w3.org/1999/xhtml" type="text/css">
 * { outline: none; }
 #l1:-moz-focusring, #l3:-moz-focusring, #b1:-moz-focusring { outline: 2px solid red; }
 #l2:focus, #b2:focus { outline: 2px solid red; }
 </html:style>
 
 <script>
--- a/dom/tests/mochitest/whatwg/test_postMessage_chrome.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_chrome.html
@@ -2,20 +2,23 @@
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=postMessage
 -->
 <head>
   <title>postMessage chrome tests</title>
   <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
+<!--
+This test runs at the following URL:
+chrome://mochikit/content/chrome/dom/tests/mochitest/whatwg/test_postMessage_chrome.html
+-->
 
 <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://example.org/tests/dom/tests/mochitest/whatwg/postMessage_chrome_helper.html"
         name="contentDomain"></iframe>
 
@@ -62,20 +65,18 @@ function messageReceiver(evt)
 
 
 /******************
  * SELF-RESPONDER *
  ******************/
 
 function checkSelf(evt)
 {
-  var prepath = getChromePrePath(window.location.href);
-
   is(evt.isTrusted, true, "should have sent a trusted event");
-  is(evt.origin, prepath, "wrong origin for chrome: URL");
+  is(evt.origin, "chrome://mochikit", "wrong origin for chrome: URL");
   is(evt.source, null, "chrome posters get a null source, for security");
 
   window.frames.contentDomain.postMessage("post-to-content",
                                           "http://example.org");
 }
 
 
 /*************
--- a/editor/libeditor/html/tests/test_contenteditable_focus.html
+++ b/editor/libeditor/html/tests/test_contenteditable_focus.html
@@ -1,17 +1,17 @@
 <html>
 <head>
   <title>Test for contenteditable focus</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <div id="display">
   First text in this document.<br>
   <input id="inputText" type="text"><br>
   <input id="inputTextReadonly" type="text" readonly><br>
   <input id="inputButton" type="button" value="input[type=button]"><br>
   <button id="button">button</button><br>
--- a/editor/libeditor/html/tests/test_contenteditable_text_input_handling.html
+++ b/editor/libeditor/html/tests/test_contenteditable_text_input_handling.html
@@ -1,19 +1,19 @@
 <html>
 <head>
   <title>Test for text input event handling on contenteditable editor</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/EventUtils.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <div id="display">
   <p id="static">static content<input id="inputInStatic"><textarea id="textareaInStatic"></textarea></p>
   <p id="editor"contenteditable="true">content editable<input id="inputInEditor"><textarea id="textareaInEditor"></textarea></p>
 </div>
 <div id="content" style="display: none">
   
--- a/editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
+++ b/editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
@@ -1,19 +1,19 @@
 <html>
 <head>
   <title>Test for key event handler of HTML editor</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/EventUtils.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <div id="display">
   <div id="htmlEditor" contenteditable="true"><br></div>
 </div>
 <div id="content" style="display: none">
   
 </div>
--- a/editor/libeditor/html/tests/test_root_element_replacement.html
+++ b/editor/libeditor/html/tests/test_root_element_replacement.html
@@ -1,19 +1,19 @@
 <html>
 <head>
   <title>Test for root element replacement</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/EventUtils.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <p id="display">
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
--- a/editor/libeditor/html/tests/test_select_all_without_body.html
+++ b/editor/libeditor/html/tests/test_select_all_without_body.html
@@ -1,17 +1,17 @@
 <html>
 <head>
   <title>Test select all in HTML editor without body element</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <p id="display">
 </p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
--- a/editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
+++ b/editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
@@ -1,19 +1,19 @@
 <html>
 <head>
   <title>Test for key event handler of text editor</title>
   <script type="text/javascript"
-          src="/MochiKit/packed.js"></script>
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/SimpleTest.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript"
-          src="/tests/SimpleTest/EventUtils.js"></script>
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css"
-          href="/tests/SimpleTest/test.css" />
+          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body>
 <div id="display">
   <input type="text" id="inputField">
   <input type="password" id="passwordField">
   <textarea id="textarea"></textarea>
 </div>
 <div id="content" style="display: none">
--- a/embedding/Makefile.in
+++ b/embedding/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = embedding
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE       = embed
 
 DIRS = base components browser
 
 ifdef ENABLE_TESTS
--- a/gfx/tests/Makefile.in
+++ b/gfx/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = gfx/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= gfx
 MOZILLA_INTERNAL_API = 1
 
 XPCSHELL_TESTS = unit
 
--- a/intl/locale/src/unix/tests/Makefile.in
+++ b/intl/locale/src/unix/tests/Makefile.in
@@ -34,16 +34,15 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/locale/src/unix/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_locale_unix
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/locale/tests/Makefile.in
+++ b/intl/locale/tests/Makefile.in
@@ -34,16 +34,15 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/locale/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_locale
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/locale/tests_multilocale/Makefile.in
+++ b/intl/locale/tests_multilocale/Makefile.in
@@ -34,16 +34,15 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/locale/tests_multilocale
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_locale_multilocale
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/strres/tests/Makefile.in
+++ b/intl/strres/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/strres/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		 = test_intl_strres
 
 XPCSHELL_TESTS	 = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/uconv/tests/Makefile.in
+++ b/intl/uconv/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/uconv/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_uconv
 XPCSHELL_TESTS	= unit
 
 ifndef MOZ_ENABLE_LIBXUL
 MOZILLA_INTERNAL_API = 1
--- a/intl/unicharutil/tests/Makefile.in
+++ b/intl/unicharutil/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = intl/unicharutil/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_intl_unicharutil
 XPCSHELL_TESTS	= unit
 
 
 CPPSRCS		= UnicharSelfTest.cpp \
--- a/ipc/testshell/Makefile.in
+++ b/ipc/testshell/Makefile.in
@@ -33,17 +33,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-relativesrcdir = ipc/testshell
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = ipcshell
 LIBRARY_NAME = ipcshell_s
 FORCE_STATIC_LIB = 1
 LIBXUL_LIBRARY = 1
 EXPORT_LIBRARY = 1
--- a/js/jetpack/tests/Makefile.in
+++ b/js/jetpack/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir = js/jetpack/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_jetpack
 
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/config.mk
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -142,82 +142,82 @@ endif
 
 ################################################################################
 # Testing frameworks support
 ################################################################################
 
 ifdef ENABLE_TESTS
 
 ifdef XPCSHELL_TESTS
-#ifndef MODULE
-#$(error Must define MODULE when defining XPCSHELL_TESTS.)
-#endif
+ifndef MODULE
+$(error Must define MODULE when defining XPCSHELL_TESTS.)
+endif
 
 testxpcobjdir = $(DEPTH)/_tests/xpcshell
 
 # Test file installation
 ifneq (,$(filter WINNT os2-emx,$(HOST_OS_ARCH)))
 # Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
 TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
 else
 TEST_INSTALLER = $(INSTALL)
 endif
 
 define _INSTALL_TESTS
-$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir)
+$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(MODULE)/$(dir)
 
 endef # do not remove the blank line!
 
 SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
 
 libs::
 	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
 	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py \
           $(testxpcobjdir)/all-test-dirs.list \
-          $(addprefix $(relativesrcdir)/,$(XPCSHELL_TESTS))
+          $(addprefix $(MODULE)/,$(XPCSHELL_TESTS))
 
 testxpcsrcdir = $(topsrcdir)/testing/xpcshell
 
 # Execute all tests in the $(XPCSHELL_TESTS) directories.
 # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
 xpcshell-tests:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           $(EXTRA_TEST_ARGS) \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 # Execute a single test, specified in $(SOLO_FILE), but don't automatically
 # start the test. Instead, present the xpcshell prompt so the user can
 # attach a debugger and then start the test.
 check-interactive:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           --test-path=$(SOLO_FILE) \
           --profile-name=$(MOZ_APP_NAME) \
           --interactive \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 # Execute a single test, specified in $(SOLO_FILE)
 check-one:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
           -I$(topsrcdir)/build \
           $(testxpcsrcdir)/runxpcshelltests.py \
           --symbols-path=$(DIST)/crashreporter-symbols \
           --test-path=$(SOLO_FILE) \
           --profile-name=$(MOZ_APP_NAME) \
           --verbose \
           $(EXTRA_TEST_ARGS) \
           $(DIST)/bin/xpcshell \
-          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
 
 endif # XPCSHELL_TESTS
 
 ifdef CPP_UNIT_TESTS
 
 # Compile the tests to $(DIST)/bin.  Make lots of niceties available by default
 # through TestHarness.h, by modifying the list of includes and the libs against
 # which stuff links.
--- a/js/src/xpconnect/tests/Makefile.in
+++ b/js/src/xpconnect/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = js/src/xpconnect/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= TestXPC
 SIMPLE_PROGRAMS = TestXPC$(BIN_SUFFIX)
 
 
 DIRS		= idl mochitest chrome
--- a/js/src/xpconnect/tests/chrome/test_bug503926.xul
+++ b/js/src/xpconnect/tests/chrome/test_bug503926.xul
@@ -11,32 +11,34 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml">
   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=503926"
      target="_blank">Mozilla Bug 503926</a>
 
-  <iframe id="ifr" type="content" onload="iframe_loaded()" src="bug503926.xul#iframe"/>
+  <iframe id="ifr" type="content" onload="iframe_loaded()"
+          src="chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/bug503926.xul#iframe"/>
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript">
   <![CDATA[
 
   /** Test for Bug 503926 **/
   function iframe_loaded() {
     var gWindowUtils  = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
                                getInterface(Components.interfaces.nsIDOMWindowUtils);
     var passed = false;
     var obj = { QueryInterface: function() { passed = true; } };
     try { gWindowUtils.dispatchDOMEventViaPresShell(obj, obj, false); } catch (e) {}
     ok(passed, "trusted QIs should be called");
 
-    openDialog("bug503926.xul", "chromeDialog", "modal");
+    openDialog("chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/bug503926.xul",
+               "chromeDialog", "modal");
     SimpleTest.finish();
   }
 
   SimpleTest.waitForExplicitFinish();
   ]]>
   </script>
 </window>
--- a/modules/libjar/test/Makefile.in
+++ b/modules/libjar/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = modules/libjar/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_libjar
 
 XPCSHELL_TESTS = unit
 
 DIRS		= mochitest chrome
--- a/modules/libjar/test/chrome/test_bug386153.html
+++ b/modules/libjar/test/chrome/test_bug386153.html
@@ -2,17 +2,16 @@
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=386153
 -->
 <head>
   <title>Test for Bug 386153</title>
   <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=386153">Mozilla Bug 386153</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
@@ -21,27 +20,25 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 386153 **/
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 // Opens a zip file from the test directory.
 function openZip(path) {
-
-  var location = window.location.href;
-  location = getRootDirectory(location);
-  var jar = getJar(location);
-  if (jar != null) {
-    var resolved = extractJarToTmp(jar);
-  } else {
-    var resolvedURI = getResolvedURI(window.location.href);
-    var resolved = getChromeDir(resolvedURI);
-  }
-  resolved.append(path);
+  var ios = Cc["@mozilla.org/network/io-service;1"].
+            getService(Ci.nsIIOService);
+  var chromeURI = ios.newURI("chrome://mochikit/content/chrome/modules/libjar/test/chrome/" + path,
+                              null, null);
+  var resolved = Cc["@mozilla.org/chrome/chrome-registry;1"].
+                 getService(Ci.nsIChromeRegistry).
+                 convertChromeURL(chromeURI).
+                 QueryInterface(Ci.nsIFileURL).
+                 file;
 
   var zip = Cc["@mozilla.org/libjar/zip-reader;1"].
             createInstance(Ci.nsIZipReader);
   zip.open(resolved);
   return zip;
 }
 
 // Gets the pretty name from the signing cert or null if the zip is unsigned.
--- a/modules/libjar/zipwriter/test/Makefile.in
+++ b/modules/libjar/zipwriter/test/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH          = ../../../..
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
-relativesrcdir = modules/libjar/zipwriter/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE         = test_zipwriter
 
 XPCSHELL_TESTS = \
   unit \
   $(NULL)
--- a/modules/libpref/test/Makefile.in
+++ b/modules/libpref/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = modules/libpref/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_libpref
 
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/modules/plugin/test/Makefile.in
+++ b/modules/plugin/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = modules/plugin/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_plugin
 
 DIRS = testplugin
 
 XPCSHELL_TESTS = \
--- a/modules/plugin/test/mochitest/test_bug532208.html
+++ b/modules/plugin/test/mochitest/test_bug532208.html
@@ -1,16 +1,16 @@
 <head>
 <title>Test for correct async delivery of large streams, bug
 532208</title>
 
 <script type="application/javascript"
-src="/MochiKit/packed.js"></script>
+src="chrome://mochikit/content/MochiKit/packed.js"></script>
 <script type="application/javascript"
-src="/tests/SimpleTest/SimpleTest.js"></script>
+src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="setTimeout(runTests, 2000)">
   <embed id="plugin1" type="application/x-test" width="400"
   height="400" src="large-pic.jpg" functiontofail="npp_write_rpc" streammode="normal"></embed>
 
 <script class="testbody" type="application/javascript">
 SimpleTest.waitForExplicitFinish();
 
--- a/modules/plugin/test/mochitest/test_cocoa_focus.html
+++ b/modules/plugin/test/mochitest/test_cocoa_focus.html
@@ -1,13 +1,13 @@
 <html>
 <head>
   <title>NPCocoaEventFocusChanged Tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
     SimpleTest.waitForExplicitFinish();
 
     var gOtherWindow;
 
--- a/modules/plugin/test/mochitest/test_cocoa_window_focus.html
+++ b/modules/plugin/test/mochitest/test_cocoa_window_focus.html
@@ -1,13 +1,13 @@
 <html>
 <head>
   <title>NPCocoaEventWindowFocusChanged Tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
     SimpleTest.waitForExplicitFinish();
 
     var gOtherWindow;
 
--- a/modules/plugin/test/mochitest/test_cookies.html
+++ b/modules/plugin/test/mochitest/test_cookies.html
@@ -1,13 +1,13 @@
 <html>
 <head>
   <title>NPAPI Cookie Tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 
 <body onload="runTests()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
   <script class="testbody" type="application/javascript">
     SimpleTest.waitForExplicitFinish();
     function runTests() {
       var pluginElement = document.getElementById("plugin1");
--- a/modules/plugin/test/mochitest/test_crash_nested_loop.html
+++ b/modules/plugin/test/mochitest/test_crash_nested_loop.html
@@ -1,12 +1,12 @@
 <head>
   <title>Plugin crashing in nested loop</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var iframe = document.getElementById('iframe1');
--- a/modules/plugin/test/mochitest/test_crashing.html
+++ b/modules/plugin/test/mochitest/test_crashing.html
@@ -1,12 +1,12 @@
 <head>
   <title>Plugin crashing</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var iframe = document.getElementById('iframe1');
--- a/modules/plugin/test/mochitest/test_crashing2.html
+++ b/modules/plugin/test/mochitest/test_crashing2.html
@@ -1,12 +1,12 @@
 <head>
   <title>Plugin crashing</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="mainLoaded()">
   <iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var iframe = document.getElementById('iframe1');
--- a/modules/plugin/test/mochitest/test_enumerate.html
+++ b/modules/plugin/test/mochitest/test_enumerate.html
@@ -1,13 +1,13 @@
 <html>
 <head>
   <title>NPAPI Cookie Tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <link rel="stylesheet" type="text/css" 
         href="/tests/SimpleTest/test.css" />
 </head>
 
 <body onload="runTests()">
   <p id="display"></p>
 
--- a/modules/plugin/test/mochitest/test_hanging.html
+++ b/modules/plugin/test/mochitest/test_hanging.html
@@ -1,12 +1,12 @@
 <head>
   <title>Plugin hanging</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var iframe = document.getElementById('iframe1');
--- a/modules/plugin/test/mochitest/test_instantiation.html
+++ b/modules/plugin/test/mochitest/test_instantiation.html
@@ -1,12 +1,13 @@
 <head>
   <title>Plugin instantiation</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
 <body onload="mainLoaded()">
   <iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var iframe = document.getElementById('iframe1');
 
--- a/modules/plugin/test/mochitest/test_multipleinstanceobjects.html
+++ b/modules/plugin/test/mochitest/test_multipleinstanceobjects.html
@@ -1,12 +1,12 @@
 <head>
   <title>NPNV*NPObject accessibility tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="runTests()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
   <embed id="plugin2" type="application/x-test" width="400" height="400"></embed>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
--- a/modules/plugin/test/mochitest/test_newstreamondestroy.html
+++ b/modules/plugin/test/mochitest/test_newstreamondestroy.html
@@ -1,12 +1,12 @@
 <head>
   <title>NPN_GetURL called from NPP_Destroy</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <link rel="stylesheet" type="text/css"
 	href="/tests/SimpleTest/test.css">
 
 <body onload="runTest()">
   <p id="display"></p>
 
   <embed id="plugin1" type="application/x-test"></embed>
--- a/modules/plugin/test/mochitest/test_npobject_getters.html
+++ b/modules/plugin/test/mochitest/test_npobject_getters.html
@@ -1,12 +1,12 @@
 <head>
   <title>NPNV*NPObject accessibility tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="runTests()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
 
   <script class="testbody" type="application/javascript">
   dump('lastScript');
 
   SimpleTest.waitForExplicitFinish();
--- a/modules/plugin/test/mochitest/test_streamNotify.html
+++ b/modules/plugin/test/mochitest/test_streamNotify.html
@@ -1,12 +1,12 @@
 <head>
   <title>NPN_Get/PostURLNotify tests</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="runTests()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   var pending = 6;
--- a/netwerk/cookie/Makefile.in
+++ b/netwerk/cookie/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH     = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir = netwerk/cookie
 
 include $(DEPTH)/config/autoconf.mk
 
 # export required interfaces, even if --disable-cookies has been given
 MODULE       = necko
 XPIDL_MODULE = necko_cookie
 GRE_MODULE   = 1
 
--- a/netwerk/test/Makefile.in
+++ b/netwerk/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = netwerk/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_necko
 
 DIRS            = \
                   httpserver \
                   browser \
@@ -115,11 +114,11 @@ check::
 libs:: $(_RES_FILES)
 	$(INSTALL) $^ $(DIST)/bin/res
 install:: $(_RES_FILES)
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/res
 
 # One of the xpcshell unit tests needs this file, so make sure it winds
 #  up in the test directory.
 libs::
-	$(NSINSTALL) -D $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/data
+	$(NSINSTALL) -D $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/data
 	$(INSTALL) $(topsrcdir)/netwerk/dns/effective_tld_names.dat \
-          $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/
+          $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/
--- a/netwerk/test/httpserver/Makefile.in
+++ b/netwerk/test/httpserver/Makefile.in
@@ -37,17 +37,16 @@
 # ***** END LICENSE BLOCK *****
 
 $(warning httpserver XPI_NAME=$(XPI_NAME))
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = netwerk/test/httpserver
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_necko
 NO_INTERFACES_MANIFEST = 1
 
 EXTRA_COMPONENTS = \
                    httpd.js \
--- a/parser/xml/test/Makefile.in
+++ b/parser/xml/test/Makefile.in
@@ -44,17 +44,16 @@
 # for detailed instructions.
 #
 
 # Note: DEPTH should be set to the relative path to mozilla/
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = parser/xml/test
 
 include $(DEPTH)/config/autoconf.mk
 
 # Note: set the test module's name to test_<yourmodule>
 MODULE		= test_xmlreader
 
 XPCSHELL_TESTS  = unit
 
--- a/rdf/tests/Makefile.in
+++ b/rdf/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = rdf/tests
 
 MODULE = test_rdf
 
 include $(DEPTH)/config/autoconf.mk
 
 DIRS		= rdfcat rdfpoll triplescat
 
 XPCSHELL_TESTS = unit
--- a/security/manager/ssl/tests/Makefile.in
+++ b/security/manager/ssl/tests/Makefile.in
@@ -35,15 +35,14 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = security/manager/ssl/tests
 
 MODULE		= pipnss
 DIRS		= mochitest
 XPCSHELL_TESTS  = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/security/manager/ssl/tests/mochitest/bugs/test_bug480509.html
+++ b/security/manager/ssl/tests/mochitest/bugs/test_bug480509.html
@@ -1,14 +1,14 @@
 <html>
 <head>
   <title>Test bug 483437 and bug 480509</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" />
+  <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" />
 </head>
 <body onload="onWindowLoad()">
 
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 function badCertListener() 
--- a/security/manager/ssl/tests/mochitest/bugs/test_bug483440.html
+++ b/security/manager/ssl/tests/mochitest/bugs/test_bug483440.html
@@ -1,14 +1,14 @@
 <html>
 <head>
   <title>Test bug 483437 and bug 480509</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" />
+  <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" />
 </head>
 <body>
 
 <script class="testbody" type="text/javascript">
 
 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
 var certdb = Components.classes["@mozilla.org/security/x509certdb;1"]
--- a/security/manager/ssl/tests/mochitest/bugs/test_bug484111.html
+++ b/security/manager/ssl/tests/mochitest/bugs/test_bug484111.html
@@ -1,14 +1,14 @@
 <html>
 <head>
   <title>Test bug 484111</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" />
+  <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" />
 </head>
 <body onload="onWindowLoad()">
 
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 function badCertListener() 
--- a/storage/test/Makefile.in
+++ b/storage/test/Makefile.in
@@ -36,17 +36,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = storage/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_storage
 
 XPCSHELL_TESTS = unit
 
 CPP_UNIT_TESTS = \
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -69,17 +69,16 @@ include $(topsrcdir)/build/automation-bu
 		$(topsrcdir)/build/mobile/remoteautomation.py \
 		gen_template.pl \
 		server.js \
 		harness-a11y.xul \
 		harness-overlay.xul \
 		harness.xul \
 		browser-test-overlay.xul \
 		browser-test.js \
-		chrome-harness.js \
 		ipc-overlay.xul \
 		ipc.js \
 		browser-harness.xul \
 		redirect-a11y.html \
 		redirect.html \
 		redirect.js \
 		$(topsrcdir)/build/pgo/server-locations.txt \
 		$(topsrcdir)/netwerk/test/httpserver/httpd.js \
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -40,17 +40,16 @@ function Tester(aTests, aDumper, aCallba
 
   this._scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                        getService(Ci.mozIJSSubScriptLoader);
   this._scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", this.EventUtils);
   // Avoid polluting this scope with packed.js contents.
   var simpleTestScope = {};
   this._scriptLoader.loadSubScript("chrome://mochikit/content/MochiKit/packed.js", simpleTestScope);
   this._scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/SimpleTest.js", simpleTestScope);
-  this._scriptLoader.loadSubScript("chrome://mochikit/content/chrome-harness.js", simpleTestScope);
   this.SimpleTest = simpleTestScope.SimpleTest;
 }
 Tester.prototype = {
   EventUtils: {},
   SimpleTest: {},
 
   checker: null,
   currentTestIndex: -1,
deleted file mode 100644
--- a/testing/mochitest/chrome-harness.js
+++ /dev/null
@@ -1,342 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mochitest code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Joel Maher <joel.maher@gmail.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-/*
- * getChromeURI converts a URL to a URI
- * 
- * url: string of a URL (http://mochi.test/test.html)
- * returns: a nsiURI object representing the given URL
- *
- */
-function getChromeURI(url) {
-  var ios = Components.classes["@mozilla.org/network/io-service;1"].
-              getService(Components.interfaces.nsIIOService);
-  return ios.newURI(url, null, null);
-}
-
-/*
- * Convert a URL (string) into a nsIURI or NSIJARURI
- * This is intended for URL's that are on a file system 
- * or in packaged up in an extension .jar file
- *
- * url: a string of a url on the local system(http://localhost/blah.html)
- */
-function getResolvedURI(url) {
-  var chromeURI = getChromeURI(url);
-  var resolvedURI = Components.classes["@mozilla.org/chrome/chrome-registry;1"].
-                    getService(Components.interfaces.nsIChromeRegistry).
-                    convertChromeURL(chromeURI);
-
-  try {
-    resolvedURI = resolvedURI.QueryInterface(Components.interfaces.nsIJARURI);
-  } catch (ex) {} //not a jar file
-
-  return resolvedURI;
-}
-
-/**
- *  getChromeDir is intended to be called after getResolvedURI and convert
- *  the input URI into a nsILocalFile (actually the directory containing the
- *  file).  This can be used for copying or referencing the file or extra files
- *  required by the test.  Usually we need to load a secondary html file or library
- *  and this will give us file system access to that.
- *
- *  resolvedURI: nsIURI (from getResolvedURI) that points to a file:/// url
- */
-function getChromeDir(resolvedURI) {
-
-  var fileHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"].
-                    getService(Components.interfaces.nsIFileProtocolHandler);
-  var chromeDir = fileHandler.getFileFromURLSpec(resolvedURI.spec);
-  return chromeDir.parent.QueryInterface(Components.interfaces.nsILocalFile);
-}
-
-/*
- * given a .jar file, we get all test files located inside the archive
- *
- * basePath: base URL to determine chrome location and search for tests
- * testPath: passed in testPath value from command line such as: dom/tests/mochitest
- * dir: the test dir to append to the baseURL after getting a directory interface
- *
- * As a note, this is hardcoded to the .jar structure we use for mochitest.  
- * Please don't assume this works for all jar files.
- */
-function getMochitestJarListing(basePath, testPath, dir)
-{
-  var zReader = Components.classes["@mozilla.org/libjar/zip-reader;1"].
-                  createInstance(Components.interfaces.nsIZipReader);
-  var fileHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"].
-                    getService(Components.interfaces.nsIFileProtocolHandler);
-
-  var fileName = fileHandler.getFileFromURLSpec(getResolvedURI(basePath).JARFile.spec);
-  zReader.open(fileName);
-  //hardcoded 'content' as that is the root dir in the mochikit.jar file
-  var base = "content/" + dir + "/";
-
-  var singleTestPath;
-  if (testPath) {
-    var extraPath = testPath;
-    var pathToCheck = base + testPath;
-    if (zReader.hasEntry(pathToCheck)) {
-      var pathEntry = zReader.getEntry(pathToCheck);
-      if (pathEntry.isDirectory) {
-        base = pathToCheck;
-      } else {
-        singleTestPath = '/' + base + testPath;
-        var singleObject = {};
-        singleObject[singleTestPath] = true;
-        return [singleObject, singleTestPath];
-      }
-    }
-    else if (zReader.hasEntry(pathToCheck + "/")) {
-      base = pathToCheck + "/";
-    }
-  }
-  var [links, count] = zList(base, zReader, true);
-  return [links, null];
-}
-
-/*
- * Replicate the server.js list() function with a .jar file
- *
- * base: string value of base directory we are testing
- * zReader: handle to opened nsIZipReader object
- * recurse: true|false if we do subdirs
- *
- * returns:
- *  [json object of {dir:{subdir:{file:true, file:true, ...}}}, count of tests]
- */
-function zList(base, zReader, recurse) {
-  var dirs = zReader.findEntries(base + "*");
-  var links = {};
-  var count = 0;
-  var fileArray = [];
-  
-  while(dirs.hasMore()) {
-    var entryName = dirs.getNext();
-    if (entryName.substr(-1) == '/' && entryName.split('/').length == (base.split('/').length + 1) ||
-        (entryName.substr(-1) != '/' && entryName.split('/').length == (base.split('/').length))) { 
-      fileArray.push(entryName);
-    }
-  }
-  fileArray.sort();
-  count = fileArray.length;
-  for (var i=0; i < fileArray.length; i++) {
-    var myFile = fileArray[i];
-    if (myFile.substr(-1) === '/' && recurse) {
-      var childCount = 0;
-      [links[myFile], childCount] = zList(myFile, zReader, recurse);
-      count += childCount;
-    } else {
-      if (myFile.indexOf("SimpleTest") == -1) {
-        //we add the '/' so we don't try to run content/content/chrome
-        links['/' + myFile] = true;
-      }
-    }
-  }
-  return [links, count];
-}
-
-/**
- * basePath: the URL base path to search from such as chrome://mochikit/content/a11y
- * testPath: the optional testPath passed into the test such as dom/tests/mochitest
- * dir: the test dir to append to the uri after getting a directory interface
- * srvScope: loaded javascript to server.js so we have aComponents.classesess to the list() function
- *
- * return value:
- *  single test: [json object, path to test]
- *  list of tests: [json object, null] <- directory [heirarchy]
- */
-function getFileListing(basePath, testPath, dir, srvScope)
-{
-  var uri = getResolvedURI(basePath);
-  var chromeDir = getChromeDir(uri);
-  chromeDir.appendRelativePath(dir);
-  basePath += '/' + dir;
-
-  var ioSvc = Components.classes["@mozilla.org/network/io-service;1"].
-              getService(Components.interfaces.nsIIOService);
-  var testsDirURI = ioSvc.newFileURI(chromeDir);
-  var testsDir = ioSvc.newURI(testPath, null, testsDirURI)
-                  .QueryInterface(Components.interfaces.nsIFileURL).file;
-
-  var singleTestPath;
-  if (testPath != undefined) {
-    var extraPath = testPath;
-    
-    var fileNameRegexp = /(browser|test)_.+\.(xul|html|js)$/;
-
-    // Invalid testPath...
-    if (!testsDir.exists())
-      return [];
-
-    // If we were passed a speComponents.interfacesfic file, run only that test.
-    if (testsDir.isFile()) {
-      if (fileNameRegexp.test(testsDir.leafName))
-        var singlePath = basePath + '/' + testPath;
-        var links = {};
-        links[singlePath] = true;
-        return [links, singlePath];
-
-      // We were passed a file that's not a test...
-      return [];
-    }
-
-    // otherwise, we were passed a directory of tests
-    basePath += "/" + testPath;
-  }
-  var [links, count] = srvScope.list(basePath, testsDir, true);
-  return [links, null];
-}
-
-
-//used by tests to determine their directory based off window.location.path
-function getRootDirectory(path, chromeURI) {
-  if (chromeURI === undefined)
-  {
-    chromeURI = getChromeURI(path);
-  }
-  var myURL = chromeURI.QueryInterface(Components.interfaces.nsIURL);
-
-  return chromeURI.prePath + myURL.directory;
-}
-
-//used by tests to determine their directory based off window.location.path
-function getChromePrePath(path, chromeURI) {
-
-  if (chromeURI === undefined) {
-    chromeURI = getChromeURI(path);
-  }
-
-  return chromeURI.prePath;
-}
-
-/*
- * Given a URI, return nsIJARURI or null
- */
-function getJar(uri) {
-  var resolvedURI = getResolvedURI(uri);
-  var jar = null;
-  try {
-    if (resolvedURI.JARFile) {
-      jar = resolvedURI;
-    }
-  } catch (ex) {}
-  return jar;
-}
-
-/*
- * input:
- *  jar: a nsIJARURI object with the jarfile and jarentry (path in jar file)
- *
- * output;
- *  all files and subdirectories inside jarentry will be extracted to TmpD/mochikit.tmp
- *  we will return the location of /TmpD/mochikit.tmp* so you can reference the files locally
- */
-function extractJarToTmp(jar) {
-  var tmpdir = Components.classes["@mozilla.org/file/directory_service;1"]
-                      .getService(Components.interfaces.nsIProperties)
-                      .get("ProfD", Components.interfaces.nsILocalFile);
-  tmpdir.append("mochikit.tmp");
-  tmpdir.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777);
-
-  var zReader = Components.classes["@mozilla.org/libjar/zip-reader;1"].
-                  createInstance(Components.interfaces.nsIZipReader);
-
-  var fileHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"].
-                    getService(Components.interfaces.nsIFileProtocolHandler);
-
-  var fileName = fileHandler.getFileFromURLSpec(jar.JARFile.spec);
-  zReader.open(fileName);
-
-  //filepath represents the path in the jar file without the filename
-  var filepath = "";
-  var parts = jar.JAREntry.split('/');
-  for (var i =0; i < parts.length - 1; i++) {
-    if (parts[i] != '') {
-      filepath += parts[i] + '/';
-    }
-  }
-
-  /* Create dir structure first, no guarantee about ordering of directories and
-   * files returned from findEntries.
-   */
-  var dirs = zReader.findEntries(filepath + '*/');
-  while (dirs.hasMore()) {
-    var targetDir = buildRelativePath(dirs.getNext(), tmpdir, filepath);
-    targetDir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777);
-  }
-
-  //now do the files
-  var files = zReader.findEntries(filepath + "*");
-  while (files.hasMore()) {
-    var fname = files.getNext();
-    if (fname.substr(-1) != '/') {
-      var targetFile = buildRelativePath(fname, tmpdir, filepath);
-      zReader.extract(fname, targetFile);
-    }
-  }
-  return tmpdir;
-}
-
-/*
- * Simple utility function to take the directory structure in jarentryname and 
- * translate that to a path of a nsILocalFile.
- */
-function buildRelativePath(jarentryname, destdir, basepath)
-{
-  var baseParts = basepath.split('/');
-  if (baseParts[baseParts.length-1] == '') {
-    baseParts.pop();
-  }
-
-  var parts = jarentryname.split('/');
-
-  var targetFile = Components.classes["@mozilla.org/file/local;1"]
-                   .createInstance(Components.interfaces.nsILocalFile);
-  targetFile.initWithFile(destdir);
-
-  for (var i = baseParts.length; i < parts.length; i++) {
-    targetFile.append(parts[i]);
-  }
-
-  return targetFile;
-}
-
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -453,22 +453,17 @@ function list(requestPath, directory, re
  * is a test case to be executed in the harness, or just
  * a supporting file.
  */
 function isTest(filename, pattern)
 {
   if (pattern)
     return pattern.test(filename);
 
-  // File name is a URL style path to a test file, make sure that we check for
-  // tests that start with test_.
-  testPattern = /^test_/;
-  pathPieces = filename.split('/');
-  
-  return testPattern.test(pathPieces[pathPieces.length - 1]) &&
+  return filename.indexOf("test_") > -1 &&
          filename.indexOf(".js") == -1 &&
          filename.indexOf(".css") == -1 &&
          !/\^headers\^$/.test(filename);
 }
 
 /**
  * Transform nested hashtables of paths to nested HTML lists.
  */
--- a/testing/mochitest/tests/SimpleTest/tests/test_synthesizeDragStart.xul
+++ b/testing/mochitest/tests/SimpleTest/tests/test_synthesizeDragStart.xul
@@ -60,18 +60,17 @@ check if nsIFile can be determined
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript">
   <![CDATA[
 
   /** Test for Bug 462172 synthesizeDragStart**/
 var testFile = Components.classes["@mozilla.org/file/directory_service;1"].
-                  getService(Components.interfaces.nsIProperties).
-                  get("CurWorkD", Components.interfaces.nsIFile);
+                  getService(Ci.nsIProperties).get("CurWorkD", Ci.nsIFile);
 var regularDtForDrag1 = null;
 
 function doOnDragStart(aEvent)
 {
   var dt = aEvent.dataTransfer;
   switch (aEvent.currentTarget.id) {
     case "drag2" :
       dt.setData("text/plain", "this is text/plain");
--- a/testing/mochitest/tests/SimpleTest/tests/test_synthesizeDrop.xul
+++ b/testing/mochitest/tests/SimpleTest/tests/test_synthesizeDrop.xul
@@ -47,16 +47,18 @@
 <window title="Mozilla Bug 462172 extra tests for synthesizeDrop"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="setTimeout(test,0)">
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
+  <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript">
   <![CDATA[
 
   /** Test for Bug 462172 synthesizeDrop**/
 
 var gSetDropEffect = true;
 var gData;
--- a/testing/xpcshell/example/Makefile.in
+++ b/testing/xpcshell/example/Makefile.in
@@ -45,17 +45,16 @@
 # for detailed instructions.
 #
 
 # Note: DEPTH should be set to the relative path to mozilla/
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = testing/xpcshell/example
 
 include $(DEPTH)/config/autoconf.mk
 
 # Note: set the test module's name to test_<yourmodule>
 MODULE		= test_testing_xpcshell_example
 
 # This is a list of directories containing tests to run, separated by spaces.
 # Most likely, tho, you won't use more than one directory here.
--- a/toolkit/components/autocomplete/tests/Makefile.in
+++ b/toolkit/components/autocomplete/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = toolkit/components/autocomplete/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_autocomplete
 
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/commandlines/test/Makefile.in
+++ b/toolkit/components/commandlines/test/Makefile.in
@@ -36,17 +36,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = toolkit/components/commandlines/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_harness_commandlines
 
 XPCSHELL_TESTS = \
                  unit \
                  $(NULL)
--- a/toolkit/components/contentprefs/tests/Makefile.in
+++ b/toolkit/components/contentprefs/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = toolkit/components/contentprefs/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_toolkit_contentprefs
 
 ifdef MOZ_PHOENIX
 XPCSHELL_TESTS = unit
 endif
--- a/toolkit/components/ctypes/tests/Makefile.in
+++ b/toolkit/components/ctypes/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-relativesrcdir = toolkit/components/ctypes/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = jsctypes-test
 LIBRARY_NAME = jsctypes-test
 SHORT_LIBNAME = jscttest
 FORCE_SHARED_LIB = 1
 NO_DIST_INSTALL = 1
@@ -67,20 +66,20 @@ XPCSHELL_TESTS = unit
 _CHROME_TEST_FILES = \
   xpcshellTestHarnessAdaptor.js \
   ctypes_worker.js \
   test_ctypes.xul \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-xpctestdir = $(testxpcobjdir)/$(relativesrcdir)/unit
+xpctestdir = $(testxpcobjdir)/$(MODULE)/unit
 
 chrometestdir = \
-  $(DEPTH)/_tests/testing/mochitest/chrome/toolkit/components/$(relativesrcdir)
+  $(DEPTH)/_tests/testing/mochitest/chrome/toolkit/components/$(MODULE)
 
 # preprocess and install our unit test into the appropriate directory,
 # and install the test library as well. the xpcshell test rules will
 # install the .js.in from the tests srcdir, so remove it when we're done.
 libs:: unit/test_jsctypes.js.in
 	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
 	  $^ > $(xpctestdir)/test_jsctypes.js
 	$(TEST_INSTALLER) $(SHARED_LIBRARY) $(xpctestdir)
--- a/toolkit/components/ctypes/tests/test_ctypes.xul
+++ b/toolkit/components/ctypes/tests/test_ctypes.xul
@@ -41,67 +41,44 @@
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/chrome-harness.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
-    /*
-     * input: string of the url where we are running from
-     * return: nsILocalFile
-     */
-    function getCurrentDir(path) {
-      var rootDir = getRootDirectory(window.location.href);
-      var jar = getJar(rootDir);
-
-      if (jar) {
-        return extractJarToTmp(jar);
-      } else {
-        return getLocalDir(path);
-      }
-    }
-
-    function getLocalDir(path) {
-      let dir = Components.classes["@mozilla.org/file/directory_service;1"]
-                          .getService(Components.interfaces.nsIProperties)
-                          .get("CurWorkD", Components.interfaces.nsILocalFile);
-      let path = location.pathname;
-      path = path.slice("content/".length,
-                                         -1 * "/test_ctypes.xul".length);
-      let components = path.split("/");
-      for (let part in components) {
-        dir.append(components[part]);
-      }
-      return dir;    
-    }
-
     function test()
     {
       SimpleTest.waitForExplicitFinish();
 
       var worker = new ChromeWorker("ctypes_worker.js");
       worker.onmessage = function(event) {
         is(event.data, "Done!", "Wrong message!");
         SimpleTest.finish();
       }
       worker.onerror = function(event) {
         ok(false, "Worker had an error: " + event.message);
         worker.terminate();
         SimpleTest.finish();
       }
 
-      var dir = getCurrentDir(location.path);
+      let dir = Components.classes["@mozilla.org/file/directory_service;1"]
+                          .getService(Components.interfaces.nsIProperties)
+                          .get("CurWorkD", Components.interfaces.nsILocalFile);
+      let path = location.pathname.slice("content/".length,
+                                         -1 * "/test_ctypes.xul".length);
+      let components = path.split("/");
+      for (let part in components) {
+        dir.append(components[part]);
+      }
       ok(dir.exists() && dir.isDirectory(), "Chrome test dir doesn't exist?!");
       worker.postMessage(dir.path);
     }
 
   ]]>
   </script>
 
   <body xmlns="http://www.w3.org/1999/xhtml">
--- a/toolkit/components/downloads/test/Makefile.in
+++ b/toolkit/components/downloads/test/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH   = ../../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH   = @srcdir@
-relativesrcdir = toolkit/components/downloads/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_dm
 
 XPCSHELL_TESTS = \
   unit \
   schema_migration \
--- a/toolkit/components/places/tests/Makefile.in
+++ b/toolkit/components/places/tests/Makefile.in
@@ -82,9 +82,9 @@ TOOL_DIRS = \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 libs:: $(MOCHI_TESTS)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
 libs:: $(XPCSHELL_TESTS_COMMON)
-	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/xpcshell/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/xpcshell/$(MODULE)
--- a/toolkit/components/places/tests/chrome/test_329534.xul
+++ b/toolkit/components/places/tests/chrome/test_329534.xul
@@ -79,18 +79,18 @@ var observer =
         bmsvc.removeItem(gLivemarkId1);
         bmsvc.removeItem(gLivemarkId2);
         SimpleTest.finish();
       }
     }
   },
   onBeforeItemRemoved: function(){},
   onItemRemoved: function() {},
-  onItemChanged: function() {},
-  onItemVisited: function() {},
+  onItemChanged: function() {}
+  onItemVisited: function() {}
   onItemMoved: function() {}
 };
 bmsvc.addObserver(observer, false);
 
 // start updating livemarks
 firstLoadTime = Date.now();
 lmsvc.start();
 
--- a/toolkit/components/urlformatter/tests/Makefile.in
+++ b/toolkit/components/urlformatter/tests/Makefile.in
@@ -33,17 +33,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = toolkit/components/urlformatter/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_urlformatter
 
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/content/tests/Makefile.in
+++ b/toolkit/content/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = toolkit/content/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_toolkit_general
 
 XPCSHELL_TESTS = unit
 
 DIRS = chrome widgets
--- a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
+++ b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
@@ -32,26 +32,16 @@ function convertChromeURI(chromeURI)
 {
   let uri = Cc["@mozilla.org/network/io-service;1"].
     getService(Ci.nsIIOService).newURI(chromeURI, null, null);
   return gChromeReg.convertChromeURL(uri);
 }
 
 function chromeURIToFile(chromeURI)
 {
-  var jar = getJar(chromeURI);
-  if (jar) {
-    var tmpDir = extractJarToTmp(jar);
-    let parts = chromeURI.split('/');
-    if (parts[parts.length - 1] != '') {
-      tmpDir.append(parts[parts.length - 1]);
-    }
-    return tmpDir;
-  }
-
   return convertChromeURI(chromeURI).
     QueryInterface(Ci.nsIFileURL).file;
 }  
 
 // Register a chrome manifest temporarily and return a function which un-does
 // the registrarion when no longer needed.
 function registerManifestTemporarily(manifestURI)
 {
--- a/toolkit/content/tests/chrome/rtlchrome/rtl.manifest
+++ b/toolkit/content/tests/chrome/rtlchrome/rtl.manifest
@@ -1,9 +1,3 @@
-content rtlchrome /content
-
-# Override intl.css with our own CSS file
-override chrome://global/locale/intl.css chrome://rtlchrome/rtl.css
-override chrome://global/locale/global.dtd chrome://rtlchrome/rtl.dtd
-
 # Override intl.css with our own CSS file
 override chrome://global/locale/intl.css chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/rtl.css
 override chrome://global/locale/global.dtd chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/rtl.dtd
--- a/toolkit/content/tests/chrome/test_bug437844.xul
+++ b/toolkit/content/tests/chrome/test_bug437844.xul
@@ -11,18 +11,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   xmlns:html="http://www.w3.org/1999/xhtml"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <title>Test for Bug 437844 and Bug 348233</title>
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" 
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" 
-          src="chrome://mochikit/content/chrome-harness.js"></script>
   <script type="application/javascript"
           src="RegisterUnregisterChrome.js"></script>
 
   <body  xmlns="http://www.w3.org/1999/xhtml">
     <a target="_blank" 
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=437844">
       Mozilla Bug 437844
     </a>
@@ -46,25 +44,21 @@ https://bugzilla.mozilla.org/show_bug.cg
 
       let cleanupFunc = registerManifestTemporarily("chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/rtl.manifest");
 
       // Load about:plugins in an iframe
       let frame = document.createElement("iframe");
       frame.setAttribute("src", "about:plugins");
       frame.addEventListener("load", function () {
           frame.removeEventListener("load", arguments.callee, false);
+
           is(frame.contentDocument.dir, "rtl", "about:plugins should be RTL in RTL locales");
 
-          let gDirSvc    = Components.classes["@mozilla.org/file/directory_service;1"].
-                                      getService(Components.interfaces.nsIDirectoryService).
-                                      QueryInterface(Components.interfaces.nsIProperties);
-          let tmpd = gDirSvc.get("ProfD", Components.interfaces.nsIFile);
-
           frame = document.createElement("iframe");
-          frame.setAttribute("src", "file://" + tmpd.path); // a file:// URI, bug 348233
+          frame.setAttribute("src", convertChromeURI("chrome://mochikit/content/chrome/toolkit/content/tests/chrome/rtlchrome/").spec); // a file:// URI, bug 348233
           frame.addEventListener("load", function () {
               frame.removeEventListener("load", arguments.callee, false);
 
               is(frame.contentDocument.body.dir, "rtl", "file:// listings should be RTL in RTL locales");
 
               cleanupFunc();
               SimpleTest.finish();
             }, false);
--- a/toolkit/content/tests/chrome/test_righttoleft.xul
+++ b/toolkit/content/tests/chrome/test_righttoleft.xul
@@ -8,18 +8,16 @@
         onload="runTest()"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" 
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" 
-          src="chrome://mochikit/content/chrome-harness.js"></script>
-  <script type="application/javascript" 
           src="RegisterUnregisterChrome.js"></script>
 
   <body  xmlns="http://www.w3.org/1999/xhtml">
     <p id="display"></p>
     <div id="content" style="display: none">
     </div>
     <pre id="test">
     </pre>
--- a/toolkit/content/tests/widgets/test_button.xul
+++ b/toolkit/content/tests/widgets/test_button.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for button
   -->
 <window title="Button Test"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" 
           src="/MochiKit/packed.js"></script>
   <script type="application/javascript"
--- a/toolkit/content/tests/widgets/test_deck.xul
+++ b/toolkit/content/tests/widgets/test_deck.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for deck
   -->
 <window title="Deck Test"
         onload="setTimeout(test_deck, 0);"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" 
           src="/MochiKit/packed.js"></script>
--- a/toolkit/content/tests/widgets/test_props.xul
+++ b/toolkit/content/tests/widgets/test_props.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for basic properties - this test checks that the basic
   properties defined in general.xml and inherited by a number of elements
   work properly.
   -->
 <window title="Basic Properties Test"
         onload="setTimeout(test_props, 0);"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
--- a/toolkit/content/tests/widgets/test_richlist_direction.xul
+++ b/toolkit/content/tests/widgets/test_richlist_direction.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for listbox direction
   -->
 <window title="Listbox direction test"
         onload="test_richlistbox()"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript"
           src="/MochiKit/packed.js"></script>
--- a/toolkit/content/tests/widgets/test_statusbar.xul
+++ b/toolkit/content/tests/widgets/test_statusbar.xul
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for statusbar
   -->
 <window title="Statusbar Test"
         onload="setTimeout(test_statusbar, 0);"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" 
           src="/MochiKit/packed.js"></script>
--- a/toolkit/crashreporter/test/Makefile.in
+++ b/toolkit/crashreporter/test/Makefile.in
@@ -91,11 +91,11 @@ ifneq (mobile,$(MOZ_BUILD_APP))
   browser/browser_aboutCrashesResubmit.js \
   $(NULL)
 
 libs::  $(_BROWSER_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)/browser
 endif
 
 libs:: $(SHARED_LIBRARY) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
-	$(NSINSTALL) -D $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/components
-	$(INSTALL) $^ $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/components
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $(srcdir)/testcrasher.manifest > $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/components/testcrasher.manifest
+	$(NSINSTALL) -D $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/components
+	$(INSTALL) $^ $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/components
+	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $(srcdir)/testcrasher.manifest > $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/components/testcrasher.manifest
--- a/toolkit/mozapps/downloads/tests/Makefile.in
+++ b/toolkit/mozapps/downloads/tests/Makefile.in
@@ -36,18 +36,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH          = ../../../..
 topsrcdir      = @top_srcdir@
 srcdir         = @srcdir@
 VPATH          = @srcdir@
-relativesrcdir = toolkit/mozapps/downloads/tests
-
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_downloads
 
 XPCSHELL_TESTS = \
   unit \
   $(NULL)
 
--- a/toolkit/mozapps/downloads/tests/chrome/test_backspace_key_removes.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_backspace_key_removes.xul
@@ -49,17 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
 dmFile.append("dm-ui-test.file");
--- a/toolkit/mozapps/downloads/tests/chrome/test_basic_functionality.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_basic_functionality.xul
@@ -48,17 +48,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
 dmFile.append("dm-ui-test.file");
--- a/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_bug_412360.xul
@@ -49,17 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 let didFail = false;
 var file;
--- a/toolkit/mozapps/downloads/tests/chrome/test_bug_429247.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_bug_429247.xul
@@ -49,18 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
-
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_bug_462172.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_bug_462172.xul
@@ -57,17 +57,17 @@ close window
 <window title="Mozilla Bug 462172"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
   <script type="application/javascript">
   <![CDATA[
 
   /** Test for Bug 462172 **/
 var missingFileElid;
 var realFileElid;
--- a/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_cleanup_search.xul
@@ -49,17 +49,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_clear_button_disabled.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_clear_button_disabled.xul
@@ -51,17 +51,17 @@
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
 
   <![CDATA[
 
 let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 let dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
--- a/toolkit/mozapps/downloads/tests/chrome/test_close_download_manager.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_close_download_manager.xul
@@ -50,17 +50,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
 
   <![CDATA[
 
 const dmui = getDMUI();
 
 function testCloseDMWithEscKey(aWin)
--- a/toolkit/mozapps/downloads/tests/chrome/test_close_on_last_window.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_close_on_last_window.xul
@@ -15,17 +15,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 const DLMGR_UI_DONE = "download-manager-ui-done";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
--- a/toolkit/mozapps/downloads/tests/chrome/test_delete_key_removes.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_delete_key_removes.xul
@@ -54,17 +54,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
 dmFile.append("dm-ui-test.file");
--- a/toolkit/mozapps/downloads/tests/chrome/test_esc_key_closes_clears.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_esc_key_closes_clears.xul
@@ -48,17 +48,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 const DLMGR_UI_DONE = "download-manager-ui-done";
 
 let os = Cc["@mozilla.org/observer-service;1"].
          getService(Ci.nsIObserverService);
--- a/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_multi_select.xul
@@ -49,17 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_multiword_search.xul
@@ -47,17 +47,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_pause_button_state.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_pause_button_state.xul
@@ -47,17 +47,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
 dmFile.append("dm-ui-test.file");
--- a/toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul
@@ -48,17 +48,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   // The private browsing service might not be available
   let pbs = null;
--- a/toolkit/mozapps/downloads/tests/chrome/test_removeDownload_updates_ui.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_removeDownload_updates_ui.xul
@@ -46,17 +46,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var dmFile = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
 dmFile.append("dm-ui-test.file");
--- a/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul
@@ -49,17 +49,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function setPref(aDoTest)
 {
   let prefs = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefBranch);
--- a/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul
@@ -46,17 +46,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_search_keys.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_search_keys.xul
@@ -50,17 +50,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test_meta_k(aWin)
 {
   let doc = aWin.document;
   let searchbox = doc.getElementById("searchbox");
--- a/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_select_all.xul
@@ -48,17 +48,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_space_key_pauses_resumes.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_space_key_pauses_resumes.xul
@@ -49,17 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function bug413985obs(aWin)
 {
   this.mWin = aWin;
   this.wasPaused = false;
--- a/toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_downloadstates.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_downloadstates.xul
@@ -49,17 +49,17 @@
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 const kTaskbarID = "@mozilla.org/windows-taskbar;1";
 const DOWNLOAD_MANAGER_URL = "chrome://mozapps/content/downloads/downloads.xul";
 const DLMGR_UI_DONE = "download-manager-ui-done";
 
--- a/toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_service.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_taskbarprogress_service.xul
@@ -47,17 +47,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 const kTaskbarID = "@mozilla.org/windows-taskbar;1";
 const DOWNLOAD_MANAGER_URL = "chrome://mozapps/content/downloads/downloads.xul";
 const DLMGR_UI_DONE = "download-manager-ui-done";
 
--- a/toolkit/mozapps/downloads/tests/chrome/test_ui_stays_open_on_alert_clickback.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_ui_stays_open_on_alert_clickback.xul
@@ -47,17 +47,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="test();">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 function test()
 {
   var dmui = getDMUI();
   if (!dmui) {
--- a/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul
+++ b/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul
@@ -47,17 +47,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="init()">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
-          src="utils.js"/>
+          src="chrome://mochikit/content/chrome/toolkit/mozapps/downloads/tests/chrome/utils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
 const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
 
 let testIndex = -1;
 let tests = [
--- a/toolkit/mozapps/extensions/test/Makefile.in
+++ b/toolkit/mozapps/extensions/test/Makefile.in
@@ -35,20 +35,19 @@
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 ADDONSRC = $(srcdir)/addons
-relativesrcdir = toolkit/mozapps/extensions/test
-
-TESTROOT = $(CURDIR)/$(DEPTH)/_tests/xpcshell/$(relativesrcdir)
+TESTROOT = $(CURDIR)/$(DEPTH)/_tests/xpcshell/$(MODULE)
 TESTXPI = $(TESTROOT)/xpcshell/addons
+relativesrcdir  = toolkit/mozapps/extensions/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_extensionmanager
 
 ifneq (mobile,$(MOZ_BUILD_APP))
  DIRS +=  \
     xpinstall \
--- a/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_dragdrop.js
@@ -116,31 +116,33 @@ add_test(function() {
                [[{type: "text/x-moz-url", data: url}]],
                "copy", gManagerWindow);
   is(effect, "copy", "Drag should be accepted");
 });
 
 // Simulates dropping a file onto the manager
 add_test(function() {
   var fileurl = get_addon_file_url("browser_dragdrop1.xpi");
+
   new WindowOpenListener(INSTALL_URI, function(aWindow) {
     test_confirmation(aWindow, [fileurl.spec]);
   }, run_next_test);
 
   var viewContainer = gManagerWindow.document.getElementById("view-container");
   var effect = EventUtils.synthesizeDrop(viewContainer, viewContainer,
                [[{type: "application/x-moz-file", data: fileurl.file}]],
                "copy", gManagerWindow);
   is(effect, "copy", "Drag should be accepted");
 });
 
 // Simulates dropping two urls onto the manager
 add_test(function() {
   var url1 = TESTROOT + "addons/browser_dragdrop1.xpi";
   var url2 = TESTROOT2 + "addons/browser_dragdrop2.xpi";
+
   new WindowOpenListener(INSTALL_URI, function(aWindow) {
     test_confirmation(aWindow, [url1, url2]);
   }, run_next_test);
 
   var viewContainer = gManagerWindow.document.getElementById("view-container");
   var effect = EventUtils.synthesizeDrop(viewContainer, viewContainer,
                [[{type: "text/x-moz-url", data: url1}],
                 [{type: "text/x-moz-url", data: url2}]],
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -45,35 +45,20 @@ function run_next_test() {
 
   gTestsRun++;
   info("Running test " + gTestsRun);
 
   gPendingTests.shift()();
 }
 
 function get_addon_file_url(aFilename) {
-  var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-                         .getService(Ci.mozIJSSubScriptLoader);
-  loader.loadSubScript("chrome://mochikit/content/chrome-harness.js");
-
-  var jar = getJar(CHROMEROOT + "addons/" + aFilename);
-
-  if (jar == null) {
-    var cr = Cc["@mozilla.org/chrome/chrome-registry;1"].
-             getService(Ci.nsIChromeRegistry);
-    var fileurl = cr.convertChromeURL(makeURI(CHROMEROOT + "addons/" + aFilename));
-    return fileurl.QueryInterface(Ci.nsIFileURL);
-  } else {
-    var ios = Cc["@mozilla.org/network/io-service;1"].  
-                getService(Ci.nsIIOService);
-
-    var tmpDir = extractJarToTmp(jar);
-    tmpDir.append(aFilename);
-    return ios.newFileURI(tmpDir).QueryInterface(Ci.nsIFileURL);
-  }
+  var cr = Cc["@mozilla.org/chrome/chrome-registry;1"].
+           getService(Ci.nsIChromeRegistry);
+  var fileurl = cr.convertChromeURL(makeURI(CHROMEROOT + "addons/" + aFilename));
+  return fileurl.QueryInterface(Ci.nsIFileURL);
 }
 
 function wait_for_view_load(aManagerWindow, aCallback, aForceWait) {
   if (!aForceWait && !aManagerWindow.gViewController.isLoading) {
     aCallback(aManagerWindow);
     return;
   }
 
--- a/toolkit/mozapps/update/test/Makefile.in
+++ b/toolkit/mozapps/update/test/Makefile.in
@@ -34,29 +34,30 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH     = ../../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir = toolkit/mozapps/update/test
 
 include $(DEPTH)/config/autoconf.mk
 
+MODULE = test_update
+
 DIRS = \
   chrome \
   $(NULL)
 
 XPCSHELL_TESTS = \
   unit \
   $(NULL)
 
-TESTROOT = $(call core_abspath,$(DEPTH))/_tests/xpcshell/$(relativesrcdir)
+TESTROOT = $(call core_abspath,$(DEPTH))/_tests/xpcshell/$(MODULE)
 
 CPPSRCS = \
   TestAUSReadStrings.cpp \
   $(NULL)
 
 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
 
 INI_TEST_FILES = \
--- a/toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, basic, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, basic, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, basic, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, basic, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, basic, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, basic, license, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, billboard, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, billboard, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, billboard, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, billboard, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, billboard, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, add-ons check, billboard, license, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_INCOMPAT_CHECK
--- a/toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: basic, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_FOUND_BASIC,
   buttonClick: "next"
 }, {
--- a/toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: basic, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_FOUND_BASIC,
   buttonClick: "next"
 }, {
--- a/toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, basic, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, basic, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, basic, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, basic, license, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BASIC,
--- a/toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: billboard, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_FOUND_BILLBOARD,
   extraDelayedCheckFunction: checkRemoteContentState,
   expectedRemoteContentState: "loading",
--- a/toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: billboard, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_FOUND_BILLBOARD,
   extraDelayedCheckFunction: checkRemoteContentState,
   expectedRemoteContentState: "loading",
--- a/toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, billboard, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, billboard, license, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, billboard, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: add-ons check, billboard, license, add-ons list, download, and finished"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INCOMPAT_CHECK
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check and error (xml malformed)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_ERRORS,
--- a/toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check and no updates found"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_NO_UPDATES_FOUND,
--- a/toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, billoard, basic, license, and manual update (bug 548061)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check, billoard, basic, license, and manual update (bug 548061)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
 }, {
   pageid: PAGEID_FOUND_BILLBOARD,
--- a/toolkit/mozapps/update/test/chrome/test_0081_error_patchApplyFailure_partial_only.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0081_error_patchApplyFailure_partial_only.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: errors (partial only patch apply failure)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
--- a/toolkit/mozapps/update/test/chrome/test_0082_error_patchApplyFailure_complete_only.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0082_error_patchApplyFailure_complete_only.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: errors (complete only patch apply failure)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
--- a/toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: error patching, download, and finished (partial failed and download complete)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_ERROR_PATCHING,
   buttonClick: "next"
 }, {
--- a/toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: error patching, download, and errors (partial failed and download complete verification failure)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_ERROR_PATCHING,
   buttonClick: "next"
 }, {
--- a/toolkit/mozapps/update/test/chrome/test_0091_installed.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0091_installed.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: installed"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_INSTALLED,
   buttonClick: "finish"
 } ];
--- a/toolkit/mozapps/update/test/chrome/test_0092_finishedBackground.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0092_finishedBackground.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: finished background"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 const TESTS = [ {
   pageid: PAGEID_FINISHED_BKGRD,
   buttonClick: "extra1"
 } ];
--- a/toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check and basic (never button test)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 gPrefToCheck = PREF_APP_UPDATE_NEVER_BRANCH + Services.appinfo.version;
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
--- a/toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
+++ b/toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
@@ -11,17 +11,17 @@
 <window title="Update Wizard pages: update check and billboard (never button test)"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTestDefault();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 gPrefToCheck = PREF_APP_UPDATE_NEVER_BRANCH + Services.appinfo.version;
 
 const TESTS = [ {
   pageid: PAGEID_CHECKING
--- a/toolkit/mozapps/update/test/chrome/test_9999_cleanup.xul
+++ b/toolkit/mozapps/update/test/chrome/test_9999_cleanup.xul
@@ -18,17 +18,17 @@
 <window title="Application Update test cleanup"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTest();">
 <script type="application/javascript" 
         src="chrome://mochikit/content/MochiKit/packed.js"/>
 <script type="application/javascript"
         src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 <script type="application/javascript"
-        src="utils.js"/>
+        src="chrome://mochikit/content/chrome/toolkit/mozapps/update/test/chrome/utils.js"/>
 
 <script type="application/javascript">
 <![CDATA[
 
 /**
  * If the application update tests left behind any of the files it uses it could
  * be a very bad thing. The purpose of this test is to prevent that from
  * happening.
--- a/toolkit/mozapps/update/test_timermanager/Makefile.in
+++ b/toolkit/mozapps/update/test_timermanager/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-relativesrcdir = toolkit/mozapps/update/test_timermanager
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_timermanager
 
 XPCSHELL_TESTS = unit
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/xre/test/test_fpuhandler.html
+++ b/toolkit/xre/test/test_fpuhandler.html
@@ -1,12 +1,12 @@
 <head>
   <title>Floating-point exception handler test</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body onload="runTest()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
   function doDiv(x, y) {
--- a/uriloader/exthandler/tests/Makefile.in
+++ b/uriloader/exthandler/tests/Makefile.in
@@ -35,17 +35,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH           = ../../..
 topsrcdir       = @top_srcdir@
 srcdir          = @srcdir@
 VPATH           = @srcdir@
-relativesrcdir = uriloader/exthandler/tests
 
 DIRS += mochitest \
         $(NULL)
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_uriloader_exthandler
 
@@ -66,9 +65,9 @@ LIBS +=		\
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 export PERSONAL_MAILCAP=$(shell cd $(srcdir) && pwd)/mailcap
 endif
 
 # need the executable for running the xpcshell unit tests
 libs::
-	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(MODULE)/unit
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -34,17 +34,16 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = xpcom/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= xpcom
 
 ifndef MOZ_ENABLE_LIBXUL
 MOZILLA_INTERNAL_API = 1
 endif
@@ -168,17 +167,17 @@ endif
 
 LOCAL_INCLUDES	= \
                 -I$(srcdir)/../ds \
 		-I$(srcdir)/services \
 		$(NULL)
 
 libs::
 	$(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
-	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(MODULE)/unit
 
 # Copy TestHarness.h into its own module, for ease of setting up includes
 # correctly.
 export::
 	$(NSINSTALL) -D $(DIST)/include/testing
 	$(INSTALL) $(srcdir)/TestHarness.h $(DIST)/include/testing
 
 install::