toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.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 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4 */
michael@0 5
michael@0 6 /* General Partial MAR File Patch Apply Test */
michael@0 7
michael@0 8 function run_test() {
michael@0 9 setupTestCommon();
michael@0 10 gTestFiles = gTestFilesPartialSuccess;
michael@0 11 gTestFiles[gTestFiles.length - 1].originalContents = null;
michael@0 12 gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
michael@0 13 gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
michael@0 14 gTestFiles[gTestFiles.length - 2].originalContents = null;
michael@0 15 gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
michael@0 16 gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
michael@0 17 gTestDirs = gTestDirsPartialSuccess;
michael@0 18 setupUpdaterTest(FILE_PARTIAL_MAR, false, false);
michael@0 19
michael@0 20 // For Mac OS X set the last modified time for the root directory to a date in
michael@0 21 // the past to test that the last modified time is updated on all updates since
michael@0 22 // the precomplete file in the root of the bundle is renamed, etc. (bug 600098).
michael@0 23 if (IS_MACOSX) {
michael@0 24 let now = Date.now();
michael@0 25 let yesterday = now - (1000 * 60 * 60 * 24);
michael@0 26 let applyToDir = getApplyDirFile();
michael@0 27 applyToDir.lastModifiedTime = yesterday;
michael@0 28 }
michael@0 29
michael@0 30 runUpdate(0, STATE_SUCCEEDED);
michael@0 31 }
michael@0 32
michael@0 33 function checkUpdateApplied() {
michael@0 34 if (IS_MACOSX) {
michael@0 35 logTestInfo("testing last modified time on the apply to directory has " +
michael@0 36 "changed after a successful update (bug 600098)");
michael@0 37 let now = Date.now();
michael@0 38 let applyToDir = getApplyDirFile();
michael@0 39 let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
michael@0 40 do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
michael@0 41 }
michael@0 42
michael@0 43 checkFilesAfterUpdateSuccess();
michael@0 44 // Sorting on Linux is different so skip this check for now.
michael@0 45 if (!IS_UNIX) {
michael@0 46 checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
michael@0 47 }
michael@0 48
michael@0 49 checkCallbackAppLog();
michael@0 50 }

mercurial