2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
5 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
8 onload=
"setTimeout(runTests, 0);"
9 title=
"bug 89419 test">
11 <script type=
"application/javascript" src=
"chrome://mochikit/content/chrome-harness.js" />
12 <script type=
"application/javascript" src=
"docshell_helpers.js" />
13 <script src=
"chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
15 <script type=
"application/javascript"><![CDATA[
17 // A visited link should have the :visited style applied
18 // to it when displayed on a page which was fetched from
21 async function runTests() {
22 // Disable rcwn to make cache behavior deterministic.
23 var {SpecialPowers} = window.arguments[
0];
24 await SpecialPowers.pushPrefEnv({
"set":[[
"network.http.rcwn.enabled", false]]});
26 // Load a test page containing an image referring to the sjs that returns
27 // a different redirect every time it's loaded.
28 await new Promise(resolve =
> {
30 uri: getHttpUrl(
"89419.html"),
31 onNavComplete: resolve,
36 var first = await snapshotWindow(TestWindow.getWindow());
38 await new Promise(resolve =
> {
41 onNavComplete: resolve,
45 var second = await snapshotWindow(TestWindow.getWindow());
46 function snapshotsEqual(snap1, snap2) {
47 return compareSnapshots(snap1, snap2, true)[
0];
49 ok(!snapshotsEqual(first, second),
"about:blank should not be the same as the image web page");
51 await new Promise(resolve =
> {
54 onNavComplete: resolve,
58 var third = await snapshotWindow(TestWindow.getWindow());
59 ok(!snapshotsEqual(third, second),
"going back should not be the same as about:blank");
60 ok(snapshotsEqual(first, third),
"going back should be the same as the initial load");
62 // Tell the framework the test is finished.
68 <browser type=
"content" primary=
"true" flex=
"1" id=
"content" src=
"about:blank"/>