test_dirjar_bug525755.js (653B)
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 // Check that we refuse to open weird files 8 function run_test() { 9 // open a bogus file 10 var file = do_get_file("/"); 11 12 var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance( 13 Ci.nsIZipReader 14 ); 15 var failed = false; 16 try { 17 zipreader.open(file); 18 } catch (e) { 19 failed = true; 20 } 21 Assert.ok(failed); 22 zipreader = null; 23 }