michael@0: function run_test() { michael@0: var ioServ = Components.classes["@mozilla.org/network/io-service;1"] michael@0: .getService(Components.interfaces.nsIIOService); michael@0: michael@0: var base = ioServ.newURI("http://www.example.com", null, null); michael@0: michael@0: var about1 = ioServ.newURI("about:blank", null, null); michael@0: var about2 = ioServ.newURI("about:blank", null, base); michael@0: michael@0: var chan1 = ioServ.newChannelFromURI(about1) michael@0: .QueryInterface(Components.interfaces.nsIPropertyBag2); michael@0: var chan2 = ioServ.newChannelFromURI(about2) michael@0: .QueryInterface(Components.interfaces.nsIPropertyBag2); michael@0: michael@0: var haveProp = false; michael@0: var propVal = null; michael@0: try { michael@0: propVal = chan1.getPropertyAsInterface("baseURI", michael@0: Components.interfaces.nsIURI); michael@0: haveProp = true; michael@0: } catch (e if e.result == Components.results.NS_ERROR_NOT_AVAILABLE) { michael@0: // Property shouldn't be there. michael@0: } michael@0: do_check_eq(propVal, null); michael@0: do_check_eq(haveProp, false); michael@0: do_check_eq(chan2.getPropertyAsInterface("baseURI", michael@0: Components.interfaces.nsIURI), michael@0: base); michael@0: }