Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1001120 - Introduce a test for slow subframe loads invalidating S…
…ession History. r=ttaubert
- Loading branch information
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
browser/components/sessionstore/test/browser_sessionHistory_slow.sjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
const Cc = Components.classes; | ||
const Ci = Components.interfaces; | ||
|
||
const DELAY_MS = "2000"; | ||
|
||
let timer; | ||
|
||
function handleRequest(req, resp) { | ||
resp.processAsync(); | ||
resp.setHeader("Cache-Control", "no-cache", false); | ||
resp.setHeader("Content-Type", "text/html;charset=utf-8", false); | ||
|
||
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); | ||
timer.init(() => { | ||
resp.write("hi"); | ||
resp.finish(); | ||
}, DELAY_MS, Ci.nsITimer.TYPE_ONE_SHOT); | ||
} |