bug 482085 - fix all xpcshell tests to not reference files from the srcdir. r=bsmedberg,waldo

--HG--
rename : toolkit/components/downloads/test/downloads.empty.sqlite => browser/components/privatebrowsing/test/unit/downloads.empty.sqlite
rename : dom/src/json/test/fail1.json => dom/src/json/test/unit/fail1.json
rename : dom/src/json/test/fail10.json => dom/src/json/test/unit/fail10.json
rename : dom/src/json/test/fail11.json => dom/src/json/test/unit/fail11.json
rename : dom/src/json/test/fail12.json => dom/src/json/test/unit/fail12.json
rename : dom/src/json/test/fail13.json => dom/src/json/test/unit/fail13.json
rename : dom/src/json/test/fail14.json => dom/src/json/test/unit/fail14.json
rename : dom/src/json/test/fail15.json => dom/src/json/test/unit/fail15.json
rename : dom/src/json/test/fail16.json => dom/src/json/test/unit/fail16.json
rename : dom/src/json/test/fail17.json => dom/src/json/test/unit/fail17.json
rename : dom/src/json/test/fail18.json => dom/src/json/test/unit/fail18.json
rename : dom/src/json/test/fail19.json => dom/src/json/test/unit/fail19.json
rename : dom/src/json/test/fail2.json => dom/src/json/test/unit/fail2.json
rename : dom/src/json/test/fail20.json => dom/src/json/test/unit/fail20.json
rename : dom/src/json/test/fail21.json => dom/src/json/test/unit/fail21.json
rename : dom/src/json/test/fail22.json => dom/src/json/test/unit/fail22.json
rename : dom/src/json/test/fail23.json => dom/src/json/test/unit/fail23.json
rename : dom/src/json/test/fail24.json => dom/src/json/test/unit/fail24.json
rename : dom/src/json/test/fail25.json => dom/src/json/test/unit/fail25.json
rename : dom/src/json/test/fail26.json => dom/src/json/test/unit/fail26.json
rename : dom/src/json/test/fail27.json => dom/src/json/test/unit/fail27.json
rename : dom/src/json/test/fail28.json => dom/src/json/test/unit/fail28.json
rename : dom/src/json/test/fail29.json => dom/src/json/test/unit/fail29.json
rename : dom/src/json/test/fail3.json => dom/src/json/test/unit/fail3.json
rename : dom/src/json/test/fail30.json => dom/src/json/test/unit/fail30.json
rename : dom/src/json/test/fail31.json => dom/src/json/test/unit/fail31.json
rename : dom/src/json/test/fail32.json => dom/src/json/test/unit/fail32.json
rename : dom/src/json/test/fail33.json => dom/src/json/test/unit/fail33.json
rename : dom/src/json/test/fail34.json => dom/src/json/test/unit/fail34.json
rename : dom/src/json/test/fail4.json => dom/src/json/test/unit/fail4.json
rename : dom/src/json/test/fail5.json => dom/src/json/test/unit/fail5.json
rename : dom/src/json/test/fail6.json => dom/src/json/test/unit/fail6.json
rename : dom/src/json/test/fail7.json => dom/src/json/test/unit/fail7.json
rename : dom/src/json/test/fail8.json => dom/src/json/test/unit/fail8.json
rename : dom/src/json/test/fail9.json => dom/src/json/test/unit/fail9.json
rename : dom/src/json/test/json2.js => dom/src/json/test/unit/json2.js
rename : dom/src/json/test/pass1.json => dom/src/json/test/unit/pass1.json
rename : dom/src/json/test/pass3.json => dom/src/json/test/unit/pass3.json
rename : testing/xpcshell/example/location_load.js => testing/xpcshell/example/unit/location_load.js
rename : toolkit/components/commandlines/test/unit/unix/test_bug410156.js => toolkit/components/commandlines/test/unit_unix/test_bug410156.js
rename : toolkit/components/commandlines/test/unit/win/test_bug410156.js => toolkit/components/commandlines/test/unit_win/test_bug410156.js
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug257155/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug257155/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_a_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_a_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_b_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_b_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_c_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_c_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_d_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_d_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_e_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_e_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_f_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_f_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_g_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_g_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_3/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_4/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_5/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_6/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_7/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_8/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_9/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug335238_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug335238_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug335238_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug335238_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_10/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_11/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_12/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_13/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug394300_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug394300_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug394300_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug394300_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug397778/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug397778/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug425657/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug425657/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_1/README => toolkit/mozapps/extensions/test/addons/test_bug428341_1/README
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug436207/install.js => toolkit/mozapps/extensions/test/addons/test_bug436207/install.js
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_1/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_2/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_3/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_4/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_5/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_6/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_7/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_8/install.rdf
rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_9/install.rdf
This commit is contained in:
Ted Mielczarek 2009-03-21 11:20:00 -04:00
parent b3c54dd1d3
commit dcc2d8f492
252 changed files with 486 additions and 334 deletions

View File

@ -167,7 +167,7 @@ function check_no_bookmarks() {
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";

View File

@ -70,8 +70,8 @@ function run_test() {
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");

View File

@ -71,7 +71,7 @@ function run_test() {
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); }

View File

@ -102,7 +102,7 @@ function run_test() {
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");

View File

@ -116,7 +116,7 @@ function do_test()
// 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

View File

@ -39,6 +39,6 @@
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();
}

View File

@ -40,6 +40,6 @@
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();
}

View File

@ -39,6 +39,6 @@
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();
}

View File

@ -40,6 +40,6 @@
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();
}

View File

@ -44,6 +44,6 @@
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();
}

View File

@ -44,6 +44,6 @@
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();
}

View File

@ -44,6 +44,6 @@
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();
}

View File

@ -44,6 +44,6 @@
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();
}

