summaryrefslogtreecommitdiffstats
path: root/netwerk/test/mochitests/test_1396395.html
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-11-27 07:57:36 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-18 10:30:15 +0100
commit83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa (patch)
tree0d81568c659cc0949e6732c198fe2ab42e490b0e /netwerk/test/mochitests/test_1396395.html
parent140e3f5c03938fa9d6a9524c3b859a95d3a540ee (diff)
downloadUXP-83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa.tar
UXP-83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa.tar.gz
UXP-83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa.tar.lz
UXP-83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa.tar.xz
UXP-83c4b04a70d2319d4c292e7aa0c8872e7c1cd7fa.zip
Two (and more) extensions together - http resume - basilisk crashes
Diffstat (limited to 'netwerk/test/mochitests/test_1396395.html')
-rw-r--r--netwerk/test/mochitests/test_1396395.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/netwerk/test/mochitests/test_1396395.html b/netwerk/test/mochitests/test_1396395.html
new file mode 100644
index 000000000..193ef219c
--- /dev/null
+++ b/netwerk/test/mochitests/test_1396395.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
+<html>
+ <!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<head>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+</head>
+<body>
+ <iframe id="f" src="http://example.com"></iframe>
+ <script type="text/javascript">
+SimpleTest.waitForExplicitFinish();
+
+var script = SpecialPowers.loadChromeScript(() => {
+ const Ci = Components.interfaces;
+ const Cc = Components.classes;
+ const Cu = Components.utils;
+ Cu.import('resource://gre/modules/Services.jsm');
+
+ Services.obs.addObserver(function onExamResp(subject, topic, data) {
+ let channel = subject.QueryInterface(Ci.nsIHttpChannel);
+ if (!channel.URI.spec.startsWith("http://example.org")) {
+ return;
+ }
+ Services.obs.removeObserver(onExamResp, 'http-on-examine-response');
+ channel.suspend();
+ Promise.resolve().then(() => {
+ channel.resume();
+ });
+ }, 'http-on-examine-response');
+
+ sendAsyncMessage('start-test');
+});
+
+script.addMessageListener('start-test', () => {
+ const iframe = document.getElementById('f');
+
+ iframe.contentWindow.onunload = function () {
+ xhr = new XMLHttpRequest();
+ xhr.open('GET', window.location, false);
+ xhr.send(null);
+ ok(true, 'complete without crash');
+ script.destroy();
+ SimpleTest.finish();
+ }
+
+ iframe.src = 'http://example.org';
+});
+ </script>
+</body>
+</html>
+