diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /modules/libjar/test/unit/test_umlaute.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'modules/libjar/test/unit/test_umlaute.js')
-rw-r--r-- | modules/libjar/test/unit/test_umlaute.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/libjar/test/unit/test_umlaute.js b/modules/libjar/test/unit/test_umlaute.js new file mode 100644 index 000000000..bfaa0eabc --- /dev/null +++ b/modules/libjar/test/unit/test_umlaute.js @@ -0,0 +1,40 @@ + +var Cc = Components.classes; +var Ci = Components.interfaces; + +function run_test() { + var dirService = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); + var tmpDir = dirService.get("TmpD", Ci.nsIFile); + + var zipfile = do_get_file("data/test_umlaute.zip"); + + var testFile = tmpDir.clone(); + testFile.append("test_\u00FC.txt"); + if (testFile.exists()) { + testFile.remove(false); + } + + var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader); + zipreader.open(zipfile); + + var entries = zipreader.findEntries(null); + do_check_true(entries.hasMore()); + + var entryName = entries.getNext(); + do_check_eq(entryName, "test_\u00FC.txt"); + + do_check_true(zipreader.hasEntry(entryName)); + + var target = tmpDir.clone(); + target.append(entryName); + target.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0o640); // 0640 + + zipreader.extract(entryName, target); + + var entry = zipreader.getEntry(entryName); + do_check_true(entry != null); + + zipreader.test(entryName); + + zipreader.close(); +} |