xpcom/tests/unit/head_xpcom.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial