1 // Regression test for bug 407303 - A failed channel should not be checked
2 // for an unsafe content type.
4 const Cc = Components.classes;
5 const Ci = Components.interfaces;
7 // XXX: NS_ERROR_UNKNOWN_HOST is not in Components.results
8 const NS_ERROR_UNKNOWN_HOST = 0x804B001E;
11 QueryInterface: function(iid) {
12 if (iid.equals(Ci.nsISupports) ||
13 iid.equals(Ci.nsIRequestObserver))
15 throw Cr.NS_ERROR_NO_INTERFACE;
18 onStartRequest: function(request, context) {
21 onDataAvailable: function(request, context, stream, offset, count) {
22 do_throw("shouldn't get data!");
25 onStopRequest: function(request, context, status) {
26 do_check_eq(status, NS_ERROR_UNKNOWN_HOST);
32 var ios = Cc["@mozilla.org/network/io-service;1"].
33 getService(Ci.nsIIOService);
35 var channel = ios.newChannel("jar:http://test.invalid/test.jar!/index.html",
37 channel.asyncOpen(listener, null);