From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- layout/generic/test/file_SlowPage.sjs | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 layout/generic/test/file_SlowPage.sjs (limited to 'layout/generic/test/file_SlowPage.sjs') diff --git a/layout/generic/test/file_SlowPage.sjs b/layout/generic/test/file_SlowPage.sjs new file mode 100644 index 0000000000..1860e8cbc9 --- /dev/null +++ b/layout/generic/test/file_SlowPage.sjs @@ -0,0 +1,43 @@ +"use strict"; + +let timer; + +const DELAY_MS = 5000; + +function handleRequest(request, response) { + response.processAsync(); + + response.setHeader("Content-Type", "text/html", false); + + // Include paint_listener.js so that we can call waitForAllPaintsFlushed + // on the window in which this is opened. + response.write( + '' + ); + + // Allow the opening window to react to loading being complete. + response.write(''); + + // Send half of the content. + for (let i = 0; i < 100; ++i) { + response.write("

Some text.

"); + } + + // Allow the opening window to react to being partially loaded. + response.write(""); + + // Wait for 5 seconds, then send the rest of the content. + timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + timer.init( + () => { + for (let i = 0; i < 100; ++i) { + response.write("

Some text.

"); + } + response.write(""); + + response.finish(); + }, + DELAY_MS, + Ci.nsITimer.TYPE_ONE_SHOT + ); +} -- cgit v1.2.3