|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=680257 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 680257</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=680257">Mozilla Bug 680257</a> |
|
13 |
|
14 <script type="application/javascript;version=1.7"> |
|
15 |
|
16 SimpleTest.waitForExplicitFinish(); |
|
17 |
|
18 var popup = window.open('file_bug680257.html'); |
|
19 |
|
20 // The popup will call into popupLoaded() once it loads. |
|
21 function popupLoaded() { |
|
22 // runTests() needs to be called from outside popupLoaded's onload handler. |
|
23 // Otherwise, the navigations we do in runTests won't create new SHEntries. |
|
24 SimpleTest.executeSoon(runTests); |
|
25 } |
|
26 |
|
27 function runTests() { |
|
28 checkPopupLinkStyle(false, 'Initial'); |
|
29 |
|
30 popup.location.hash = 'a'; |
|
31 checkPopupLinkStyle(true, 'After setting hash'); |
|
32 |
|
33 popup.history.back(); |
|
34 checkPopupLinkStyle(false, 'After going back'); |
|
35 |
|
36 popup.history.forward(); |
|
37 checkPopupLinkStyle(true, 'After going forward'); |
|
38 |
|
39 popup.close(); |
|
40 SimpleTest.finish(); |
|
41 } |
|
42 |
|
43 function checkPopupLinkStyle(isTarget, desc) { |
|
44 var link = popup.document.getElementById('a'); |
|
45 var style = popup.getComputedStyle(link); |
|
46 var color = style.getPropertyValue('color'); |
|
47 |
|
48 // Color is red if isTarget, black otherwise. |
|
49 if (isTarget) { |
|
50 is(color, 'rgb(255, 0, 0)', desc); |
|
51 } |
|
52 else { |
|
53 is(color, 'rgb(0, 0, 0)', desc); |
|
54 } |
|
55 } |
|
56 |
|
57 </script> |
|
58 </body> |
|
59 </html> |