mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-17 20:57:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
28
modules/libjar/test/unit/test_bug370103.js
Normal file
28
modules/libjar/test/unit/test_bug370103.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue