michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: const DIRNAME1 = "test"; michael@0: const DIRNAME1_CORRECT = "test/"; michael@0: const DIRNAME2 = "test2/"; michael@0: const time = Date.now(); michael@0: michael@0: function run_test() michael@0: { michael@0: zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE); michael@0: michael@0: zipW.addEntryDirectory(DIRNAME1, time * PR_USEC_PER_MSEC, false); michael@0: do_check_false(zipW.hasEntry(DIRNAME1)); michael@0: do_check_true(zipW.hasEntry(DIRNAME1_CORRECT)); michael@0: var entry = zipW.getEntry(DIRNAME1_CORRECT); michael@0: do_check_true(entry.isDirectory); michael@0: michael@0: zipW.addEntryDirectory(DIRNAME2, time * PR_USEC_PER_MSEC, false); michael@0: do_check_true(zipW.hasEntry(DIRNAME2)); michael@0: entry = zipW.getEntry(DIRNAME2); michael@0: do_check_true(entry.isDirectory); michael@0: michael@0: zipW.close(); michael@0: }