bug 482085 - fix all xpcshell tests to not reference files from the srcdir. r=bsmedberg,waldo
authorTed Mielczarek <ted.mielczarek@gmail.com>
Sat, 21 Mar 2009 11:20:00 -0400
changeset 26446 a17552ca8f97ff788325cbfa17b35aeb0523a907
parent 26445 95596bfe6d7eb5bd8c769652b87d12e927828e54
child 26447 99930ad81298752686082643f01358c474e32dc7
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg, waldo
bugs482085
milestone1.9.2a1pre
bug 482085 - fix all xpcshell tests to not reference files from the srcdir. r=bsmedberg,waldo
browser/components/places/tests/unit/head_bookmarks.js
browser/components/places/tests/unit/test_384370.js
browser/components/places/tests/unit/test_457441-import-export-corrupt-bookmarks-html.js
browser/components/places/tests/unit/test_bookmarks_html.js
browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js
browser/components/privatebrowsing/test/unit/downloads.empty.sqlite
browser/components/privatebrowsing/test/unit/test_privatebrowsing_autostart.js
browser/components/privatebrowsing/test/unit/test_privatebrowsing_exit.js
browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_autostart.js
browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_exit.js
browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain.js
browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain_activeDownloads.js
browser/components/privatebrowsing/test/unit/test_removeDataFromDomain.js
browser/components/privatebrowsing/test/unit/test_removeDataFromDomain_activeDownloads.js
chrome/test/unit/test_bug292789.js
chrome/test/unit/test_bug380398.js
chrome/test/unit/test_bug397073.js
chrome/test/unit/test_bug399707.js
chrome/test/unit/test_bug401153.js
chrome/test/unit/test_data_protocol_registration.js
chrome/test/unit/test_no_remote_registration.js
config/rules.mk
content/base/test/unit/head_utilities.js
content/base/test/unit/test_xmlserializer.js
content/test/unit/head_content.js
content/test/unit/test_range.js
content/xtf/test/unit/test_xtf.js
dom/src/json/test/fail1.json
dom/src/json/test/fail10.json
dom/src/json/test/fail11.json
dom/src/json/test/fail12.json
dom/src/json/test/fail13.json
dom/src/json/test/fail14.json
dom/src/json/test/fail15.json
dom/src/json/test/fail16.json
dom/src/json/test/fail17.json
dom/src/json/test/fail18.json
dom/src/json/test/fail19.json
dom/src/json/test/fail2.json
dom/src/json/test/fail20.json
dom/src/json/test/fail21.json
dom/src/json/test/fail22.json
dom/src/json/test/fail23.json
dom/src/json/test/fail24.json
dom/src/json/test/fail25.json
dom/src/json/test/fail26.json
dom/src/json/test/fail27.json
dom/src/json/test/fail28.json
dom/src/json/test/fail29.json
dom/src/json/test/fail3.json
dom/src/json/test/fail30.json
dom/src/json/test/fail31.json
dom/src/json/test/fail32.json
dom/src/json/test/fail33.json
dom/src/json/test/fail34.json
dom/src/json/test/fail4.json
dom/src/json/test/fail5.json
dom/src/json/test/fail6.json
dom/src/json/test/fail7.json
dom/src/json/test/fail8.json
dom/src/json/test/fail9.json
dom/src/json/test/json2.js
dom/src/json/test/pass1.json
dom/src/json/test/pass3.json
dom/src/json/test/unit/fail1.json
dom/src/json/test/unit/fail10.json
dom/src/json/test/unit/fail11.json
dom/src/json/test/unit/fail12.json
dom/src/json/test/unit/fail13.json
dom/src/json/test/unit/fail14.json
dom/src/json/test/unit/fail15.json
dom/src/json/test/unit/fail16.json
dom/src/json/test/unit/fail17.json
dom/src/json/test/unit/fail18.json
dom/src/json/test/unit/fail19.json
dom/src/json/test/unit/fail2.json
dom/src/json/test/unit/fail20.json
dom/src/json/test/unit/fail21.json
dom/src/json/test/unit/fail22.json
dom/src/json/test/unit/fail23.json
dom/src/json/test/unit/fail24.json
dom/src/json/test/unit/fail25.json
dom/src/json/test/unit/fail26.json
dom/src/json/test/unit/fail27.json
dom/src/json/test/unit/fail28.json
dom/src/json/test/unit/fail29.json
dom/src/json/test/unit/fail3.json
dom/src/json/test/unit/fail30.json
dom/src/json/test/unit/fail31.json
dom/src/json/test/unit/fail32.json
dom/src/json/test/unit/fail33.json
dom/src/json/test/unit/fail34.json
dom/src/json/test/unit/fail4.json
dom/src/json/test/unit/fail5.json
dom/src/json/test/unit/fail6.json
dom/src/json/test/unit/fail7.json
dom/src/json/test/unit/fail8.json
dom/src/json/test/unit/fail9.json
dom/src/json/test/unit/head_json.js
dom/src/json/test/unit/json2.js
dom/src/json/test/unit/pass1.json
dom/src/json/test/unit/pass3.json
dom/src/json/test/unit/test_decode.js
extensions/cookie/test/unit/test_bug468700.js
intl/uconv/tests/unit/test_charset_conversion.js
js/src/config/rules.mk
js/src/xpconnect/tests/unit/test_bogus_files.js
js/src/xpconnect/tests/unit/test_bug408412.js
js/src/xpconnect/tests/unit/test_bug451678.js
js/src/xpconnect/tests/unit/test_import.js
js/src/xpconnect/tests/unit/test_recursive_import.js
modules/libjar/test/unit/data/empty
modules/libjar/test/unit/test_bug278262.js
modules/libjar/test/unit/test_bug333423.js
modules/libjar/test/unit/test_bug336691.js
modules/libjar/test/unit/test_bug370103.js
modules/libjar/test/unit/test_bug379841.js
modules/libjar/zipwriter/test/unit/head_zipwriter.js
modules/libjar/zipwriter/test/unit/test_bug425768.js
modules/libjar/zipwriter/test/unit/test_bug446708.js
modules/libpr0n/test/unit/test_imgtools.js
netwerk/test/Makefile.in
netwerk/test/httpserver/test/head_utils.js
netwerk/test/httpserver/test/test_byte_range.js
netwerk/test/httpserver/test/test_cern_meta.js
netwerk/test/httpserver/test/test_default_index_handler.js
netwerk/test/httpserver/test/test_name_scheme.js
netwerk/test/httpserver/test/test_registerdirectory.js
netwerk/test/httpserver/test/test_registerfile.js
netwerk/test/httpserver/test/test_setindexhandler.js
netwerk/test/httpserver/test/test_sjs.js
netwerk/test/httpserver/test/test_sjs_state.js
netwerk/test/httpserver/test/test_sjs_throwing_exceptions.js
netwerk/test/unit/test_authentication.js
netwerk/test/unit/test_bug203271.js
netwerk/test/unit/test_bug263127.js
netwerk/test/unit/test_bug331825.js
netwerk/test/unit/test_bug369787.js
netwerk/test/unit/test_bug412945.js
netwerk/test/unit/test_bug414122.js
netwerk/test/unit/test_bug455311.js
netwerk/test/unit/test_bug468594.js
netwerk/test/unit/test_bug482601.js
netwerk/test/unit/test_cacheflags.js
netwerk/test/unit/test_content_sniffer.js
netwerk/test/unit/test_cookie_header.js
netwerk/test/unit/test_event_sink.js
netwerk/test/unit/test_gzipped_206.js
netwerk/test/unit/test_httpcancel.js
netwerk/test/unit/test_plaintext_sniff.js
netwerk/test/unit/test_readline.js
netwerk/test/unit/test_redirect_caching.js
netwerk/test/unit/test_reopen.js
netwerk/test/unit/test_resumable_channel.js
netwerk/test/unit/test_resumable_truncate.js
netwerk/test/unit/test_traceable_channel.js
rdf/tests/unit/test_rdfredirect.js
storage/test/unit/head_storage.js
testing/xpcshell/example/location_load.js
testing/xpcshell/example/unit/file.txt
testing/xpcshell/example/unit/load_subscript.js
testing/xpcshell/example/unit/location_load.js
testing/xpcshell/example/unit/subdir/file.txt
testing/xpcshell/example/unit/test_get_file.js
testing/xpcshell/example/unit/test_load.js
testing/xpcshell/example/unit/test_load_httpd_js.js
testing/xpcshell/example/unit/test_location.js
testing/xpcshell/head.js
testing/xpcshell/runxpcshelltests.py
toolkit/components/commandlines/test/Makefile.in
toolkit/components/commandlines/test/unit/unix/test_bug410156.js
toolkit/components/commandlines/test/unit/win/test_bug410156.js
toolkit/components/commandlines/test/unit_unix/test_bug410156.js
toolkit/components/commandlines/test/unit_win/test_bug410156.js
toolkit/components/downloads/test/downloads.empty.sqlite
toolkit/components/downloads/test/schema_migration/head_migration.js
toolkit/components/downloads/test/unit/head_download_manager.js
toolkit/components/passwordmgr/test/unit/head_storage_legacy_1.js
toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_5.js
toolkit/components/places/tests/sync/test_database_sync_onitemadded.js
toolkit/components/places/tests/unit/test_451499.js
toolkit/components/places/tests/unit/test_457698_crash.js
toolkit/components/places/tests/unit/test_crash_476292.js
toolkit/components/places/tests/unit/test_dynamic_containers.js
toolkit/components/places/tests/unit/test_favicons.js
toolkit/components/places/tests/unit/test_history.js
toolkit/components/places/tests/unit/test_history_import.js
toolkit/components/satchel/test/unit/test_bug_329741.js
toolkit/components/satchel/test/unit/test_db_corrupt.js
toolkit/components/satchel/test/unit/test_db_update_v1.js
toolkit/components/satchel/test/unit/test_db_update_v1b.js
toolkit/components/satchel/test/unit/test_db_update_v999a.js
toolkit/components/satchel/test/unit/test_db_update_v999b.js
toolkit/components/satchel/test/unit/test_history_api.js
toolkit/mozapps/extensions/test/Makefile.in
toolkit/mozapps/extensions/test/addons/test_bug257155/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_a_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_a_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_b_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_b_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_c_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_c_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_d_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_d_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_e_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_e_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_f_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_f_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_g_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug299716_g_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug324121_9/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug335238_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug335238_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug394300_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug394300_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug397778/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug425657/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_1/README
toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug436207/install.js
toolkit/mozapps/extensions/test/addons/test_bug463819_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug463819_9/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug257155/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_3/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_4/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_5/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_6/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_7/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_8/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug324121_9/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug335238_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug335238_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_10/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_11/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_12/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_13/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_3/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_4/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_5/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_6/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_7/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_8/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug378216_9/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug394300_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug394300_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug397778/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug425657/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_1/README
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_3/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_4/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_5/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_6/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_7/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_8/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug428341_9/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug436207/install.js
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_1/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_2/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_3/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_4/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_5/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_6/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_7/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_8/install.rdf
toolkit/mozapps/extensions/test/unit/addons/test_bug463819_9/install.rdf
toolkit/mozapps/extensions/test/unit/head_extensionmanager.js
toolkit/mozapps/extensions/test/unit/test_bug299716.js
toolkit/mozapps/extensions/test/unit/test_bug299716_2.js
toolkit/mozapps/extensions/test/unit/test_bug324121.js
toolkit/mozapps/extensions/test/unit/test_bug335238.js
toolkit/mozapps/extensions/test/unit/test_bug356370.js
toolkit/mozapps/extensions/test/unit/test_bug378216.js
toolkit/mozapps/extensions/test/unit/test_bug393285.js
toolkit/mozapps/extensions/test/unit/test_bug394300.js
toolkit/mozapps/extensions/test/unit/test_bug394717.js
toolkit/mozapps/extensions/test/unit/test_bug396129.js
toolkit/mozapps/extensions/test/unit/test_bug404024.js
toolkit/mozapps/extensions/test/unit/test_bug406118.js
toolkit/mozapps/extensions/test/unit/test_bug417606.js
toolkit/mozapps/extensions/test/unit/test_bug421396.js
toolkit/mozapps/extensions/test/unit/test_bug424107.js
toolkit/mozapps/extensions/test/unit/test_bug424262.js
toolkit/mozapps/extensions/test/unit/test_bug428341.js
toolkit/mozapps/extensions/test/unit/test_bug430120.js
toolkit/mozapps/extensions/test/unit/test_bug449027.js
toolkit/mozapps/extensions/test/unit/test_bug455906.js
toolkit/mozapps/extensions/test/unit/test_bug463819.js
toolkit/mozapps/update/test/unit/head_update.js
toolkit/mozapps/update/test/unit/test_0110_general.js
xpcom/tests/unit/test_bug121341.js
xpcom/tests/unit/test_bug333505.js
xpcom/tests/unit/test_mac_bundle.js
--- a/browser/components/places/tests/unit/head_bookmarks.js
+++ b/browser/components/places/tests/unit/head_bookmarks.js
@@ -162,17 +162,17 @@ function check_no_bookmarks() {
   options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
   var result = hs.executeQuery(query, options);
   var root = result.root;
   root.containerOpen = true;
   do_check_eq(root.childCount, 0);
   root.containerOpen = false;
 }
 
