michael@0: // This is essentially a debug mode crashtest to make sure everything michael@0: // involved in a reload runs on the right thread. It relies on the michael@0: // assertions in necko. michael@0: michael@0: var listener = { michael@0: onStartRequest: function test_onStartR(request, ctx) { michael@0: }, michael@0: michael@0: onDataAvailable: function test_ODA() { michael@0: do_throw("Should not get any data!"); michael@0: }, michael@0: michael@0: onStopRequest: function test_onStopR(request, ctx, status) { michael@0: do_test_finished(); michael@0: }, michael@0: }; michael@0: michael@0: function run_test() { michael@0: var ios = Cc["@mozilla.org/network/io-service;1"]. michael@0: getService(Ci.nsIIOService); michael@0: var chan = ios.newChannel("http://localhost:4444", "", null); michael@0: chan.loadFlags = Ci.nsIRequest.LOAD_FRESH_CONNECTION | michael@0: Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI; michael@0: chan.QueryInterface(Ci.nsIHttpChannel); michael@0: chan.asyncOpen(listener, null); michael@0: do_test_pending(); michael@0: } michael@0: