sjs_slow-test-server.sjs (478B)
1 "use strict"; 2 3 let timer; 4 5 const DELAY_MS = 1000; 6 function handleRequest(request, response) { 7 response.processAsync(); 8 timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); 9 timer.init( 10 () => { 11 response.setHeader("Content-Type", "text/html", false); 12 response.write( 13 "<body>Slow loading page for netmonitor test. You should never see this.</body>" 14 ); 15 response.finish(); 16 }, 17 DELAY_MS, 18 Ci.nsITimer.TYPE_ONE_SHOT 19 ); 20 }