unit test (xpcshell) for bug 336691 (nsZipArchive::Test shouldn't try to ExtractFile on directories)

by Ryan Jones <sciguyryan@gmail.com>
r=biesi
This commit is contained in:
asqueella%gmail.com 2007-03-07 20:19:09 +00:00
parent bc1a2c6821
commit 278563015b
2 changed files with 12 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,12 @@
// Regression test for bug 336691 - nsZipArchive::Test shouldn't try to ExtractFile on directories.
const Cc = Components.classes;
const Ci = Components.interfaces;
function run_test() {
var file = do_get_file("modules/libjar/test/unit/data/test_bug336691.zip");
var zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
createInstance(Ci.nsIZipReader);
zipReader.open(file);
zipReader.test(null); // We shouldn't crash here.
zipReader.close();
}