diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /dom/xslt/crashtests/1430818.sjs | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/xslt/crashtests/1430818.sjs')
-rw-r--r-- | dom/xslt/crashtests/1430818.sjs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dom/xslt/crashtests/1430818.sjs b/dom/xslt/crashtests/1430818.sjs new file mode 100644 index 0000000000..a1c9f1e662 --- /dev/null +++ b/dom/xslt/crashtests/1430818.sjs @@ -0,0 +1,49 @@ +function getFileStream(filename) +{ + let self = Components.classes["@mozilla.org/file/local;1"] + .createInstance(Components.interfaces.nsIFile); + self.initWithPath(getState("__LOCATION__")); + let file = self.parent; + file.append(filename); + let stream = Components.classes['@mozilla.org/network/file-input-stream;1'] + .createInstance(Components.interfaces.nsIFileInputStream); + stream.init(file, -1, -1, false); + return stream; +} + +function handleRequest(request, response) +{ + response.processAsync(); + response.setStatusLine(null, 200, "OK"); + response.setHeader("Content-Type", "text/xml", false); + + switch (request.queryString) { + case "stylesheet": + { + let timer = Components.classes["@mozilla.org/timer;1"] + .createInstance(Components.interfaces.nsITimer); + timer.initWithCallback(() => { + setState("xslt", "loaded"); + response.finish(); + timer.cancel(); + }, 1000 /* milliseconds */, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK); + break; + } + default: + { + let stream = getFileStream("1430818.xml"); + response.bodyOutputStream.writeFrom(stream, + stream.available()); + stream.close(); + let timer = Components.classes["@mozilla.org/timer;1"] + .createInstance(Components.interfaces.nsITimer); + timer.initWithCallback(() => { + if (getState("xslt") == "loaded") { + response.finish(); + timer.cancel(); + } + }, 100 /* milliseconds */, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK); + break; + } + } +} |