summaryrefslogtreecommitdiffstats
path: root/modules/libjar/test/unit/test_umlaute.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /modules/libjar/test/unit/test_umlaute.js
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/libjar/test/unit/test_umlaute.js')
-rw-r--r--modules/libjar/test/unit/test_umlaute.js37
1 files changed, 37 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 0000000000..93e43529cd
--- /dev/null
+++ b/modules/libjar/test/unit/test_umlaute.js
@@ -0,0 +1,37 @@
+function run_test() {
+ var tmpDir = Services.dirsvc.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);
+ Assert.ok(entries.hasMore());
+
+ var entryName = entries.getNext();
+ Assert.equal(entryName, "test_\u00FC.txt");
+
+ Assert.ok(zipreader.hasEntry(entryName));
+
+ var target = tmpDir.clone();
+ target.append(entryName);
+ target.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o640); // 0640
+
+ zipreader.extract(entryName, target);
+
+ var entry = zipreader.getEntry(entryName);
+ Assert.ok(entry != null);
+
+ zipreader.test(entryName);
+
+ zipreader.close();
+}