// Make sure our timer stays alive. let gTimer; function handleRequest(request, response) { response.processAsync(); response.setHeader("Content-Type", "text/html", false); response.setStatusLine(request.httpVersion, 200, "OK"); // The id to be used for `getLastContentDisplayportFor`, // `scrollbar-width: none` is to avoid the scrollbar area is excluded from // the displayport. response.write( "" ); response.write(""); response.write(""); response.write(""); // Send a bunch of block elements to make the content vertically scrollable. for (let i = 0; i < 100; ++i) { response.write("

Some text.

"); } // Flush above changes first. response.write( "" ); // Now it's time to start the test. response.write(""); gTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); gTimer.init( () => { response.write(""); response.write(""); response.finish(); }, 3000, Ci.nsITimer.TYPE_ONE_SHOT ); }