import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View 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
}