From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- layout/generic/test/file_SlowTallImage.sjs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 layout/generic/test/file_SlowTallImage.sjs (limited to 'layout/generic/test/file_SlowTallImage.sjs') diff --git a/layout/generic/test/file_SlowTallImage.sjs b/layout/generic/test/file_SlowTallImage.sjs new file mode 100644 index 0000000000..382d36e49a --- /dev/null +++ b/layout/generic/test/file_SlowTallImage.sjs @@ -0,0 +1,21 @@ +"use strict"; + +let { setTimeout } = ChromeUtils.importESModule( + "resource://gre/modules/Timer.sys.mjs" +); + +// A tall 1x1000 black png. +const IMG_BYTES = atob( + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAPoAQMAAAAleAYdAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAF0lEQVQ4jWNgGAWjYBSMglEwCkbBUAcAB9AAASBs/t4AAAAASUVORK5CYII=" +); + +// Cargo-culted from file_SlowImage.sjs +function handleRequest(request, response) { + response.processAsync(); + response.setHeader("Content-Type", "image/png"); + let delay = request.queryString.indexOf("slow") >= 0 ? 600 : 200; + setTimeout(function () { + response.write(IMG_BYTES); + response.finish(); + }, delay); +} -- cgit v1.2.3