Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 }