View File

@ -37,7 +37,7 @@
*/
const MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug292789.manifest")
do_get_file("data/test_bug292789.manifest")
];
registerManifests(MANIFESTS);

View File

@ -38,7 +38,7 @@
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug380398.manifest")
do_get_file("data/test_bug380398.manifest")
];
registerManifests(MANIFESTS);
@ -83,7 +83,7 @@ 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)

View File

@ -37,7 +37,7 @@
*/
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug397073.manifest")
do_get_file("data/test_bug397073.manifest")
];
@ -83,7 +83,7 @@ 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)

View File

@ -37,7 +37,7 @@
*/
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug399707.manifest")
do_get_file("data/test_bug399707.manifest")
];
registerManifests(MANIFESTS);
@ -82,7 +82,7 @@ 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)

View File

@ -37,7 +37,7 @@
*/
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug401153.manifest")
do_get_file("data/test_bug401153.manifest")
];
registerManifests(MANIFESTS);
@ -106,7 +106,7 @@ function test_failed_mapping(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");

View File

@ -38,7 +38,7 @@
* ***** 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);

View File

@ -38,7 +38,7 @@
* ***** 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);

View File

@ -131,9 +131,15 @@ 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!

View File

@ -36,7 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
const gBasePath = "content/base/test/unit/";
const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
@ -45,7 +44,7 @@ function loadContentFile(aFile, aCharset) {
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) );

View File

@ -40,7 +40,7 @@ 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);

View File

@ -66,7 +66,7 @@ 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);

View File

@ -257,7 +257,7 @@ function getParsedDocument(aPath) {
* 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");
@ -409,7 +409,7 @@ function run_extract_test() {
* 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");

View File

@ -40,7 +40,7 @@ function run_test() {
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);

View File

@ -16,4 +16,4 @@ if (!outputDir.exists()) {
do_throw(outputName + " is not a directory?")
}
var crockfordJSON = null;
do_import_script("dom/src/json/test/json2.js");
load("json2.js");

View File

@ -96,11 +96,11 @@ function test_files() {
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);
@ -163,7 +163,7 @@ function test_files() {
// 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);

View File

@ -2,7 +2,7 @@ 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);

View File

@ -31,7 +31,7 @@ function run_test()
"nsIConverterInputStream",
"init");
dataDir = do_get_file("intl/uconv/tests/unit/data/");
dataDir = do_get_file("data/");
test_utf8_1();
test_utf16_1();

View File

@ -131,9 +131,15 @@ 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!

View File

@ -58,7 +58,7 @@ function run_test() {
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);

View File

@ -37,7 +37,7 @@
* ***** 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);

View File

@ -40,7 +40,7 @@ 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);

View File

@ -92,7 +92,7 @@ function run_test() {
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"]

View File

@ -44,7 +44,7 @@ function run_test() {
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);

View File

View File

@ -2,7 +2,7 @@
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"].
@ -23,7 +23,7 @@ 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.

View File

@ -44,7 +44,7 @@ function run_test() {
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);

View File

@ -3,7 +3,7 @@ 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);

View File

@ -7,7 +7,7 @@ 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";

View File

@ -2,7 +2,7 @@
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;

View File

@ -61,7 +61,7 @@ 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");

View File

@ -42,7 +42,7 @@ 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.

View File

@ -1,5 +1,5 @@
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);
}

View File

@ -2,7 +2,6 @@
* Tests for imgITools
*/
const TESTDIR = "modules/libpr0n/test/unit/";
const Ci = Components.interfaces;
const Cc = Components.classes;
@ -145,7 +144,7 @@ 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);
@ -170,7 +169,7 @@ 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);
@ -189,7 +188,7 @@ 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);
@ -205,7 +204,7 @@ 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);
@ -231,7 +230,7 @@ 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);
@ -252,7 +251,7 @@ 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);
@ -269,7 +268,7 @@ 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);
@ -294,7 +293,7 @@ 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);
@ -313,7 +312,7 @@ 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);
@ -341,11 +340,11 @@ var testData =
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 };
@ -379,7 +378,7 @@ 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);

View File

@ -113,3 +113,10 @@ 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/

View File

@ -36,7 +36,7 @@
*
* ***** 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;

View File

@ -72,7 +72,7 @@ var tests =
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);

View File

@ -58,7 +58,7 @@ 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);

View File

@ -49,7 +49,7 @@ function run_test()
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);

View File

@ -79,7 +79,7 @@ function run_test()
// 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);

View File

@ -316,7 +316,7 @@ var testsDirectory;
function run_test()
{
testsDirectory = do_get_file("netwerk/test/httpserver/test/");
testsDirectory = do_get_cwd();
srv = createServer();
srv.start(4444);

View File

@ -46,7 +46,7 @@ function isException(e, 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)
{
@ -67,7 +67,7 @@ function run_test()
try
{
srv.registerFile("/foo", do_get_file("netwerk/test/httpserver/"));
srv.registerFile("/foo", do_get_cwd());
throw "registerFile succeeded!";
}
catch (e)

View File

@ -43,7 +43,7 @@ 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);

View File

@ -40,7 +40,7 @@
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 = [];

View File

@ -46,7 +46,7 @@ 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);

View File

@ -48,7 +48,7 @@ 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);

View File

@ -1,6 +1,6 @@
// 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;

View File

@ -4,7 +4,7 @@
// 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();

View File

@ -1,4 +1,4 @@
do_import_script("netwerk/test/httpserver/httpd.js");
do_load_httpd_js();
var server;
const BUGID = "263127";

View File

@ -1,4 +1,4 @@
do_import_script("netwerk/test/httpserver/httpd.js");
do_load_httpd_js();
var server;
const BUGID = "331825";

Some files were not shown because too many files have changed in this diff Show More