|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 |
|
4 <window id="89419Test" |
|
5 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
6 width="600" |
|
7 height="600" |
|
8 onload="setTimeout(nextTest,0);" |
|
9 title="bug 89419 test"> |
|
10 |
|
11 <script type="application/javascript" src= "chrome://mochikit/content/chrome-harness.js" /> |
|
12 <script type="text/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/specialpowersAPI.js"/> |
|
14 <script type="text/javascript" |
|
15 src="chrome://mochikit/content/tests/SimpleTest/SpecialPowersObserverAPI.js"/> |
|
16 <script type="text/javascript" |
|
17 src="chrome://mochikit/content/tests/SimpleTest/ChromePowers.js"/> |
|
18 <script type="application/javascript" src="docshell_helpers.js" /> |
|
19 <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script> |
|
20 |
|
21 <script type="application/javascript"><![CDATA[ |
|
22 // Define the generator-iterator for the tests. |
|
23 var tests = testIterator(); |
|
24 |
|
25 //// |
|
26 // Execute the next test in the generator function. |
|
27 // |
|
28 function nextTest() { |
|
29 tests.next(); |
|
30 } |
|
31 |
|
32 //// |
|
33 // Generator function for test steps for bug 89419: |
|
34 // A visited link should have the :visited style applied |
|
35 // to it when displayed on a page which was fetched from |
|
36 // the bfcache. |
|
37 // |
|
38 function testIterator() |
|
39 { |
|
40 // Load a test page containing an image referring to the sjs that returns |
|
41 // a different redirect every time it's loaded. |
|
42 doPageNavigation({ |
|
43 uri: getHttpUrl("89419.html"), |
|
44 onNavComplete: nextTest, |
|
45 preventBFCache: true |
|
46 }); |
|
47 yield undefined; |
|
48 |
|
49 var first = snapshotWindow(TestWindow.getWindow()); |
|
50 |
|
51 doPageNavigation({ |
|
52 uri: "about:blank", |
|
53 onNavComplete: nextTest |
|
54 }); |
|
55 yield undefined; |
|
56 |
|
57 var second = snapshotWindow(TestWindow.getWindow()); |
|
58 function snapshotsEqual(snap1, snap2) { |
|
59 return compareSnapshots(snap1, snap2, true)[0]; |
|
60 } |
|
61 ok(!snapshotsEqual(first, second), "about:blank should not be the same as the image web page"); |
|
62 |
|
63 doPageNavigation({ |
|
64 back: true, |
|
65 onNavComplete: nextTest |
|
66 }); |
|
67 yield undefined; |
|
68 |
|
69 var third = snapshotWindow(TestWindow.getWindow()); |
|
70 ok(!snapshotsEqual(third, second), "going back should not be the same as about:blank"); |
|
71 ok(snapshotsEqual(first, third), "going back should be the same as the initial load"); |
|
72 |
|
73 // Tell the framework the test is finished. Include the final 'yield' |
|
74 // statement to prevent a StopIteration exception from being thrown. |
|
75 finish(); |
|
76 yield undefined; |
|
77 } |
|
78 |
|
79 ]]></script> |
|
80 |
|
81 <browser type="content-primary" flex="1" id="content" src="about:blank"/> |
|
82 </window> |