-let gTestDir = do_get_file("browser/components/places/tests/unit/");
+let gTestDir = do_get_cwd();
 const FILENAME_BOOKMARKS_HTML = "bookmarks.html";
 let backup_date = new Date().toLocaleFormat("%Y-%m-%d");
 const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json";
 // Number of smart bookmarks we have on the toolbar
 const SMART_BOOKMARKS_ON_TOOLBAR = 1;
 
 /**
  * Creates a bookmarks.html file in the profile folder from a given source file.
--- a/browser/components/places/tests/unit/test_384370.js
+++ b/browser/components/places/tests/unit/test_384370.js
@@ -65,18 +65,18 @@ function run_test() {
   // get places import/export service
   var importer = Cc["@mozilla.org/browser/places/import-export-service;1"].getService(Ci.nsIPlacesImportExportService);
 
   // avoid creating the places smart folder during tests
   Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch).
   setIntPref("browser.places.smartBookmarksVersion", -1);
 
   // file pointer to legacy bookmarks file
-  //var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.large.html");
-  var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");
+  //var bookmarksFileOld = do_get_file("bookmarks.large.html");
+  var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
   // file pointer to a new places-exported json file
   var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile);
   jsonFile.append("bookmarks.exported.json");
 
   // create bookmarks.exported.json
   if (jsonFile.exists())
     jsonFile.remove(false);
   jsonFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600);
--- a/browser/components/places/tests/unit/test_457441-import-export-corrupt-bookmarks-html.js
+++ b/browser/components/places/tests/unit/test_457441-import-export-corrupt-bookmarks-html.js
@@ -66,17 +66,17 @@ const TEST_FAVICON_PAGE_URL = "http://en
 const TEST_FAVICON_DATA_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
 
 // main
 function run_test() {
   // avoid creating the places smart folder during tests
   ps.setIntPref("browser.places.smartBookmarksVersion", -1);
 
   // import bookmarks from corrupt file
-  var corruptBookmarksFile = do_get_file("browser/components/places/tests/unit/bookmarks.corrupt.html");
+  var corruptBookmarksFile = do_get_file("bookmarks.corrupt.html");
   try {
     ies.importHTMLFromFile(corruptBookmarksFile, true);
   } catch(ex) { do_throw("couldn't import corrupt bookmarks file: " + ex); }
 
   // Check that every bookmark is correct
   // Corrupt bookmarks should not have been imported
   database_check();
 
--- a/browser/components/places/tests/unit/test_bookmarks_html.js
+++ b/browser/components/places/tests/unit/test_bookmarks_html.js
@@ -97,17 +97,17 @@ function run_test() {
   // get places import/export service
   var importer = Cc["@mozilla.org/browser/places/import-export-service;1"].getService(Ci.nsIPlacesImportExportService);
 
   // avoid creating the places smart folder during tests
   Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch).
   setIntPref("browser.places.smartBookmarksVersion", -1);
 
   // file pointer to legacy bookmarks file
-  var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html");
+  var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
   // file pointer to a new places-exported bookmarks file
   var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);
   bookmarksFileNew.append("bookmarks.exported.html");
 
   // create bookmarks.exported.html
   if (bookmarksFileNew.exists())
     bookmarksFileNew.remove(false);
   bookmarksFileNew.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600);
--- a/browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js
+++ b/browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js
@@ -111,17 +111,17 @@ let data = [
 
 function do_test()
 {
   // We add this data to the database first, but we cannot instantiate the
   // download manager service, otherwise these downloads will not be placed in
   // the active downloads array.
 
   // Copy the empty downloads database to our profile directory
-  let downloads = do_get_file("toolkit/components/downloads/test/downloads.empty.sqlite");
+  let downloads = do_get_file("downloads.empty.sqlite");
   downloads.copyTo(dirSvc.get("ProfD", Ci.nsIFile), "downloads.sqlite");
 
   // Open the database
   let ss = Cc["@mozilla.org/storage/service;1"].
            getService(Ci.mozIStorageService);
   let file = dirSvc.get("ProfD", Ci.nsIFile);
   file.append("downloads.sqlite");
   let db = ss.openDatabase(file);
rename from toolkit/components/downloads/test/downloads.empty.sqlite
rename to browser/components/privatebrowsing/test/unit/downloads.empty.sqlite
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsing_autostart.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsing_autostart.js
@@ -34,11 +34,11 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // This test checks the browser.privatebrowsing.autostart preference.
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js");
+  load("do_test_privatebrowsing_autostart.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsing_exit.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsing_exit.js
@@ -35,11 +35,11 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 // This test makes sure that the private browsing mode is left at application
 // shutdown.
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js");
+  load("do_test_privatebrowsing_exit.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_autostart.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_autostart.js
@@ -34,11 +34,11 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // This test checks the browser.privatebrowsing.autostart preference.
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js");
+  load("do_test_privatebrowsing_autostart.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_exit.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_exit.js
@@ -35,11 +35,11 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 // This test makes sure that the private browsing mode is left at application
 // shutdown.
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js");
+  load("do_test_privatebrowsing_exit.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain.js
@@ -39,11 +39,11 @@
 
 /**
  * Test added with bug 460086 to test the behavior of the new API that was added
  * to remove all traces of visiting a site.
  */
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js");
+  load("do_test_removeDataFromDomain.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain_activeDownloads.js
+++ b/browser/components/privatebrowsing/test/unit/test_privatebrowsingwrapper_removeDataFromDomain_activeDownloads.js
@@ -39,11 +39,11 @@
 
 /**
  * Test added with bug 460086 to test the behavior of the new API that was added
  * to remove all traces of visiting a site.
  */
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js");
+  load("do_test_removeDataFromDomain_activeDownloads.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_removeDataFromDomain.js
+++ b/browser/components/privatebrowsing/test/unit/test_removeDataFromDomain.js
@@ -39,11 +39,11 @@
 
 /**
  * Test added with bug 460086 to test the behavior of the new API that was added
  * to remove all traces of visiting a site.
  */
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js");
+  load("do_test_removeDataFromDomain.js");
   do_test();
 }
--- a/browser/components/privatebrowsing/test/unit/test_removeDataFromDomain_activeDownloads.js
+++ b/browser/components/privatebrowsing/test/unit/test_removeDataFromDomain_activeDownloads.js
@@ -39,11 +39,11 @@
 
 /**
  * Test added with bug 460086 to test the behavior of the new API that was added
  * to remove all traces of visiting a site.
  */
 
 function run_test() {
   PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
-  do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js");
+  load("do_test_removeDataFromDomain_activeDownloads.js");
   do_test();
 }
--- a/chrome/test/unit/test_bug292789.js
+++ b/chrome/test/unit/test_bug292789.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 
 const MANIFESTS = [
-  do_get_file("chrome/test/unit/data/test_bug292789.manifest")
+  do_get_file("data/test_bug292789.manifest")
 ];
 
 registerManifests(MANIFESTS);
 
 var gIOS;
 var gCR;
 
 function check_accessibility(spec, desired)
--- a/chrome/test/unit/test_bug380398.js
+++ b/chrome/test/unit/test_bug380398.js
@@ -33,17 +33,17 @@
  * 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 *****
  */
 
 
 var MANIFESTS = [
-  do_get_file("chrome/test/unit/data/test_bug380398.manifest")
+  do_get_file("data/test_bug380398.manifest")
 ];
 
 registerManifests(MANIFESTS);
 
 var XULAppInfo = {
   vendor: "Mozilla",
   name: "XPCShell",
   ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
@@ -78,17 +78,17 @@ registrar.registerFactory(XULAPPINFO_CID
                           XULAPPINFO_CONTRACTID, XULAppInfoFactory);
 
 var gIOS = Cc["@mozilla.org/network/io-service;1"]
             .getService(Ci.nsIIOService);
 var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
                  .getService(Ci.nsIChromeRegistry);
 chromeReg.checkForNewChrome();
 
-var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data"));
+var target = gIOS.newFileURI(do_get_file("data"));
 target = target.spec + "test/test.xul";
 
 function test_succeeded_mapping(namespace)
 {
   var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul",
                         null, null);
   try {
     var result = chromeReg.convertChromeURL(uri);
--- a/chrome/test/unit/test_bug397073.js
+++ b/chrome/test/unit/test_bug397073.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 
 var MANIFESTS = [
-  do_get_file("chrome/test/unit/data/test_bug397073.manifest")
+  do_get_file("data/test_bug397073.manifest")
 ];
 
 
 registerManifests(MANIFESTS);
 
 var XULAppInfo = {
   vendor: "Mozilla",
   name: "XPCShell",
@@ -78,17 +78,17 @@ registrar.registerFactory(XULAPPINFO_CID
                           XULAPPINFO_CONTRACTID, XULAppInfoFactory);
 
 var gIOS = Cc["@mozilla.org/network/io-service;1"]
             .getService(Ci.nsIIOService);
 var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
                  .getService(Ci.nsIChromeRegistry);
 chromeReg.checkForNewChrome();
 
-var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data"));
+var target = gIOS.newFileURI(do_get_file("data"));
 target = target.spec + "test/test.xul";
 
 function test_succeeded_mapping(namespace)
 {
   var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul",
                         null, null);
   try {
     var result = chromeReg.convertChromeURL(uri);
--- a/chrome/test/unit/test_bug399707.js
+++ b/chrome/test/unit/test_bug399707.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 
 var MANIFESTS = [
-  do_get_file("chrome/test/unit/data/test_bug399707.manifest")
+  do_get_file("data/test_bug399707.manifest")
 ];
 
 registerManifests(MANIFESTS);
 
 var XULAppInfo = {
   vendor: "Mozilla",
   name: "XPCShell",
   ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
@@ -77,17 +77,17 @@ registrar.registerFactory(XULAPPINFO_CID
                           XULAPPINFO_CONTRACTID, XULAppInfoFactory);
 
 var gIOS = Cc["@mozilla.org/network/io-service;1"]
             .getService(Ci.nsIIOService);
 var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
                  .getService(Ci.nsIChromeRegistry);
 chromeReg.checkForNewChrome();
 
-var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data"));
+var target = gIOS.newFileURI(do_get_file("data"));
 target = target.spec + "test/test.xul";
 
 function test_succeeded_mapping(namespace)
 {
   var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul",
                         null, null);
   try {
     var result = chromeReg.convertChromeURL(uri);
--- a/chrome/test/unit/test_bug401153.js
+++ b/chrome/test/unit/test_bug401153.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 
 var MANIFESTS = [
-  do_get_file("chrome/test/unit/data/test_bug401153.manifest")
+  do_get_file("data/test_bug401153.manifest")
 ];
 
 registerManifests(MANIFESTS);
 
 var XULAppInfo = {
   vendor: "Mozilla",
   name: "XPCShell",
   ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
@@ -101,14 +101,14 @@ function test_succeeded_mapping(namespac
 
 function test_failed_mapping(namespace)
 {
   do_check_false(rph.hasSubstitution(namespace));
 }
 
 function run_test()
 {
-  var data = gIOS.newFileURI(do_get_file("chrome/test/unit/data")).spec;
+  var data = gIOS.newFileURI(do_get_file("data")).spec;
   test_succeeded_mapping("test1", data + "test1/");
   test_succeeded_mapping("test3", "jar:" + data + "test3.jar!/resources/");
   test_failed_mapping("test4");
   test_succeeded_mapping("test5", data + "test5/");
 }
--- a/chrome/test/unit/test_data_protocol_registration.js
+++ b/chrome/test/unit/test_data_protocol_registration.js
@@ -33,17 +33,17 @@
  * 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 ***** */
 
 let manifests = [
-  do_get_file("chrome/test/unit/data/test_data_protocol_registration.manifest"),
+  do_get_file("data/test_data_protocol_registration.manifest"),
 ];
 registerManifests(manifests);
 
 let XULAppInfoFactory = {
   // These two are used when we register all our factories (and unregister)
   CID: XULAPPINFO_CID,
   scheme: "XULAppInfo",
   contractID: XULAPPINFO_CONTRACTID,
--- a/chrome/test/unit/test_no_remote_registration.js
+++ b/chrome/test/unit/test_no_remote_registration.js
@@ -33,17 +33,17 @@
  * 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 ***** */
 
 let manifests = [
-  do_get_file("chrome/test/unit/data/test_no_remote_registration.manifest"),
+  do_get_file("data/test_no_remote_registration.manifest"),
 ];
 registerManifests(manifests);
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 let XULAppInfo = {
   vendor: "Mozilla",
   name: "XPCShell",
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -126,19 +126,25 @@ ifdef ENABLE_TESTS
 ifdef XPCSHELL_TESTS
 ifndef MODULE
 $(error Must define MODULE when defining XPCSHELL_TESTS.)
 endif
 
 testxpcobjdir = $(DEPTH)/_tests/xpcshell
 
 # Test file installation
+ifdef NSINSTALL_BIN
+# nsinstall in moztools can't recursively copy directories, so use nsinstall.py
+TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
+else
+TEST_INSTALLER = $(INSTALL)
+endif
 
 define _INSTALL_TESTS
-$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(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))
 
--- a/content/base/test/unit/head_utilities.js
+++ b/content/base/test/unit/head_utilities.js
@@ -31,26 +31,25 @@
  * 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 ***** */
 
-const gBasePath = "content/base/test/unit/";
 const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
 const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
 
 function loadContentFile(aFile, aCharset) {
     //if(aAsIso == undefined) aAsIso = false;
     if(aCharset == undefined)
         aCharset = 'UTF-8';
 
-    var file = do_get_file(gBasePath+aFile);
+    var file = do_get_file(aFile);
     var ios = Components.classes['@mozilla.org/network/io-service;1']
             .getService(Components.interfaces.nsIIOService);
     var chann = ios.newChannelFromURI ( ios.newFileURI (file) );
     chann.contentCharset = aCharset;
 
     /*var inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
                         .createInstance(Components.interfaces.nsIScriptableInputStream);
     inputStream.init(chann.open());
--- a/content/base/test/unit/test_xmlserializer.js
+++ b/content/base/test/unit/test_xmlserializer.js
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 function xmlEncode(aFile, aFlags, aCharset) {
     if(aFlags == undefined) aFlags = 0;
     if(aCharset == undefined) aCharset = "UTF-8";
 
-    var doc = do_parse_document(gBasePath+aFile, "text/xml");
+    var doc = do_parse_document(aFile, "text/xml");
 
     var encoder = Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/xml"]
                    .createInstance(nsIDocumentEncoder);
     encoder.setCharset(aCharset);
     encoder.init(doc, "text/xml", aFlags);
     return encoder.encodeToString();
 }
 
--- a/content/test/unit/head_content.js
+++ b/content/test/unit/head_content.js
@@ -61,17 +61,17 @@ function DOMParser() {
   return C["@mozilla.org/xmlextras/domparser;1"].createInstance(nsIDOMParser);
 }
 
 var __testsDirectory = null;
 
 function ParseFile(file) {
   if (typeof(file) == "string") {
     if (!__testsDirectory) {
-      __testsDirectory = do_get_file("content/test/unit/");
+      __testsDirectory = do_get_cwd();
     }
     var fileObj = __testsDirectory.clone();
     fileObj.append(file);
     file = fileObj;
   }
 
   do_check_eq(file instanceof nsILocalFile, true);
 
--- a/content/test/unit/test_range.js
+++ b/content/test/unit/test_range.js
@@ -252,17 +252,17 @@ function getParsedDocument(aPath) {
 
   return doc;
 }
 
 /**
  * Run the extraction tests.
  */
 function run_extract_test() {
-  var filePath = "/content/test/unit/test_delete_range.xml";
+  var filePath = "test_delete_range.xml";
   var doc = getParsedDocument(filePath);
   var tests = doc.getElementsByTagName("test");
 
   // Run our deletion, extraction tests.
   for (i = 0; i < tests.length; i++) {
     dump("Configuring for test " + i + "\n");
     var currentTest = tests.item(i);
 
@@ -404,17 +404,17 @@ function run_extract_test() {
     do_check_true(compareFrag.isEqualNode(baseFrag));
   }
 }
 
 /**
  * Miscellaneous tests not covered above.
  */
 function run_miscellaneous_tests() {
-  var filePath = "/content/test/unit/test_delete_range.xml";
+  var filePath = "test_delete_range.xml";
   var doc = getParsedDocument(filePath);
   var tests = doc.getElementsByTagName("test");
 
   // Let's try some invalid inputs to our DOM range and see what happens.
   var currentTest = tests.item(0);
   baseSource = currentTest.firstChild;
   baseResult = baseSource.nextSibling;
   baseExtract = baseResult.nextSibling;
--- a/content/xtf/test/unit/test_xtf.js
+++ b/content/xtf/test/unit/test_xtf.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function run_test() {
   const C_i = Components.interfaces;
   const nsIXTFElementFactory = C_i.nsIXTFElementFactory;
   const nsIXTFPrivate        = C_i.nsIXTFPrivate;
   const nsIDOMParser         = C_i.nsIDOMParser;
   const nsIDOMEventTarget    = C_i.nsIDOMEventTarget;
-  do_load_module("/content/xtf/test/unit/xtfComponent.js");
+  do_load_module("xtfComponent.js");
   const xtfClass = "@mozilla.org/xtf/element-factory;1?namespace=";
 
   do_check_true(xtfClass + "xtf-tests;foo" in Components.classes);
   var fooFactory = Components.classes[xtfClass + "xtf-tests;foo"]
                              .getService(nsIXTFElementFactory);
   do_check_true(Boolean(fooFactory));
 
   var xmlSource = "<bar xmlns='xtf-tests;foo'/>";
rename from dom/src/json/test/fail1.json
rename to dom/src/json/test/unit/fail1.json
rename from dom/src/json/test/fail10.json
rename to dom/src/json/test/unit/fail10.json
rename from dom/src/json/test/fail11.json
rename to dom/src/json/test/unit/fail11.json
rename from dom/src/json/test/fail12.json
rename to dom/src/json/test/unit/fail12.json
rename from dom/src/json/test/fail13.json
rename to dom/src/json/test/unit/fail13.json
rename from dom/src/json/test/fail14.json
rename to dom/src/json/test/unit/fail14.json
rename from dom/src/json/test/fail15.json
rename to dom/src/json/test/unit/fail15.json
rename from dom/src/json/test/fail16.json
rename to dom/src/json/test/unit/fail16.json
rename from dom/src/json/test/fail17.json
rename to dom/src/json/test/unit/fail17.json
rename from dom/src/json/test/fail18.json
rename to dom/src/json/test/unit/fail18.json
rename from dom/src/json/test/fail19.json
rename to dom/src/json/test/unit/fail19.json
rename from dom/src/json/test/fail2.json
rename to dom/src/json/test/unit/fail2.json
rename from dom/src/json/test/fail20.json
rename to dom/src/json/test/unit/fail20.json
rename from dom/src/json/test/fail21.json
rename to dom/src/json/test/unit/fail21.json
rename from dom/src/json/test/fail22.json
rename to dom/src/json/test/unit/fail22.json
rename from dom/src/json/test/fail23.json
rename to dom/src/json/test/unit/fail23.json
rename from dom/src/json/test/fail24.json
rename to dom/src/json/test/unit/fail24.json
rename from dom/src/json/test/fail25.json
rename to dom/src/json/test/unit/fail25.json
rename from dom/src/json/test/fail26.json
rename to dom/src/json/test/unit/fail26.json
rename from dom/src/json/test/fail27.json
rename to dom/src/json/test/unit/fail27.json
rename from dom/src/json/test/fail28.json
rename to dom/src/json/test/unit/fail28.json
rename from dom/src/json/test/fail29.json
rename to dom/src/json/test/unit/fail29.json
rename from dom/src/json/test/fail3.json
rename to dom/src/json/test/unit/fail3.json
rename from dom/src/json/test/fail30.json
rename to dom/src/json/test/unit/fail30.json
rename from dom/src/json/test/fail31.json
rename to dom/src/json/test/unit/fail31.json
rename from dom/src/json/test/fail32.json
rename to dom/src/json/test/unit/fail32.json
rename from dom/src/json/test/fail33.json
rename to dom/src/json/test/unit/fail33.json
rename from dom/src/json/test/fail34.json
rename to dom/src/json/test/unit/fail34.json
rename from dom/src/json/test/fail4.json
rename to dom/src/json/test/unit/fail4.json
rename from dom/src/json/test/fail5.json
rename to dom/src/json/test/unit/fail5.json
rename from dom/src/json/test/fail6.json
rename to dom/src/json/test/unit/fail6.json
rename from dom/src/json/test/fail7.json
rename to dom/src/json/test/unit/fail7.json
rename from dom/src/json/test/fail8.json
rename to dom/src/json/test/unit/fail8.json
rename from dom/src/json/test/fail9.json
rename to dom/src/json/test/unit/fail9.json
--- a/dom/src/json/test/unit/head_json.js
+++ b/dom/src/json/test/unit/head_json.js
@@ -11,9 +11,9 @@ outputDir.initWithFile(workingDir);
 outputDir.append(outputName);
 
 if (!outputDir.exists()) {
   outputDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777);
 } else if (!outputDir.isDirectory()) {
   do_throw(outputName + " is not a directory?")
 }
 var crockfordJSON = null;
-do_import_script("dom/src/json/test/json2.js");
\ No newline at end of file
+load("json2.js");
rename from dom/src/json/test/json2.js
rename to dom/src/json/test/unit/json2.js
rename from dom/src/json/test/pass1.json
rename to dom/src/json/test/unit/pass1.json
rename from dom/src/json/test/pass3.json
rename to dom/src/json/test/unit/pass3.json
--- a/dom/src/json/test/unit/test_decode.js
+++ b/dom/src/json/test/unit/test_decode.js
@@ -91,21 +91,21 @@ function test_files() {
       istream.init(f, -1, -1, false);
       var x = nativeJSON.decodeFromStream(istream, istream.available());
     } finally {
       istream.close();
     }
     return x;
   }
 
-  var x = read_file("/dom/src/json/test/pass3.json");
+  var x = read_file("pass3.json");
   do_check_eq(x["JSON Test Pattern pass3"]["The outermost value"], "must be an object or array.");
   do_check_eq(x["JSON Test Pattern pass3"]["In this test"], "It is an object.");
 
-  x = read_file("/dom/src/json/test/pass1.json");
+  x = read_file("pass1.json");
   do_check_eq(x[0], "JSON Test Pattern pass1");
   do_check_eq(x[1]["object with 1 member"][0], "array with 1 element");
   do_check_eq(x[2].constructor, Object);
   do_check_eq(x[3].constructor, Array);
   do_check_eq(x[4], -42);
   do_check_eq(x[5], true);
   do_check_eq(x[6], false);
   do_check_eq(x[7], null);
@@ -158,17 +158,17 @@ function test_files() {
   //
   // We allow some minor JSON infractions, like trailing commas
   // Those are special-cased below, leaving the original sequence
   // of failure's from Crockford intact.
   //
   // Section 4 of RFC 4627 allows this tolerance.
   //
   for (var i = 1; i <= 34; ++i) {
-    var path = "/dom/src/json/test/fail" + i + ".json";
+    var path = "fail" + i + ".json";
     try {
       dump(path +"\n");
       x = read_file(path);
       if (i == 4) {
         // ["extra comma",]
         do_check_eq(x[0], "extra comma");
         do_check_eq(x.length, 1);
       } else if (i == 9) {
--- a/extensions/cookie/test/unit/test_bug468700.js
+++ b/extensions/cookie/test/unit/test_bug468700.js
@@ -1,13 +1,13 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 function run_test() {
-  do_load_module("/extensions/cookie/test/unit/cookieprompt.js");
+  do_load_module("cookieprompt.js");
 
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
   var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
   var pb = null;
   try {
     pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
--- a/intl/uconv/tests/unit/test_charset_conversion.js
+++ b/intl/uconv/tests/unit/test_charset_conversion.js
@@ -26,17 +26,17 @@ function run_test()
                                "init");
   _SS = Components.Constructor("@mozilla.org/storagestream;1",
                                "nsIStorageStream",
                                "init");
   CIS = Components.Constructor("@mozilla.org/intl/converter-input-stream;1",
                                "nsIConverterInputStream",
                                "init");
 
-  dataDir = do_get_file("intl/uconv/tests/unit/data/");
+  dataDir = do_get_file("data/");
 
   test_utf8_1();
   test_utf16_1();
   test_utf16_2();
   test_utf16_3();
   test_cross_conversion();
 }
 
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -126,19 +126,25 @@ ifdef ENABLE_TESTS
 ifdef XPCSHELL_TESTS
 ifndef MODULE
 $(error Must define MODULE when defining XPCSHELL_TESTS.)
 endif
 
 testxpcobjdir = $(DEPTH)/_tests/xpcshell
 
 # Test file installation
+ifdef NSINSTALL_BIN
+# nsinstall in moztools can't recursively copy directories, so use nsinstall.py
+TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
+else
+TEST_INSTALLER = $(INSTALL)
+endif
 
 define _INSTALL_TESTS
-$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(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))
 
--- a/js/src/xpconnect/tests/unit/test_bogus_files.js
+++ b/js/src/xpconnect/tests/unit/test_bogus_files.js
@@ -53,17 +53,17 @@ function test_BrokenFile(path, shouldThr
 
 function run_test() {
   const C_i = Components.interfaces;
   const ioService = Components.classes["@mozilla.org/network/io-service;1"]
                               .getService(C_i.nsIIOService);
   const resProt = ioService.getProtocolHandler("resource")
                            .QueryInterface(C_i.nsIResProtocolHandler);
 
-  var curdir = do_get_file("js/src/xpconnect/tests/unit");
+  var curdir = do_get_cwd();
   var curURI = ioService.newFileURI(curdir);
   resProt.setSubstitution("test", curURI);
 
   test_BrokenFile("resource://test/bogus_exports_type.jsm", true, "Error");
 
   test_BrokenFile("resource://test/bogus_element_type.jsm", true, "Error");
 
   test_BrokenFile("resource://test/non_existing.jsm",
--- a/js/src/xpconnect/tests/unit/test_bug408412.js
+++ b/js/src/xpconnect/tests/unit/test_bug408412.js
@@ -32,17 +32,17 @@
  * 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 ***** */
  
 function run_test() {
-  var file = do_get_file("js/src/xpconnect/tests/unit/syntax_error.jsm");
+  var file = do_get_file("syntax_error.jsm");
   var ios = Components.classes["@mozilla.org/network/io-service;1"]
                       .getService(Components.interfaces.nsIIOService);
   var uri = ios.newFileURI(file);
 
   try {
     Components.utils.import(uri.spec);
     do_throw("Failed to report any error at all");
   } catch (e) {
--- a/js/src/xpconnect/tests/unit/test_bug451678.js
+++ b/js/src/xpconnect/tests/unit/test_bug451678.js
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 function run_test() {
-  var file = do_get_file("js/src/xpconnect/tests/unit/bug451678_subscript.js");
+  var file = do_get_file("bug451678_subscript.js");
   var ios = Cc["@mozilla.org/network/io-service;1"]
               .getService(Ci.nsIIOService);
   var uri = ios.newFileURI(file);
   var scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
                        .getService(Ci.mozIJSSubScriptLoader);
   var srvScope = {};
   scriptLoader.loadSubScript(uri.spec, srvScope);
   do_check_true('makeTags' in srvScope && srvScope.makeTags instanceof Function);
--- a/js/src/xpconnect/tests/unit/test_import.js
+++ b/js/src/xpconnect/tests/unit/test_import.js
@@ -87,17 +87,17 @@ function run_test() {
       Components.utils.import("resource://gre/modules/XPCOMUtils.jsm", "wrong");
   } catch (ex) {
       print("exception (expected): " + ex);
       didThrow = true;
   }
   do_check_true(didThrow);
  
   // try to create a component
-  do_load_module("/js/src/xpconnect/tests/unit/component_import.js");
+  do_load_module("component_import.js");
   const contractID = "@mozilla.org/tests/module-importer;";
   do_check_true((contractID + "1") in Components.classes);
   var foo = Components.classes[contractID + "1"]
                       .createInstance(Components.interfaces.nsIClassInfo);
   do_check_true(Boolean(foo));
   do_check_true(foo.contractID == contractID + "1");
   // XXX the following check succeeds only if the test component wasn't
   //     already registered. Need to figure out a way to force registration
--- a/js/src/xpconnect/tests/unit/test_recursive_import.js
+++ b/js/src/xpconnect/tests/unit/test_recursive_import.js
@@ -39,17 +39,17 @@
  
 function run_test() {
   const Ci = Components.interfaces; 
   const ioService = Components.classes["@mozilla.org/network/io-service;1"]
                               .getService(Ci.nsIIOService);
   const resProt = ioService.getProtocolHandler("resource")
                            .QueryInterface(Ci.nsIResProtocolHandler);
 
-  var curdir = do_get_file("js/src/xpconnect/tests/unit");
+  var curdir = do_get_cwd();
   var curURI = ioService.newFileURI(curdir);
   resProt.setSubstitution("test", curURI);
 
   var scope = {};
   Components.utils.import("resource://test/recursive_importA.jsm", scope);
 
   // A imported correctly
   do_check_true(scope.foo() == "foo");
new file mode 100644
--- a/modules/libjar/test/unit/test_bug278262.js
+++ b/modules/libjar/test/unit/test_bug278262.js
@@ -1,13 +1,13 @@
 // Regression test for bug 278262 - JAR URIs should resolve relative URIs in the base section.
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
-const path = "modules/libjar/test/unit/data/test_bug333423.zip";
+const path = "data/test_bug333423.zip";
 
 function test_relative_sub() {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
 
   var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/";
   var base = ios.newURI(spec, null, null);
   var uri = ios.newURI("../modules/libjar", null, base);
@@ -18,17 +18,17 @@ function test_relative_sub() {
   
   do_check_eq(uri.spec, expected);
 }
 
 function test_relative_base() {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
 
-  var base = ios.newFileURI(do_get_file("netwerk/Makefile.in"));
+  var base = ios.newFileURI(do_get_file("data/empty"));
   var uri = ios.newURI("jar:../" + path + "!/", null, base);
 
   // This is the URI we expect to see.
   var expected = "jar:" + ios.newFileURI(do_get_file(path)).spec +
     "!/";
 
   do_check_eq(uri.spec, expected);
 }
--- a/modules/libjar/test/unit/test_bug333423.js
+++ b/modules/libjar/test/unit/test_bug333423.js
@@ -39,17 +39,17 @@
 
 // Regression test for bug 333423 - crash enumerating entries of a 
 // closed nsIZipReader
 function run_test() {
   const Cc = Components.classes;
   const Ci = Components.interfaces;
 
   // the build script have created the zip we can test on in the current dir.
-  var file = do_get_file("modules/libjar/test/unit/data/test_bug333423.zip");
+  var file = do_get_file("data/test_bug333423.zip");
 
   var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
                   createInstance(Ci.nsIZipReader);
   zipreader.open(file);
   zipreader.close();
   var entries = zipreader.findEntries('*.*');
   do_check_true(!entries.hasMore()); // this shouldn't crash
 }
--- a/modules/libjar/test/unit/test_bug336691.js
+++ b/modules/libjar/test/unit/test_bug336691.js
@@ -1,12 +1,12 @@
 // Regression test for bug 336691 - nsZipArchive::Test shouldn't try to ExtractFile on directories.
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 function run_test() {
-  var file = do_get_file("modules/libjar/test/unit/data/test_bug336691.zip");
+  var file = do_get_file("data/test_bug336691.zip");
   var zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
                   createInstance(Ci.nsIZipReader);
   zipReader.open(file);
   zipReader.test(null); // We shouldn't crash here.
   zipReader.close();
 }
--- a/modules/libjar/test/unit/test_bug370103.js
+++ b/modules/libjar/test/unit/test_bug370103.js
@@ -2,17 +2,17 @@ var Cc = Components.classes;
 var Ci = Components.interfaces;
 
 // Regression test for bug 370103 - crash when passing a null listener to
 // nsIChannel.asyncOpen
 function run_test() {
   // Compose the jar: url
   var ioService = Cc["@mozilla.org/network/io-service;1"].
                     getService(Ci.nsIIOService);
-  var file = do_get_file("modules/libjar/test/unit/data/test_bug370103.jar");  
+  var file = do_get_file("data/test_bug370103.jar");
   var url = ioService.newFileURI(file).spec;
   url = "jar:" + url + "!/test_bug370103";
 
   // Try opening channel with null listener
   var channel = ioService.newChannel(url, null, null);
 
   var exception = false;
   try {
--- a/modules/libjar/test/unit/test_bug379841.js
+++ b/modules/libjar/test/unit/test_bug379841.js
@@ -1,13 +1,13 @@
 // Regression test for bug 379841 - nsIZipReader's last modified time ignores seconds
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
-const path = "modules/libjar/test/unit/data/test_bug379841.zip";
+const path = "data/test_bug379841.zip";
 // Retrieved time should be within 2 seconds of original file's time.
 const MAX_TIME_DIFF = 2000000;
 
 var ENTRY_NAME = "test";
 // Actual time of file was 07 May 2007 14:35:49
 var ENTRY_TIME = new Date(2007, 4, 7, 14, 35, 49, 0);
 
 function run_test() {
--- a/modules/libjar/zipwriter/test/unit/head_zipwriter.js
+++ b/modules/libjar/zipwriter/test/unit/head_zipwriter.js
@@ -56,17 +56,17 @@ const ZIP_CDS_HEADER_SIZE = 46;
 const ZIP_METHOD_STORE = 0
 const ZIP_METHOD_DEFLATE = 8
 
 const PR_USEC_PER_MSEC = 1000;
 
 // ZIP times are stored at a 2 second resolution.
 const TIME_RESOLUTION = 2000;
 
-const DATA_DIR = "modules/libjar/zipwriter/test/unit/data/";
+const DATA_DIR = "data/";
 
 var ZipWriter = Components.Constructor("@mozilla.org/zipwriter;1",
                                        "nsIZipWriter");
 var ZipReader = Components.Constructor("@mozilla.org/libjar/zip-reader;1",
                                        "nsIZipReader", "open");
 
 var dirSvc = Cc["@mozilla.org/file/directory_service;1"]
               .getService(Ci.nsIProperties);
--- a/modules/libjar/zipwriter/test/unit/test_bug425768.js
+++ b/modules/libjar/zipwriter/test/unit/test_bug425768.js
@@ -37,17 +37,17 @@
  */
 
 const DIRNAME = "test/";
 const time = Date.now();
 
 function run_test()
 {
   // Copy in the test file.
-  var source = do_get_file("modules/libjar/zipwriter/test/unit/data/test.zip");
+  var source = do_get_file("data/test.zip");
   source.copyTo(tmpFile.parent, tmpFile.leafName);
 
   // Open it and add something so the CDS is rewritten.
   zipW.open(tmpFile, PR_RDWR | PR_APPEND);
   zipW.addEntryDirectory(DIRNAME, time * PR_USEC_PER_MSEC, false);
   do_check_true(zipW.hasEntry(DIRNAME));
   zipW.close();
 
--- a/modules/libjar/zipwriter/test/unit/test_bug446708.js
+++ b/modules/libjar/zipwriter/test/unit/test_bug446708.js
@@ -1,10 +1,10 @@
 function run_test() {
-  var testBundle = do_get_file("modules/libjar/zipwriter/test/unit/data/test_bug446708");
+  var testBundle = do_get_file("data/test_bug446708");
 
   RecursivelyZipDirectory(testBundle);
 }
 
 // Add |file| to the zip. |path| is the current path for the file.
 function AddToZip(zipWriter, path, file)
 {
   var currentPath = path + file.leafName;
--- a/modules/libpr0n/test/unit/test_imgtools.js
+++ b/modules/libpr0n/test/unit/test_imgtools.js
@@ -1,13 +1,12 @@
 /*
  * Tests for imgITools
  */
 
-const TESTDIR = "modules/libpr0n/test/unit/";
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 
 
 /*
  * dumpToFile()
  *
  * For test development, dumps the specified array to a file.
@@ -140,17 +139,17 @@ var isWindows = ("@mozilla.org/windows-r
 
 /* ========== 1 ========== */
 testnum++;
 testdesc = "test decoding a PNG";
 
 // 64x64 png, 10698 bytes.
 var imgName = "image1.png";
 var inMimeType = "image/png";
-var imgFile = do_get_file(TESTDIR + imgName);
+var imgFile = do_get_file(imgName);
 
 var istream = getFileInputStream(imgFile);
 do_check_eq(istream.available(), 10698);
 
 var outParam = { value: null };
 imgTools.decodeImageData(istream, inMimeType, outParam);
 var container = outParam.value;
 
@@ -165,17 +164,17 @@ testnum++;
 testdesc = "test encoding a scaled JPEG";
 
 // we'll reuse the container from the previous test
 istream = imgTools.encodeScaledImage(container, "image/jpeg", 16, 16);
 
 var encodedBytes = streamToArray(istream);
 // Get bytes for exected result
 var refName = "image1png16x16.jpg";
-var refFile = do_get_file(TESTDIR + refName);
+var refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 1081);
 var referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 
 
@@ -184,33 +183,33 @@ testnum++;
 testdesc = "test encoding an unscaled JPEG";
 
 // we'll reuse the container from the previous test
 istream = imgTools.encodeImage(container, "image/jpeg");
 encodedBytes = streamToArray(istream);
 
 // Get bytes for exected result
 refName = "image1png64x64.jpg";
-refFile = do_get_file(TESTDIR + refName);
+refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 4493);
 referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 
 
 /* ========== 4 ========== */
 testnum++;
 testdesc = "test decoding a JPEG";
 
 // 32x32 jpeg, 3494 bytes.
 imgName = "image2.jpg";
 inMimeType = "image/jpeg";
-imgFile = do_get_file(TESTDIR + imgName);
+imgFile = do_get_file(imgName);
 
 istream = getFileInputStream(imgFile);
 do_check_eq(istream.available(), 3494);
 
 outParam = {};
 imgTools.decodeImageData(istream, inMimeType, outParam);
 container = outParam.value;
 
@@ -226,17 +225,17 @@ testdesc = "test encoding a scaled PNG";
 
 if (!isWindows) {
 // we'll reuse the container from the previous test
 istream = imgTools.encodeScaledImage(container, "image/png", 16, 16);
 
 encodedBytes = streamToArray(istream);
 // Get bytes for exected result
 refName = isWindows ? "image2jpg16x16-win.png" : "image2jpg16x16.png";
-refFile = do_get_file(TESTDIR + refName);
+refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 948);
 referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 }
 
@@ -247,34 +246,34 @@ testdesc = "test encoding an unscaled PN
 
 if (!isWindows) {
 // we'll reuse the container from the previous test
 istream = imgTools.encodeImage(container, "image/png");
 encodedBytes = streamToArray(istream);
 
 // Get bytes for exected result
 refName = isWindows ? "image2jpg32x32-win.png" : "image2jpg32x32.png";
-refFile = do_get_file(TESTDIR + refName);
+refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 3105);
 referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 }
 
 
 /* ========== 7 ========== */
 testnum++;
 testdesc = "test decoding a ICO";
 
 // 16x16 ico, 1406 bytes.
 imgName = "image3.ico";
 inMimeType = "image/x-icon";
-imgFile = do_get_file(TESTDIR + imgName);
+imgFile = do_get_file(imgName);
 
 istream = getFileInputStream(imgFile);
 do_check_eq(istream.available(), 1406);
 
 outParam = { value: null };
 imgTools.decodeImageData(istream, inMimeType, outParam);
 container = outParam.value;
 
@@ -289,17 +288,17 @@ testnum++;
 testdesc = "test encoding a scaled PNG"; // note that we're scaling UP
 
 // we'll reuse the container from the previous test
 istream = imgTools.encodeScaledImage(container, "image/png", 32, 32);
 encodedBytes = streamToArray(istream);
 
 // Get bytes for exected result
 refName = "image3ico32x32.png";
-refFile = do_get_file(TESTDIR + refName);
+refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 2281);
 referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 
 
@@ -308,17 +307,17 @@ testnum++;
 testdesc = "test encoding an unscaled PNG";
 
 // we'll reuse the container from the previous test
 istream = imgTools.encodeImage(container, "image/png");
 encodedBytes = streamToArray(istream);
 
 // Get bytes for exected result
 refName = "image3ico16x16.png";
-refFile = do_get_file(TESTDIR + refName);
+refFile = do_get_file(refName);
 istream = getFileInputStream(refFile);
 do_check_eq(istream.available(), 330);
 referenceBytes = streamToArray(istream);
 
 // compare the encoder's output to the reference file.
 compareArrays(encodedBytes, referenceBytes);
 
 
@@ -336,21 +335,21 @@ var testData =
      {preImage: "image1.png",
       preImageMimeType: "image/png",
       refImage: "image1png64x64.jpg",
       refImageMimeType: "image/jpeg"}];
 
 for(var i=0; i<testData.length; ++i) {
     var dict = testData[i];
 
-    var imgFile = do_get_file(TESTDIR + dict["refImage"]);
+    var imgFile = do_get_file(dict["refImage"]);
     var istream = getFileInputStream(imgFile);
     var refBytes = streamToArray(istream);
 
-    imgFile = do_get_file(TESTDIR + dict["preImage"]);
+    imgFile = do_get_file(dict["preImage"]);
     istream = getFileInputStream(imgFile);
 
     var outParam = { value: null };
     imgTools.decodeImageData(istream, dict["preImageMimeType"], outParam);
     var container = outParam.value;
 
     istream = imgTools.encodeImage(container, dict["refImageMimeType"]);
 
@@ -374,17 +373,17 @@ for(var i=0; i<testData.length; ++i) {
 
 
 /* ========== bug 413512  ========== */
 testnum = 413512;
 testdesc = "test decoding bad favicon (bug 413512)";
 
 imgName = "bug413512.ico";
 inMimeType = "image/x-icon";
-imgFile = do_get_file(TESTDIR + imgName);
+imgFile = do_get_file(imgName);
 
 istream = getFileInputStream(imgFile);
 do_check_eq(istream.available(), 17759);
 
 // You'd think the decoder would fail, but it doesn't. The decoders use
 // stream->ReadSegments with a callback, and buffered streams ignore errors
 // from the callback. :-( See bug 413595.
 outParam = { value: null };
--- a/netwerk/test/Makefile.in
+++ b/netwerk/test/Makefile.in
@@ -108,8 +108,15 @@ check::
 
 _RES_FILES 	= urlparse.dat \
 		  urlparse_unx.dat \
 		  $(NULL)
 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/$(MODULE)/unit/data
+	$(INSTALL) $(topsrcdir)/netwerk/dns/src/effective_tld_names.dat \
+          $(DEPTH)/_tests/xpcshell/$(MODULE)/unit/
--- a/netwerk/test/httpserver/test/head_utils.js
+++ b/netwerk/test/httpserver/test/head_utils.js
@@ -31,17 +31,17 @@
  * 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 ***** */
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 // if these tests fail, we'll want the debug output
 DEBUG = true;
 
 
 /**
  * Constructs a new nsHttpServer instance.  This function is intended to
  * encapsulate construction of a server so that at some point in the future it
--- a/netwerk/test/httpserver/test/test_byte_range.js
+++ b/netwerk/test/httpserver/test/test_byte_range.js
@@ -67,17 +67,17 @@ var tests =
             null, start_byterange12, stop_byterange12),
    new Test(PREFIX + "/range.txt",
             null, start_normal, stop_normal)
    ];
 
 function run_test()
 {
   var srv = createServer();
-  var dir = do_get_file("netwerk/test/httpserver/test/data/ranges/");
+  var dir = do_get_file("data/ranges/");
   srv.registerDirectory("/", dir);
 
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); });
 }
 
 function start_normal(ch, cx)
--- a/netwerk/test/httpserver/test/test_cern_meta.js
+++ b/netwerk/test/httpserver/test/test_cern_meta.js
@@ -53,17 +53,17 @@ var tests =
    new Test(PREFIX + "/caret_test.txt^",
             null, start_caret_test_txt_, null)
   ];
 
 function run_test()
 {
   var srv = createServer();
 
-  var cernDir = do_get_file("netwerk/test/httpserver/test/data/cern_meta/");
+  var cernDir = do_get_file("data/cern_meta/");
   srv.registerDirectory("/", cernDir);
 
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); });
 }
 
 
--- a/netwerk/test/httpserver/test/test_default_index_handler.js
+++ b/netwerk/test/httpserver/test/test_default_index_handler.js
@@ -44,17 +44,17 @@ var srv, dir, dirEntries;
 
 function run_test()
 {
   createTestDirectory();
 
   srv = createServer();
   srv.registerDirectory("/", dir);
 
-  var nameDir = do_get_file("netwerk/test/httpserver/test/data/name-scheme/");
+  var nameDir = do_get_file("data/name-scheme/");
   srv.registerDirectory("/bar/", nameDir);
 
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); destroyTestDirectory(); });
 }
 
 function createTestDirectory()
--- a/netwerk/test/httpserver/test/test_name_scheme.js
+++ b/netwerk/test/httpserver/test/test_name_scheme.js
@@ -74,17 +74,17 @@ var tests =
 
 
 function run_test()
 {
   var srv = createServer();
 
   // make sure underscores work in directories "mounted" in directories with
   // folders starting with _
-  var nameDir = do_get_file("netwerk/test/httpserver/test/data/name-scheme/");
+  var nameDir = do_get_file("data/name-scheme/");
   srv.registerDirectory("/", nameDir);
   srv.registerDirectory("/foo/", nameDir);
   srv.registerDirectory("/end-caret^/", nameDir);
 
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); });
 }
--- a/netwerk/test/httpserver/test/test_registerdirectory.js
+++ b/netwerk/test/httpserver/test/test_registerdirectory.js
@@ -311,17 +311,17 @@ tests.push(test);
 
 
 var srv;
 var serverBasePath;
 var testsDirectory;
 
 function run_test()
 {
-  testsDirectory = do_get_file("netwerk/test/httpserver/test/");
+  testsDirectory = do_get_cwd();
 
   srv = createServer();
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); });
 }
 
 
--- a/netwerk/test/httpserver/test/test_registerfile.js
+++ b/netwerk/test/httpserver/test/test_registerfile.js
@@ -41,17 +41,17 @@
 const BASE = "http://localhost:4444";
 
 function isException(e, code)
 {
   if (e !== code && e.result !== code)
     do_throw("unexpected error: " + e);
 }
 
-var file = do_get_file("netwerk/test/httpserver/test/test_registerfile.js");
+var file = do_get_file("test_registerfile.js");
 
 function onStart(ch, cx)
 {
   do_check_eq(ch.responseStatus, 200);
 }
 
 function onStop(ch, cx, status, data)
 {
@@ -62,17 +62,17 @@ function onStop(ch, cx, status, data)
 var test = new Test(BASE + "/foo", null, onStart, onStop);
 
 function run_test()
 {
   var srv = createServer();
 
   try
   {
-    srv.registerFile("/foo", do_get_file("netwerk/test/httpserver/"));
+    srv.registerFile("/foo", do_get_cwd());
     throw "registerFile succeeded!";
   }
   catch (e)
   {
     isException(e, Cr.NS_ERROR_INVALID_ARG);
   }
 
   srv.registerFile("/foo", file);
--- a/netwerk/test/httpserver/test/test_setindexhandler.js
+++ b/netwerk/test/httpserver/test/test_setindexhandler.js
@@ -38,17 +38,17 @@
 
 // Make sure setIndexHandler works as expected
 
 var srv, serverBasePath;
 
 function run_test()
 {
   srv = createServer();
-  serverBasePath = do_get_file("netwerk/test/httpserver/test/");
+  serverBasePath = do_get_cwd();
   srv.registerDirectory("/", serverBasePath);
   srv.setIndexHandler(myIndexHandler);
   srv.start(4444);
 
   runHttpTests(tests, function() { srv.stop(); });
 }
 
 
--- a/netwerk/test/httpserver/test/test_sjs.js
+++ b/netwerk/test/httpserver/test/test_sjs.js
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // tests support for server JS-generated pages
 
 const BASE = "http://localhost:4444";
 
-var sjs = do_get_file("netwerk/test/httpserver/test/data/sjs/cgi.sjs");
+var sjs = do_get_file("data/sjs/cgi.sjs");
 var srv;
 var test;
 var tests = [];
 
 
 /*********************
  * UTILITY FUNCTIONS *
  *********************/
--- a/netwerk/test/httpserver/test/test_sjs_state.js
+++ b/netwerk/test/httpserver/test/test_sjs_state.js
@@ -41,17 +41,17 @@
 
 const PORT = 4444;
 
 var srv;
 
 function run_test()
 {
   srv = createServer();
-  var sjsDir = do_get_file("netwerk/test/httpserver/test/data/sjs/");
+  var sjsDir = do_get_file("data/sjs/");
   srv.registerDirectory("/", sjsDir);
   srv.registerContentType("sjs", "sjs");
   srv.registerPathHandler("/path-handler", pathHandler);
   srv.start(PORT);
 
   function done()
   {
     do_check_eq(srv.getSharedState("shared-value"), "done!");
--- a/netwerk/test/httpserver/test/test_sjs_throwing_exceptions.js
+++ b/netwerk/test/httpserver/test/test_sjs_throwing_exceptions.js
@@ -43,17 +43,17 @@
  * then preventing any file from being opened).
  */
 
 const PORT = 4444;
 
 function run_test()
 {
   var srv = createServer();
-  var sjsDir = do_get_file("netwerk/test/httpserver/test/data/sjs/");
+  var sjsDir = do_get_file("data/sjs/");
   srv.registerDirectory("/", sjsDir);
   srv.registerContentType("sjs", "sjs");
   srv.start(PORT);
 
   function done()
   {
     srv.stop();
     do_check_eq(gStartCount, TEST_RUNS);
--- a/netwerk/test/unit/test_authentication.js
+++ b/netwerk/test/unit/test_authentication.js
@@ -1,11 +1,11 @@
 // This file tests authentication prompt callbacks
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const FLAG_RETURN_FALSE   = 1 << 0;
 const FLAG_WRONG_PASSWORD = 1 << 1;
 
 const nsIAuthPrompt2 = Components.interfaces.nsIAuthPrompt2;
 const nsIAuthInformation = Components.interfaces.nsIAuthInformation;
 
 
--- a/netwerk/test/unit/test_bug203271.js
+++ b/netwerk/test/unit/test_bug203271.js
@@ -1,15 +1,15 @@
 //
 // Tests if a response with an Expires-header in the past
 // and Cache-Control: max-age  in the future works as
 // specified in RFC 2616 section 14.9.3 by letting max-age
 // take precedence
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 const BUGID = "203271";
 
 var httpserver = new nsHttpServer();
 var index = 0;
 var tests = [
     // original problem described in bug#203271
     {url: "/precedence", server: "0", expected: "0",
      responseheader: [ "Expires: " + getDateString(-1),
--- a/netwerk/test/unit/test_bug263127.js
+++ b/netwerk/test/unit/test_bug263127.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var server;
 const BUGID = "263127";
 
 var listener = {
   QueryInterface: function(iid) {
     if (!iid.equals(nsIDownloadObserver) &&
         !iid.equals(nsISupports))
--- a/netwerk/test/unit/test_bug331825.js
+++ b/netwerk/test/unit/test_bug331825.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var server;
 const BUGID = "331825";
 
 function TestListener() {
 }
 TestListener.prototype.onStartRequest = function(request, context) {
 }
--- a/netwerk/test/unit/test_bug369787.js
+++ b/netwerk/test/unit/test_bug369787.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const BUGID = "369787";
 var server = null;
 var channel = null;
 
 function change_content_type() {
   var origType = channel.contentType;
   const newType = "x-foo/x-bar";
--- a/netwerk/test/unit/test_bug412945.js
+++ b/netwerk/test/unit/test_bug412945.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserv;
 
 function TestListener() {
 }
 
 TestListener.prototype.onStartRequest = function(request, context) {
 }
--- a/netwerk/test/unit/test_bug414122.js
+++ b/netwerk/test/unit/test_bug414122.js
@@ -7,17 +7,17 @@ var etld = Cc["@mozilla.org/network/effe
              .getService(Ci.nsIEffectiveTLDService);
 var idn = Cc["@mozilla.org/network/idn-service;1"]
              .getService(Ci.nsIIDNService);
 
 function run_test()
 {
   var fis = Cc["@mozilla.org/network/file-input-stream;1"]
               .createInstance(Ci.nsIFileInputStream);
-  fis.init(do_get_file("netwerk/dns/src/effective_tld_names.dat"),
+  fis.init(do_get_file("effective_tld_names.dat"),
            PR_RDONLY, 0444, Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
   var lis = Cc["@mozilla.org/intl/converter-input-stream;1"]
               .createInstance(Ci.nsIConverterInputStream);
   lis.init(fis, "UTF-8", 1024, 0);
   lis.QueryInterface(Ci.nsIUnicharLineInputStream);
 
   var out = { value: "" };
--- a/netwerk/test/unit/test_bug455311.js
+++ b/netwerk/test/unit/test_bug455311.js
@@ -2,20 +2,20 @@ const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 const isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
 const isLinux = ("@mozilla.org/gnome-gconf-service;1" in Cc);
 
 function getLinkFile()
 {
   if (isWindows) {
-    return do_get_file("netwerk/test/unit/test_link.url");
+    return do_get_file("test_link.url");
   }
   if (isLinux) {
-    return do_get_file("netwerk/test/unit/test_link.desktop");
+    return do_get_file("test_link.desktop");
   }
   do_throw("Unexpected platform");
   return null;
 }
 
 const ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 var link;
 var linkURI;
--- a/netwerk/test/unit/test_bug468594.js
+++ b/netwerk/test/unit/test_bug468594.js
@@ -8,17 +8,17 @@
 // always seems to send an Expires-header in the response,
 // breaking the finer details of the test. This script has
 // full control of response-headers, however, and can perform
 // the intended testing plus some extra stuff.
 //
 // Please see RFC 2616 section 13.2.1 6th paragraph for the
 // definition of "explicit expiration time" being used here.
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = new nsHttpServer();
 var index = 0;
 var tests = [
     {url: "/freshness",   server: "0", expected: "0"},
     {url: "/freshness",   server: "1", expected: "0"}, // cached
 
     // RFC 2616 section 13.9 2nd paragraph
--- a/netwerk/test/unit/test_bug482601.js
+++ b/netwerk/test/unit/test_bug482601.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserv = null;
 var test_nr = 0;
 var observers_called = "";
 var handlers_called = "";
 var buffer = "";
 
 var observer = {
--- a/netwerk/test/unit/test_cacheflags.js
+++ b/netwerk/test/unit/test_cacheflags.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 
 // Need to randomize, because apparently no one clears our cache
 var suffix = Math.random();
 var httpBase = "http://localhost:4444";
 var httpsBase = "http://localhost:4445";
 var shortexpPath = "/shortexp" + suffix;
--- a/netwerk/test/unit/test_content_sniffer.js
+++ b/netwerk/test/unit/test_content_sniffer.js
@@ -1,11 +1,11 @@
 // This file tests nsIContentSniffer, introduced in bug 324985
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const unknownType = "application/x-unknown-content-type";
 const sniffedType = "application/x-sniffed";
 
 const snifferCID = Components.ID("{4c93d2db-8a56-48d7-b261-9cf2a8d998eb}");
 const snifferContract = "@mozilla.org/network/unittest/contentsniffer;1";
 const categoryName = "net-content-sniffers";
 
--- a/netwerk/test/unit/test_cookie_header.js
+++ b/netwerk/test/unit/test_cookie_header.js
@@ -1,11 +1,11 @@
 // This file tests bug 250375
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 function check_request_header(chan, name, value) {
   var chanValue;
   try {
     chanValue = chan.getRequestHeader(name);
   } catch (e) {
     do_throw("Expected to find header '" + name + "' but didn't find it");
   }
--- a/netwerk/test/unit/test_event_sink.js
+++ b/netwerk/test/unit/test_event_sink.js
@@ -1,11 +1,11 @@
 // This file tests channel event sinks (bug 315598 et al)
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const sinkCID = Components.ID("{14aa4b81-e266-45cb-88f8-89595dece114}");
 const sinkContract = "@mozilla.org/network/unittest/channeleventsink;1";
 
 const categoryName = "net-channel-event-sinks";
 
 const NS_BINDING_ABORTED = 0x804b0002;
 
--- a/netwerk/test/unit/test_gzipped_206.js
+++ b/netwerk/test/unit/test_gzipped_206.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 
 const responseBody = [0x1f, 0x8b, 0x08, 0x00, 0x16, 0x5a, 0x8a, 0x48, 0x02,
 		      0x03, 0x2b, 0x49, 0x2d, 0x2e, 0xe1, 0x02, 0x00, 0xc6,
 		      0x35, 0xb9, 0x3b, 0x05, 0x00, 0x00, 0x00];
 
 function make_channel(url, callback, ctx) {
--- a/netwerk/test/unit/test_httpcancel.js
+++ b/netwerk/test/unit/test_httpcancel.js
@@ -1,12 +1,12 @@
 // This file ensures that canceling a channel early does not
 // send the request to the server (bug 350790)
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const NS_BINDING_ABORTED = 0x804b0002;
 
 var observer = {
   QueryInterface: function eventsink_qi(iid) {
     if (iid.equals(Components.interfaces.nsISupports) ||
         iid.equals(Components.interfaces.nsIObserver))
       return this;
--- a/netwerk/test/unit/test_plaintext_sniff.js
+++ b/netwerk/test/unit/test_plaintext_sniff.js
@@ -1,11 +1,11 @@
 // Test the plaintext-or-binary sniffer
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 // List of Content-Type headers to test.  For each header we have an array.
 // The first element in the array is the Content-Type header string.  The
 // second element in the array is a boolean indicating whether we allow
 // sniffing for that type.
 var contentTypeHeaderList =
 [
  [ "text/plain", true ],
--- a/netwerk/test/unit/test_readline.js
+++ b/netwerk/test/unit/test_readline.js
@@ -47,24 +47,24 @@ function new_file_input_stream(file) {
 }
 
 function new_line_input_stream(filename) {
   return new_file_input_stream(do_get_file(filename))
            .QueryInterface(Ci.nsILineInputStream);
 }
 
 var test_array = [
-  { file:"netwerk/test/unit/data/test_readline1.txt", lines:[] }, 
-  { file:"netwerk/test/unit/data/test_readline2.txt", lines:[""] }, 
-  { file:"netwerk/test/unit/data/test_readline3.txt", lines:["","","","",""] }, 
-  { file:"netwerk/test/unit/data/test_readline4.txt", l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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxE"] }, 
+  { file:"data/test_readline1.txt", lines:[] }, 
+  { file:"data/test_readline2.txt", lines:[""] }, 
+  { file:"data/test_readline3.txt", lines:["","","","",""] }, 
+  { file:"data/test_readline4.txt", lines:["1","23","456","","78901"] }, 
+  { file:"data/test_readline5.txt", lines:["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxE"] }, 
 ];
 
 function err(file, lineNo, msg) {
   do_throw("\""+file+"\" line "+lineNo+", "+msg);
 }
 
 function run_test()
 {
--- a/netwerk/test/unit/test_redirect_caching.js
+++ b/netwerk/test/unit/test_redirect_caching.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 // Need to randomize, because apparently no one clears our cache
 var randomPath = "/redirect/" + Math.random();
 var randomURI = "http://localhost:4444" + randomPath;
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
--- a/netwerk/test/unit/test_reopen.js
+++ b/netwerk/test/unit/test_reopen.js
@@ -1,12 +1,12 @@
 // This testcase verifies that channels can't be reopened
 // See https://bugzilla.mozilla.org/show_bug.cgi?id=372486
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 const NS_ERROR_IN_PROGRESS = 0x804b000f;
 const NS_ERROR_ALREADY_OPENED = 0x804b0049;
 
 var chan = null;
 var httpserv = null;
 
 var test_index = 0;
@@ -113,17 +113,17 @@ function test_data_channel() {
 
 function test_http_channel() {
   test_channel(function() {
     return makeChan("http://localhost:4444/");
   });
 }
 
 function test_file_channel() {
-  var file = do_get_file("netwerk/test/Makefile.in");
+  var file = do_get_file("data/test_readline1.txt");
   test_channel(function() {
     return new_file_channel(file);
   });
 }
 
 // Uncomment test_ftp_channel in test_array to test this
 function test_ftp_channel() {
   test_channel(function() {
--- a/netwerk/test/unit/test_resumable_channel.js
+++ b/netwerk/test/unit/test_resumable_channel.js
@@ -1,11 +1,11 @@
 /* Tests various aspects of nsIResumableChannel in combination with HTTP */
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 
 const NS_ERROR_ENTITY_CHANGED = 0x804b0020;
 const NS_ERROR_NOT_RESUMABLE = 0x804b0019;
 
 const rangeBody = "Body of the range request handler.\r\n";
 
--- a/netwerk/test/unit/test_resumable_truncate.js
+++ b/netwerk/test/unit/test_resumable_truncate.js
@@ -1,9 +1,9 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 
 function make_channel(url, callback, ctx) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return ios.newChannel(url, "", null);
 }
--- a/netwerk/test/unit/test_traceable_channel.js
+++ b/netwerk/test/unit/test_traceable_channel.js
@@ -1,14 +1,14 @@
 // Test nsITraceableChannel interface.
 // Replace original listener with TracingListener that modifies body of HTTP
 // response. Make sure that body received by original channel's listener
 // is correctly modified.
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var httpserver = null;
 var originalBody = "original http response body";
 var replacedBody = "replaced http response body";
 
 function TracingListener() {}
 
 TracingListener.prototype = {
--- a/rdf/tests/unit/test_rdfredirect.js
+++ b/rdf/tests/unit/test_rdfredirect.js
@@ -1,21 +1,21 @@
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 function getRDFService()
 {
   return Components.classes["@mozilla.org/rdf/rdf-service;1"].
     getService(Components.interfaces.nsIRDFService);
 }
 
 var server1, server2;
 
 function run_test()
 {
-  var samplefile = do_get_file('rdf/tests/unit/sample.rdf');
+  var samplefile = do_get_file('sample.rdf');
   
   server1 = new nsHttpServer();
   server1.registerPathHandler("/sample-xs.rdf", xsRedirect);
   server1.registerPathHandler("/sample-local.rdf", localRedirect);
   server1.registerFile('/sample.rdf', samplefile);
   server1.start(4444);
 
   server2 = new nsHttpServer();
--- a/storage/test/unit/head_storage.js
+++ b/storage/test/unit/head_storage.js
@@ -49,17 +49,17 @@ function getTestDB()
   return db;
 }
 
 /**
  * Obtains a corrupt database to test against.
  */
 function getCorruptDB()
 {
-  return do_get_file("storage/test/unit/corruptDB.sqlite");
+  return do_get_file("corruptDB.sqlite");
 }
 
 function cleanup()
 {
   // close the connection
   print("*** Storage Tests: Trying to close!");
   getOpenedDatabase().close();
 
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/file.txt
@@ -0,0 +1,1 @@
+hello
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/load_subscript.js
@@ -0,0 +1,1 @@
+subscriptLoaded = true;
rename from testing/xpcshell/example/location_load.js
rename to testing/xpcshell/example/unit/location_load.js
--- a/testing/xpcshell/example/location_load.js
+++ b/testing/xpcshell/example/unit/location_load.js
@@ -1,2 +1,2 @@
-// Gets loaded via test_location.js
-do_check_eq(__LOCATION__.leafName, "location_load.js");
+// Gets loaded via test_location.js
+do_check_eq(__LOCATION__.leafName, "location_load.js");
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/subdir/file.txt
@@ -0,0 +1,1 @@
+subdir hello
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/test_get_file.js
@@ -0,0 +1,67 @@
+/* -*- 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Ted Mielczarek <ted.mielczarek@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 ***** */
+
+var subscriptLoaded = false;
+
+function run_test() {
+  var lf = do_get_file("file.txt");
+  do_check_true(lf.exists());
+  do_check_true(lf.isFile());
+  // check that allowNonexistent works
+  lf = do_get_file("file.txt.notfound", true);
+  do_check_false(lf.exists());
+  // check that we can get a file from a subdirectory
+  lf = do_get_file("subdir/file.txt");
+  do_check_true(lf.exists());
+  do_check_true(lf.isFile());
+  // and that we can get a handle to a directory itself
+  lf = do_get_file("subdir/");
+  do_check_true(lf.exists());
+  do_check_true(lf.isDirectory());
+  // check that we can go up a level
+  lf = do_get_file("..");
+  do_check_true(lf.exists());
+  lf.append("unit");
+  lf.append("file.txt");
+  do_check_true(lf.exists());
+  // check that do_get_cwd works
+  lf = do_get_cwd();
+  do_check_true(lf.exists());
+  do_check_true(lf.isDirectory());
+}
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/test_load.js
@@ -0,0 +1,45 @@
+/* -*- 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Ted Mielczarek <ted.mielczarek@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 ***** */
+
+var subscriptLoaded = false;
+
+function run_test() {
+  load("load_subscript.js");
+  do_check_true(subscriptLoaded);
+}
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/example/unit/test_load_httpd_js.js
@@ -0,0 +1,46 @@
+/* -*- 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Ted Mielczarek <ted.mielczarek@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 ***** */
+
+do_load_httpd_js();
+
+function run_test() {
+  var httpserver = new nsHttpServer();
+  do_check_neq(httpserver, null);
+  do_check_neq(httpserver.QueryInterface(Components.interfaces.nsIHttpServer), null);
+}
--- a/testing/xpcshell/example/unit/test_location.js
+++ b/testing/xpcshell/example/unit/test_location.js
@@ -1,44 +1,44 @@
-/* -*- 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ted Mielczarek <ted.mielczarek@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 ***** */
-
-function run_test() {
-  do_check_eq(__LOCATION__.leafName, "test_location.js");
-  // also check that __LOCATION__ works via load()
-  do_import_script("testing/xpcshell/example/location_load.js");
-}
+/* -*- 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Ted Mielczarek <ted.mielczarek@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 ***** */
+
+function run_test() {
+  do_check_eq(__LOCATION__.leafName, "test_location.js");
+  // also check that __LOCATION__ works via load()
+  load("location_load.js");
+}
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -166,63 +166,50 @@ function do_test_pending() {
 }
 
 function do_test_finished() {
   dump("*** test finished\n");
   if (--_tests_pending == 0)
     _do_quit();
 }
 
-function do_import_script(topsrcdirRelativePath) {
-  var scriptPath = environment["TOPSRCDIR"];
-  if (scriptPath.charAt(scriptPath.length - 1) != "/")
-    scriptPath += "/";
-  scriptPath += topsrcdirRelativePath;
+function do_get_file(path, allowNonexistent) {
+  try {
+    let lf = Components.classes["@mozilla.org/file/directory_service;1"]
+      .getService(Components.interfaces.nsIProperties)
+      .get("CurWorkD", Components.interfaces.nsILocalFile);
 
-  load(scriptPath);
+    let bits = path.split("/");
+    for (let i = 0; i < bits.length; i++) {
+      if (bits[i]) {
+        if (bits[i] == "..")
+          lf = lf.parent;
+        else
+          lf.append(bits[i]);
+      }
+    }
+
+    if (!allowNonexistent) {
+      if (!lf.exists()) {
+        print(lf.path + " doesn't exist\n");
+      }
+      do_check_true(lf.exists());
+    }
+
+    return lf;
+  }
+  catch(ex) {
+    do_throw(ex.toString(), Components.stack.caller);
+  }
+  return null;
 }
 
-function do_get_file(path, allowInexistent) {
-  var comps = path.split("/");
-  try {
-    // The following always succeeds on Windows because we use cygpath with
-    // the -a (absolute) modifier to generate NATIVE_TOPSRCDIR.
-    var lf = Components.classes["@mozilla.org/file/local;1"]
-                       .createInstance(Components.interfaces.nsILocalFile);
-    lf.initWithPath(environment["NATIVE_TOPSRCDIR"]);
-  } catch (e) {
-    // Relative -- and not-Windows per above
-    lf = Components.classes["@mozilla.org/file/directory_service;1"]
-                   .getService(Components.interfaces.nsIProperties)
-                   .get("CurWorkD", Components.interfaces.nsILocalFile);
-
-    // We can't use appendRelativePath because it's not supposed to work with
-    // paths containing "..", and this path might contain "..".
-    var topsrcdirComps = environment["NATIVE_TOPSRCDIR"].split("/");
-    Array.prototype.unshift.apply(comps, topsrcdirComps);
-  }
-
-  for (var i = 0, sz = comps.length; i < sz; i++) {
-    // avoids problems if either path ended with /
-    if (comps[i].length > 0) {
-      if (comps[i] == "..")
-        lf = lf.parent;
-      else
-        lf.append(comps[i]);
-    }
-  }
-
-  if (!allowInexistent) {
-    if (!lf.exists()) {
-      print(lf.path + " doesn't exist\n");
-    }
-    do_check_true(lf.exists());
-  }
-
-  return lf;
+// do_get_cwd() isn't exactly self-explanatory, so provide a helper
+function do_get_cwd() {
+  return do_get_file("");
 }
 
 function do_load_module(path) {
   var lf = do_get_file(path);
   const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
   do_check_true(Components.manager instanceof nsIComponentRegistrar);
   Components.manager.autoRegister(lf);
 }
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -36,57 +36,61 @@
 #
 # ***** END LICENSE BLOCK ***** */
 
 import sys, os, os.path
 from glob import glob
 from optparse import OptionParser
 from subprocess import Popen, PIPE, STDOUT
 
-def runTests(xpcshell, topsrcdir, testdirs, xrePath=None, testFile=None, interactive=False):
+def runTests(xpcshell, topsrcdir, testdirs, xrePath=None, testFile=None,
+             interactive=False):
   """Run the tests in |testdirs| using the |xpcshell| executable.
   If provided, |xrePath| is the path to the XRE to use. If provided,
   |testFile| indicates a single test to run. |interactive|, if set to True,
   indicates to provide an xpcshell prompt instead of automatically executing
   the test."""
+  testharnessdir = os.path.dirname(os.path.abspath(__file__))
   xpcshell = os.path.abspath(xpcshell)
+  # we assume that httpd.js lives in components/ relative to xpcshell
+  httpdJSPath = os.path.join(os.path.dirname(xpcshell), "components", "httpd.js").replace("\\", "/");
+
   env = dict(os.environ)
-  env["NATIVE_TOPSRCDIR"] = os.path.normpath(topsrcdir)
-  env["TOPSRCDIR"] = topsrcdir
   # Make assertions fatal
   env["XPCOM_DEBUG_BREAK"] = "stack-and-abort"
 
   if xrePath is None:
     xrePath = os.path.dirname(xpcshell)
   if sys.platform == 'win32':
     env["PATH"] = env["PATH"] + ";" + xrePath
   elif sys.platform == 'osx':
     env["DYLD_LIBRARY_PATH"] = xrePath
   else: # unix or linux?
     env["LD_LIBRARY_PATH"] = xrePath
   args = [xpcshell, '-g', xrePath, '-j', '-s']
 
-  testharnessdir = os.path.dirname(os.path.abspath(sys.argv[0]))
-  headfiles = ['-f', os.path.join(testharnessdir, 'head.js')]
+  headfiles = ['-f', os.path.join(testharnessdir, 'head.js'),
+               '-e', 'function do_load_httpd_js() {load("%s");}' % httpdJSPath]
   tailfiles = ['-f', os.path.join(testharnessdir, 'tail.js')]
   if not interactive:
     tailfiles += ['-e', '_execute_test();']
 
   # when --test is specified, it can either be just a filename or
   # testdir/filename. This is for convenience when there's only one
   # test dir.
   singleDir = None
   if testFile and testFile.find('/') != -1:
     # directory was specified
     bits = testFile.split('/', 1)
     singleDir = bits[0]
     testFile = bits[1]
   for testdir in testdirs:
     if singleDir and singleDir != os.path.basename(testdir):
       continue
+    testdir = os.path.abspath(testdir)
 
     # get the list of head and tail files from the directory
     testheadfiles = []
     for f in sorted(glob(os.path.join(testdir, "head_*.js"))):
       if os.path.isfile(f):
         testheadfiles += ['-f', f]
     testtailfiles = []
     for f in sorted(glob(os.path.join(testdir, "tail_*.js"))):
@@ -104,20 +108,22 @@ def runTests(xpcshell, topsrcdir, testdi
     for test in testfiles:
       pstdout = PIPE
       pstderr = STDOUT
       interactiveargs = []
       if interactive:
         pstdout = None
         pstderr = None
         interactiveargs = ['-e', 'print("To start the test, type _execute_test();")', '-i']
-      proc = Popen(args + headfiles + testheadfiles
-                   + ['-f', test]
-                   + tailfiles + testtailfiles + interactiveargs,
-                   stdout=pstdout, stderr=pstderr, env=env)
+      full_args = args + headfiles + testheadfiles \
+                  + ['-f', test] \
+                  + tailfiles + testtailfiles + interactiveargs
+      #print "args: %s" % full_args
+      proc = Popen(full_args, stdout=pstdout, stderr=pstderr,
+                   env=env, cwd=testdir)
       stdout, stderr = proc.communicate()
 
       if interactive:
         # not sure what else to do here...
         return True
 
       if proc.returncode != 0 or stdout.find("*** PASS") == -1:
         print """TEST-UNEXPECTED-FAIL | %s | test failed, see log
--- a/toolkit/components/commandlines/test/Makefile.in
+++ b/toolkit/components/commandlines/test/Makefile.in
@@ -46,16 +46,16 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE		= test_harness_commandlines
 
 XPCSHELL_TESTS = \
                  unit \
                  $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
-XPCSHELL_TESTS += unit/win
+XPCSHELL_TESTS += unit_win
 else
 ifneq (,$(filter-out OS2 Darwin,$(OS_ARCH)))
-XPCSHELL_TESTS += unit/unix
+XPCSHELL_TESTS += unit_unix
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
rename from toolkit/components/commandlines/test/unit/unix/test_bug410156.js
rename to toolkit/components/commandlines/test/unit_unix/test_bug410156.js
--- a/toolkit/components/commandlines/test/unit/unix/test_bug410156.js
+++ b/toolkit/components/commandlines/test/unit_unix/test_bug410156.js
@@ -32,12 +32,12 @@
  * 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 ***** */
 
 function run_test() {
   var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"];
   var commandLine = clClass.createInstance();
-  var urlFile = do_get_file("toolkit/components/commandlines/test/unit/data/test_bug410156.desktop");
+  var urlFile = do_get_file("../unit/data/test_bug410156.desktop");
   var uri = commandLine.resolveURI(urlFile.path);
   do_check_eq(uri.spec, "http://www.bug410156.com/");
 }
rename from toolkit/components/commandlines/test/unit/win/test_bug410156.js
rename to toolkit/components/commandlines/test/unit_win/test_bug410156.js
--- a/toolkit/components/commandlines/test/unit/win/test_bug410156.js
+++ b/toolkit/components/commandlines/test/unit_win/test_bug410156.js
@@ -32,12 +32,12 @@
  * 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 ***** */
 
 function run_test() {
   var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"];
   var commandLine = clClass.createInstance();
-  var urlFile = do_get_file("toolkit/components/commandlines/test/unit/data/test_bug410156.url");
+  var urlFile = do_get_file("../unit/data/test_bug410156.url");
   var uri = commandLine.resolveURI(urlFile.path);
   do_check_eq(uri.spec, "http://www.bug410156.com/");
 }
--- a/toolkit/components/downloads/test/schema_migration/head_migration.js
+++ b/toolkit/components/downloads/test/schema_migration/head_migration.js
@@ -68,17 +68,17 @@ if (!profileDir) {
       throw Cr.NS_ERROR_NO_INTERFACE;
     }
   };
   dirSvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
 }
 
 function importDatabaseFile(aFName)
 {
-  var file = do_get_file("toolkit/components/downloads/test/schema_migration/" + aFName);
+  var file = do_get_file(aFName);
   var newFile = dirSvc.get("ProfD", Ci.nsIFile);
   file.copyTo(newFile, "downloads.sqlite");
 }
 
 function cleanup()
 {
   // removing database
   var dbFile = dirSvc.get("ProfD", Ci.nsIFile);
--- a/toolkit/components/downloads/test/unit/head_download_manager.js
+++ b/toolkit/components/downloads/test/unit/head_download_manager.js
@@ -32,17 +32,17 @@
  * 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 ***** */
 
 // This file tests the download manager backend
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 function createURI(aObj)
 {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return (aObj instanceof Ci.nsIFile) ? ios.newFileURI(aObj) :
                                         ios.newURI(aObj, null, null);
 }
@@ -85,17 +85,17 @@ if (!profileDir) {
  * Imports a download test file to use.  Works with rdf and sqlite files.
  *
  * @param aFName
  *        The name of the file to import.  This file should be located in the
  *        same directory as this file.
  */
 function importDownloadsFile(aFName)
 {
-  var file = do_get_file("toolkit/components/downloads/test/unit/" + aFName);
+  var file = do_get_file(aFName);
   var newFile = dirSvc.get("ProfD", Ci.nsIFile);
   if (/\.rdf$/i.test(aFName))
     file.copyTo(newFile, "downloads.rdf");
   else if (/\.sqlite$/i.test(aFName))
     file.copyTo(newFile, "downloads.sqlite");
   else
     do_throw("Unexpected filename!");
 }
--- a/toolkit/components/passwordmgr/test/unit/head_storage_legacy_1.js
+++ b/toolkit/components/passwordmgr/test/unit/head_storage_legacy_1.js
@@ -279,17 +279,16 @@ try {
 if (!profileDir) {
     LoginTest.makeDirectoryService();
     profileDir = dirSvc.get(NS_APP_USER_PROFILE_50_DIR, Ci.nsIFile);
 }
 
 
 // nsIFiles...
 var PROFDIR = profileDir;
-var DATADIR = do_get_file("toolkit/components/passwordmgr/test/unit/data/" +
-                         "signons-00.txt").parent;
+var DATADIR = do_get_file("data/");
 // string versions...
 var OUTDIR = PROFDIR.path;
 var INDIR = DATADIR.path;
 
 // Copy key3.db into the profile used for the unit tests. Need this so we can
 // decrypt the encrypted logins stored in the various tests inputs.
 LoginTest.copyFile("key3.db");
--- a/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_5.js
+++ b/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage_5.js
@@ -61,18 +61,17 @@ LoginTest.deleteFile(OUTDIR, "signons.sq
  */
 
 /* ========== 3 ========== */
 testnum++;
 var testdesc = "Corrupt database and backup"
 
 var filename = "signons-c.sqlite";
 // copy corrupt db to output directory
-var corruptDB = do_get_file("toolkit/components/passwordmgr/test/unit/data/" +
-                            "corruptDB.sqlite");
+var corruptDB = do_get_file("data/corruptDB.sqlite");
 
 var cfile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
 cfile.initWithPath(OUTDIR);
 cfile.append(filename);
 if (cfile.exists())
     cfile.remove(false);
 
 corruptDB.copyTo(PROFDIR, filename)
--- a/toolkit/components/places/tests/sync/test_database_sync_onitemadded.js
+++ b/toolkit/components/places/tests/sync/test_database_sync_onitemadded.js
@@ -80,17 +80,17 @@ var bookmarksObserver = {
       syncObserver.finalSync = true;
   }
 }
 bs.addObserver(bookmarksObserver, false);
 
 function run_test()
 {
   // dynamic container sample
-  do_load_module("/toolkit/components/places/tests/unit/nsDynamicContainerServiceSample.js");
+  do_load_module("../unit/nsDynamicContainerServiceSample.js");
 
   // First set the preference for the timer to a large value, so it won't sync
   prefs.setIntPref(kSyncPrefName, SYNC_INTERVAL);
 
   // Add a folder
   bs.createFolder(bs.toolbarFolder, "folder", bs.DEFAULT_INDEX);
 
   // Add a dynamic container
--- a/toolkit/components/places/tests/unit/test_451499.js
+++ b/toolkit/components/places/tests/unit/test_451499.js
@@ -31,18 +31,16 @@
  * 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 ***** */
 
-const TESTDIR = "toolkit/components/places/tests/unit/";
- 
 // Get services
 try {
   var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
                   getService(Ci.nsINavHistoryService);
   var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
                 getService(Ci.nsINavBookmarksService);
   var iconsvc = Cc["@mozilla.org/browser/favicon-service;1"].
                   getService(Ci.nsIFaviconService);
@@ -80,17 +78,17 @@ var result;
 // main
 function run_test() {
   var testURI = uri("http://places.test/");
 
   // Setup a real favicon data
   var iconName = "favicon-normal16.png";
   var iconURI = uri("http://places.test/" + iconName);
   var iconMimeType = "image/png";
-  var iconFile = do_get_file(TESTDIR + iconName);
+  var iconFile = do_get_file(iconName);
   var iconData = readFileData(iconFile);
   do_check_eq(iconData.length, 286);
   iconsvc.setFaviconData(iconURI,
                          iconData, iconData.length, iconMimeType,
                          Number.MAX_VALUE);
 
   // Bookmark our test page, so it will appear in the query resultset
   var testBookmark = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder,
--- a/toolkit/components/places/tests/unit/test_457698_crash.js
+++ b/toolkit/components/places/tests/unit/test_457698_crash.js
@@ -67,17 +67,17 @@ var observer = {
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
 };
 bms.addObserver(observer, false);
 
 // main
 function run_test() {
   // load our dynamic-container sample service
-  do_load_module("/toolkit/components/places/tests/unit/nsDynamicContainerServiceSample.js");
+  do_load_module("nsDynamicContainerServiceSample.js");
   var testRoot = bms.createFolder(bms.placesRoot, "test root", bms.DEFAULT_INDEX);
 
   var options = hs.getNewQueryOptions();
   var query = hs.getNewQuery();
   query.setFolders([testRoot], 1);
   var result = hs.executeQuery(query, options);
   var rootNode = result.root;
   rootNode.containerOpen = true;
--- a/toolkit/components/places/tests/unit/test_crash_476292.js
+++ b/toolkit/components/places/tests/unit/test_crash_476292.js
@@ -44,17 +44,17 @@
  */
 
 function run_test()
 {
   // First, we need to move our old database file into our test profile
   // directory.  This will trigger DATABASE_STATUS_UPGRADED (CREATE is not
   // sufficient since there will be no entires to update frecencies for, which
   // causes us to get the bookmarks service in the first place).
-  let dbFile = do_get_file("toolkit/components/places/tests/unit/bug476292.sqlite");
+  let dbFile = do_get_file("bug476292.sqlite");
   let profD = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).
              get(NS_APP_USER_PROFILE_50_DIR, Ci.nsIFile);
   dbFile.copyTo(profD, "places.sqlite");
 
   // Now get the bookmarks service.  This will crash when the bug exists.
   let bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
            getService(Ci.nsINavBookmarksService);
--- a/toolkit/components/places/tests/unit/test_dynamic_containers.js
+++ b/toolkit/components/places/tests/unit/test_dynamic_containers.js
@@ -45,17 +45,17 @@
   var annosvc = Cc["@mozilla.org/browser/annotation-service;1"].
                 getService(Ci.nsIAnnotationService);
 } catch (ex) {
   do_throw("Could not get services\n");
 }
 // main
 function run_test() {
   // load our dynamic-container sample service
-  do_load_module("/toolkit/components/places/tests/unit/nsDynamicContainerServiceSample.js");
+  do_load_module("nsDynamicContainerServiceSample.js");
   var testRoot = bmsvc.createFolder(bmsvc.placesRoot, "test root", bmsvc.DEFAULT_INDEX);
   var exposedFolder = bmsvc.createFolder(testRoot, "exposed folder", bmsvc.DEFAULT_INDEX);
   var efId1 = bmsvc.insertBookmark(exposedFolder, uri("http://uri1.tld"), bmsvc.DEFAULT_INDEX, "");
 
   // create our dynamic container
   var remoteContainer =
     bmsvc.createDynamicContainer(testRoot, "remote container sample",
                                 "@mozilla.org/browser/remote-container-sample;1",
--- a/toolkit/components/places/tests/unit/test_favicons.js
+++ b/toolkit/components/places/tests/unit/test_favicons.js
@@ -1,14 +1,12 @@
 /*
  * Tests for nsIFaviconService
  */
 
-const TESTDIR = "toolkit/components/places/tests/unit/";
-
 /*
  * dumpToFile()
  *
  * For test development, dumps the specified array to a file.
  * Call |dumpToFile(outData);| in a test to file to a file.
  */
 function dumpToFile(aData) {
   const path = "/tmp";
@@ -129,17 +127,17 @@ try {
 
 /* ========== 1 ========== */
 var testnum = 1;
 var testdesc = "test storing a normal 16x16 icon";
 
 // 16x16 png, 286 bytes.
 var iconName = "favicon-normal16.png";
 var inMimeType = "image/png";
-var iconFile = do_get_file(TESTDIR + iconName);
+var iconFile = do_get_file(iconName);
 
 var inData = readFileData(iconFile);
 do_check_eq(inData.length, 286);
 
 var [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Ensure input and output are identical
 do_check_eq(inMimeType, outMimeType);
@@ -148,17 +146,17 @@ compareArrays(inData, outData);
 
 /* ========== 2 ========== */
 testnum++;
 testdesc = "test storing a normal 32x32 icon";
 
 // 32x32 png, 344 bytes.
 iconName = "favicon-normal32.png";
 inMimeType = "image/png";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 344);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Ensure input and output are identical
 do_check_eq(inMimeType, outMimeType);
@@ -168,72 +166,72 @@ compareArrays(inData, outData);
 /* ========== 3 ========== */
 testnum++;
 testdesc = "test storing an oversize 16x16 icon ";
 
 //  in: 16x16 ico, 1406 bytes.
 // out: 16x16 png 
 iconName = "favicon-big16.ico";
 inMimeType = "image/x-icon";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 1406);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 /* ========== 4 ========== */
 testnum++;
 testdesc = "test storing an oversize 4x4 icon ";
 
 //  in: 4x4 jpg, 4751 bytes.
 // out: 16x16 png 
 iconName = "favicon-big4.jpg";
 inMimeType = "image/jpeg";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 4751);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 
 /* ========== 5 ========== */
 testnum++;
 testdesc = "test storing an oversize 32x32 icon ";
 
 //  in: 32x32 jpg, 3494 bytes.
 // out: 16x16 png 
 iconName = "favicon-big32.jpg";
 inMimeType = "image/jpeg";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 3494);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 // Disabled on Windows due to problems with pixels varying slightly.
 if (!isWindows)
   compareArrays(expectedData, outData);
 
@@ -243,120 +241,120 @@ testnum++;
 testdesc = "test storing an oversize 48x48 icon ";
 
 //  in: 48x48 ico, 56646 bytes.
 // (howstuffworks.com icon, contains 13 icons with sizes from 16x16 to
 // 48x48 in varying depths)
 // out: 16x16 png 
 iconName = "favicon-big48.ico";
 inMimeType = "image/x-icon";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 56646);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 /* ========== 7 ========== */
 testnum++;
 testdesc = "test storing an oversize 64x64 icon ";
 
 //  in: 64x64 png, 10698 bytes.
 // out: 16x16 png 
 iconName = "favicon-big64.png";
 inMimeType = "image/png";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 10698);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 /* ========== 8 ========== */
 testnum++;
 testdesc = "test scaling an oversize 160x3 icon ";
 
 //  in: 160x3 jpg, 5095 bytes.
 // out: 16x16 png 
 iconName = "favicon-scale160x3.jpg";
 inMimeType = "image/jpeg";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 5095);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 /* ========== 9 ========== */
 testnum++;
 testdesc = "test scaling an oversize 3x160 icon ";
 
 //  in: 3x160 jpg, 5059 bytes.
 // out: 16x16 png 
 iconName = "favicon-scale3x160.jpg";
 inMimeType = "image/jpeg";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 5059);
 
 [outData, outMimeType] = setAndGetFaviconData(iconName, inData, inMimeType);
 
 // Read in the expected output.
-var expectedFile = do_get_file(TESTDIR + "expected-" + iconName + ".png");
+var expectedFile = do_get_file("expected-" + iconName + ".png");
 var expectedData = readFileData(expectedFile);
 
 // Compare thet expected data to the actual data.
 do_check_eq("image/png", outMimeType);
 compareArrays(expectedData, outData);
 
 
 /* ========== 10 ========== */
 testnum++;
 testdesc = "test set and get favicon ";
 
 // 32x32 png, 344 bytes.
 var icon1Name = "favicon-normal32.png";
 var icon1MimeType = "image/png";
-var icon1File = do_get_file(TESTDIR + icon1Name);
+var icon1File = do_get_file(icon1Name);
 var icon1Data = readFileData(icon1File);
 do_check_eq(icon1Data.length, 344);
-var icon1URI = uri("file:///./" + TESTDIR + icon1Name);
+var icon1URI = uri("file:///./" + icon1Name);
 
 // 16x16 png, 286 bytes.
 var icon2Name = "favicon-normal16.png";
 var icon2MimeType = "image/png";
-var icon2File = do_get_file(TESTDIR + icon2Name);
+var icon2File = do_get_file(icon2Name);
 var icon2Data = readFileData(icon2File);
 do_check_eq(icon2Data.length, 286);
-var icon2URI = uri("file:///./" + TESTDIR + icon2Name);
+var icon2URI = uri("file:///./" + icon2Name);
 
 var page1URI = uri("http://foo.bar/");
 var page2URI = uri("http://bar.foo/");
 var page3URI = uri("http://foo.bar.moz/");
 
 // add visits to the db
 histsvc.addVisit(page1URI, Date.now() * 1000, null,
                  histsvc.TRANSITION_TYPED, false, 0);
@@ -410,22 +408,22 @@ compareArrays(icon1Data, out3Data);
 
 /* ========== 11 ========== */
 testnum++;
 testdesc = "test setAndLoadFaviconForPage ";
 
 // 32x32 png, 344 bytes.
 iconName = "favicon-normal32.png";
 inMimeType = "image/png";
-iconFile = do_get_file(TESTDIR + iconName);
+iconFile = do_get_file(iconName);
 inData = readFileData(iconFile);
 do_check_eq(inData.length, 344);
 var pageURI = uri("http://foo.bar/");
 
-faviconURI = uri("file:///./" + TESTDIR + iconName);
+faviconURI = uri("file:///./" + iconName);
 
 iconsvc.setAndLoadFaviconForPage(pageURI, faviconURI, true);
 
 var savedFaviconURI = iconsvc.getFaviconForPage(pageURI);
 outMimeType = {};
 outData = iconsvc.getFaviconData(savedFaviconURI, outMimeType, {});
 
 // Ensure input and output are identical
@@ -442,17 +440,17 @@ do_check_eq(iconsvc.getFaviconImageForPa
 
 
 /* ========== 13 ========== */
 testnum++;
 testdesc = "test failed favicon cache ";
 
 // 32x32 png, 344 bytes.
 iconName = "favicon-normal32.png";
-faviconURI = uri("file:///./" + TESTDIR + iconName);
+faviconURI = uri("file:///./" + iconName);
 
 iconsvc.addFailedFavicon(faviconURI);
 do_check_true(iconsvc.isFailedFavicon(faviconURI));
 iconsvc.removeFailedFavicon(faviconURI);
 do_check_false(iconsvc.isFailedFavicon(faviconURI));
 
 
 /* ========== end ========== */
--- a/toolkit/components/places/tests/unit/test_history.js
+++ b/toolkit/components/places/tests/unit/test_history.js
@@ -217,17 +217,17 @@ function run_test() {
 
   // bug 400544 - testing that a referrer that is not in the DB gets added
   var referrerURI = uri("http://yahoo.com");
   do_check_false(uri_in_db(referrerURI));
   add_visit(uri("http://mozilla.com"), referrerURI);
   do_check_true(uri_in_db(referrerURI));
 
   // test to ensure history.dat gets deleted if all history is being cleared
-  var file = do_get_file("toolkit/components/places/tests/unit/history.dat");
+  var file = do_get_file("history.dat");
   var histFile = dirSvc.get("ProfD", Ci.nsIFile);
   file.copyTo(histFile, "history.dat");
   histFile.append("history.dat");
   do_check_true(histFile.exists());
 
   bh.removeAllPages();
   do_check_false(histFile.exists());
 }
--- a/toolkit/components/places/tests/unit/test_history_import.js
+++ b/toolkit/components/places/tests/unit/test_history_import.js
@@ -57,17 +57,17 @@ function uri_in_db(aURI) {
   var root = result.root;
   root.containerOpen = true;
   return (root.childCount == 1);
 }
 
 // main
 function run_test() {
   // test import history
-  var file = do_get_file("toolkit/components/places/tests/unit/history_import_test.dat");
+  var file = do_get_file("history_import_test.dat");
   gh.importHistory(file);
   var uri1 = uri("http://www.mozilla.org/");
   do_check_true(uri_in_db(uri1));
 
   // Check visit count
   var options = hs.getNewQueryOptions();
   options.sortingMode = options.SORT_BY_DATE_DESCENDING;
   options.resultType = options.RESULTS_AS_VISIT;
--- a/toolkit/components/satchel/test/unit/test_bug_329741.js
+++ b/toolkit/components/satchel/test/unit/test_bug_329741.js
@@ -36,17 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 // Test to make sure we drop formhistory.dat when clearing form logins
 
 
 
 function run_test()
 {
-  var file = do_get_file("toolkit/components/satchel/test/unit/formhistory.dat");
+  var file = do_get_file("formhistory.dat");
   var formhistFile = dirSvc.get("ProfD", Ci.nsIFile);
   file.copyTo(formhistFile, "formhistory.dat");
   formhistFile.append("formhistory.dat");
   do_check_true(formhistFile.exists());
 
   var formHistory = Cc["@mozilla.org/satchel/form-history;1"].
                     getService(Ci.nsIFormHistory2);
   formHistory.removeAllEntries();
--- a/toolkit/components/satchel/test/unit/test_db_corrupt.js
+++ b/toolkit/components/satchel/test/unit/test_db_corrupt.js
@@ -36,17 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 function run_test()
 {
   try {
   var testnum = 0;
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_CORRUPT.sqlite");
+  var testfile = do_get_file("formhistory_CORRUPT.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/components/satchel/test/unit/test_db_update_v1.js
+++ b/toolkit/components/satchel/test/unit/test_db_update_v1.js
@@ -46,17 +46,17 @@ var testnum = 0;
 var fh;
 var timesUsed, firstUsed, lastUsed;
 
 function run_test()
 {
   try {
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_v0.sqlite");
+  var testfile = do_get_file("formhistory_v0.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/components/satchel/test/unit/test_db_update_v1b.js
+++ b/toolkit/components/satchel/test/unit/test_db_update_v1b.js
@@ -46,17 +46,17 @@ var testnum = 0;
 var fh;
 var timesUsed, firstUsed, lastUsed;
 
 function run_test()
 {
   try {
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_v0v1.sqlite");
+  var testfile = do_get_file("formhistory_v0v1.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/components/satchel/test/unit/test_db_update_v999a.js
+++ b/toolkit/components/satchel/test/unit/test_db_update_v999a.js
@@ -45,17 +45,17 @@
  */
 
 function run_test()
 {
   try {
   var testnum = 0;
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_v999a.sqlite");
+  var testfile = do_get_file("formhistory_v999a.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/components/satchel/test/unit/test_db_update_v999b.js
+++ b/toolkit/components/satchel/test/unit/test_db_update_v999b.js
@@ -45,17 +45,17 @@
  */
 
 function run_test()
 {
   try {
   var testnum = 0;
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_v999b.sqlite");
+  var testfile = do_get_file("formhistory_v999b.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/components/satchel/test/unit/test_history_api.js
+++ b/toolkit/components/satchel/test/unit/test_history_api.js
@@ -38,17 +38,17 @@
 var testnum = 0;
 var fh;
 
 function run_test()
 {
   try {
 
   // ===== test init =====
-  var testfile = do_get_file("toolkit/components/satchel/test/unit/formhistory_apitest.sqlite");
+  var testfile = do_get_file("formhistory_apitest.sqlite");
   var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
 
   // Cleanup from any previous tests or failures.
   var destFile = profileDir.clone();
   destFile.append("formhistory.sqlite");
   if (destFile.exists())
     destFile.remove(false);
 
--- a/toolkit/mozapps/extensions/test/Makefile.in
+++ b/toolkit/mozapps/extensions/test/Makefile.in
@@ -34,19 +34,18 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH = ../../../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-ADDONSRC = $(srcdir)/unit/addons
+ADDONSRC = $(srcdir)/addons
 TESTROOT = $(shell cd $(DEPTH) && pwd)/_tests/xpcshell/$(MODULE)
-TESTPROFILE = $(TESTROOT)/profile
 TESTXPI = $(TESTROOT)/unit/addons
 relativesrcdir  = toolkit/mozapps/extensions/test
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = test_extensionmanager
 
 XPCSHELL_TESTS = \
@@ -64,18 +63,16 @@ XPCSHELL_TESTS = \
 include $(topsrcdir)/config/rules.mk
 
 # disabled due to potentially breaking other tests
 # libs:: $(_CHROME_FILES)
 # 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
 
 libs::
 	rm -rf $(TESTXPI)
-	mkdir -p $(TESTXPI)
+	$(NSINSTALL) -D $(TESTXPI)
 	if [ -d $(ADDONSRC) ]; then \
 		$(EXIT_ON_ERROR) \
 		for dir in $(ADDONSRC)/*; do \
-			if [ "$$dir" != "$(ADDONSRC)/CVS" ]; then \
-				base=`basename $$dir` ; \
-				(cd $$dir && zip $(TESTXPI)/$$base.xpi *) \
-			fi \
+			base=`basename $$dir` ; \
+			(cd $$dir && zip $(TESTXPI)/$$base.xpi *) \
 		done \
 	fi
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug257155/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug257155/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_a_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_a_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_b_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_b_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_c_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_c_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_d_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_d_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_e_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_e_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_f_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_f_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_g_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug299716_g_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_3/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_3/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_4/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_4/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_5/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_5/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_6/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_6/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_7/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_7/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_8/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_8/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug324121_9/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug324121_9/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug335238_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug335238_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug335238_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug335238_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_10/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_11/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_12/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_13/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_3/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_4/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_5/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_6/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_7/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_8/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug378216_9/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug394300_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug394300_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug394300_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug394300_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug397778/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug397778/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug425657/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug425657/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_1/README
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_1/README
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_3/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_4/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_5/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_6/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_7/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_8/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug428341_9/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug436207/install.js
rename to toolkit/mozapps/extensions/test/addons/test_bug436207/install.js
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_1/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_1/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_2/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_2/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_3/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_3/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_4/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_4/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_5/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_5/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_6/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_6/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_7/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_7/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_8/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_8/install.rdf
rename from toolkit/mozapps/extensions/test/unit/addons/test_bug463819_9/install.rdf
rename to toolkit/mozapps/extensions/test/addons/test_bug463819_9/install.rdf
--- a/toolkit/mozapps/extensions/test/unit/head_extensionmanager.js
+++ b/toolkit/mozapps/extensions/test/unit/head_extensionmanager.js
@@ -139,24 +139,17 @@ function getManifestProperty(id, propert
 /**
  * Returns a testcase xpi
  * @param   name
  *          The name of the testcase (without extension)
  * @returns an nsILocalFile pointing to the testcase xpi
  */
 function do_get_addon(name)
 {
-  var lf = gTestRoot.clone();
-  lf.append("unit");
-  lf.append("addons");
-  lf.append(name + ".xpi");
-  if (!lf.exists())
-    do_throw("Addon "+name+" does not exist.");
-
-  return lf;
+  return do_get_file("addons/" + name + ".xpi");
 }
 
 /**
  * Creates an nsIXULAppInfo
  * @param   id
  *          The ID of the test application
  * @param   name
  *          A name for the test application
@@ -254,22 +247,19 @@ function restartEM()
 {
   var needsRestart = gEM.start(null);
   if (needsRestart)
     gEM.start(null);
 }
 
 var gDirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
                         .getService(Components.interfaces.nsIProperties);
-// Remove '/unit/*.js'.
-var gTestRoot = __LOCATION__.parent.parent;
-gTestRoot.normalize();
 
 // Need to create and register a profile folder.
-var gProfD = gTestRoot.clone();
+var gProfD = do_get_cwd();
 gProfD.append("profile");
 if (gProfD.exists())
   gProfD.remove(true);
 gProfD.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
 
 var dirProvider = {
   getFile: function(prop, persistent) {
     persistent.value = true;
--- a/toolkit/mozapps/extensions/test/unit/test_bug299716.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug299716.js
@@ -222,17 +222,17 @@ const checkListener = {
         ADDONS[i].newItem = aAddon;
         return;
       }
     }
   }
 }
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 var updateItems = [];
 
 // Configure test.
 const DELAY = 2000;
 
 var ADDONS = [
   // XPCShell
@@ -318,17 +318,17 @@ function do_check_item(aItem, aVersion, 
 }
 
 /**
  * Start the test by installing extensions.
  */
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "5", "1.9");
 
-  const dataDir = do_get_file("toolkit/mozapps/extensions/test/unit/data");
+  const dataDir = do_get_file("data");
   const addonsDir = do_get_addon(ADDONS[0].addon).parent;
 
   // Make sure we can actually get our data files.
   const xpiFile = addonsDir.clone();
   xpiFile.append("test_bug299716_a_2.xpi");
   do_check_true(xpiFile.exists());
 
   // Create and configure the HTTP server.
--- a/toolkit/mozapps/extensions/test/unit/test_bug299716_2.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug299716_2.js
@@ -63,28 +63,28 @@ const checkListener = {
   },
 
   // nsIAddonUpdateCheckListener
   onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
   }
 }
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 var ADDON = {
   id: "bug299716-2@tests.mozilla.org",
   addon: "test_bug299716_2"
 };
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
-  const dataDir = do_get_file("toolkit/mozapps/extensions/test/unit/data");
+  const dataDir = do_get_file("data");
   const addonsDir = do_get_addon(ADDON.addon).parent;
 
   // Create and configure the HTTP server.
   testserver = new nsHttpServer();
   testserver.registerDirectory("/addons/", addonsDir);
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug324121.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug324121.js
@@ -35,17 +35,17 @@
  *
  * ***** END LICENSE BLOCK *****
  */
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 var next_test = null;
 
 var gItemsNotCheck = [];
 
 var ADDONS = [ {id: "bug324121_1@tests.mozilla.org",
                 addon: "test_bug324121_1",
@@ -137,17 +137,17 @@ var updateListener = {
     var pos = gItemsNotCheck.indexOf(aAddon.id);
     gItemsNotCheck.splice(pos, 1);
   }
 };
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
 
-  const dataDir = do_get_file("toolkit/mozapps/extensions/test/unit/data");
+  const dataDir = do_get_file("data");
 
   // Create and configure the HTTP server.
   testserver = new nsHttpServer();
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
   startupEM();
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug335238.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug335238.js
@@ -37,17 +37,17 @@
  */
 
 const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
 const PREF_SELECTED_LOCALE = "general.useragent.locale";
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 // This is the data we expect to see sent as part of the update url.
 var EXPECTED = [
   {
     id: "bug335238_1@tests.mozilla.org",
     version: "1.3.4",
     maxAppVersion: "5",
     status: "userEnabled",
--- a/toolkit/mozapps/extensions/test/unit/test_bug356370.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug356370.js
@@ -84,49 +84,49 @@ function write_cache_line(stream, locati
  *
  * After startup only the first two should exist in the correct install location
  * and installing extensions should be successful.
  */
 function setup_profile() {
   // Set up the profile with some existing extensions
   // Not nice to copy the extensions datasource in, but bringing up the EM to
   // create it properly will invalidate the test
-  var source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug356370.rdf");
+  var source = do_get_file("data/test_bug356370.rdf");
   source.copyTo(gProfD, "extensions.rdf");
 
   // Must programmatically generate the cache since it depends on the mimetimes
   // being accurate.
   var cache = gProfD.clone();
   cache.append("extensions.cache");
   var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
                            .createInstance(Components.interfaces.nsIFileOutputStream);
   foStream.init(cache, 0x02 | 0x08 | 0x20, 0666, 0);  // Write, create, truncate
 
   var addon = gProfD.clone();
   addon.append("extensions");
   addon.append("bug356370_1@tests.mozilla.org");
-  source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug356370_1.rdf");
+  source = do_get_file("data/test_bug356370_1.rdf");
   addon.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
   source.copyTo(addon, "install.rdf");
   write_cache_line(foStream, "app-profile", "bug356370_1@tests.mozilla.org",
                    addon.lastModifiedTime);
 
   addon = gProfD.clone();
   addon.append("extensions");
   addon.append("bug356370_2@tests.mozilla.org");
-  source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug356370_2.rdf");
+  source = do_get_file("data/test_bug356370_2.rdf");
   addon.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
   source.copyTo(addon, "install.rdf");
   write_cache_line(foStream, "app-profile", "bug356370_2@tests.mozilla.org",
                    addon.lastModifiedTime);
 
   addon = gProfD.clone();
   addon.append("extensions");
   addon.append("bug356370_4@tests.mozilla.org");
-  source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug356370_4.rdf");
+  source = do_get_file("data/test_bug356370_4.rdf");
   addon.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
   source.copyTo(addon, "install.rdf");
 
   // Write out a set of invalid entries
   write_cache_line(foStream, "invalid-lo", "bug356370_1@tests.mozilla.org", 0);
   write_cache_line(foStream, "invalid-hi", "bug356370_2@tests.mozilla.org", 0);
   write_cache_line(foStream, "invalid", "bug356370_3@tests.mozilla.org", 0);
   write_cache_line(foStream, "invalid", "bug356370_4@tests.mozilla.org", 0);
--- a/toolkit/mozapps/extensions/test/unit/test_bug378216.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug378216.js
@@ -59,17 +59,17 @@
  * 8        correct     absent      http         no update
  * 9        correct     sha1        http         update
  * 10       corrent     absent      https        update
  * 11       corrent     sha1        https        update
  * 12       corrent     md2         http         no update
  * 13       corrent     md2         https        update
  */
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var server;
 
 // This allows the EM to attempt to display errors to the user without failing
 var promptService = {
   alert: function(aParent, aDialogTitle, aText) {
   },
   
   alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
@@ -211,17 +211,17 @@ function run_test()
   do_check_neq(gEM.getItemForID("test_bug378216_8@tests.mozilla.org"), null);
   do_check_neq(gEM.getItemForID("test_bug378216_9@tests.mozilla.org"), null);
   do_check_neq(gEM.getItemForID("test_bug378216_10@tests.mozilla.org"), null);
   do_check_neq(gEM.getItemForID("test_bug378216_11@tests.mozilla.org"), null);
   do_check_neq(gEM.getItemForID("test_bug378216_12@tests.mozilla.org"), null);
   do_check_neq(gEM.getItemForID("test_bug378216_13@tests.mozilla.org"), null);
 
   server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
   
   var updates = [
     gEM.getItemForID("test_bug378216_5@tests.mozilla.org"),
     gEM.getItemForID("test_bug378216_7@tests.mozilla.org"),
     gEM.getItemForID("test_bug378216_8@tests.mozilla.org"),
     gEM.getItemForID("test_bug378216_9@tests.mozilla.org"),
     gEM.getItemForID("test_bug378216_10@tests.mozilla.org"),
--- a/toolkit/mozapps/extensions/test/unit/test_bug393285.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug393285.js
@@ -35,17 +35,17 @@
  *
  * ***** END LICENSE BLOCK *****
  */
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   // We cannot force the blocklist to update so just copy our test list to the profile
-  var source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug393285.xml");
+  var source = do_get_file("data/test_bug393285.xml");
   source.copyTo(gProfD, "blocklist.xml");
 
   var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
                             .getService(Components.interfaces.nsIBlocklistService);
   
   // No info in blocklist, shouldn't be blocked
   do_check_false(blocklist.isAddonBlocklisted("test_bug393285_1@tests.mozilla.org", "1", "1", "1.9"));
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug394300.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug394300.js
@@ -34,17 +34,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK *****
  */
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var server;
 
 // nsIAddonUpdateCheckListener implementation
 var updateListener = {
   _count: 0,
   
   onUpdateStarted: function onUpdateStarted()
   {
@@ -85,17 +85,17 @@ function run_test()
     gEM.getItemForID("bug394300_1@tests.mozilla.org"),
     gEM.getItemForID("bug394300_2@tests.mozilla.org")
   ];
   
   do_check_neq(updates[0], null);
   do_check_neq(updates[1], null);
   
   server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
   
   do_test_pending();
   
   gEM.update(updates, updates.length,
              Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION,
              updateListener);
 }
--- a/toolkit/mozapps/extensions/test/unit/test_bug394717.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug394717.js
@@ -63,17 +63,17 @@ const checkListener = {
 
   // nsIAddonUpdateCheckListener
   onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
     this._onAddonUpdateEndedCount++;
   }
 }
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 /**
  * Run the test.
  */
 function run_test() {
   // Start the http server. Will return empty update info but that's ok
   testserver = new nsHttpServer();
--- a/toolkit/mozapps/extensions/test/unit/test_bug396129.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug396129.js
@@ -38,17 +38,17 @@
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Use the internal webserver for regular update pings, will just return an error
 gPrefs.setCharPref("extensions.update.url", "http://localhost:4444/");
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 var next_state = null;
 var needs_compatibility = false;
 var next_test = null;
 
 // This allows the EM to attempt to display errors to the user without failing
 var promptService = {
@@ -174,17 +174,17 @@ var installListener = {
 
   onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
   }
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
 
-  const dataDir = do_get_file("toolkit/mozapps/extensions/test/unit/data");
+  const dataDir = do_get_file("data");
   const addonsDir = do_get_addon("test_bug396129_a_1").parent;
 
   // Create and configure the HTTP server.
   testserver = new nsHttpServer();
   testserver.registerDirectory("/addons/", addonsDir);
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug404024.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug404024.js
@@ -48,17 +48,17 @@ const SEARCH      = "http://localhost:44
 
 var BROWSE_SEARCH_URLS = [
   ["test",                              SEARCH + "test" ],
   ["SEARCH",                            SEARCH + "SEARCH" ],
   ["test search",                       SEARCH + "test%20search" ],
   ["odd=search:with&weird\"characters", SEARCH + "odd%3Dsearch%3Awith%26weird%22characters" ]
 ];
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var server;
 var addonRepo;
 
 var RESULTS = [
 {
   id:           "test5@tests.mozilla.org",
   name:         "PASS",
   version:      "1.0",
@@ -166,17 +166,17 @@ function run_test()
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   // Install an add-on so we can check the same add-on isn't returns in the results
   startupEM();
   gEM.installItemFromFile(do_get_addon("test_bug397778"), NS_INSTALL_LOCATION_APPPROFILE);
   restartEM();
 
   server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
 
   // Point the addons repository to the test server
   gPrefs.setCharPref(PREF_GETADDONS_BROWSEADDONS, BROWSE);
   gPrefs.setCharPref(PREF_GETADDONS_BROWSERECOMMENDED, RECOMMENDED);
   gPrefs.setCharPref(PREF_GETADDONS_GETRECOMMENDED, "http://localhost:4444/test_bug404024.xml");
   gPrefs.setCharPref(PREF_GETADDONS_BROWSESEARCHRESULTS, SEARCH + "%TERMS%");
   gPrefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS, "http://localhost:4444/test_%TERMS%.xml");
--- a/toolkit/mozapps/extensions/test/unit/test_bug406118.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug406118.js
@@ -35,17 +35,17 @@
  *
  * ***** END LICENSE BLOCK *****
  */
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   // We cannot force the blocklist to update so just copy our test list to the profile
-  var source = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug393285.xml");
+  var source = do_get_file("data/test_bug393285.xml");
   source.copyTo(gProfD, "blocklist.xml");
 
   var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
                             .getService(Components.interfaces.nsIBlocklistService);
   
   // All these should be blocklisted for the current app.
   do_check_false(blocklist.isAddonBlocklisted("test_bug393285_1@tests.mozilla.org", "1", null, null));
   do_check_true(blocklist.isAddonBlocklisted("test_bug393285_2@tests.mozilla.org", "1", null, null));
--- a/toolkit/mozapps/extensions/test/unit/test_bug417606.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug417606.js
@@ -48,17 +48,17 @@ const SEARCH      = "http://localhost:44
 
 var BROWSE_SEARCH_URLS = [
   ["test",                              SEARCH + "test" ],
   ["SEARCH",                            SEARCH + "SEARCH" ],
   ["test search",                       SEARCH + "test%20search" ],
   ["odd=search:with&weird\"characters", SEARCH + "odd%3Dsearch%3Awith%26weird%22characters" ]
 ];
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var server;
 var addonRepo;
 
 var RESULTS = [
 {
   id:           "test5@tests.mozilla.org",
   name:         "PASS",
   version:      "1.0",
@@ -166,17 +166,17 @@ function run_test()
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   // Install an add-on so we can check the same add-on isn't returns in the results
   startupEM();
   gEM.installItemFromFile(do_get_addon("test_bug397778"), NS_INSTALL_LOCATION_APPPROFILE);
   restartEM();
 
   server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
 
   // Point the addons repository to the test server
   gPrefs.setCharPref(PREF_GETADDONS_BROWSEADDONS, BROWSE);
   gPrefs.setCharPref(PREF_GETADDONS_BROWSERECOMMENDED, RECOMMENDED);
   gPrefs.setCharPref(PREF_GETADDONS_GETRECOMMENDED, "http://localhost:4444/test_bug417606.xml");
   gPrefs.setCharPref(PREF_GETADDONS_BROWSESEARCHRESULTS, SEARCH + "%TERMS%");
   gPrefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS, "http://localhost:4444/test_%TERMS%.xml");
--- a/toolkit/mozapps/extensions/test/unit/test_bug421396.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug421396.js
@@ -155,24 +155,24 @@ var InstallLocation = {
   priority: Components.interfaces.nsIInstallLocation.PRIORITY_APP_SYSTEM_GLOBAL,
 
   get itemLocations() {
     return new DirectoryEnumerator([ this.getItemLocation(TESTID) ]);
   },
 
   getItemLocation: function(id) {
     if (id == TESTID) {
-      var file = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug421396");
+      var file = do_get_file("data/test_bug421396");
       if (INSTALLED)
         return file;
       // If we are simulating after the extension is "removed" then return the
       // empty undeletable directory.
       return new RestrictedPath(file, true);
     }
-    var file = do_get_file("toolkit/mozapps/extensions/test");
+    var file = do_get_cwd();
     file.append("INVALIDNAME");
     file.append(id);
     return file;
   },
 
   getIDForLocation: function(file) {
     if (file.leafName == "test_bug421396")
       return TESTID;
--- a/toolkit/mozapps/extensions/test/unit/test_bug424107.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug424107.js
@@ -39,17 +39,17 @@
 function run_test()
 {
   // Copy an initial add-on into the profile.
   var extension = gProfD.clone()
   extension.append("extensions");
   extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
   extension.append("bug424107@tests.mozilla.org");
   extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  var sourcerdf = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug424107_1.rdf");
+  var sourcerdf = do_get_file("data/test_bug424107_1.rdf");
   sourcerdf.copyTo(extension, "install.rdf");
   
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "5", "1.9");
   startupEM();
   var addon = gEM.getItemForID("bug424107@tests.mozilla.org");
   do_check_neq(addon, null);
   do_check_eq(addon.version, 1);
 
@@ -57,17 +57,17 @@ function run_test()
   extension.remove(true);
 
   restartEM();
   addon = gEM.getItemForID("bug424107@tests.mozilla.org");
   do_check_eq(addon, null);
 
   // Install a new version
   extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  sourcerdf = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug424107_2.rdf");
+  sourcerdf = do_get_file("data/test_bug424107_2.rdf");
   sourcerdf.copyTo(extension, "install.rdf");
 
   restartEM();
   addon = gEM.getItemForID("bug424107@tests.mozilla.org");
   do_check_neq(addon, null);
   do_check_eq(addon.version, 2);
 }
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug424262.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug424262.js
@@ -33,17 +33,17 @@
  * 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 *****
  */
 
 const PREF_GETADDONS_GETRECOMMENDED      = "extensions.getAddons.recommended.url";
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var server;
 var addonRepo;
 
 var RESULTS = [
   -1,
   -1,
   0,
   2,
@@ -76,17 +76,17 @@ var RecommendedCallback = {
 
 function run_test()
 {
   // EM needs to be running.
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
   startupEM();
 
   server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
 
   // Point the addons repository to the test server
   gPrefs.setCharPref(PREF_GETADDONS_GETRECOMMENDED, "http://localhost:4444/test_bug424262.xml");
   
   addonRepo = Components.classes["@mozilla.org/extensions/addon-repository;1"]
                         .getService(Components.interfaces.nsIAddonRepository);
 
--- a/toolkit/mozapps/extensions/test/unit/test_bug428341.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug428341.js
@@ -34,17 +34,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL
  *
  * ***** END LICENSE BLOCK *****
  */
 
 // Use the internal webserver for regular update pings, will just return an error
 gPrefs.setCharPref("extensions.update.url", "http://localhost:4444/");
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 // This allows the EM to attempt to display errors to the user without failing
 var promptService = {
   alert: function(aParent, aDialogTitle, aText) {
   },
   
   alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
--- a/toolkit/mozapps/extensions/test/unit/test_bug430120.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug430120.js
@@ -40,17 +40,17 @@ const BLOCKLIST_TIMER                 = 
 const PREF_BLOCKLIST_URL              = "extensions.blocklist.url";
 const PREF_BLOCKLIST_ENABLED          = "extensions.blocklist.enabled";
 const PREF_APP_DISTRIBUTION           = "distribution.id";
 const PREF_APP_DISTRIBUTION_VERSION   = "distribution.version";
 const PREF_APP_UPDATE_CHANNEL         = "app.update.channel";
 const PREF_GENERAL_USERAGENT_LOCALE   = "general.useragent.locale";
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 var gOSVersion;
 var gBlocklist;
 
 // This is a replacement for the timer service so we can trigger timers
 var timerService = {
 
   timers: {},
--- a/toolkit/mozapps/extensions/test/unit/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug449027.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var ADDONS = [{
   id: "test_bug449027_1@tests.mozilla.org",
   name: "Bug 449027 Addon Test 1",
   version: "5",
   start: false,
   appBlocks: false,
   toolkitBlocks: false
@@ -545,17 +545,17 @@ function run_test() {
   // write them into the profile.
   for (var i = 0; i < ADDONS.length; i++)
     create_addon(ADDONS[i]);
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupEM();
 
   gTestserver = new nsHttpServer();
-  gTestserver.registerDirectory("/data/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
   check_test_pt1();
 }
 
 /**
  * Checks the initial state is correct
--- a/toolkit/mozapps/extensions/test/unit/test_bug455906.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug455906.js
@@ -32,17 +32,17 @@
  * 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 *****
  */
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 
 var ADDONS = [{
   // Tests how the blocklist affects a disabled add-on
   id: "test_bug455906_1@tests.mozilla.org",
   name: "Bug 455906 Addon Test 1",
   version: "5",
   appVersion: "3"
 }, {
@@ -260,24 +260,24 @@ function run_test() {
   dump("Setting up tests\n");
   // Rather than keeping lots of identical add-ons in version control, just
   // write them into the profile.
   for (var i = 0; i < ADDONS.length; i++)
     create_addon(ADDONS[i]);
 
   // Copy the initial blocklist into the profile to check add-ons start in the
   // right state.
-  var blocklist = do_get_file("toolkit/mozapps/extensions/test/unit/data/bug455906_start.xml")
+  var blocklist = do_get_file("data/bug455906_start.xml")
   blocklist.copyTo(gProfD, "blocklist.xml");
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupEM();
 
   gTestserver = new nsHttpServer();
-  gTestserver.registerDirectory("/data/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
   check_test_pt1();
 }
 
 // Before every main test this is the state the add-ons are meant to be in
 function check_initial_state() {
--- a/toolkit/mozapps/extensions/test/unit/test_bug463819.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug463819.js
@@ -40,17 +40,17 @@ const INSTALLERROR_SUCCESS              
 const INSTALLERROR_INCOMPATIBLE_VERSION  = -3;
 const INSTALLERROR_BLOCKLISTED           = -6;
 const INSTALLERROR_SOFTBLOCKED           = -10;
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Get the HTTP server.
-do_import_script("netwerk/test/httpserver/httpd.js");
+do_load_httpd_js();
 var testserver;
 
 // This allows the EM to attempt to display errors to the user without failing
 var promptService = {
   alert: function(aParent, aDialogTitle, aText) {
   },
   
   alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
@@ -154,22 +154,22 @@ var installListener = {
   onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
   }
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
 
   // Install the blocklist
-  var blocklist = do_get_file("toolkit/mozapps/extensions/test/unit/data/test_bug463819.xml");
+  var blocklist = do_get_file("data/test_bug463819.xml");
   blocklist.copyTo(gProfD, "blocklist.xml");
 
   // Create and configure the HTTP server.
   testserver = new nsHttpServer();
-  testserver.registerDirectory("/", do_get_file("toolkit/mozapps/extensions/test/unit/data"));
+  testserver.registerDirectory("/", do_get_file("data"));
   testserver.start(4444);
 
   startupEM();
   gEM.addInstallListener(installListener);
 
   // These add-ons require no update check so will complete installation immediately
   dump("Installing add-on 1\n");
   gNextTest = test_addon_1;
--- a/toolkit/mozapps/update/test/unit/head_update.js
+++ b/toolkit/mozapps/update/test/unit/head_update.js
@@ -242,19 +242,19 @@ function remove_dirs_and_files () {
 
 /**
  * Helper for starting the http server used by the tests
  * @param   aRelativeDirName
  *          The directory name to register relative to
  *          toolkit/mozapps/update/test/unit/
  */
 function start_httpserver(aRelativeDirName) {
-  do_import_script("netwerk/test/httpserver/httpd.js");
+  do_load_httpd_js();
   gTestserver = new nsHttpServer();
-  gTestserver.registerDirectory("/data/", do_get_file("toolkit/mozapps/update/test/unit/" + aRelativeDirName));
+  gTestserver.registerDirectory("/data/", do_get_file(aRelativeDirName));
   gTestserver.start(4444);
 }
 
 /* Helper for stopping the http server used by the tests */
 function stop_httpserver() {
   gTestserver.stop();
 }
 
--- a/toolkit/mozapps/update/test/unit/test_0110_general.js
+++ b/toolkit/mozapps/update/test/unit/test_0110_general.js
@@ -58,17 +58,17 @@ var gUpdatesDirPath;
 function run_test() {
   do_test_pending();
 
   var fileLocator = AUS_Cc["@mozilla.org/file/directory_service;1"]
                       .getService(AUS_Ci.nsIProperties);
 
   // The directory the updates will be applied to is the current working
   // directory (e.g. obj-dir/toolkit/mozapps/update/test) and not dist/bin
-  gTestDir = fileLocator.get("CurWorkD", AUS_Ci.nsIFile);
+  gTestDir = do_get_cwd();
   // The mar files were created with all files in a subdirectory named
   // mar_test... clear it out of the way if it exists and recreate it.
   gTestDir.append("mar_test");
   if (gTestDir.exists())
     gTestDir.remove(true);
   gTestDir.create(AUS_Ci.nsIFile.DIRECTORY_TYPE, 0755);
 
   // Create an empty test file to test the complete mar's ability to replace an
@@ -206,17 +206,17 @@ function run_test_pt1() {
 function run_test_pt2() {
   var exitValue = runUpdate();
   do_check_eq(exitValue, 0);
 
   dump("Testing: contents of files added\n");
   do_check_eq(getFileBytes(getTestFile("text1")), "ToBeModified\n");
   do_check_eq(getFileBytes(getTestFile("text2")), "ToBeDeleted\n");
 
-  var refImage = do_get_file("toolkit/mozapps/update/test/unit/data/aus-0110_general_ref_image1.png");
+  var refImage = do_get_file("data/aus-0110_general_ref_image1.png");
   var srcImage = getTestFile("image1.png");
   do_check_eq(getFileBytes(srcImage), getFileBytes(refImage));
 
   remove_dirs_and_files();
   run_test_pt3();
 }
 
 // applying a partial mar and remove an existing file
@@ -230,17 +230,17 @@ function run_test_pt4() {
   var exitValue = runUpdate();
   do_check_eq(exitValue, 0);
 
   dump("Testing: removal of a file and contents of added / modified files\n");
   do_check_eq(getFileBytes(getTestFile("text1")), "Modified\n");
   do_check_false(getTestFile("text2").exists()); // file removed
   do_check_eq(getFileBytes(getTestFile("text3")), "Added\n");
 
-  var refImage = do_get_file("toolkit/mozapps/update/test/unit/data/aus-0110_general_ref_image2.png");
+  var refImage = do_get_file("data/aus-0110_general_ref_image2.png");
   var srcImage = getTestFile("image1.png");
   do_check_eq(getFileBytes(srcImage), getFileBytes(refImage));
 
   end_test();
 }
 
 // Update check listener
 const updateCheckListener = {
--- a/xpcom/tests/unit/test_bug121341.js
+++ b/xpcom/tests/unit/test_bug121341.js
@@ -1,13 +1,13 @@
 function run_test() {
   var ios = Components.classes["@mozilla.org/network/io-service;1"].
             getService(Components.interfaces.nsIIOService);
                       
-  var dataFile = do_get_file("xpcom/tests/unit/data/bug121341.properties");
+  var dataFile = do_get_file("data/bug121341.properties");
 
   var channel = ios.newChannelFromURI(ios.newFileURI(dataFile, null, null));
   var inp = channel.open();
 
   var properties = Components.classes["@mozilla.org/persistent-properties;1"].
                    createInstance(Components.interfaces.nsIPersistentProperties);
   properties.load(inp);
 
@@ -41,17 +41,17 @@ function run_test() {
   do_check_eq(value, " test6\t");
 
   value = properties.getStringProperty("10a\u1234b");
   do_check_eq(value, "c\uCDEFd");
 
   value = properties.getStringProperty("11");
   do_check_eq(value, "\uABCD");
 
-  dataFile = do_get_file("xpcom/tests/unit/data/bug121341-2.properties");
+  dataFile = do_get_file("data/bug121341-2.properties");
 
   channel = ios.newChannelFromURI(ios.newFileURI(dataFile, null, null));
   inp = channel.open();
 
   var properties2 = Components.classes["@mozilla.org/persistent-properties;1"].
                     createInstance(Components.interfaces.nsIPersistentProperties);
   try {
     properties2.load(inp);
--- a/xpcom/tests/unit/test_bug333505.js
+++ b/xpcom/tests/unit/test_bug333505.js
@@ -1,10 +1,10 @@
 function run_test()
 {
-  var dirEntries = do_get_file("xpcom/tests/unit/").directoryEntries;
+  var dirEntries = do_get_cwd().directoryEntries;
 
   while (dirEntries.hasMoreElements())
     dirEntries.getNext();
 
   // We ensure there is no crash
   dirEntries.hasMoreElements();
 }
--- a/xpcom/tests/unit/test_mac_bundle.js
+++ b/xpcom/tests/unit/test_mac_bundle.js
@@ -1,17 +1,17 @@
 function run_test() { 
   // this is a hack to skip the rest of the code on non-Mac platforms, 
   // since #ifdef is not available to xpcshell tests...
   if (!("nsILocalFileMac" in Components.interfaces))
     return;
   
   // OK, here's the real part of the test:
   // make sure these two test bundles are recognized as bundles (or "packages") 
-  var keynoteBundle = do_get_file("xpcom/tests/unit/data/presentation.key");
-  var appBundle = do_get_file("xpcom/tests/unit/data/SmallApp.app");
+  var keynoteBundle = do_get_file("data/presentation.key");
+  var appBundle = do_get_file("data/SmallApp.app");
   
   do_check_true(keynoteBundle instanceof Components.interfaces.nsILocalFileMac);
   do_check_true(appBundle instanceof Components.interfaces.nsILocalFileMac);
   
   do_check_true(keynoteBundle.isPackage());
   do_check_true(appBundle.isPackage());
 }