Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 // This is essentially a crashtest for accessing an out of range port
2 // Perform the async open several times in order to induce exponential
3 // scheduling behavior bugs.
5 const CC = Components.Constructor;
7 var counter = 0;
8 const iterations = 10;
10 var listener = {
11 onStartRequest: function test_onStartR(request, ctx) {
12 },
14 onDataAvailable: function test_ODA() {
15 do_throw("Should not get any data!");
16 },
18 onStopRequest: function test_onStopR(request, ctx, status) {
19 if (counter++ == iterations)
20 do_test_finished();
21 else
22 execute_test();
23 },
24 };
26 function run_test() {
27 execute_test();
28 do_test_pending();
29 }
31 function execute_test() {
32 var ios = Cc["@mozilla.org/network/io-service;1"].
33 getService(Ci.nsIIOService);
34 var chan = ios.newChannel("http://localhost:75000", "", null);
35 chan.QueryInterface(Ci.nsIHttpChannel);
36 chan.asyncOpen(listener, null);
37 }