docshell/test/test_bug680257.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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

mercurial