diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /modules/libjar/test/unit/test_bug407303.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'modules/libjar/test/unit/test_bug407303.js')
-rw-r--r-- | modules/libjar/test/unit/test_bug407303.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/libjar/test/unit/test_bug407303.js b/modules/libjar/test/unit/test_bug407303.js new file mode 100644 index 000000000..313d88c64 --- /dev/null +++ b/modules/libjar/test/unit/test_bug407303.js @@ -0,0 +1,42 @@ +// 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(); +} |