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 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 3 | */ |
michael@0 | 4 | |
michael@0 | 5 | /* File locked complete MAR file patch apply failure test */ |
michael@0 | 6 | |
michael@0 | 7 | function run_test() { |
michael@0 | 8 | setupTestCommon(); |
michael@0 | 9 | gTestFiles = gTestFilesCompleteSuccess; |
michael@0 | 10 | gTestDirs = gTestDirsCompleteSuccess; |
michael@0 | 11 | setTestFilesAndDirsForFailure(); |
michael@0 | 12 | setupUpdaterTest(FILE_COMPLETE_MAR, false, false); |
michael@0 | 13 | |
michael@0 | 14 | // Exclusively lock an existing file so it is in use during the update. |
michael@0 | 15 | let helperBin = getTestDirFile(FILE_HELPER_BIN); |
michael@0 | 16 | let helperDestDir = getApplyDirFile("a/b/"); |
michael@0 | 17 | helperBin.copyTo(helperDestDir, FILE_HELPER_BIN); |
michael@0 | 18 | helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN); |
michael@0 | 19 | // Strip off the first two directories so the path has to be from the helper's |
michael@0 | 20 | // working directory. |
michael@0 | 21 | let lockFileRelPath = gTestFiles[3].relPathDir.split("/"); |
michael@0 | 22 | lockFileRelPath = lockFileRelPath.slice(2); |
michael@0 | 23 | lockFileRelPath = lockFileRelPath.join("/") + "/" + gTestFiles[3].fileName; |
michael@0 | 24 | let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", |
michael@0 | 25 | HELPER_SLEEP_TIMEOUT, lockFileRelPath]; |
michael@0 | 26 | let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"]. |
michael@0 | 27 | createInstance(AUS_Ci.nsIProcess); |
michael@0 | 28 | lockFileProcess.init(helperBin); |
michael@0 | 29 | lockFileProcess.run(false, args, args.length); |
michael@0 | 30 | |
michael@0 | 31 | do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function doUpdate() { |
michael@0 | 35 | runUpdate(1, STATE_FAILED_WRITE_ERROR); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | function checkUpdateApplied() { |
michael@0 | 39 | setupHelperFinish(); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | function checkUpdate() { |
michael@0 | 43 | checkFilesAfterUpdateFailure(); |
michael@0 | 44 | checkUpdateLogContains(ERR_RENAME_FILE); |
michael@0 | 45 | checkCallbackAppLog(); |
michael@0 | 46 | } |