test_bug333423.js (857B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 2 /* vim:set ts=2 sw=2 sts=2 et: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // Regression test for bug 333423 - crash enumerating entries of a 8 // closed nsIZipReader 9 function run_test() { 10 // the build script have created the zip we can test on in the current dir. 11 var file = do_get_file("data/test_bug333423.zip"); 12 13 var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance( 14 Ci.nsIZipReader 15 ); 16 zipreader.open(file); 17 zipreader.close(); 18 // this should error out and not crash 19 Assert.throws( 20 () => zipreader.findEntries("*.*"), 21 /NS_ERROR_FAILURE/, 22 "Should error out on a closed zipreader" 23 ); 24 }