diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-02-18 12:21:38 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-18 12:21:38 +0100 |
commit | 51b6354f31b5f2122c11afec7fc0e3d650ce5e5d (patch) | |
tree | cfc8e519c89e459f7199a8210c72879537dec208 /netwerk/test | |
parent | d38f865699b1c1cb2395f719324b661acffa3223 (diff) | |
parent | 31c5e63eda295ed87419ff035631cadf776244af (diff) | |
download | UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.gz UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.lz UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.xz UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.zip |
Merge branch 'ported-moebius'
Diffstat (limited to 'netwerk/test')
-rw-r--r-- | netwerk/test/mochitests/mochitest.ini | 1 | ||||
-rw-r--r-- | netwerk/test/mochitests/test_1396395.html | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/netwerk/test/mochitests/mochitest.ini b/netwerk/test/mochitests/mochitest.ini index 98d406c80..f8a919031 100644 --- a/netwerk/test/mochitests/mochitest.ini +++ b/netwerk/test/mochitests/mochitest.ini @@ -24,3 +24,4 @@ support-files = [test_user_agent_updates_reset.html] [test_viewsource_unlinkable.html] [test_xhr_method_case.html] +[test_1396395.html] 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> + |