mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 872379 - Netmonitor tests SJS: Store a reference to the response timer to avoid garbage collection before the timer fires. Otherwise netmonitor tests timeout waiting for missing responses. r=vp
This commit is contained in:
parent
edb9591ffe
commit
23cea067c1
@ -29,7 +29,10 @@ function handleRequest(request, response) {
|
||||
cachedCount++;
|
||||
}
|
||||
|
||||
Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer).initWithCallback(() => {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(() => {
|
||||
// to avoid garbage collection
|
||||
timer = null;
|
||||
switch (format) {
|
||||
case "txt": {
|
||||
response.setStatusLine(request.httpVersion, status, "DA DA DA");
|
||||
|
@ -9,7 +9,10 @@ function handleRequest(request, response) {
|
||||
let params = request.queryString.split("&");
|
||||
let index = params.filter((s) => s.contains("index="))[0].split("=")[1];
|
||||
|
||||
Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer).initWithCallback(() => {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(() => {
|
||||
// to avoid garbage collection
|
||||
timer = null;
|
||||
response.setStatusLine(request.httpVersion, index == 1 ? 101 : index * 100, "Meh");
|
||||
|
||||
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
|
@ -9,7 +9,10 @@ function handleRequest(request, response) {
|
||||
let params = request.queryString.split("&");
|
||||
let status = params.filter((s) => s.contains("sts="))[0].split("=")[1];
|
||||
|
||||
Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer).initWithCallback(() => {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(() => {
|
||||
// to avoid garbage collection
|
||||
timer = null;
|
||||
switch (status) {
|
||||
case "100":
|
||||
response.setStatusLine(request.httpVersion, 101, "Switching Protocols");
|
||||
|
Loading…
Reference in New Issue
Block a user