test_corrupt_541828.js (686B)
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 5 // Check that files can be read from after closing zipreader 6 function run_test() { 7 // the build script have created the zip we can test on in the current dir. 8 var file = do_get_file("data/test_corrupt2.zip"); 9 10 var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance( 11 Ci.nsIZipReader 12 ); 13 var failed = false; 14 try { 15 zipreader.open(file); 16 // corrupt files should trigger an exception 17 } catch (ex) { 18 failed = true; 19 } 20 Assert.ok(failed); 21 }