summaryrefslogtreecommitdiffstats
path: root/modules/libjar/test/mochitest
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /modules/libjar/test/mochitest
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/libjar/test/mochitest')
-rw-r--r--modules/libjar/test/mochitest/bug1173171.zipbin0 -> 239 bytes
-rw-r--r--modules/libjar/test/mochitest/bug1173171.zip^headers^1
-rw-r--r--modules/libjar/test/mochitest/mochitest.ini5
-rw-r--r--modules/libjar/test/mochitest/test_bug1173171.html50
4 files changed, 56 insertions, 0 deletions
diff --git a/modules/libjar/test/mochitest/bug1173171.zip b/modules/libjar/test/mochitest/bug1173171.zip
new file mode 100644
index 0000000000..48ba268ddf
--- /dev/null
+++ b/modules/libjar/test/mochitest/bug1173171.zip
Binary files differ
diff --git a/modules/libjar/test/mochitest/bug1173171.zip^headers^ b/modules/libjar/test/mochitest/bug1173171.zip^headers^
new file mode 100644
index 0000000000..28b8aa0a57
--- /dev/null
+++ b/modules/libjar/test/mochitest/bug1173171.zip^headers^
@@ -0,0 +1 @@
+Content-Type: application/java-archive
diff --git a/modules/libjar/test/mochitest/mochitest.ini b/modules/libjar/test/mochitest/mochitest.ini
new file mode 100644
index 0000000000..71c315b91b
--- /dev/null
+++ b/modules/libjar/test/mochitest/mochitest.ini
@@ -0,0 +1,5 @@
+
+[test_bug1173171.html]
+support-files =
+ bug1173171.zip
+ bug1173171.zip^headers^ \ No newline at end of file
diff --git a/modules/libjar/test/mochitest/test_bug1173171.html b/modules/libjar/test/mochitest/test_bug1173171.html
new file mode 100644
index 0000000000..6f18513f86
--- /dev/null
+++ b/modules/libjar/test/mochitest/test_bug1173171.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1173171
+-->
+<head>
+ <title>Test for Bug 1173171</title>
+ <script 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="application/javascript">
+
+/** Test for Bug 1173171 **/
+
+// __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 xhrInstance = new XMLHttpRequest();
+ xhrInstance.open(method, url, true);
+ xhrInstance.onload = function() {
+ resolve(xhrInstance.response);
+ };
+ xhrInstance.onerror = function() {
+ resolve(null);
+ };
+ xhrInstance.responseType = responseType;
+ xhrInstance.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(async function() {
+ let response = await xhr("GET", jarURL, "document");
+ is(response, null, "Remote jars should be blocked.");
+});
+
+</script>
+</pre>
+
+</body>
+</html>