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 FILENAME = "missing.txt"; michael@0: michael@0: var observer = { michael@0: onStartRequest: function(request, context) michael@0: { michael@0: }, michael@0: michael@0: onStopRequest: function(request, context, status) michael@0: { michael@0: do_check_eq(status, Components.results.NS_ERROR_FILE_NOT_FOUND); michael@0: zipW.close(); michael@0: do_check_eq(ZIP_EOCDR_HEADER_SIZE, tmpFile.fileSize); michael@0: do_test_finished(); michael@0: } michael@0: }; 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: var source = tmpDir.clone(); michael@0: source.append(FILENAME); michael@0: zipW.addEntryFile(FILENAME, Ci.nsIZipWriter.COMPRESSION_NONE, source, true); michael@0: michael@0: do_test_pending(); michael@0: zipW.processQueue(observer, null); michael@0: michael@0: // With nothing to actually do the queue would have completed immediately michael@0: do_check_false(zipW.inQueue); michael@0: }