modules/libjar/zipwriter/test/unit/test_directory.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 const DIRNAME1 = "test";
     7 const DIRNAME1_CORRECT = "test/";
     8 const DIRNAME2 = "test2/";
     9 const time = Date.now();
    11 function run_test()
    12 {
    13   zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
    15   zipW.addEntryDirectory(DIRNAME1, time * PR_USEC_PER_MSEC, false);
    16   do_check_false(zipW.hasEntry(DIRNAME1));
    17   do_check_true(zipW.hasEntry(DIRNAME1_CORRECT));
    18   var entry = zipW.getEntry(DIRNAME1_CORRECT);
    19   do_check_true(entry.isDirectory);
    21   zipW.addEntryDirectory(DIRNAME2, time * PR_USEC_PER_MSEC, false);
    22   do_check_true(zipW.hasEntry(DIRNAME2));
    23   entry = zipW.getEntry(DIRNAME2);
    24   do_check_true(entry.isDirectory);
    26   zipW.close();
    27 }

mercurial