summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-11-19 06:33:00 -0500
committerMatt A. Tobin <email@mattatobin.com>2021-11-19 06:33:00 -0500
commit88b5b6ef2072bcbb09329a9db25de1debbc06143 (patch)
tree103da19044b5202abb63e6bc8848c2c43c8cb258
parentf8796cf0a4259b4b24b3be8ece0e0c26e2c017d5 (diff)
downloadaura-central-88b5b6ef2072bcbb09329a9db25de1debbc06143.tar.gz
Issue %3005 - Move modules/libjar to components/jar
- Also merges the sub component zipwriter
-rw-r--r--build/moz.configure/old.configure1
-rw-r--r--components/jar/appnote.txt (renamed from modules/libjar/appnote.txt)0
-rw-r--r--components/jar/moz.build39
-rw-r--r--components/jar/public/nsIJARChannel.idl (renamed from modules/libjar/nsIJARChannel.idl)0
-rw-r--r--components/jar/public/nsIJARProtocolHandler.idl (renamed from modules/libjar/nsIJARProtocolHandler.idl)0
-rw-r--r--components/jar/public/nsIJARURI.idl (renamed from modules/libjar/nsIJARURI.idl)0
-rw-r--r--components/jar/public/nsIZipReader.idl (renamed from modules/libjar/nsIZipReader.idl)0
-rw-r--r--components/jar/public/nsIZipWriter.idl (renamed from modules/libjar/zipwriter/nsIZipWriter.idl)0
-rw-r--r--components/jar/src/StreamFunctions.cpp (renamed from modules/libjar/zipwriter/StreamFunctions.cpp)0
-rw-r--r--components/jar/src/StreamFunctions.h (renamed from modules/libjar/zipwriter/StreamFunctions.h)0
-rw-r--r--components/jar/src/ZipWriterModule.cpp (renamed from modules/libjar/zipwriter/ZipWriterModule.cpp)0
-rw-r--r--components/jar/src/nsDeflateConverter.cpp (renamed from modules/libjar/zipwriter/nsDeflateConverter.cpp)0
-rw-r--r--components/jar/src/nsDeflateConverter.h (renamed from modules/libjar/zipwriter/nsDeflateConverter.h)0
-rw-r--r--components/jar/src/nsIJARFactory.h (renamed from modules/libjar/nsIJARFactory.h)0
-rw-r--r--components/jar/src/nsJAR.cpp (renamed from modules/libjar/nsJAR.cpp)0
-rw-r--r--components/jar/src/nsJAR.h (renamed from modules/libjar/nsJAR.h)0
-rw-r--r--components/jar/src/nsJARChannel.cpp (renamed from modules/libjar/nsJARChannel.cpp)0
-rw-r--r--components/jar/src/nsJARChannel.h (renamed from modules/libjar/nsJARChannel.h)0
-rw-r--r--components/jar/src/nsJARFactory.cpp (renamed from modules/libjar/nsJARFactory.cpp)0
-rw-r--r--components/jar/src/nsJARInputStream.cpp (renamed from modules/libjar/nsJARInputStream.cpp)0
-rw-r--r--components/jar/src/nsJARInputStream.h (renamed from modules/libjar/nsJARInputStream.h)0
-rw-r--r--components/jar/src/nsJARProtocolHandler.cpp (renamed from modules/libjar/nsJARProtocolHandler.cpp)0
-rw-r--r--components/jar/src/nsJARProtocolHandler.h (renamed from modules/libjar/nsJARProtocolHandler.h)0
-rw-r--r--components/jar/src/nsJARURI.cpp (renamed from modules/libjar/nsJARURI.cpp)0
-rw-r--r--components/jar/src/nsJARURI.h (renamed from modules/libjar/nsJARURI.h)0
-rw-r--r--components/jar/src/nsZipArchive.cpp (renamed from modules/libjar/nsZipArchive.cpp)0
-rw-r--r--components/jar/src/nsZipArchive.h (renamed from modules/libjar/nsZipArchive.h)0
-rw-r--r--components/jar/src/nsZipDataStream.cpp (renamed from modules/libjar/zipwriter/nsZipDataStream.cpp)0
-rw-r--r--components/jar/src/nsZipDataStream.h (renamed from modules/libjar/zipwriter/nsZipDataStream.h)0
-rw-r--r--components/jar/src/nsZipHeader.cpp (renamed from modules/libjar/zipwriter/nsZipHeader.cpp)0
-rw-r--r--components/jar/src/nsZipHeader.h (renamed from modules/libjar/zipwriter/nsZipHeader.h)0
-rw-r--r--components/jar/src/nsZipWriter.cpp (renamed from modules/libjar/zipwriter/nsZipWriter.cpp)0
-rw-r--r--components/jar/src/nsZipWriter.h (renamed from modules/libjar/zipwriter/nsZipWriter.h)0
-rw-r--r--components/jar/src/zipstruct.h (renamed from modules/libjar/zipstruct.h)0
-rw-r--r--components/moz.build1
-rw-r--r--dom/ipc/moz.build4
-rw-r--r--modules/libjar/moz.build46
-rw-r--r--modules/libjar/test/chrome/chrome.ini9
-rw-r--r--modules/libjar/test/chrome/signed-added.zipbin2141 -> 0 bytes
-rw-r--r--modules/libjar/test/chrome/signed-badca.zipbin1964 -> 0 bytes
-rw-r--r--modules/libjar/test/chrome/signed-tampered.zipbin1979 -> 0 bytes
-rw-r--r--modules/libjar/test/chrome/signed.zipbin1957 -> 0 bytes
-rw-r--r--modules/libjar/test/chrome/test_bug386153.html97
-rw-r--r--modules/libjar/test/chrome/unsigned.zipbin174 -> 0 bytes
-rw-r--r--modules/libjar/test/mochitest/bug403331.zipbin239 -> 0 bytes
-rw-r--r--modules/libjar/test/mochitest/bug403331.zip^headers^1
-rw-r--r--modules/libjar/test/mochitest/mochitest.ini11
-rw-r--r--modules/libjar/test/mochitest/openredirect.sjs5
-rw-r--r--modules/libjar/test/mochitest/test_bug1034143_mapped.html53
-rw-r--r--modules/libjar/test/mochitest/test_bug1173171.html64
-rw-r--r--modules/libjar/test/mochitest/test_bug403331.html47
-rw-r--r--modules/libjar/test/unit/data/empty0
-rw-r--r--modules/libjar/test/unit/data/test_bug333423.zipbin1086 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug336691.zipbin789 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug370103.jarbin128 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug379841.zipbin140 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug589292.zipbin168 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug597702.zipbin253 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug637286.zipbin12958 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_bug658093.zipbin4096 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_corrupt.zipbin142 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_corrupt2.zip1
-rw-r--r--modules/libjar/test/unit/data/test_corrupt3.zipbin121 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_crx_dummy.crxbin1102 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/test_umlaute.zipbin179 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/data/uncompressed.zipbin142 -> 0 bytes
-rw-r--r--modules/libjar/test/unit/test_bug278262.js39
-rw-r--r--modules/libjar/test/unit/test_bug333423.js22
-rw-r--r--modules/libjar/test/unit/test_bug336691.js12
-rw-r--r--modules/libjar/test/unit/test_bug370103.js28
-rw-r--r--modules/libjar/test/unit/test_bug379841.js23
-rw-r--r--modules/libjar/test/unit/test_bug407303.js42
-rw-r--r--modules/libjar/test/unit/test_bug453254.js12
-rw-r--r--modules/libjar/test/unit/test_bug458158.js11
-rw-r--r--modules/libjar/test/unit/test_bug589292.js25
-rw-r--r--modules/libjar/test/unit/test_bug597702.js35
-rw-r--r--modules/libjar/test/unit/test_bug637286.js29
-rw-r--r--modules/libjar/test/unit/test_bug658093.js25
-rw-r--r--modules/libjar/test/unit/test_corrupt_1211262.js34
-rw-r--r--modules/libjar/test/unit/test_corrupt_536911.js36
-rw-r--r--modules/libjar/test/unit/test_corrupt_541828.js24
-rw-r--r--modules/libjar/test/unit/test_crx.js43
-rw-r--r--modules/libjar/test/unit/test_dirjar_bug525755.js25
-rw-r--r--modules/libjar/test/unit/test_jarchannel.js216
-rw-r--r--modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js42
-rw-r--r--modules/libjar/test/unit/test_not_found.js24
-rw-r--r--modules/libjar/test/unit/test_umlaute.js40
-rw-r--r--modules/libjar/test/unit/test_uncompressed.js12
-rw-r--r--modules/libjar/test/unit/xpcshell.ini44
-rw-r--r--modules/libjar/zipwriter/moz.build23
-rw-r--r--modules/libjar/zipwriter/test/unit/data/emptyfile.txt0
-rw-r--r--modules/libjar/zipwriter/test/unit/data/smallfile.txt1
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test.pngbin3402 -> 0 bytes
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test.txt5
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test.zipbin3824 -> 0 bytes
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test_bug399727.html160
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test_bug399727.zlibbin1959 -> 0 bytes
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test_bug446708/thumbs/st14-1.tiffbin4940 -> 0 bytes
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test_bug717061.gzbin1275 -> 0 bytes
-rw-r--r--modules/libjar/zipwriter/test/unit/data/test_bug717061.html16
-rw-r--r--modules/libjar/zipwriter/test/unit/head_zipwriter.js46
-rw-r--r--modules/libjar/zipwriter/test/unit/tail_zipwriter.js14
-rw-r--r--modules/libjar/zipwriter/test/unit/test_alignment.js113
-rw-r--r--modules/libjar/zipwriter/test/unit/test_asyncadd.js107
-rw-r--r--modules/libjar/zipwriter/test/unit/test_asyncbadadd.js35
-rw-r--r--modules/libjar/zipwriter/test/unit/test_asyncbadremove.js31
-rw-r--r--modules/libjar/zipwriter/test/unit/test_asyncremove.js47
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug399727.js86
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug419769_1.js70
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug419769_2.js64
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug425768.js31
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug433248.js73
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug446708.js37
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug467740.js29
-rw-r--r--modules/libjar/zipwriter/test/unit/test_bug717061.js92
-rw-r--r--modules/libjar/zipwriter/test/unit/test_createempty.js16
-rw-r--r--modules/libjar/zipwriter/test/unit/test_deflatedata.js53
-rw-r--r--modules/libjar/zipwriter/test/unit/test_directory.js27
-rw-r--r--modules/libjar/zipwriter/test/unit/test_editexisting.js62
-rw-r--r--modules/libjar/zipwriter/test/unit/test_storedata.js78
-rw-r--r--modules/libjar/zipwriter/test/unit/test_sync.js57
-rw-r--r--modules/libjar/zipwriter/test/unit/test_undochange.js42
-rw-r--r--modules/libjar/zipwriter/test/unit/test_zipcomment.js34
-rw-r--r--modules/libjar/zipwriter/test/unit/test_zippermissions.js83
-rw-r--r--modules/libjar/zipwriter/test/unit/xpcshell.ini37
-rw-r--r--netwerk/ipc/moz.build2
-rw-r--r--old-configure.in10
-rw-r--r--toolkit/toolkit.mozbuild1
-rw-r--r--xpcom/components/moz.build2
129 files changed, 43 insertions, 2763 deletions
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index a9f387bc0..9d5ee25ca 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -248,7 +248,6 @@ def old_configure_options(*options):
'--enable-valgrind',
'--enable-verify-mar',
'--enable-webrtc',
- '--enable-zipwriter',
'--includedir',
'--libdir',
'--no-create',
diff --git a/modules/libjar/appnote.txt b/components/jar/appnote.txt
index 7b96643ca..7b96643ca 100644
--- a/modules/libjar/appnote.txt
+++ b/components/jar/appnote.txt
diff --git a/components/jar/moz.build b/components/jar/moz.build
new file mode 100644
index 000000000..e7aae241a
--- /dev/null
+++ b/components/jar/moz.build
@@ -0,0 +1,39 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include('/ipc/chromium/chromium-config.mozbuild')
+
+XPIDL_SOURCES += [
+ 'public/nsIJARChannel.idl',
+ 'public/nsIJARProtocolHandler.idl',
+ 'public/nsIJARURI.idl',
+ 'public/nsIZipReader.idl',
+ 'public/nsIZipWriter.idl',
+]
+
+EXPORTS += [
+ 'src/nsJARURI.h',
+ 'src/nsZipArchive.h',
+ 'src/zipstruct.h',
+]
+
+SOURCES += [
+ 'src/nsDeflateConverter.cpp',
+ 'src/nsJAR.cpp',
+ 'src/nsJARChannel.cpp',
+ 'src/nsJARFactory.cpp',
+ 'src/nsJARInputStream.cpp',
+ 'src/nsJARProtocolHandler.cpp',
+ 'src/nsJARURI.cpp',
+ 'src/nsZipArchive.cpp',
+ 'src/nsZipDataStream.cpp',
+ 'src/nsZipHeader.cpp',
+ 'src/nsZipWriter.cpp',
+ 'src/StreamFunctions.cpp',
+ 'src/ZipWriterModule.cpp',
+]
+
+XPIDL_MODULE = 'jar'
+FINAL_LIBRARY = 'xul'
diff --git a/modules/libjar/nsIJARChannel.idl b/components/jar/public/nsIJARChannel.idl
index 4348717d2..4348717d2 100644
--- a/modules/libjar/nsIJARChannel.idl
+++ b/components/jar/public/nsIJARChannel.idl
diff --git a/modules/libjar/nsIJARProtocolHandler.idl b/components/jar/public/nsIJARProtocolHandler.idl
index a00239a48..a00239a48 100644
--- a/modules/libjar/nsIJARProtocolHandler.idl
+++ b/components/jar/public/nsIJARProtocolHandler.idl
diff --git a/modules/libjar/nsIJARURI.idl b/components/jar/public/nsIJARURI.idl
index 68aefa9db..68aefa9db 100644
--- a/modules/libjar/nsIJARURI.idl
+++ b/components/jar/public/nsIJARURI.idl
diff --git a/modules/libjar/nsIZipReader.idl b/components/jar/public/nsIZipReader.idl
index 9ca111a3a..9ca111a3a 100644
--- a/modules/libjar/nsIZipReader.idl
+++ b/components/jar/public/nsIZipReader.idl
diff --git a/modules/libjar/zipwriter/nsIZipWriter.idl b/components/jar/public/nsIZipWriter.idl
index bcea5aaf7..bcea5aaf7 100644
--- a/modules/libjar/zipwriter/nsIZipWriter.idl
+++ b/components/jar/public/nsIZipWriter.idl
diff --git a/modules/libjar/zipwriter/StreamFunctions.cpp b/components/jar/src/StreamFunctions.cpp
index 9a38f2dca..9a38f2dca 100644
--- a/modules/libjar/zipwriter/StreamFunctions.cpp
+++ b/components/jar/src/StreamFunctions.cpp
diff --git a/modules/libjar/zipwriter/StreamFunctions.h b/components/jar/src/StreamFunctions.h
index 012fce986..012fce986 100644
--- a/modules/libjar/zipwriter/StreamFunctions.h
+++ b/components/jar/src/StreamFunctions.h
diff --git a/modules/libjar/zipwriter/ZipWriterModule.cpp b/components/jar/src/ZipWriterModule.cpp
index 2891da58d..2891da58d 100644
--- a/modules/libjar/zipwriter/ZipWriterModule.cpp
+++ b/components/jar/src/ZipWriterModule.cpp
diff --git a/modules/libjar/zipwriter/nsDeflateConverter.cpp b/components/jar/src/nsDeflateConverter.cpp
index d51cb2ceb..d51cb2ceb 100644
--- a/modules/libjar/zipwriter/nsDeflateConverter.cpp
+++ b/components/jar/src/nsDeflateConverter.cpp
diff --git a/modules/libjar/zipwriter/nsDeflateConverter.h b/components/jar/src/nsDeflateConverter.h
index 9678af87d..9678af87d 100644
--- a/modules/libjar/zipwriter/nsDeflateConverter.h
+++ b/components/jar/src/nsDeflateConverter.h
diff --git a/modules/libjar/nsIJARFactory.h b/components/jar/src/nsIJARFactory.h
index a5b48280e..a5b48280e 100644
--- a/modules/libjar/nsIJARFactory.h
+++ b/components/jar/src/nsIJARFactory.h
diff --git a/modules/libjar/nsJAR.cpp b/components/jar/src/nsJAR.cpp
index 96e18e1d3..96e18e1d3 100644
--- a/modules/libjar/nsJAR.cpp
+++ b/components/jar/src/nsJAR.cpp
diff --git a/modules/libjar/nsJAR.h b/components/jar/src/nsJAR.h
index 2a982a1b5..2a982a1b5 100644
--- a/modules/libjar/nsJAR.h
+++ b/components/jar/src/nsJAR.h
diff --git a/modules/libjar/nsJARChannel.cpp b/components/jar/src/nsJARChannel.cpp
index 65c034779..65c034779 100644
--- a/modules/libjar/nsJARChannel.cpp
+++ b/components/jar/src/nsJARChannel.cpp
diff --git a/modules/libjar/nsJARChannel.h b/components/jar/src/nsJARChannel.h
index 5328d586a..5328d586a 100644
--- a/modules/libjar/nsJARChannel.h
+++ b/components/jar/src/nsJARChannel.h
diff --git a/modules/libjar/nsJARFactory.cpp b/components/jar/src/nsJARFactory.cpp
index 01d8d73f3..01d8d73f3 100644
--- a/modules/libjar/nsJARFactory.cpp
+++ b/components/jar/src/nsJARFactory.cpp
diff --git a/modules/libjar/nsJARInputStream.cpp b/components/jar/src/nsJARInputStream.cpp
index a1f6c1d56..a1f6c1d56 100644
--- a/modules/libjar/nsJARInputStream.cpp
+++ b/components/jar/src/nsJARInputStream.cpp
diff --git a/modules/libjar/nsJARInputStream.h b/components/jar/src/nsJARInputStream.h
index 60c3d763e..60c3d763e 100644
--- a/modules/libjar/nsJARInputStream.h
+++ b/components/jar/src/nsJARInputStream.h
diff --git a/modules/libjar/nsJARProtocolHandler.cpp b/components/jar/src/nsJARProtocolHandler.cpp
index 38de73f14..38de73f14 100644
--- a/modules/libjar/nsJARProtocolHandler.cpp
+++ b/components/jar/src/nsJARProtocolHandler.cpp
diff --git a/modules/libjar/nsJARProtocolHandler.h b/components/jar/src/nsJARProtocolHandler.h
index 62a4f7ac2..62a4f7ac2 100644
--- a/modules/libjar/nsJARProtocolHandler.h
+++ b/components/jar/src/nsJARProtocolHandler.h
diff --git a/modules/libjar/nsJARURI.cpp b/components/jar/src/nsJARURI.cpp
index d1e4b5a59..d1e4b5a59 100644
--- a/modules/libjar/nsJARURI.cpp
+++ b/components/jar/src/nsJARURI.cpp
diff --git a/modules/libjar/nsJARURI.h b/components/jar/src/nsJARURI.h
index d2608a5c6..d2608a5c6 100644
--- a/modules/libjar/nsJARURI.h
+++ b/components/jar/src/nsJARURI.h
diff --git a/modules/libjar/nsZipArchive.cpp b/components/jar/src/nsZipArchive.cpp
index b28fddc18..b28fddc18 100644
--- a/modules/libjar/nsZipArchive.cpp
+++ b/components/jar/src/nsZipArchive.cpp
diff --git a/modules/libjar/nsZipArchive.h b/components/jar/src/nsZipArchive.h
index 6b758c9fd..6b758c9fd 100644
--- a/modules/libjar/nsZipArchive.h
+++ b/components/jar/src/nsZipArchive.h
diff --git a/modules/libjar/zipwriter/nsZipDataStream.cpp b/components/jar/src/nsZipDataStream.cpp
index 4a7b785b7..4a7b785b7 100644
--- a/modules/libjar/zipwriter/nsZipDataStream.cpp
+++ b/components/jar/src/nsZipDataStream.cpp
diff --git a/modules/libjar/zipwriter/nsZipDataStream.h b/components/jar/src/nsZipDataStream.h
index ffa455274..ffa455274 100644
--- a/modules/libjar/zipwriter/nsZipDataStream.h
+++ b/components/jar/src/nsZipDataStream.h
diff --git a/modules/libjar/zipwriter/nsZipHeader.cpp b/components/jar/src/nsZipHeader.cpp
index af2ee0335..af2ee0335 100644
--- a/modules/libjar/zipwriter/nsZipHeader.cpp
+++ b/components/jar/src/nsZipHeader.cpp
diff --git a/modules/libjar/zipwriter/nsZipHeader.h b/components/jar/src/nsZipHeader.h
index f09aa2090..f09aa2090 100644
--- a/modules/libjar/zipwriter/nsZipHeader.h
+++ b/components/jar/src/nsZipHeader.h
diff --git a/modules/libjar/zipwriter/nsZipWriter.cpp b/components/jar/src/nsZipWriter.cpp
index 25231fac0..25231fac0 100644
--- a/modules/libjar/zipwriter/nsZipWriter.cpp
+++ b/components/jar/src/nsZipWriter.cpp
diff --git a/modules/libjar/zipwriter/nsZipWriter.h b/components/jar/src/nsZipWriter.h
index f7fa1b163..f7fa1b163 100644
--- a/modules/libjar/zipwriter/nsZipWriter.h
+++ b/components/jar/src/nsZipWriter.h
diff --git a/modules/libjar/zipstruct.h b/components/jar/src/zipstruct.h
index f7393128a..f7393128a 100644
--- a/modules/libjar/zipstruct.h
+++ b/components/jar/src/zipstruct.h
diff --git a/components/moz.build b/components/moz.build
index 97f20aad8..649e7a55b 100644
--- a/components/moz.build
+++ b/components/moz.build
@@ -37,6 +37,7 @@ DIRS += [
'gfx',
'global',
'handling',
+ 'jar',
'jsdebugger',
'jsdownloads',
'jsinspector',
diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build
index 4ebda87ff..392f66fd4 100644
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -127,9 +127,7 @@ LOCAL_INCLUDES += [
]
if CONFIG['OS_ARCH'] != 'WINNT':
- LOCAL_INCLUDES += [
- '/modules/libjar',
- ]
+ LOCAL_INCLUDES += ['/components/jar/src']
DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
diff --git a/modules/libjar/moz.build b/modules/libjar/moz.build
deleted file mode 100644
index 3f03ee268..000000000
--- a/modules/libjar/moz.build
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['MOZ_ZIPWRITER']:
- DIRS += ['zipwriter']
-
-MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini']
-
-MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIJARChannel.idl',
- 'nsIJARProtocolHandler.idl',
- 'nsIJARURI.idl',
- 'nsIZipReader.idl',
-]
-
-XPIDL_MODULE = 'jar'
-
-EXPORTS += [
- 'nsJARURI.h',
- 'nsZipArchive.h',
- 'zipstruct.h',
-]
-
-UNIFIED_SOURCES += [
- 'nsJARProtocolHandler.cpp',
- 'nsJARURI.cpp',
-]
-
-# These files cannot be built in unified mode because they rely on plarena.h.
-SOURCES += [
- 'nsJAR.cpp',
- 'nsJARChannel.cpp',
- 'nsJARFactory.cpp',
- 'nsJARInputStream.cpp',
- 'nsZipArchive.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
diff --git a/modules/libjar/test/chrome/chrome.ini b/modules/libjar/test/chrome/chrome.ini
deleted file mode 100644
index b130cbc33..000000000
--- a/modules/libjar/test/chrome/chrome.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-support-files =
- signed-added.zip
- signed-badca.zip
- signed-tampered.zip
- signed.zip
- unsigned.zip
-
-[test_bug386153.html]
diff --git a/modules/libjar/test/chrome/signed-added.zip b/modules/libjar/test/chrome/signed-added.zip
deleted file mode 100644
index c90bc250a..000000000
--- a/modules/libjar/test/chrome/signed-added.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/chrome/signed-badca.zip b/modules/libjar/test/chrome/signed-badca.zip
deleted file mode 100644
index f493cbd1a..000000000
--- a/modules/libjar/test/chrome/signed-badca.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/chrome/signed-tampered.zip b/modules/libjar/test/chrome/signed-tampered.zip
deleted file mode 100644
index d3b9d16cc..000000000
--- a/modules/libjar/test/chrome/signed-tampered.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/chrome/signed.zip b/modules/libjar/test/chrome/signed.zip
deleted file mode 100644
index 94e114783..000000000
--- a/modules/libjar/test/chrome/signed.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/chrome/test_bug386153.html b/modules/libjar/test/chrome/test_bug386153.html
deleted file mode 100644
index 3fe541a1a..000000000
--- a/modules/libjar/test/chrome/test_bug386153.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=386153
--->
-<head>
- <title>Test for Bug 386153</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=386153">Mozilla Bug 386153</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 386153 **/
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-// Opens a zip file from the test directory.
-function openZip(path) {
-
- var location = window.location.href;
- location = getRootDirectory(location);
- var jar = getJar(location);
- if (jar != null) {
- var resolved = extractJarToTmp(jar);
- } else {
- var resolvedURI = getResolvedURI(window.location.href);
- var resolved = getChromeDir(resolvedURI);
- }
- resolved.append(path);
-
- var zip = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zip.open(resolved);
- return zip;
-}
-
-// Gets the pretty name from the signing cert or null if the zip is unsigned.
-function getSigner(zip) {
- var signingCert = zip.getSigningCert(null);
- if (signingCert) {
- return signingCert.organization;
- }
- return null;
-}
-
-function verifySigning(zip) {
- var signingCert = zip.getSigningCert(null);
- var count = 0;
- var entries = zip.findEntries(null);
- while (entries.hasMore()) {
- var entry = entries.getNext();
- // Nothing in META-INF is in the manifest.
- if (entry.substr(0, 9) == "META-INF/")
- continue;
- // Directory entries aren't in the manifest.
- if (entry.substr(-1) == "/")
- continue;
- count++;
- var entryCert = zip.getSigningCert(entry);
- if (!entryCert || !signingCert.equals(entryCert)) {
- return false;
- }
- }
- return zip.manifestEntriesCount == count;
-}
-
-var zip = openZip("unsigned.zip");
-is(getSigner(zip), null, "Should not be signed");
-
-zip = openZip("signed.zip");
-is(getSigner(zip), "Mozilla Testing", "Should be signed by the right cert");
-ok(verifySigning(zip), "Should be correctly signed");
-
-zip = openZip("signed-added.zip");
-is(getSigner(zip), "Mozilla Testing", "Should be signed by the right cert");
-ok(!verifySigning(zip), "Should be incorrectly signed");
-
-zip = openZip("signed-tampered.zip");
-is(getSigner(zip), "Mozilla Testing", "Should be signed by the right cert");
-ok(!verifySigning(zip), "Should be incorrectly signed");
-
-zip = openZip("signed-badca.zip");
-is(getSigner(zip), null, "Should not appear to be signed");
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/modules/libjar/test/chrome/unsigned.zip b/modules/libjar/test/chrome/unsigned.zip
deleted file mode 100644
index f1e26b06a..000000000
--- a/modules/libjar/test/chrome/unsigned.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/mochitest/bug403331.zip b/modules/libjar/test/mochitest/bug403331.zip
deleted file mode 100644
index 48ba268dd..000000000
--- a/modules/libjar/test/mochitest/bug403331.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/mochitest/bug403331.zip^headers^ b/modules/libjar/test/mochitest/bug403331.zip^headers^
deleted file mode 100644
index 28b8aa0a5..000000000
--- a/modules/libjar/test/mochitest/bug403331.zip^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Content-Type: application/java-archive
diff --git a/modules/libjar/test/mochitest/mochitest.ini b/modules/libjar/test/mochitest/mochitest.ini
deleted file mode 100644
index 0ae466cca..000000000
--- a/modules/libjar/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[DEFAULT]
-support-files =
- bug403331.zip
- bug403331.zip^headers^
- openredirect.sjs
- !/dom/base/test/file_bug945152.jar
-
-[test_bug403331.html]
-[test_bug1034143_mapped.html]
-run-if = os == 'linux'
-[test_bug1173171.html] \ No newline at end of file
diff --git a/modules/libjar/test/mochitest/openredirect.sjs b/modules/libjar/test/mochitest/openredirect.sjs
deleted file mode 100644
index b6249cadf..000000000
--- a/modules/libjar/test/mochitest/openredirect.sjs
+++ /dev/null
@@ -1,5 +0,0 @@
-function handleRequest(request, response)
-{
- response.setStatusLine(request.httpVersion, 301, "Moved Permanently");
- response.setHeader("Location", request.queryString, false);
-}
diff --git a/modules/libjar/test/mochitest/test_bug1034143_mapped.html b/modules/libjar/test/mochitest/test_bug1034143_mapped.html
deleted file mode 100644
index d65ae31f2..000000000
--- a/modules/libjar/test/mochitest/test_bug1034143_mapped.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1034143
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 945152</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1034143">Mozilla Bug 1034143</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript;version=1.7">
-// Ensure that XMLHttpRequest's memory-mapping code can handle a case
-// where the nsIJARChannel's jarFile property is null, but which is
-// otherwise eligible for bug 945152's memory-mapping optimization.
-
-function runTest() {
- const jarURL = "jar:http://example.org/tests/dom/base/test/file_bug945152.jar!/data_1.txt";
- let xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true });
- xhr.open("GET", jarURL);
- xhr.onerror = function onerror(e) {
- ok(false, "JAR XHR failed: " + e.status);
- SimpleTest.finish();
- };
- xhr.onload = function onload(e) {
- ok(xhr.status == 200, "Status is 200");
- let ct = xhr.getResponseHeader("Content-Type");
- ok(ct.indexOf("mem-mapped") == -1, "Data is not memory-mapped");
- SimpleTest.finish();
- };
- xhr.responseType = 'arraybuffer';
- xhr.send();
-}
-
-SimpleTest.waitForExplicitFinish();
-
-addLoadEvent(function() {
- SpecialPowers.pushPrefEnv({"set": [["dom.mapped_arraybuffer.enabled", true],
- ["network.jar.block-remote-files", false]]}, function() {
- SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest);
- });
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/modules/libjar/test/mochitest/test_bug1173171.html b/modules/libjar/test/mochitest/test_bug1173171.html
deleted file mode 100644
index 9fed630b3..000000000
--- a/modules/libjar/test/mochitest/test_bug1173171.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1173171
--->
-<head>
- <title>Test for Bug 1173171</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<iframe id="testFrame"></iframe>
-
-<pre id="test">
-<script class="testbody" type="application/javascript;version=1.7">
-
-/** Test for Bug 1173171 **/
-
-// __setPref(key, value)__.
-// Set a pref value asynchronously, returning a prmoise that resolves
-// when it succeeds.
-let pushPref = function (key, value) {
- return new Promise(function(resolve, reject) {
- SpecialPowers.pushPrefEnv({"set": [[key, value]]}, resolve);
- });
-};
-
-// __xhr(method, url, responseType__.
-// A simple async XMLHttpRequest call.
-// Returns a promise with the response.
-let xhr = function (method, url, responseType) {
- return new Promise(function (resolve, reject) {
- let xhr = new XMLHttpRequest();
- xhr.open(method, url, true);
- xhr.onload = function () {
- resolve(xhr.response);
- };
- xhr.onerror = function() {
- resolve(null);
- };
- xhr.responseType = responseType;
- xhr.send();
- });
-};
-
-let jarURL = "jar:http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
-
-// Test behavior when blocking is deactivated and activated.
-add_task(function* () {
- for (let shouldBlock of [false, true]) {
- yield pushPref("network.jar.block-remote-files", shouldBlock);
- let response = yield xhr("GET", jarURL, "document");
- ok(shouldBlock === (response === null),
- "Remote jars should be blocked if and only if the 'network.jar.block-remote-files' pref is active.");
- }
-});
-
-</script>
-</pre>
-
-</body>
-</html>
diff --git a/modules/libjar/test/mochitest/test_bug403331.html b/modules/libjar/test/mochitest/test_bug403331.html
deleted file mode 100644
index b292c4c9b..000000000
--- a/modules/libjar/test/mochitest/test_bug403331.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=403331
--->
-<head>
- <title>Test for Bug 403331</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<iframe id="testFrame"></iframe>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 403331 **/
-
-SimpleTest.waitForExplicitFinish();
-
-function runTest() {
- var testFrame = document.getElementById('testFrame');
-
- // Try a redirected load from another domain to this one.
-
- testFrame.onload = function() {
- // If properly redirected, we'll be able to access elements in the loaded
- // document.
- var item = testFrame.contentDocument.getElementById('testitem');
- is(item.textContent, "testcontents", "Should be able to access the child document");
-
- SimpleTest.finish();
- }
-
- testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
-}
-
-addLoadEvent(function() {
- SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, runTest);
-});
-
-</script>
-</pre>
-
-</body>
-</html>
diff --git a/modules/libjar/test/unit/data/empty b/modules/libjar/test/unit/data/empty
deleted file mode 100644
index e69de29bb..000000000
--- a/modules/libjar/test/unit/data/empty
+++ /dev/null
diff --git a/modules/libjar/test/unit/data/test_bug333423.zip b/modules/libjar/test/unit/data/test_bug333423.zip
deleted file mode 100644
index 42662a408..000000000
--- a/modules/libjar/test/unit/data/test_bug333423.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug336691.zip b/modules/libjar/test/unit/data/test_bug336691.zip
deleted file mode 100644
index 16bd2d6f2..000000000
--- a/modules/libjar/test/unit/data/test_bug336691.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug370103.jar b/modules/libjar/test/unit/data/test_bug370103.jar
deleted file mode 100644
index 7723568ba..000000000
--- a/modules/libjar/test/unit/data/test_bug370103.jar
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug379841.zip b/modules/libjar/test/unit/data/test_bug379841.zip
deleted file mode 100644
index f3c520519..000000000
--- a/modules/libjar/test/unit/data/test_bug379841.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug589292.zip b/modules/libjar/test/unit/data/test_bug589292.zip
deleted file mode 100644
index b7b9e65b4..000000000
--- a/modules/libjar/test/unit/data/test_bug589292.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug597702.zip b/modules/libjar/test/unit/data/test_bug597702.zip
deleted file mode 100644
index 55ce8fff4..000000000
--- a/modules/libjar/test/unit/data/test_bug597702.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug637286.zip b/modules/libjar/test/unit/data/test_bug637286.zip
deleted file mode 100644
index 5dc8e747e..000000000
--- a/modules/libjar/test/unit/data/test_bug637286.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_bug658093.zip b/modules/libjar/test/unit/data/test_bug658093.zip
deleted file mode 100644
index d32180101..000000000
--- a/modules/libjar/test/unit/data/test_bug658093.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_corrupt.zip b/modules/libjar/test/unit/data/test_corrupt.zip
deleted file mode 100644
index d7f5f42f9..000000000
--- a/modules/libjar/test/unit/data/test_corrupt.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_corrupt2.zip b/modules/libjar/test/unit/data/test_corrupt2.zip
deleted file mode 100644
index 0cfbf0888..000000000
--- a/modules/libjar/test/unit/data/test_corrupt2.zip
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/modules/libjar/test/unit/data/test_corrupt3.zip b/modules/libjar/test/unit/data/test_corrupt3.zip
deleted file mode 100644
index 86f8d76c9..000000000
--- a/modules/libjar/test/unit/data/test_corrupt3.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_crx_dummy.crx b/modules/libjar/test/unit/data/test_crx_dummy.crx
deleted file mode 100644
index 516e4ff80..000000000
--- a/modules/libjar/test/unit/data/test_crx_dummy.crx
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/test_umlaute.zip b/modules/libjar/test/unit/data/test_umlaute.zip
deleted file mode 100644
index d147138e1..000000000
--- a/modules/libjar/test/unit/data/test_umlaute.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/data/uncompressed.zip b/modules/libjar/test/unit/data/uncompressed.zip
deleted file mode 100644
index 192bf1561..000000000
--- a/modules/libjar/test/unit/data/uncompressed.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/test/unit/test_bug278262.js b/modules/libjar/test/unit/test_bug278262.js
deleted file mode 100644
index d63276b89..000000000
--- a/modules/libjar/test/unit/test_bug278262.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Regression test for bug 278262 - JAR URIs should resolve relative URIs in the base section.
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-const path = "data/test_bug333423.zip";
-
-function test_relative_sub() {
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-
- var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/";
- var base = ios.newURI(spec, null, null);
- var uri = ios.newURI("../modules/libjar", null, base);
-
- // This is the URI we expect to see.
- var expected = "jar:" + ios.newFileURI(do_get_file(path)).spec +
- "!/modules/libjar";
-
- do_check_eq(uri.spec, expected);
-}
-
-function test_relative_base() {
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-
- var base = ios.newFileURI(do_get_file("data/empty"));
- var uri = ios.newURI("jar:../" + path + "!/", null, base);
-
- // This is the URI we expect to see.
- var expected = "jar:" + ios.newFileURI(do_get_file(path)).spec +
- "!/";
-
- do_check_eq(uri.spec, expected);
-}
-
-function run_test() {
- test_relative_sub();
- test_relative_base();
-}
diff --git a/modules/libjar/test/unit/test_bug333423.js b/modules/libjar/test/unit/test_bug333423.js
deleted file mode 100644
index cd965b93e..000000000
--- a/modules/libjar/test/unit/test_bug333423.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Regression test for bug 333423 - crash enumerating entries of a
-// closed nsIZipReader
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- // the build script have created the zip we can test on in the current dir.
- var file = do_get_file("data/test_bug333423.zip");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipreader.open(file);
- zipreader.close();
- var entries = zipreader.findEntries('*.*');
- do_check_true(!entries.hasMore()); // this shouldn't crash
-}
diff --git a/modules/libjar/test/unit/test_bug336691.js b/modules/libjar/test/unit/test_bug336691.js
deleted file mode 100644
index e10dd3c9c..000000000
--- a/modules/libjar/test/unit/test_bug336691.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Regression test for bug 336691 - nsZipArchive::Test shouldn't try to ExtractFile on directories.
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-function run_test() {
- var file = do_get_file("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();
-}
diff --git a/modules/libjar/test/unit/test_bug370103.js b/modules/libjar/test/unit/test_bug370103.js
deleted file mode 100644
index 210cf7a15..000000000
--- a/modules/libjar/test/unit/test_bug370103.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// Regression test for bug 370103 - crash when passing a null listener to
-// nsIChannel.asyncOpen
-function run_test() {
- // Compose the jar: url
- var ioService = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var file = do_get_file("data/test_bug370103.jar");
- var url = ioService.newFileURI(file).spec;
- url = "jar:" + url + "!/test_bug370103";
-
- // Try opening channel with null listener
- var channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
-
- var exception = false;
- try {
- channel.asyncOpen2(null);
- }
- catch(e) {
- exception = true;
- }
-
- do_check_true(exception); // should throw exception instead of crashing
-}
diff --git a/modules/libjar/test/unit/test_bug379841.js b/modules/libjar/test/unit/test_bug379841.js
deleted file mode 100644
index a6840a577..000000000
--- a/modules/libjar/test/unit/test_bug379841.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Regression test for bug 379841 - nsIZipReader's last modified time ignores seconds
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-const path = "data/test_bug379841.zip";
-// Retrieved time should be within 2 seconds of original file's time.
-const MAX_TIME_DIFF = 2000000;
-
-var ENTRY_NAME = "test";
-// Actual time of file was 07 May 2007 13:35:49 UTC
-var ENTRY_TIME = new Date(Date.UTC(2007, 4, 7, 13, 35, 49, 0));
-
-function run_test() {
- var file = do_get_file(path);
- var zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipReader.open(file);
- var entry = zipReader.getEntry(ENTRY_NAME);
- var diff = Math.abs(entry.lastModifiedTime - ENTRY_TIME.getTime()*1000);
- zipReader.close();
- if (diff >= MAX_TIME_DIFF)
- do_throw(diff);
-}
diff --git a/modules/libjar/test/unit/test_bug407303.js b/modules/libjar/test/unit/test_bug407303.js
deleted file mode 100644
index 313d88c64..000000000
--- a/modules/libjar/test/unit/test_bug407303.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Regression test for bug 407303 - A failed channel should not be checked
-// for an unsafe content type.
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// XXX: NS_ERROR_UNKNOWN_HOST is not in Components.results
-const NS_ERROR_UNKNOWN_HOST = 0x804B001E;
-
-var listener = {
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIRequestObserver))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- onStartRequest: function(request, context) {
- },
-
- onDataAvailable: function(request, context, stream, offset, count) {
- do_throw("shouldn't get data!");
- },
-
- onStopRequest: function(request, context, status) {
- do_check_eq(status, NS_ERROR_UNKNOWN_HOST);
- do_test_finished();
- }
-};
-
-function run_test() {
- Services.prefs.setBoolPref("network.jar.block-remote-files", false);
- var channel = NetUtil.newChannel({
- uri: "jar:http://test.invalid/test.jar!/index.html",
- loadUsingSystemPrincipal: true}
- );
- channel.asyncOpen2(listener);
- do_test_pending();
-}
diff --git a/modules/libjar/test/unit/test_bug453254.js b/modules/libjar/test/unit/test_bug453254.js
deleted file mode 100644
index bc9d805b4..000000000
--- a/modules/libjar/test/unit/test_bug453254.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function run_test() {
- const zipCache = Components.classes["@mozilla.org/libjar/zip-reader-cache;1"]
- .createInstance(Components.interfaces.nsIZipReaderCache);
- zipCache.init(1024);
- try {
- zipCache.getZip(null);
- do_throw("Shouldn't get here!");
- } catch (e if ((e instanceof Components.interfaces.nsIException) &&
- (e.result == Components.results.NS_ERROR_INVALID_POINTER))) {
- // do nothing, this test passes
- }
-}
diff --git a/modules/libjar/test/unit/test_bug458158.js b/modules/libjar/test/unit/test_bug458158.js
deleted file mode 100644
index 582712337..000000000
--- a/modules/libjar/test/unit/test_bug458158.js
+++ /dev/null
@@ -1,11 +0,0 @@
-function run_test() {
- var zReader = Components.classes["@mozilla.org/libjar/zip-reader;1"]
- .createInstance(Components.interfaces.nsIZipReader);
- try {
- zReader.open(null);
- do_throw("Shouldn't get here!");
- } catch (e if (e instanceof Components.interfaces.nsIException &&
- e.result == Components.results.NS_ERROR_NULL_POINTER)) {
- // do nothing, this test passes
- }
-}
diff --git a/modules/libjar/test/unit/test_bug589292.js b/modules/libjar/test/unit/test_bug589292.js
deleted file mode 100644
index 1fa103e3c..000000000
--- a/modules/libjar/test/unit/test_bug589292.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Make sure we behave appropriately when asking for content-disposition
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-const path = "data/test_bug589292.zip";
-
-function run_test() {
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/foo.txt";
- var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
- instr = channel.open2();
- var val;
- try {
- val = channel.contentDisposition;
- do_check_true(false, "The channel has content disposition?!");
- } catch (e) {
- // This is what we want to happen - there's no underlying channel, so no
- // content-disposition header is available
- do_check_true(true, "How are you reading this?!");
- }
-}
diff --git a/modules/libjar/test/unit/test_bug597702.js b/modules/libjar/test/unit/test_bug597702.js
deleted file mode 100644
index 3f32a8923..000000000
--- a/modules/libjar/test/unit/test_bug597702.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// Check that reading non existant inner jars results in the right error
-
-function run_test() {
- var file = do_get_file("data/test_bug597702.zip");
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
- var goodSpec = "jar:" + outerJarBase + "inner.jar!/hello";
- var badSpec = "jar:" + outerJarBase + "jar_that_isnt_in_the.jar!/hello";
- var goodChannel = NetUtil.newChannel({uri: goodSpec, loadUsingSystemPrincipal: true});
- var badChannel = NetUtil.newChannel({uri: badSpec, loadUsingSystemPrincipal: true});
-
- try {
- instr = goodChannel.open2();
- } catch (e) {
- do_throw("Failed to open file in inner jar");
- }
-
- try {
- instr = badChannel.open2();
- do_throw("Failed to report that file doesn't exist");
- } catch (e) {
- do_check_true(e.name == "NS_ERROR_FILE_NOT_FOUND");
- }
-}
-
diff --git a/modules/libjar/test/unit/test_bug637286.js b/modules/libjar/test/unit/test_bug637286.js
deleted file mode 100644
index d7609f78f..000000000
--- a/modules/libjar/test/unit/test_bug637286.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// Check that the zip cache can expire entries from nested jars
-var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-
-function open_inner_zip(base, idx) {
- var spec = "jar:" + base + "inner" + idx + ".zip!/foo";
- var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
- var stream = channel.open2();
-}
-
-function run_test() {
- var file = do_get_file("data/test_bug637286.zip");
- var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
-
- for (var i = 0; i < 40; i++) {
- open_inner_zip(outerJarBase, i);
- gc();
- }
-}
-
diff --git a/modules/libjar/test/unit/test_bug658093.js b/modules/libjar/test/unit/test_bug658093.js
deleted file mode 100644
index 52cf13b1d..000000000
--- a/modules/libjar/test/unit/test_bug658093.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// Check that we don't crash on reading a directory entry signature
-var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-
-function run_test() {
- var file = do_get_file("data/test_bug658093.zip");
- var spec = "jar:" + ios.newFileURI(file).spec + "!/0000";
- var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
- var failed = false;
- try {
- var stream = channel.open2();
- } catch (e) {
- failed = true;
- }
- do_check_true(failed);
-}
diff --git a/modules/libjar/test/unit/test_corrupt_1211262.js b/modules/libjar/test/unit/test_corrupt_1211262.js
deleted file mode 100644
index fe289959f..000000000
--- a/modules/libjar/test/unit/test_corrupt_1211262.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// Regression test ensuring that that a STORED entry with differing compressed
-// and uncompressed sizes is considered to be corrupt.
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- var file = do_get_file("data/test_corrupt3.zip");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipreader.open(file);
-
- var entries = zipreader.findEntries('*');
- var failed = false;
-
- while (entries.hasMore()) {
- let entryPath = entries.getNext();
- let entry = zipreader.getEntry(entryPath);
- if (!entry.isDirectory) {
- try {
- let inputStream = zipreader.getInputStream(entryPath);
- } catch (e) {
- failed = true;
- }
- }
- }
-
- do_check_true(failed);
-}
-
diff --git a/modules/libjar/test/unit/test_corrupt_536911.js b/modules/libjar/test/unit/test_corrupt_536911.js
deleted file mode 100644
index f0748dbf2..000000000
--- a/modules/libjar/test/unit/test_corrupt_536911.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function wrapInputStream(input)
-{
- var nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
- var factory = Components.classes["@mozilla.org/scriptableinputstream;1"];
- var wrapper = factory.createInstance(nsIScriptableInputStream);
- wrapper.init(input);
- return wrapper;
-}
-
-// Check that files can be read from after closing zipreader
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- // the build script have created the zip we can test on in the current dir.
- var file = do_get_file("data/test_corrupt.zip");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipreader.open(file);
- // var entries = zipreader.findEntries(null);
- // the signature for file is corrupt, should not segfault
- var failed = false;
- try {
- var stream = wrapInputStream(zipreader.getInputStream("file"));
- stream.read(1024);
- } catch (ex) {
- failed = true;
- }
- do_check_true(failed);
-}
-
diff --git a/modules/libjar/test/unit/test_corrupt_541828.js b/modules/libjar/test/unit/test_corrupt_541828.js
deleted file mode 100644
index 022eb96eb..000000000
--- a/modules/libjar/test/unit/test_corrupt_541828.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Check that files can be read from after closing zipreader
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- // the build script have created the zip we can test on in the current dir.
- var file = do_get_file("data/test_corrupt2.zip");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- var failed = false;
- try {
- zipreader.open(file);
- // corrupt files should trigger an exception
- } catch (ex) {
- failed = true;
- }
- do_check_true(failed);
-}
-
diff --git a/modules/libjar/test/unit/test_crx.js b/modules/libjar/test/unit/test_crx.js
deleted file mode 100644
index e06f36323..000000000
--- a/modules/libjar/test/unit/test_crx.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function wrapInputStream(input)
-{
- let nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
- let factory = Components.classes["@mozilla.org/scriptableinputstream;1"];
- let wrapper = factory.createInstance(nsIScriptableInputStream);
- wrapper.init(input);
- return wrapper;
-}
-
-// Make sure that we can read from CRX files as if they were ZIP files.
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- // Note: test_crx_dummy.crx is a dummy crx file created for this test. The
- // public key and signature fields in the header are both empty.
- let file = do_get_file("data/test_crx_dummy.crx");
-
- let zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipreader.open(file);
- // do crc stuff
- function check_archive_crc() {
- zipreader.test(null);
- return true;
- }
- Assert.ok(check_archive_crc())
- let entries = zipreader.findEntries(null);
- let stream = wrapInputStream(zipreader.getInputStream("modules/libjar/test/Makefile.in"))
- let dirstream= wrapInputStream(zipreader.getInputStream("modules/libjar/test/"))
- zipreader.close();
- zipreader = null;
- Components.utils.forceGC();
- Assert.ok(stream.read(1024).length > 0);
- Assert.ok(dirstream.read(100).length > 0);
-}
-
diff --git a/modules/libjar/test/unit/test_dirjar_bug525755.js b/modules/libjar/test/unit/test_dirjar_bug525755.js
deleted file mode 100644
index 00f099a4e..000000000
--- a/modules/libjar/test/unit/test_dirjar_bug525755.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Check that we refuse to open weird files
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- // open a bogus file
- var file = do_get_file("/");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- var failed = false;
- try {
- zipreader.open(file);
- } catch (e) {
- failed = true;
- }
- do_check_true(failed);
- zipreader = null;
-}
-
diff --git a/modules/libjar/test/unit/test_jarchannel.js b/modules/libjar/test/unit/test_jarchannel.js
deleted file mode 100644
index 46eda8691..000000000
--- a/modules/libjar/test/unit/test_jarchannel.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Tests some basic jar channel functionality
- */
-
-
-const {classes: Cc,
- interfaces: Ci,
- results: Cr,
- utils: Cu,
- Constructor: ctor
- } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-const ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-const dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
-const obs = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
-
-const nsIBinaryInputStream = ctor("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream"
- );
-
-const fileBase = "test_bug637286.zip";
-const file = do_get_file("data/" + fileBase);
-const jarBase = "jar:" + ios.newFileURI(file).spec + "!";
-const tmpDir = dirSvc.get("TmpD", Ci.nsIFile);
-
-function Listener(callback) {
- this._callback = callback;
-}
-Listener.prototype = {
- gotStartRequest: false,
- available: -1,
- gotStopRequest: false,
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIRequestObserver))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
- onDataAvailable: function(request, ctx, stream, offset, count) {
- try {
- this.available = stream.available();
- do_check_eq(this.available, count);
- // Need to consume stream to avoid assertion
- new nsIBinaryInputStream(stream).readBytes(count);
- }
- catch (ex) {
- do_throw(ex);
- }
- },
- onStartRequest: function(request, ctx) {
- this.gotStartRequest = true;
- },
- onStopRequest: function(request, ctx, status) {
- this.gotStopRequest = true;
- do_check_eq(status, 0);
- if (this._callback) {
- this._callback.call(null, this);
- }
- }
-};
-
-/**
- * Basic reading test for asynchronously opened jar channel
- */
-function testAsync() {
- var uri = jarBase + "/inner40.zip";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
- do_check_true(chan.contentLength < 0);
- chan.asyncOpen2(new Listener(function(l) {
- do_check_true(chan.contentLength > 0);
- do_check_true(l.gotStartRequest);
- do_check_true(l.gotStopRequest);
- do_check_eq(l.available, chan.contentLength);
-
- run_next_test();
- }));
-}
-
-add_test(testAsync);
-// Run same test again so we test the codepath for a zipcache hit
-add_test(testAsync);
-
-/**
- * Basic test for nsIZipReader.
- */
-function testZipEntry() {
- var uri = jarBase + "/inner40.zip";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true})
- .QueryInterface(Ci.nsIJARChannel);
- var entry = chan.zipEntry;
- do_check_true(entry.CRC32 == 0x8b635486);
- do_check_true(entry.realSize == 184);
- run_next_test();
-}
-
-add_test(testZipEntry);
-
-
-/**
- * Basic reading test for synchronously opened jar channels
- */
-add_test(function testSync() {
- var uri = jarBase + "/inner40.zip";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
- var stream = chan.open2();
- do_check_true(chan.contentLength > 0);
- do_check_eq(stream.available(), chan.contentLength);
- stream.close();
- stream.close(); // should still not throw
-
- run_next_test();
-});
-
-
-/**
- * Basic reading test for synchronously opened, nested jar channels
- */
-add_test(function testSyncNested() {
- var uri = "jar:" + jarBase + "/inner40.zip!/foo";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
- var stream = chan.open2();
- do_check_true(chan.contentLength > 0);
- do_check_eq(stream.available(), chan.contentLength);
- stream.close();
- stream.close(); // should still not throw
-
- run_next_test();
-});
-
-/**
- * Basic reading test for asynchronously opened, nested jar channels
- */
-add_test(function testAsyncNested(next) {
- var uri = "jar:" + jarBase + "/inner40.zip!/foo";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
- chan.asyncOpen2(new Listener(function(l) {
- do_check_true(chan.contentLength > 0);
- do_check_true(l.gotStartRequest);
- do_check_true(l.gotStopRequest);
- do_check_eq(l.available, chan.contentLength);
-
- run_next_test();
- }));
-});
-
-/**
- * Verify that file locks are released when closing a synchronously
- * opened jar channel stream
- */
-add_test(function testSyncCloseUnlocks() {
- var copy = tmpDir.clone();
- copy.append(fileBase);
- file.copyTo(copy.parent, copy.leafName);
- var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
- var stream = chan.open2();
- do_check_true(chan.contentLength > 0);
- stream.close();
-
- // Drop any jar caches
- obs.notifyObservers(null, "chrome-flush-caches", null);
-
- try {
- copy.remove(false);
- }
- catch (ex) {
- do_throw(ex);
- }
-
- run_next_test();
-});
-
-/**
- * Verify that file locks are released when closing an asynchronously
- * opened jar channel stream
- */
-add_test(function testAsyncCloseUnlocks() {
- var copy = tmpDir.clone();
- copy.append(fileBase);
- file.copyTo(copy.parent, copy.leafName);
-
- var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
- var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-
- chan.asyncOpen2(new Listener(function (l) {
- do_check_true(chan.contentLength > 0);
-
- // Drop any jar caches
- obs.notifyObservers(null, "chrome-flush-caches", null);
-
- try {
- copy.remove(false);
- }
- catch (ex) {
- do_throw(ex);
- }
-
- run_next_test();
- }));
-});
-
-
-function run_test() {
- return run_next_test();
-}
diff --git a/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js b/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js
deleted file mode 100644
index 741b84b03..000000000
--- a/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function wrapInputStream(input)
-{
- var nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
- var factory = Components.classes["@mozilla.org/scriptableinputstream;1"];
- var wrapper = factory.createInstance(nsIScriptableInputStream);
- wrapper.init(input);
- return wrapper;
-}
-
-// Check that files can be read from after closing zipreader
-function run_test() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- // the build script have created the zip we can test on in the current dir.
- var file = do_get_file("data/test_bug333423.zip");
-
- var zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipreader.open(file);
- // do crc stuff
- function check_archive_crc() {
- zipreader.test(null);
- return true;
- }
- do_check_true(check_archive_crc())
- var entries = zipreader.findEntries(null);
- var stream = wrapInputStream(zipreader.getInputStream("modules/libjar/test/Makefile.in"))
- var dirstream= wrapInputStream(zipreader.getInputStream("modules/libjar/test/"))
- zipreader.close();
- zipreader = null;
- Components.utils.forceGC();
- do_check_true(stream.read(1024).length > 0);
- do_check_true(dirstream.read(100).length > 0);
-}
-
diff --git a/modules/libjar/test/unit/test_not_found.js b/modules/libjar/test/unit/test_not_found.js
deleted file mode 100644
index f7944cd47..000000000
--- a/modules/libjar/test/unit/test_not_found.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Should report file not found on non-existent files
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/NetUtil.jsm");
-const path = "data/test_bug333423.zip";
-
-function run_test() {
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/";
- var channel = NetUtil.newChannel({
- uri: spec + "file_that_isnt_in.archive",
- loadUsingSystemPrincipal: true
- });
- try {
- instr = channel.open2();
- do_throw("Failed to report that file doesn't exist")
- } catch (e) {
- do_check_true(e.name == "NS_ERROR_FILE_NOT_FOUND")
- }
-}
diff --git a/modules/libjar/test/unit/test_umlaute.js b/modules/libjar/test/unit/test_umlaute.js
deleted file mode 100644
index bfaa0eabc..000000000
--- a/modules/libjar/test/unit/test_umlaute.js
+++ /dev/null
@@ -1,40 +0,0 @@
-
-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();
-}
diff --git a/modules/libjar/test/unit/test_uncompressed.js b/modules/libjar/test/unit/test_uncompressed.js
deleted file mode 100644
index 80fbbcee5..000000000
--- a/modules/libjar/test/unit/test_uncompressed.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Make sure uncompressed files pass crc
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-function run_test() {
- var file = do_get_file("data/uncompressed.zip");
- var zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipReader.open(file);
- zipReader.test("hello");
- zipReader.close();
-}
diff --git a/modules/libjar/test/unit/xpcshell.ini b/modules/libjar/test/unit/xpcshell.ini
deleted file mode 100644
index ee22f4c24..000000000
--- a/modules/libjar/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- data/empty
- data/test_bug333423.zip
- data/test_bug336691.zip
- data/test_bug370103.jar
- data/test_bug379841.zip
- data/test_bug589292.zip
- data/test_bug597702.zip
- data/test_bug637286.zip
- data/test_bug658093.zip
- data/test_corrupt.zip
- data/test_corrupt2.zip
- data/test_corrupt3.zip
- data/test_crx_dummy.crx
- data/test_umlaute.zip
- data/uncompressed.zip
-
-[test_jarchannel.js]
-skip-if = os == "mac"
-[test_bug278262.js]
-[test_bug333423.js]
-[test_bug336691.js]
-[test_bug370103.js]
-[test_bug379841.js]
-[test_bug407303.js]
-[test_bug453254.js]
-[test_bug458158.js]
-[test_bug589292.js]
-[test_bug597702.js]
-[test_bug637286.js]
-[test_bug658093.js]
-[test_corrupt_536911.js]
-[test_corrupt_541828.js]
-[test_corrupt_1211262.js]
-[test_crx.js]
-[test_dirjar_bug525755.js]
-[test_jarinput_stream_zipreader_reference.js]
-[test_not_found.js]
-[test_uncompressed.js]
-[test_umlaute.js]
diff --git a/modules/libjar/zipwriter/moz.build b/modules/libjar/zipwriter/moz.build
deleted file mode 100644
index ade5904d3..000000000
--- a/modules/libjar/zipwriter/moz.build
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIZipWriter.idl',
-]
-
-XPIDL_MODULE = 'zipwriter'
-
-UNIFIED_SOURCES += [
- 'nsDeflateConverter.cpp',
- 'nsZipDataStream.cpp',
- 'nsZipHeader.cpp',
- 'nsZipWriter.cpp',
- 'StreamFunctions.cpp',
- 'ZipWriterModule.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/modules/libjar/zipwriter/test/unit/data/emptyfile.txt b/modules/libjar/zipwriter/test/unit/data/emptyfile.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/modules/libjar/zipwriter/test/unit/data/emptyfile.txt
+++ /dev/null
diff --git a/modules/libjar/zipwriter/test/unit/data/smallfile.txt b/modules/libjar/zipwriter/test/unit/data/smallfile.txt
deleted file mode 100644
index e068fcf81..000000000
--- a/modules/libjar/zipwriter/test/unit/data/smallfile.txt
+++ /dev/null
@@ -1 +0,0 @@
-Small (16 bytes) \ No newline at end of file
diff --git a/modules/libjar/zipwriter/test/unit/data/test.png b/modules/libjar/zipwriter/test/unit/data/test.png
deleted file mode 100644
index c648f7299..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test.png
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/zipwriter/test/unit/data/test.txt b/modules/libjar/zipwriter/test/unit/data/test.txt
deleted file mode 100644
index 1040981a3..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This is a test text file for the zipwriter component.
-It will be made available in the unit test directory.
-It will also be compressed into a testcase zip file
-made by a 3rd party zip tool to test the opening of
-existing zip files.
diff --git a/modules/libjar/zipwriter/test/unit/data/test.zip b/modules/libjar/zipwriter/test/unit/data/test.zip
deleted file mode 100644
index 96581fe8b..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test.zip
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/zipwriter/test/unit/data/test_bug399727.html b/modules/libjar/zipwriter/test/unit/data/test_bug399727.html
deleted file mode 100644
index a6556274f..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test_bug399727.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="Content-Language" content="en-gb"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta name="generator" content="Fog Creek CityDesk 2.0.19"><meta name="citydesk" content="BB40F561/251"><title>TK's Sleater-Kinney pages</title><style type="text/css">
-<!--
-body {
- font-family: verdana, arial;
- font-size: 10pt;
- color: black;
- background-color: #D0E8E8;
-}
-td {
- font-family: verdana, arial;
- font-size: 10pt;
-}
-hr {
- color: #808080;
- height: 1px;
-}
-caption {
- font-family: verdana, arial;
- font-size: 8pt;
- color: #808080;
- background-color: white;
-}
-.bigText {
- font-family: verdana, arial;
- font-size: 18pt;
- font-weight: bold;
- color: black;
- padding-bottom: 10px;
-}
-.smallText {
- font-family: verdana, arial;
- font-size: 7pt;
- color: #808080;
-}
-.tabText {
- font-family: Courier, "Courier New", monospace;
- font-size: 7pt;
- color: #808080;
-}
-.emphasis
-{
- font-weight: bold;
- color: #000000;
-}
-.articleHeader {
- padding-bottom: 4px;
- border-bottom: #808080 dotted 1px;
-}
-.headerCell {
- background-color: #689090;
- color: white;
- padding: 4px;
-}
-.navbarText {
- color: white;
- font-weight: bold;
-}
-.articleTable {
- border: #808080 solid 1px;
- background-color: white;
- padding: 15px;
-}
-
-
-
--->
-</style></head><body>
-
-
-
-
-
-
-
-
-
-
-<div align="center">
- <center>
- <table border="0" cellpadding="0" cellspacing="0" width="700">
- <tbody><tr>
- <td><p class="bigText">TK's Sleater-Kinney pages</p>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <table class="articleTable" border="0" cellpadding="0" cellspacing="0" width="100%">
- <tbody><tr>
- <td class="headerCell" align="right"><p class="navbarText">
- : <a class="navbarText" href="http://tk-jk.net/S-K/index.html"> <span class="1home">Home</span></a>
- : <a class="navbarText" href="http://tk-jk.net/S-K/blog/general/Archive.html"> <span class="2archive">Archive</span></a>
- : <a class="navbarText" href="http://tk-jk.net/S-K/blog/general/Tabs.html"> <span class="3tabs">Tabs</span></a>
- : <a class="navbarText" href="http://tk-jk.net/S-K/blog/general/Drumtabs.html"> <span class="4drumtabs">Drum tabs</span></a>
- : <a class="navbarText" href="http://tk-jk.net/S-K/blog/general/SetLists.html"> <span class="5setlists">Set Lists</span></a>
- : <a class="navbarText" href="http://tk-jk.net/S-K/blog/general/About.html"> <span class="6about">About</span></a> :
-</p>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <div align="left">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tbody><tr>
- <td width="100%">
-<p class="bigText"><strong>All Hands on the Bad One</strong>
-</p>
-<p></p><p><strong>All Hands on the Bad One, <em>"All Hands on the Bad One"</em></strong></p>
-<p dir="ltr">This, followed by <a href="http://tk-jk.net/S-K/Tabs/YouthDecay.html">Youth Decay</a>&nbsp;- wow - most bands would be happy just to have just one of these songs.&nbsp; S-K has a boatload.</p>
-<p dir="ltr">Tabbing this was very frustrating.&nbsp;Riff 3 is a
-masterpiece of guitar and vocal harmony, rhythm and guitar
-interplay.&nbsp; It has a bass intro and stacks guitars and vocals on
-top. This is the definition of Sleater-Kinney magic. You can't&nbsp;get
-it all done on two guitars.&nbsp; You can get close.&nbsp;&nbsp; I
-haven't done it justice.</p>
-<p dir="ltr">As usual the guitar 2's rhythms are vital to the S-K sound.&nbsp; It's still good if you don't get it just right.</p>
-<p dir="ltr">I sure hope I've done this well enough for you to figure out.</p>
-<ul dir="ltr">
-<li>
-<div style="margin-right: 0px;">Quarter note =&nbsp;153 or so.</div>
-</li><li>
-<div style="margin-right: 0px;">Standard tuning. But tuning down 3 half steps makes Riff 3 easier and more authentic.</div>
-</li><li>
-<div style="margin-right: 0px;">Tabbed&nbsp;where it felt good&nbsp;on the fretboard but there are alternatives.</div>
-</li><li>
-<div style="margin-right: 0px;">Tuning down is required for authenticity but it sounds great in standard tuning</div></li></ul><strong>
-</strong><p dir="ltr"><strong><br>1:</strong></p>
-<p></p><span><img alt="All Hands on the Bad One Riff 1" src="AllHandsontheBadOne_files/AHOTBO1.jpg" cd:pos="2" align="left" border="0" height="500" hspace="4" width="580"><br clear="all"></span>
-<p><strong></strong>&nbsp;</p>
-<p><strong>2:</strong></p><span><img alt="All Hands on the Bad One Riff 2" src="AllHandsontheBadOne_files/AHOTBO2.jpg" cd:pos="2" align="left" border="0" height="257" hspace="4" width="580"><br clear="all"></span>
-<p><strong></strong>&nbsp;</p>
-<p><strong>Riff 3 (3a and 3b) is a little masterpeice:</strong></p><span><img alt="All Hands on the Bad One Riff 3a" src="AllHandsontheBadOne_files/AHOTBO3a.jpg" cd:pos="2" align="left" border="0" height="446" hspace="4" width="580"><br clear="all"></span>
-<p><span><img alt="All Hands on the Bad One Riff 3b" src="AllHandsontheBadOne_files/AHOTBO3b.jpg" cd:pos="2" align="left" border="0" height="179" hspace="4" width="580"><br clear="all"></span></p>
-<p>&nbsp;</p>
-<p>The Outro</p>
-<p><span><img alt="All Hands on the Bad One Riff 4" src="AllHandsontheBadOne_files/AHOTBO4.jpg" cd:pos="2" align="left" border="0" height="216" hspace="4" width="580"><br clear="all"></span></p><p></p>
- </td>
- </tr>
- </tbody></table>
- </div>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <hr>
- <center>
- <div class="smallText">
- The views expressed within this site pretty much represent those of the author.<br>
- Copyright (c) 2002 <a href="http://tk-jk.net/">Terry Kearns</a>. All rights reserved.
- </div>
- </center>
- </td>
- </tr>
- </tbody></table>
- </td>
- </tr>
- </tbody></table>
- </center>
-</div>
-</body></html> \ No newline at end of file
diff --git a/modules/libjar/zipwriter/test/unit/data/test_bug399727.zlib b/modules/libjar/zipwriter/test/unit/data/test_bug399727.zlib
deleted file mode 100644
index 080b63c52..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test_bug399727.zlib
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/zipwriter/test/unit/data/test_bug446708/thumbs/st14-1.tiff b/modules/libjar/zipwriter/test/unit/data/test_bug446708/thumbs/st14-1.tiff
deleted file mode 100644
index 6b0465758..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test_bug446708/thumbs/st14-1.tiff
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/zipwriter/test/unit/data/test_bug717061.gz b/modules/libjar/zipwriter/test/unit/data/test_bug717061.gz
deleted file mode 100644
index f990c6e51..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test_bug717061.gz
+++ /dev/null
Binary files differ
diff --git a/modules/libjar/zipwriter/test/unit/data/test_bug717061.html b/modules/libjar/zipwriter/test/unit/data/test_bug717061.html
deleted file mode 100644
index 80ce0319b..000000000
--- a/modules/libjar/zipwriter/test/unit/data/test_bug717061.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="Content-Language" content="en-us"><title>Lorem Ipsum</title><style type="text/css">
-body {
- font-family: verdana, arial;
- font-size: 10pt;
- color: black;
- background-color: #D0E8E8;
-}
-</style></head><body>
-<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
-
-<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
-
-<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
-
-</body></html>
diff --git a/modules/libjar/zipwriter/test/unit/head_zipwriter.js b/modules/libjar/zipwriter/test/unit/head_zipwriter.js
deleted file mode 100644
index bc77455a5..000000000
--- a/modules/libjar/zipwriter/test/unit/head_zipwriter.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-const NS_ERROR_IN_PROGRESS = 2152398863;
-
-const PR_RDONLY = 0x01
-const PR_WRONLY = 0x02
-const PR_RDWR = 0x04
-const PR_CREATE_FILE = 0x08
-const PR_APPEND = 0x10
-const PR_TRUNCATE = 0x20
-const PR_SYNC = 0x40
-const PR_EXCL = 0x80
-
-const ZIP_EOCDR_HEADER_SIZE = 22;
-const ZIP_FILE_HEADER_SIZE = 30;
-const ZIP_CDS_HEADER_SIZE = 46;
-const ZIP_METHOD_STORE = 0
-const ZIP_METHOD_DEFLATE = 8
-const ZIP_EXTENDED_TIMESTAMP_SIZE = 9;
-
-const PR_USEC_PER_MSEC = 1000;
-const PR_USEC_PER_SEC = 1000000;
-const PR_MSEC_PER_SEC = 1000;
-
-const DATA_DIR = "data/";
-
-var ioSvc = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService);
-
-var ZipWriter = Components.Constructor("@mozilla.org/zipwriter;1",
- "nsIZipWriter");
-var ZipReader = Components.Constructor("@mozilla.org/libjar/zip-reader;1",
- "nsIZipReader", "open");
-
-var tmpDir = do_get_profile();
-var tmpFile = tmpDir.clone();
-tmpFile.append("zipwriter-test.zip");
-if (tmpFile.exists())
- tmpFile.remove(true);
-
-var zipW = new ZipWriter();
diff --git a/modules/libjar/zipwriter/test/unit/tail_zipwriter.js b/modules/libjar/zipwriter/test/unit/tail_zipwriter.js
deleted file mode 100644
index 033cc23c2..000000000
--- a/modules/libjar/zipwriter/test/unit/tail_zipwriter.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-try {
- zipW.close();
-}
-catch (e) {
- // Just ignore a failure here and attempt to delete the file anyway.
-}
-
-if (tmpFile.exists())
- tmpFile.remove(true);
diff --git a/modules/libjar/zipwriter/test/unit/test_alignment.js b/modules/libjar/zipwriter/test/unit/test_alignment.js
deleted file mode 100644
index da497253c..000000000
--- a/modules/libjar/zipwriter/test/unit/test_alignment.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "ZIP WRITER TEST DATA";
-const FILENAME = "test_data.txt";
-const CRC = 0xe6164331;
-const time = 1199145600000; // Jan 1st 2008
-
-var TESTS = [
- {
- name: "test.txt",
- compression: Ci.nsIZipWriter.COMPRESSION_DEFAULT
- },
- {
- name: "test.png",
- compression: Ci.nsIZipWriter.COMPRESSION_NONE
- }
-];
-
-function swap16(n)
-{
- return (((n >> 8) & 0xFF) << 0) |
- (((n >> 0) & 0xFF) << 8);
-}
-
-function swap32(n)
-{
- return (((n >> 24) & 0xFF) << 0) |
- (((n >> 16) & 0xFF) << 8) |
- (((n >> 8) & 0xFF) << 16) |
- (((n >> 0) & 0xFF) << 24);
-}
-
-function move_to_data(bis, offset)
-{
- bis.readBytes(18); // Move to compressed size
- var size = swap32(bis.read32());
- bis.readBytes(4);
- var file_len = swap16(bis.read16());
- var extra_len = swap16(bis.read16());
- var file = bis.readBytes(file_len);
- bis.readBytes(extra_len);
- offset += ZIP_FILE_HEADER_SIZE + file_len + extra_len;
-
- return {offset: offset, size: size};
-}
-
-function test_alignment(align_size)
-{
- // Create zip for testing.
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR + TESTS[i].name);
- zipW.addEntryFile(TESTS[i].name, TESTS[i].compression, source, false);
- }
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(DATA, DATA.length);
- zipW.addEntryStream(FILENAME, time * PR_USEC_PER_MSEC,
- Ci.nsIZipWriter.COMPRESSION_NONE, stream, false);
- zipW.alignStoredFiles(align_size);
- zipW.close();
-
- // Check data can be decompressed.
- var zipR = new ZipReader(tmpFile);
- var stream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- stream.init(zipR.getInputStream(FILENAME));
- var result = stream.read(DATA.length);
- do_check_eq(result, DATA);
- stream.close();
- zipR.close();
-
- // Check data is correct and aligned.
- var fis = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- fis.init(tmpFile, -1, -1, null);
- let bis = Cc["@mozilla.org/binaryinputstream;1"]
- .createInstance(Ci.nsIBinaryInputStream);
- bis.setInputStream(fis);
- var offset = 0;
-
- var ret = move_to_data(bis, offset); // "test.txt"
- offset = ret.offset;
- bis.readBytes(ret.size);
- offset += ret.size;
-
- ret = move_to_data(bis, offset); // "test.png"
- offset = ret.offset;
- do_check_eq(offset % align_size, 0);
- bis.readBytes(ret.size);
- offset += ret.size;
-
- ret = move_to_data(bis, offset); // "test_data.txt"
- offset = ret.offset;
- var result = bis.readBytes(DATA.length);
- do_check_eq(result, DATA);
- do_check_eq(offset % align_size, 0);
-
- fis.close();
- bis.close();
-}
-
-function run_test()
-{
- test_alignment(2);
- test_alignment(4);
- test_alignment(16);
- test_alignment(4096);
- test_alignment(32768);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_asyncadd.js b/modules/libjar/zipwriter/test/unit/test_asyncadd.js
deleted file mode 100644
index a6659f61a..000000000
--- a/modules/libjar/zipwriter/test/unit/test_asyncadd.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-// Values taken from using zipinfo to list the test.zip contents
-var TESTS = [
- {
- name: "test.txt",
- size: 232,
- crc: 0x0373ac26
- },
- {
- name: "test.png",
- size: 3402,
- crc: 0x504a5c30
- }
-];
-
-var size = 0;
-
-var observer = {
- onStartRequest: function(request, context)
- {
- },
-
- onStopRequest: function(request, context, status)
- {
- do_check_eq(status, Components.results.NS_OK);
-
- zipW.close();
- size += ZIP_EOCDR_HEADER_SIZE;
-
- do_check_eq(size, tmpFile.fileSize);
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
-
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR + TESTS[i].name);
- for (let method in methods) {
- var entryName = method + "/" + TESTS[i].name;
- do_check_true(zipR.hasEntry(entryName));
-
- var entry = zipR.getEntry(entryName);
- do_check_eq(entry.realSize, TESTS[i].size);
- do_check_eq(entry.size, TESTS[i].size);
- do_check_eq(entry.CRC32, TESTS[i].crc);
- do_check_eq(Math.floor(entry.lastModifiedTime / PR_USEC_PER_SEC),
- Math.floor(source.lastModifiedTime / PR_MSEC_PER_SEC));
-
- zipR.test(entryName);
- }
- }
-
- zipR.close();
- do_test_finished();
- }
-};
-
-var methods = {
- file: function method_file(entry, source)
- {
- zipW.addEntryFile(entry, Ci.nsIZipWriter.COMPRESSION_NONE, source,
- true);
- },
- channel: function method_channel(entry, source)
- {
- zipW.addEntryChannel(entry, source.lastModifiedTime * PR_MSEC_PER_SEC,
- Ci.nsIZipWriter.COMPRESSION_NONE,
- NetUtil.newChannel({
- uri: ioSvc.newFileURI(source),
- loadUsingSystemPrincipal: true
- }), true);
- },
- stream: function method_stream(entry, source)
- {
- zipW.addEntryStream(entry, source.lastModifiedTime * PR_MSEC_PER_SEC,
- Ci.nsIZipWriter.COMPRESSION_NONE,
- NetUtil.newChannel({
- uri: ioSvc.newFileURI(source),
- loadUsingSystemPrincipal: true
- }).open2(), true);
- }
-}
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR+TESTS[i].name);
- for (let method in methods) {
- var entry = method + "/" + TESTS[i].name;
- methods[method](entry, source);
- size += ZIP_FILE_HEADER_SIZE + ZIP_CDS_HEADER_SIZE +
- (ZIP_EXTENDED_TIMESTAMP_SIZE * 2) +
- (entry.length*2) + TESTS[i].size;
- }
- }
- do_test_pending();
- zipW.processQueue(observer, null);
- do_check_true(zipW.inQueue);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_asyncbadadd.js b/modules/libjar/zipwriter/test/unit/test_asyncbadadd.js
deleted file mode 100644
index 2f8ebe644..000000000
--- a/modules/libjar/zipwriter/test/unit/test_asyncbadadd.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const FILENAME = "missing.txt";
-
-var observer = {
- onStartRequest: function(request, context)
- {
- },
-
- onStopRequest: function(request, context, status)
- {
- do_check_eq(status, Components.results.NS_ERROR_FILE_NOT_FOUND);
- zipW.close();
- do_check_eq(ZIP_EOCDR_HEADER_SIZE, tmpFile.fileSize);
- do_test_finished();
- }
-};
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- var source = tmpDir.clone();
- source.append(FILENAME);
- zipW.addEntryFile(FILENAME, Ci.nsIZipWriter.COMPRESSION_NONE, source, true);
-
- do_test_pending();
- zipW.processQueue(observer, null);
-
- // With nothing to actually do the queue would have completed immediately
- do_check_false(zipW.inQueue);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_asyncbadremove.js b/modules/libjar/zipwriter/test/unit/test_asyncbadremove.js
deleted file mode 100644
index 609d4345d..000000000
--- a/modules/libjar/zipwriter/test/unit/test_asyncbadremove.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const FILENAME = "missing.txt";
-
-var observer = {
- onStartRequest: function(request, context)
- {
- },
-
- onStopRequest: function(request, context, status)
- {
- do_check_eq(status, Components.results.NS_ERROR_FILE_NOT_FOUND);
- zipW.close();
- do_check_eq(ZIP_EOCDR_HEADER_SIZE, tmpFile.fileSize);
- do_test_finished();
- }
-};
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- zipW.removeEntry(FILENAME, true);
- do_test_pending();
- zipW.processQueue(observer, null);
-
- // With nothing to actually do the queue would have completed immediately
- do_check_false(zipW.inQueue);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_asyncremove.js b/modules/libjar/zipwriter/test/unit/test_asyncremove.js
deleted file mode 100644
index c44ff3354..000000000
--- a/modules/libjar/zipwriter/test/unit/test_asyncremove.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-var TESTS = [
- "test.txt",
- "test.png"
-];
-
-var observer = {
- onStartRequest: function(request, context)
- {
- },
-
- onStopRequest: function(request, context, status)
- {
- do_check_eq(status, Components.results.NS_OK);
-
- zipW.close();
-
- // Empty zip file should just be the end of central directory marker
- var newTmpFile = tmpFile.clone();
- do_check_eq(newTmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE);
- do_test_finished();
- }
-};
-
-function run_test()
-{
- // Copy our test zip to the tmp dir so we can modify it
- var testzip = do_get_file(DATA_DIR + "test.zip");
- testzip.copyTo(tmpDir, tmpFile.leafName);
-
- do_check_true(tmpFile.exists());
-
- zipW.open(tmpFile, PR_RDWR);
-
- for (var i = 0; i < TESTS.length; i++) {
- do_check_true(zipW.hasEntry(TESTS[i]));
- zipW.removeEntry(TESTS[i], true);
- }
-
- do_test_pending();
- zipW.processQueue(observer, null);
- do_check_true(zipW.inQueue);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug399727.js b/modules/libjar/zipwriter/test/unit/test_bug399727.js
deleted file mode 100644
index 065cacae3..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug399727.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function BinaryComparer(file, callback) {
- var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(file, -1, 0, 0);
- this.length = file.fileSize;
- this.fileStream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- this.fileStream.setInputStream(fstream);
- this.offset = 0;
- this.callback = callback;
-}
-
-BinaryComparer.prototype = {
- fileStream: null,
- offset: null,
- length: null,
- callback: null,
-
- onStartRequest: function(aRequest, aContext) {
- },
-
- onStopRequest: function(aRequest, aContext, aStatusCode) {
- this.fileStream.close();
- do_check_eq(aStatusCode, Components.results.NS_OK);
- do_check_eq(this.offset, this.length);
- this.callback();
- },
-
- onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount) {
- var stream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- stream.setInputStream(aInputStream);
- var source, actual;
- for (var i = 0; i < aCount; i++) {
- try {
- source = this.fileStream.read8();
- }
- catch (e) {
- do_throw("Unable to read from file at offset " + this.offset + " " + e);
- }
- try {
- actual = stream.read8();
- }
- catch (e) {
- do_throw("Unable to read from converted stream at offset " + this.offset + " " + e);
- }
- if (source != actual)
- do_throw("Invalid value " + actual + " at offset " + this.offset + ", should have been " + source);
- this.offset++;
- }
- }
-}
-
-function comparer_callback()
-{
- do_test_finished();
-}
-
-function run_test()
-{
- var source = do_get_file(DATA_DIR + "test_bug399727.html");
- var comparer = new BinaryComparer(do_get_file(DATA_DIR + "test_bug399727.zlib"),
- comparer_callback);
-
- // Prepare the stream converter
- var scs = Cc["@mozilla.org/streamConverters;1"].
- getService(Ci.nsIStreamConverterService);
- var converter = scs.asyncConvertData("uncompressed", "deflate", comparer, null);
-
- // Open the expected output file
- var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(source, -1, 0, 0);
-
- // Set up a pump to push data from the file to the stream converter
- var pump = Cc["@mozilla.org/network/input-stream-pump;1"].
- createInstance(Ci.nsIInputStreamPump);
- pump.init(fstream, -1, -1, 0, 0, true);
- pump.asyncRead(converter, null);
- do_test_pending();
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug419769_1.js b/modules/libjar/zipwriter/test/unit/test_bug419769_1.js
deleted file mode 100644
index cd81a31c3..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug419769_1.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "";
-const FILENAME = "test.txt";
-const CRC = 0x00000000;
-// XXX Must use a constant time here away from DST changes. See bug 402434.
-const time = 1199145600000; // Jan 1st 2008
-
-function testpass(source)
-{
- // Should exist.
- do_check_true(source.hasEntry(FILENAME));
-
- var entry = source.getEntry(FILENAME);
- do_check_neq(entry, null);
-
- do_check_false(entry.isDirectory);
-
- // Should be stored
- do_check_eq(entry.compression, ZIP_METHOD_DEFLATE);
-
- do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC, time);
-
- // File size should match our data size.
- do_check_eq(entry.realSize, DATA.length);
-
- // Check that the CRC is accurate
- do_check_eq(entry.CRC32, CRC);
-}
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- // Shouldn't be there to start with.
- do_check_false(zipW.hasEntry(FILENAME));
-
- do_check_false(zipW.inQueue);
-
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(DATA, DATA.length);
- zipW.addEntryStream(FILENAME, time * PR_USEC_PER_MSEC,
- Ci.nsIZipWriter.COMPRESSION_BEST, stream, false);
-
- // Check that zip state is right at this stage.
- testpass(zipW);
- zipW.close();
-
- // Check to see if we get the same results loading afresh.
- zipW.open(tmpFile, PR_RDWR);
- testpass(zipW);
- zipW.close();
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
- testpass(zipR);
- zipR.test(FILENAME);
- var stream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- stream.init(zipR.getInputStream(FILENAME));
- var result = stream.read(DATA.length);
- stream.close();
- zipR.close();
-
- do_check_eq(result, DATA);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug419769_2.js b/modules/libjar/zipwriter/test/unit/test_bug419769_2.js
deleted file mode 100644
index f46ab395e..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug419769_2.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "";
-const FILENAME = "test.txt";
-const CRC = 0x00000000;
-const time = Date.now();
-
-function testpass(source)
-{
- // Should exist.
- do_check_true(source.hasEntry(FILENAME));
-
- var entry = source.getEntry(FILENAME);
- do_check_neq(entry, null);
-
- do_check_false(entry.isDirectory);
-
- // Should be stored
- do_check_eq(entry.compression, ZIP_METHOD_DEFLATE);
-
- // File size should match our data size.
- do_check_eq(entry.realSize, DATA.length);
-
- // Check that the CRC is accurate
- do_check_eq(entry.CRC32, CRC);
-}
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- // Shouldn't be there to start with.
- do_check_false(zipW.hasEntry(FILENAME));
-
- do_check_false(zipW.inQueue);
-
- var file = do_get_file(DATA_DIR + "emptyfile.txt");
- zipW.addEntryFile(FILENAME, Ci.nsIZipWriter.COMPRESSION_BEST, file, false);
-
- // Check that zip state is right at this stage.
- testpass(zipW);
- zipW.close();
-
- // Check to see if we get the same results loading afresh.
- zipW.open(tmpFile, PR_RDWR);
- testpass(zipW);
- zipW.close();
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
- testpass(zipR);
- zipR.test(FILENAME);
- var stream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- stream.init(zipR.getInputStream(FILENAME));
- var result = stream.read(DATA.length);
- stream.close();
- zipR.close();
-
- do_check_eq(result, DATA);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug425768.js b/modules/libjar/zipwriter/test/unit/test_bug425768.js
deleted file mode 100644
index f59767342..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug425768.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DIRNAME = "test/";
-const time = Date.now();
-
-function run_test()
-{
- // Copy in the test file.
- var source = do_get_file("data/test.zip");
- source.copyTo(tmpFile.parent, tmpFile.leafName);
-
- // Open it and add something so the CDS is rewritten.
- zipW.open(tmpFile, PR_RDWR | PR_APPEND);
- zipW.addEntryDirectory(DIRNAME, time * PR_USEC_PER_MSEC, false);
- do_check_true(zipW.hasEntry(DIRNAME));
- zipW.close();
-
- var zipR = new ZipReader(tmpFile);
- do_check_true(zipR.hasEntry(DIRNAME));
- zipR.close();
-
- // Adding the directory would have added a fixed amount to the file size.
- // Any difference suggests the CDS was written out incorrectly.
- var extra = ZIP_FILE_HEADER_SIZE + ZIP_CDS_HEADER_SIZE +
- (DIRNAME.length * 2) + (ZIP_EXTENDED_TIMESTAMP_SIZE * 2);
-
- do_check_eq(source.fileSize + extra, tmpFile.fileSize);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug433248.js b/modules/libjar/zipwriter/test/unit/test_bug433248.js
deleted file mode 100644
index 15f2e4970..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug433248.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test()
-{
- var test;
- // zipW is an uninitialised zipwriter at this point.
- try {
- test = zipW.file;
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- test = zipW.comment;
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.comment = "test";
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.addEntryDirectory("test", 0, false);
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.addEntryFile("test", Ci.nsIZipWriter.COMPRESSION_DEFAULT, tmpDir, false);
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.removeEntry("test", false);
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.processQueue(null, null);
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-
- try {
- zipW.close();
- do_throw("Should have thrown uninitialized error.");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_NOT_INITIALIZED);
- }
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug446708.js b/modules/libjar/zipwriter/test/unit/test_bug446708.js
deleted file mode 100644
index 2b4e7a0ce..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug446708.js
+++ /dev/null
@@ -1,37 +0,0 @@
-function run_test() {
- var testBundle = do_get_file("data/test_bug446708");
-
- RecursivelyZipDirectory(testBundle);
-}
-
-// Add |file| to the zip. |path| is the current path for the file.
-function AddToZip(zipWriter, path, file)
-{
- var currentPath = path + file.leafName;
-
- if (file.isDirectory()) {
- currentPath += "/";
- }
-
- // THIS IS WHERE THE ERROR OCCURS, FOR THE FILE "st14-1.tiff" IN "test_bug446708"
- zipWriter.addEntryFile(currentPath, Ci.nsIZipWriter.COMPRESSION_DEFAULT, file, false);
-
- // if it's a dir, continue adding its contents recursively...
- if (file.isDirectory()) {
- var entries = file.QueryInterface(Components.interfaces.nsIFile).directoryEntries;
- while (entries.hasMoreElements()) {
- var entry = entries.getNext().QueryInterface(Components.interfaces.nsIFile);
- AddToZip(zipWriter, currentPath, entry);
- }
- }
-
- // ...otherwise, we're done
-}
-
-function RecursivelyZipDirectory(bundle)
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- AddToZip(zipW, "", bundle);
- zipW.close();
-}
-
diff --git a/modules/libjar/zipwriter/test/unit/test_bug467740.js b/modules/libjar/zipwriter/test/unit/test_bug467740.js
deleted file mode 100644
index cdb2b6042..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug467740.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test()
-{
- // In this test we try to open some files that aren't archives:
- // - An empty file, that is certainly not an archive.
- // - A file that couldn't be mistaken for archive, since it is too small.
- // - A file that could be mistaken for archive, if we checked only the file
- // size, but is invalid since it contains no ZIP signature.
- var invalidArchives = ["emptyfile.txt", "smallfile.txt", "test.png"];
-
- invalidArchives.forEach(function(invalidArchive) {
- // Get a reference to the invalid file
- var invalidFile = do_get_file(DATA_DIR + invalidArchive);
-
- // Opening the invalid file should fail (but not crash)
- try {
- zipW.open(invalidFile, PR_RDWR);
- do_throw("Should have thrown NS_ERROR_FILE_CORRUPTED on " +
- invalidArchive + " !");
- } catch (e if (e instanceof Ci.nsIException &&
- e.result == Components.results.NS_ERROR_FILE_CORRUPTED)) {
- // do nothing
- }
- });
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_bug717061.js b/modules/libjar/zipwriter/test/unit/test_bug717061.js
deleted file mode 100644
index 35163a464..000000000
--- a/modules/libjar/zipwriter/test/unit/test_bug717061.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0
- */
-
-function BinaryComparer(file, callback) {
- var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(file, -1, 0, 0);
- this.length = file.fileSize;
- this.fileStream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- this.fileStream.setInputStream(fstream);
- this.offset = 0;
- this.callback = callback;
-}
-
-BinaryComparer.prototype = {
- fileStream: null,
- offset: null,
- length: null,
- callback: null,
-
- onStartRequest: function(aRequest, aContext) {
- },
-
- onStopRequest: function(aRequest, aContext, aStatusCode) {
- this.fileStream.close();
- do_check_eq(aStatusCode, Components.results.NS_OK);
- do_check_eq(this.offset, this.length);
- this.callback();
- },
-
- onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount) {
- var stream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- stream.setInputStream(aInputStream);
- var source, actual;
- for (var i = 0; i < aCount; i++) {
- try {
- source = this.fileStream.read8();
- }
- catch (e) {
- do_throw("Unable to read from file at offset " + this.offset + " " + e);
- }
- try {
- actual = stream.read8();
- }
- catch (e) {
- do_throw("Unable to read from converted stream at offset " + this.offset + " " + e);
- }
- // The byte at offset 9 is the OS byte (see RFC 1952, section 2.3), which
- // can legitimately differ when the source is compressed on different
- // operating systems. The actual .gz for this test was created on a Unix
- // system, but we want the test to work correctly everywhere. So ignore
- // the byte at offset 9.
- if (this.offset == 9)
- ;
- else if (source != actual)
- do_throw("Invalid value " + actual + " at offset " + this.offset + ", should have been " + source);
- this.offset++;
- }
- }
-}
-
-function comparer_callback()
-{
- do_test_finished();
-}
-
-function run_test()
-{
- var source = do_get_file(DATA_DIR + "test_bug717061.html");
- var comparer = new BinaryComparer(do_get_file(DATA_DIR + "test_bug717061.gz"),
- comparer_callback);
-
- // Prepare the stream converter
- var scs = Cc["@mozilla.org/streamConverters;1"].
- getService(Ci.nsIStreamConverterService);
- var converter = scs.asyncConvertData("uncompressed", "gzip", comparer, null);
-
- // Open the expected output file
- var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(source, -1, 0, 0);
-
- // Set up a pump to push data from the file to the stream converter
- var pump = Cc["@mozilla.org/network/input-stream-pump;1"].
- createInstance(Ci.nsIInputStreamPump);
- pump.init(fstream, -1, -1, 0, 0, true);
- pump.asyncRead(converter, null);
- do_test_pending();
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_createempty.js b/modules/libjar/zipwriter/test/unit/test_createempty.js
deleted file mode 100644
index 4de1992e4..000000000
--- a/modules/libjar/zipwriter/test/unit/test_createempty.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- zipW.close();
-
- // Should have created a zip file
- do_check_true(tmpFile.exists());
-
- // Empty zip file should just be the end of central directory marker
- do_check_eq(tmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_deflatedata.js b/modules/libjar/zipwriter/test/unit/test_deflatedata.js
deleted file mode 100644
index 6c0f39bc2..000000000
--- a/modules/libjar/zipwriter/test/unit/test_deflatedata.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "ZIP WRITER TEST DATA";
-const FILENAME = "test.txt";
-const CRC = 0xe6164331;
-// XXX Must use a constant time here away from DST changes. See bug 402434.
-const time = 1199145600000; // Jan 1st 2008
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- // Shouldn't be there to start with.
- do_check_false(zipW.hasEntry(FILENAME));
-
- do_check_false(zipW.inQueue);
-
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(DATA, DATA.length);
- zipW.addEntryStream(FILENAME, time * PR_USEC_PER_MSEC,
- Ci.nsIZipWriter.COMPRESSION_BEST, stream, false);
-
- var entry = zipW.getEntry(FILENAME);
-
- do_check_true(entry != null);
-
- // Check entry seems right.
- do_check_eq(entry.compression, ZIP_METHOD_DEFLATE);
- do_check_eq(entry.CRC32, CRC);
- do_check_eq(entry.realSize, DATA.length);
- do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC, time);
-
- zipW.close();
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
- do_check_true(zipR.hasEntry(FILENAME));
-
- zipR.test(FILENAME);
-
- var stream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- stream.init(zipR.getInputStream(FILENAME));
- var result = stream.read(DATA.length);
- stream.close();
- zipR.close();
-
- do_check_eq(result, DATA);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_directory.js b/modules/libjar/zipwriter/test/unit/test_directory.js
deleted file mode 100644
index 3196ebed9..000000000
--- a/modules/libjar/zipwriter/test/unit/test_directory.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DIRNAME1 = "test";
-const DIRNAME1_CORRECT = "test/";
-const DIRNAME2 = "test2/";
-const time = Date.now();
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- zipW.addEntryDirectory(DIRNAME1, time * PR_USEC_PER_MSEC, false);
- do_check_false(zipW.hasEntry(DIRNAME1));
- do_check_true(zipW.hasEntry(DIRNAME1_CORRECT));
- var entry = zipW.getEntry(DIRNAME1_CORRECT);
- do_check_true(entry.isDirectory);
-
- zipW.addEntryDirectory(DIRNAME2, time * PR_USEC_PER_MSEC, false);
- do_check_true(zipW.hasEntry(DIRNAME2));
- entry = zipW.getEntry(DIRNAME2);
- do_check_true(entry.isDirectory);
-
- zipW.close();
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_editexisting.js b/modules/libjar/zipwriter/test/unit/test_editexisting.js
deleted file mode 100644
index 84b20690b..000000000
--- a/modules/libjar/zipwriter/test/unit/test_editexisting.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-// Values taken from using zipinfo to list the test.zip contents
-var TESTS = [
- {
- name: "test.txt",
- size: 232,
- crc: 0x0373ac26,
- time: Date.UTC(2007, 4, 1, 20, 44, 55)
- },
- {
- name: "test.png",
- size: 3402,
- crc: 0x504a5c30,
- time: Date.UTC(2007, 4, 1, 20, 49, 39)
- }
-];
-var BADENTRY = "unknown.txt";
-
-function run_test()
-{
- // Copy our test zip to the tmp dir so we can modify it
- var testzip = do_get_file(DATA_DIR + "test.zip");
- testzip.copyTo(tmpDir, tmpFile.leafName);
-
- do_check_true(tmpFile.exists());
-
- zipW.open(tmpFile, PR_RDWR);
-
- for (var i = 0; i < TESTS.length; i++) {
- do_check_true(zipW.hasEntry(TESTS[i].name));
- var entry = zipW.getEntry(TESTS[i].name);
- do_check_true(entry != null);
-
- do_check_eq(entry.realSize, TESTS[i].size);
- do_check_eq(entry.CRC32, TESTS[i].crc);
- do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC, TESTS[i].time);
- }
-
- try {
- zipW.removeEntry(BADENTRY, false);
- do_throw("shouldn't be able to remove an entry that doesn't exist");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_FILE_NOT_FOUND);
- }
-
- for (var i = 0; i < TESTS.length; i++) {
- zipW.removeEntry(TESTS[i].name, false);
- }
-
- zipW.close();
-
- // Certain platforms cache the file size so get a fresh file to check.
- tmpFile = tmpFile.clone();
-
- // Empty zip file should just be the end of central directory marker
- do_check_eq(tmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_storedata.js b/modules/libjar/zipwriter/test/unit/test_storedata.js
deleted file mode 100644
index d3fbc6ba5..000000000
--- a/modules/libjar/zipwriter/test/unit/test_storedata.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "ZIP WRITER TEST DATA";
-const FILENAME = "test.txt";
-const FILENAME2 = "test2.txt";
-const CRC = 0xe6164331;
-// XXX Must use a constant time here away from DST changes. See bug 402434.
-const time = 1199145600000; // Jan 1st 2008
-
-function testpass(source)
-{
- // Should exist.
- do_check_true(source.hasEntry(FILENAME));
-
- var entry = source.getEntry(FILENAME);
- do_check_neq(entry, null);
-
- do_check_false(entry.isDirectory);
-
- // Should be stored
- do_check_eq(entry.compression, ZIP_METHOD_STORE);
-
- do_check_eq(entry.lastModifiedTime / PR_USEC_PER_MSEC, time);
-
- // File size should match our data size.
- do_check_eq(entry.realSize, DATA.length);
- // When stored sizes should match.
- do_check_eq(entry.size, entry.realSize);
-
- // Check that the CRC is accurate
- do_check_eq(entry.CRC32, CRC);
-}
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- // Shouldn't be there to start with.
- do_check_false(zipW.hasEntry(FILENAME));
-
- do_check_false(zipW.inQueue);
-
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(DATA, DATA.length);
- zipW.addEntryStream(FILENAME, time * PR_USEC_PER_MSEC,
- Ci.nsIZipWriter.COMPRESSION_NONE, stream, false);
-
- // Check that zip state is right at this stage.
- testpass(zipW);
- zipW.close();
-
- do_check_eq(tmpFile.fileSize,
- DATA.length + ZIP_FILE_HEADER_SIZE + ZIP_CDS_HEADER_SIZE +
- (ZIP_EXTENDED_TIMESTAMP_SIZE * 2) +
- (FILENAME.length * 2) + ZIP_EOCDR_HEADER_SIZE);
-
- // Check to see if we get the same results loading afresh.
- zipW.open(tmpFile, PR_RDWR);
- testpass(zipW);
- zipW.close();
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
- testpass(zipR);
- zipR.test(FILENAME);
- var stream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- stream.init(zipR.getInputStream(FILENAME));
- var result = stream.read(DATA.length);
- stream.close();
- zipR.close();
-
- do_check_eq(result, DATA);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_sync.js b/modules/libjar/zipwriter/test/unit/test_sync.js
deleted file mode 100644
index b2b6e7f6e..000000000
--- a/modules/libjar/zipwriter/test/unit/test_sync.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-// Values taken from using zipinfo to list the test.zip contents
-var TESTS = [
- {
- name: "test.txt",
- size: 232,
- crc: 0x0373ac26
- },
- {
- name: "test.png",
- size: 3402,
- crc: 0x504a5c30
- }
-];
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- var size = 0;
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR + TESTS[i].name);
- zipW.addEntryFile(TESTS[i].name, Ci.nsIZipWriter.COMPRESSION_NONE, source,
- false);
- size += ZIP_FILE_HEADER_SIZE + ZIP_CDS_HEADER_SIZE +
- (ZIP_EXTENDED_TIMESTAMP_SIZE * 2) +
- (TESTS[i].name.length*2) + TESTS[i].size;
- }
-
- zipW.close();
- size += ZIP_EOCDR_HEADER_SIZE;
-
- do_check_eq(size, tmpFile.fileSize);
-
- // Test the stored data with the zipreader
- var zipR = new ZipReader(tmpFile);
-
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR + TESTS[i].name);
- do_check_true(zipR.hasEntry(TESTS[i].name));
-
- var entry = zipR.getEntry(TESTS[i].name);
- do_check_eq(entry.realSize, TESTS[i].size);
- do_check_eq(entry.size, TESTS[i].size);
- do_check_eq(entry.CRC32, TESTS[i].crc);
- do_check_eq(Math.floor(entry.lastModifiedTime / PR_USEC_PER_SEC),
- Math.floor(source.lastModifiedTime / PR_MSEC_PER_SEC));
-
- zipR.test(TESTS[i].name);
- }
-
- zipR.close();
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_undochange.js b/modules/libjar/zipwriter/test/unit/test_undochange.js
deleted file mode 100644
index 59647f9af..000000000
--- a/modules/libjar/zipwriter/test/unit/test_undochange.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-// Values taken from using zipinfo to list the test.zip contents
-var TESTS = [
- "test.txt",
- "test.png"
-];
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-
- for (var i = 0; i < TESTS.length; i++) {
- var source = do_get_file(DATA_DIR + TESTS[i]);
- zipW.addEntryFile(TESTS[i], Ci.nsIZipWriter.COMPRESSION_NONE, source,
- false);
- }
-
- try {
- var source = do_get_file(DATA_DIR + TESTS[0]);
- zipW.addEntryFile(TESTS[0], Ci.nsIZipWriter.COMPRESSION_NONE, source,
- false);
- do_throw("Should not be able to add the same file twice");
- }
- catch (e) {
- do_check_eq(e.result, Components.results.NS_ERROR_FILE_ALREADY_EXISTS);
- }
-
- // Remove all the tests and see if we are left with an empty zip
- for (var i = 0; i < TESTS.length; i++) {
- zipW.removeEntry(TESTS[i], false);
- }
-
- zipW.close();
-
- // Empty zip file should just be the end of central directory marker
- var newTmpFile = tmpFile.clone();
- do_check_eq(newTmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_zipcomment.js b/modules/libjar/zipwriter/test/unit/test_zipcomment.js
deleted file mode 100644
index 0bc111c6c..000000000
--- a/modules/libjar/zipwriter/test/unit/test_zipcomment.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "ZIP WRITER TEST COMMENT";
-const DATA2 = "ANOTHER ONE";
-
-function run_test()
-{
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- zipW.comment = DATA;
- zipW.close();
-
- // Should have created a zip file
- do_check_true(tmpFile.exists());
-
- // Empty zip file should just be the end of central directory marker
- // and comment
- do_check_eq(tmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE + DATA.length);
-
- zipW.open(tmpFile, PR_RDWR);
- // Should have the set comment
- do_check_eq(zipW.comment, DATA);
- zipW.comment = DATA2;
- zipW.close();
-
- // Certain platforms cache the file size so get a fresh file to check.
- tmpFile = tmpFile.clone();
-
- // Empty zip file should just be the end of central directory marker
- // and comment. This should now be shorter
- do_check_eq(tmpFile.fileSize, ZIP_EOCDR_HEADER_SIZE + DATA2.length);
-}
diff --git a/modules/libjar/zipwriter/test/unit/test_zippermissions.js b/modules/libjar/zipwriter/test/unit/test_zippermissions.js
deleted file mode 100644
index c3f276dfc..000000000
--- a/modules/libjar/zipwriter/test/unit/test_zippermissions.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-const DATA = "ZIP WRITER TEST DATA";
-
-var TESTS = [];
-
-function build_tests() {
- var id = 0;
-
- // Minimum mode is 0o400
- for (let u = 4; u <= 7; u++) {
- for (let g = 0; g <= 7; g++) {
- for (let o = 0; o <= 7; o++) {
- TESTS[id] = {
- name: "test" + u + g + o,
- permission: (u << 6) + (g << 3) + o
- };
- id++;
- }
- }
- }
-}
-
-function run_test() {
- build_tests();
-
- var foStream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
-
- var tmp = tmpDir.clone();
- tmp.append("temp-permissions");
- tmp.createUnique(Ci.nsILocalFile.DIRECTORY_TYPE, 0o755);
-
- var file = tmp.clone();
- file.append("tempfile");
-
- zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- for (let i = 0; i < TESTS.length; i++) {
- // Open the file with the permissions to match how the zipreader extracts
- // This obeys the umask
- foStream.init(file, 0x02 | 0x08 | 0x20, TESTS[i].permission, 0);
- foStream.close();
-
- // umask may have altered the permissions so test against what they really were.
- // This reduces the coverage of the test but there isn't much we can do
- var perm = file.permissions & 0xfff;
- if (TESTS[i].permission != perm) {
- dump("File permissions for " + TESTS[i].name + " were " + perm.toString(8) + "\n");
- TESTS[i].permission = perm;
- }
-
- zipW.addEntryFile(TESTS[i].name, Ci.nsIZipWriter.COMPRESSION_NONE, file, false);
- do_check_eq(zipW.getEntry(TESTS[i].name).permissions, TESTS[i].permission | 0o400);
- file.permissions = 0o600;
- file.remove(true);
- }
- zipW.close();
-
- zipW.open(tmpFile, PR_RDWR);
- for (let i = 0; i < TESTS.length; i++) {
- dump("Testing zipwriter file permissions for " + TESTS[i].name + "\n");
- do_check_eq(zipW.getEntry(TESTS[i].name).permissions, TESTS[i].permission | 0o400);
- }
- zipW.close();
-
- var zipR = new ZipReader(tmpFile);
- for (let i = 0; i < TESTS.length; i++) {
- dump("Testing zipreader file permissions for " + TESTS[i].name + "\n");
- do_check_eq(zipR.getEntry(TESTS[i].name).permissions, TESTS[i].permission | 0o400);
- dump("Testing extracted file permissions for " + TESTS[i].name + "\n");
- zipR.extract(TESTS[i].name, file);
- do_check_eq(file.permissions & 0xfff, TESTS[i].permission);
- do_check_false(file.isDirectory());
- file.permissions = 0o600;
- file.remove(true);
- }
- zipR.close();
-
- tmp.remove(true);
-}
diff --git a/modules/libjar/zipwriter/test/unit/xpcshell.ini b/modules/libjar/zipwriter/test/unit/xpcshell.ini
deleted file mode 100644
index a0a4a3ce1..000000000
--- a/modules/libjar/zipwriter/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,37 +0,0 @@
-[DEFAULT]
-head = head_zipwriter.js
-tail = tail_zipwriter.js
-support-files =
- data/test_bug446708/thumbs/st14-1.tiff
- data/emptyfile.txt
- data/smallfile.txt
- data/test.png
- data/test.txt
- data/test.zip
- data/test_bug399727.html
- data/test_bug399727.zlib
- data/test_bug717061.gz
- data/test_bug717061.html
-
-[test_asyncadd.js]
-[test_asyncbadadd.js]
-[test_asyncbadremove.js]
-[test_asyncremove.js]
-[test_bug399727.js]
-[test_bug419769_1.js]
-[test_bug419769_2.js]
-[test_bug425768.js]
-[test_bug433248.js]
-[test_bug446708.js]
-[test_bug467740.js]
-[test_createempty.js]
-[test_deflatedata.js]
-[test_directory.js]
-[test_editexisting.js]
-[test_storedata.js]
-[test_sync.js]
-[test_undochange.js]
-[test_zipcomment.js]
-[test_zippermissions.js]
-[test_bug717061.js]
-[test_alignment.js]
diff --git a/netwerk/ipc/moz.build b/netwerk/ipc/moz.build
index 8571579f8..5747b614e 100644
--- a/netwerk/ipc/moz.build
+++ b/netwerk/ipc/moz.build
@@ -33,7 +33,7 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/caps',
- '/modules/libjar',
+ '/components/jar/src',
'/netwerk/base',
'/netwerk/protocol/http',
]
diff --git a/old-configure.in b/old-configure.in
index 407ea75bb..872cd6721 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -1902,7 +1902,6 @@ MOZ_SPELLCHECK=1
MOZ_TOOLKIT_SEARCH=1
MOZ_UI_LOCALE=en-US
MOZ_UNIVERSALCHARDET=1
-MOZ_ZIPWRITER=1
MOZ_NO_SMART_CARDS=
MOZ_NECKO_WIFI=1
NECKO_COOKIES=1
@@ -3369,15 +3368,6 @@ else
fi
dnl ========================================================
-dnl = Disable zipwriter
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(zipwriter,
-[ --disable-zipwriter Disable zipwriter component],
- MOZ_ZIPWRITER=,
- MOZ_ZIPWRITER=1 )
-AC_SUBST(MOZ_ZIPWRITER)
-
-dnl ========================================================
dnl = faststripe theme
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(faststripe,
diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild
index 8aed7d83b..4ef1753f6 100644
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -43,7 +43,6 @@ DIRS += [
'/js/xpconnect',
'/intl/chardet',
'/libs/libyuv',
- '/modules/libjar',
]
if CONFIG['MOZ_PERMISSIONS']:
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
index d4ad128b2..724c60af7 100644
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -46,8 +46,8 @@ LOCAL_INCLUDES += [
'../build',
'../ds',
'../reflect/xptinfo',
+ '/components/jar/src',
'/components/registry/src',
- '/modules/libjar',
]
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: