toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.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.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     6 /* General Update Manager Tests */
     8 function run_test() {
     9   setupTestCommon();
    11   logTestInfo("testing removal of an active update for a channel that is not" +
    12               "valid due to switching channels (Bug 486275).");
    14   var patches, updates, update;
    15   patches = getLocalPatchString(null, null, null, null, null, null,
    16                                 STATE_DOWNLOADING);
    17   updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0");
    18   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
    19   writeStatusFile(STATE_DOWNLOADING);
    21   patches = getLocalPatchString(null, null, null, null, null, null,
    22                                 STATE_FAILED);
    23   updates = getLocalUpdateString(patches, null, "Existing", "version 3.0",
    24                                  "3.0", "3.0", null, null, null, null, null,
    25                                  getString("patchApplyFailure"));
    26   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
    28   setUpdateChannel("original_channel");
    30   standardInit();
    32   do_check_eq(gUpdateManager.updateCount, 1);
    33   update = gUpdateManager.getUpdateAt(0);
    34   do_check_eq(update.name, "Existing");
    36   do_check_eq(gUpdateManager.activeUpdate, null);
    37   // Verify that the active-update.xml file has had the update from the old
    38   // channel removed.
    39   file = getUpdatesXMLFile(true);
    40   logTestInfo("verifying contents of " + FILE_UPDATE_ACTIVE);
    41   do_check_eq(readFile(file), getLocalUpdatesXMLString(""));
    43   doTestFinish();
    44 }

mercurial