Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | // This is essentially a crashtest for accessing an out of range port |
michael@0 | 2 | // Perform the async open several times in order to induce exponential |
michael@0 | 3 | // scheduling behavior bugs. |
michael@0 | 4 | |
michael@0 | 5 | const CC = Components.Constructor; |
michael@0 | 6 | |
michael@0 | 7 | var counter = 0; |
michael@0 | 8 | const iterations = 10; |
michael@0 | 9 | |
michael@0 | 10 | var listener = { |
michael@0 | 11 | onStartRequest: function test_onStartR(request, ctx) { |
michael@0 | 12 | }, |
michael@0 | 13 | |
michael@0 | 14 | onDataAvailable: function test_ODA() { |
michael@0 | 15 | do_throw("Should not get any data!"); |
michael@0 | 16 | }, |
michael@0 | 17 | |
michael@0 | 18 | onStopRequest: function test_onStopR(request, ctx, status) { |
michael@0 | 19 | if (counter++ == iterations) |
michael@0 | 20 | do_test_finished(); |
michael@0 | 21 | else |
michael@0 | 22 | execute_test(); |
michael@0 | 23 | }, |
michael@0 | 24 | }; |
michael@0 | 25 | |
michael@0 | 26 | function run_test() { |
michael@0 | 27 | execute_test(); |
michael@0 | 28 | do_test_pending(); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | function execute_test() { |
michael@0 | 32 | var ios = Cc["@mozilla.org/network/io-service;1"]. |
michael@0 | 33 | getService(Ci.nsIIOService); |
michael@0 | 34 | var chan = ios.newChannel("http://localhost:75000", "", null); |
michael@0 | 35 | chan.QueryInterface(Ci.nsIHttpChannel); |
michael@0 | 36 | chan.asyncOpen(listener, null); |
michael@0 | 37 | } |
michael@0 | 38 |