toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 function run_test() {
     7   setupTestCommon();
     9   logTestInfo("testing update logs are first in first out deleted");
    11   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
    12   var patches = getLocalPatchString(null, null, null, null, null, null,
    13                                     STATE_PENDING);
    14   var updates = getLocalUpdateString(patches);
    15   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
    16   writeStatusFile(STATE_SUCCEEDED);
    18   var dir = getUpdatesDir();
    19   var log = dir.clone();
    20   log.append(FILE_LAST_LOG);
    21   writeFile(log, "Backup Update Log");
    23   log = dir.clone();
    24   log.append(FILE_BACKUP_LOG);
    25   writeFile(log, "To Be Deleted Backup Update Log");
    27   log = dir.clone();
    28   log.append("0");
    29   log.append(FILE_UPDATE_LOG);
    30   writeFile(log, "Last Update Log");
    32   standardInit();
    34   logTestInfo("testing " + log.path + " shouldn't exist");
    35   do_check_false(log.exists());
    37   log = dir.clone();
    38   log.append(FILE_LAST_LOG);
    39   logTestInfo("testing " + log.path + " should exist");
    40   do_check_true(log.exists());
    42   logTestInfo("testing " + log.path + " contents");
    43   do_check_eq(readFile(log), "Last Update Log");
    45   log = dir.clone();
    46   log.append(FILE_BACKUP_LOG);
    47   logTestInfo("testing " + log.path + " should exist");
    48   do_check_true(log.exists());
    50   logTestInfo("testing " + log.path + " contents (bug 470979)");
    51   do_check_eq(readFile(log), "Backup Update Log");
    53   dir.append("0");
    54   logTestInfo("testing " + dir.path + " should exist (bug 512994)");
    55   do_check_true(dir.exists());
    57   doTestFinish();
    58 }

mercurial