1
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_bug476919.js
2
===================================================================
3
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_bug476919.js 2012-11-14 21:08:45.000000000 +0000
4
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_bug476919.js 2012-11-17 01:53:49.599156760 +0000
6
// skip this test on Windows
7
var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
9
- var testDir = __LOCATION__.parent;
10
+ var testDir = do_get_profile();
11
// create a test file, then symlink it, then check that we think it's a symlink
12
var targetFile = testDir.clone();
13
targetFile.append("target.txt");
14
- if (!targetFile.exists())
15
- targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
16
+ targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
18
var link = testDir.clone();
23
var ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
24
ln.initWithPath("/bin/ln");
25
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_iniProcessor.js
26
===================================================================
27
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_iniProcessor.js 2012-11-14 21:08:45.000000000 +0000
28
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_iniProcessor.js 2012-11-19 15:09:32.934061498 +0000
30
getService(Ci.nsIINIParserFactory);
31
do_check_true(!!factory);
33
+var outputDir = do_get_profile();
34
+outputDir.append("test_iniProcessor_data");
36
// Test reading from a variety of files. While we're at it, write out each one
37
// and read it back to ensure that nothing changed.
38
while (testnum < testdata.length) {
41
do_check_true(parser instanceof Ci.nsIINIParserWriter);
42
// write contents out to a new file
43
- let newfilename = filename + ".new";
44
- let newfile = do_get_file(filename);
45
- newfile.leafName += ".new";
46
+ let newfile = outputDir.clone();
47
+ newfile.appendRelativePath(filename);
48
+ if (!newfile.parent.exists()) {
49
+ newfile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
51
parser.writeFile(newfile);
52
// read new file and make sure the contents are the same.
53
- parser = parserForFile(newfilename);
54
+ parser = factory.createINIParser(newfile);
55
+ do_check_true(!!parser);
56
checkParserOutput(parser, testdata[testnum - 1].reference);
57
- // cleanup after the test
58
- newfile.remove(false);
61
dump("INFO | test #" + ++testnum + "\n");
63
// test writing to a new file.
64
-let newfile = do_get_file("data/");
65
+let newfile = outputDir.clone();
66
newfile.append("nonexistent-file.ini");
67
-if (newfile.exists())
68
- newfile.remove(false);
69
do_check_false(newfile.exists());
71
let parser = factory.createINIParser(newfile);
73
do_check_true(newfile.exists());
74
checkParserOutput(parser, {section: {key: "value"} });
75
// read it in again, check for same data.
76
-parser = parserForFile("data/nonexistent-file.ini");
77
+parser = factory.createINIParser(newfile);
78
checkParserOutput(parser, {section: {key: "value"} });
79
-// cleanup after the test
80
-newfile.remove(false);
82
dump("INFO | test #" + ++testnum + "\n");
84
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_nsIProcess.js
85
===================================================================
86
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_nsIProcess.js 2012-11-14 21:08:45.000000000 +0000
87
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_nsIProcess.js 2012-11-19 19:07:55.765807352 +0000
89
"\u09AE\u09CB\u099C\u09BF\u09B2\u09BE",
90
"\uD808\uDE2C\uD808\uDF63\uD808\uDDB7"];
92
+gProfileDir = do_get_profile();
94
// test if a process can be started, polled for its running status
98
test_args(get_test_program("TestUnicodeArguments"), TEST_UNICODE_ARGS, false);
101
-function rename_and_test(asciiName, unicodeName, args, argsAreASCII)
102
+function copy_and_test(asciiName, unicodeName, args, argsAreASCII)
104
var asciiFile = get_test_program(asciiName);
105
var asciiLeaf = asciiFile.leafName;
106
var unicodeLeaf = asciiLeaf.replace(asciiName, unicodeName);
108
- asciiFile.moveTo(null, unicodeLeaf);
109
+ asciiFile.copyTo(gProfileDir, unicodeLeaf);
111
- var unicodeFile = get_test_program(unicodeName);
112
+ var unicodeFile = get_test_program(unicodeName, gProfileDir);
114
test_args(unicodeFile, args, argsAreASCII);
116
- unicodeFile.moveTo(null, asciiLeaf);
119
// test passing ASCII and Unicode arguments to an application with a Unicode name
120
function test_unicode_app()
122
- rename_and_test("TestArguments",
123
- // "Unicode" in Tamil
124
- "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
127
- rename_and_test("TestUnicodeArguments",
128
- // "Unicode" in Thai
129
- "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
130
- TEST_UNICODE_ARGS, false);
131
+ copy_and_test("TestArguments",
132
+ // "Unicode" in Tamil
133
+ "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
136
+ copy_and_test("TestUnicodeArguments",
137
+ // "Unicode" in Thai
138
+ "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
139
+ TEST_UNICODE_ARGS, false);
142
// test if we get notified about a blocking process
143
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_symlinks.js
144
===================================================================
145
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/test_symlinks.js 2012-11-14 21:08:45.000000000 +0000
146
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/test_symlinks.js 2012-11-19 16:07:43.461999474 +0000
152
+ var testDir = do_get_profile();
153
testDir.append("test_symlinks");
155
testSymLinks(testDir, false);
156
Index: firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/head_xpcom.js
157
===================================================================
158
--- firefox-trunk-19.0~a1~hg20121114r113217.orig/xpcom/tests/unit/head_xpcom.js 2012-11-14 21:08:45.000000000 +0000
159
+++ firefox-trunk-19.0~a1~hg20121114r113217/xpcom/tests/unit/head_xpcom.js 2012-11-19 19:07:21.373807965 +0000
161
var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
163
-function get_test_program(prog)
164
+function get_test_program(prog, dir)
166
- var progPath = do_get_cwd();
168
+ var progPath = do_get_cwd();
170
+ var progPath = dir.clone();
171
progPath.append(prog);
173
progPath.leafName = progPath.leafName + ".exe";