xpcom/tests/unit/head_xpcom.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:ab1717f0ed52
1 var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
2
3 function get_test_program(prog)
4 {
5 var progPath = do_get_cwd();
6 progPath.append(prog);
7 if (isWindows)
8 progPath.leafName = progPath.leafName + ".exe";
9 return progPath;
10 }
11
12 function set_process_running_environment()
13 {
14 var envSvc = Components.classes["@mozilla.org/process/environment;1"].
15 getService(Components.interfaces.nsIEnvironment);
16 var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
17 getService(Components.interfaces.nsIProperties);
18 var greDir = dirSvc.get("GreD", Components.interfaces.nsIFile);
19
20 envSvc.set("DYLD_LIBRARY_PATH", greDir.path);
21 // For Linux
22 envSvc.set("LD_LIBRARY_PATH", greDir.path);
23 //XXX: handle windows
24 }
25

mercurial