Sat, 03 Jan 2015 20:18:00 +0100
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 | const Cc = Components.classes; |
michael@0 | 2 | const Ci = Components.interfaces; |
michael@0 | 3 | |
michael@0 | 4 | function run_test() { |
michael@0 | 5 | // skip this test on Windows |
michael@0 | 6 | var isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes); |
michael@0 | 7 | if (!isWindows) { |
michael@0 | 8 | var testDir = __LOCATION__.parent; |
michael@0 | 9 | // create a test file, then symlink it, then check that we think it's a symlink |
michael@0 | 10 | var targetFile = testDir.clone(); |
michael@0 | 11 | targetFile.append("target.txt"); |
michael@0 | 12 | if (!targetFile.exists()) |
michael@0 | 13 | targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644); |
michael@0 | 14 | |
michael@0 | 15 | var link = testDir.clone(); |
michael@0 | 16 | link.append("link"); |
michael@0 | 17 | if (link.exists()) |
michael@0 | 18 | link.remove(false); |
michael@0 | 19 | |
michael@0 | 20 | var ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); |
michael@0 | 21 | ln.initWithPath("/bin/ln"); |
michael@0 | 22 | var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); |
michael@0 | 23 | process.init(ln); |
michael@0 | 24 | var args = ["-s", targetFile.path, link.path]; |
michael@0 | 25 | process.run(true, args, args.length); |
michael@0 | 26 | do_check_true(link.isSymlink()); |
michael@0 | 27 | } |
michael@0 | 28 | } |