docshell/test/test_anchor_scroll_after_document_open.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=881487
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset="utf-8">
michael@0 8 <title>Test for Bug 881487</title>
michael@0 9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 11 <script type="application/javascript">
michael@0 12
michael@0 13 /** Test for Bug 881487 **/
michael@0 14 SimpleTest.waitForExplicitFinish();
michael@0 15 // Child needs to invoke us, otherwise our onload will fire before the child
michael@0 16 // has done the write/close bit.
michael@0 17 var gotOnload = false;
michael@0 18 addLoadEvent(function() {
michael@0 19 gotOnload = true;
michael@0 20 });
michael@0 21 onmessage = function handleMessage(msg) {
michael@0 22 if (msg.data == "doTest") {
michael@0 23 if (!gotOnload) {
michael@0 24 addLoadEvent(function() { handleMessage(msg); });
michael@0 25 return;
michael@0 26 }
michael@0 27 frames[0].onscroll = function() {
michael@0 28 ok(true, "Got a scroll event");
michael@0 29 SimpleTest.finish();
michael@0 30 }
michael@0 31 frames[0].location.hash = "#target";
michael@0 32 return;
michael@0 33 }
michael@0 34 if (msg.data == "haveHash") {
michael@0 35 ok(false, "Child got reloaded");
michael@0 36 } else {
michael@0 37 ok(false, "Unexpected message");
michael@0 38 }
michael@0 39 SimpleTest.finish();
michael@0 40 }
michael@0 41
michael@0 42 </script>
michael@0 43 </head>
michael@0 44 <body>
michael@0 45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=881487">Mozilla Bug 881487</a>
michael@0 46 <p id="display">
michael@0 47 <!-- iframe goes here so it can scroll -->
michael@0 48 <iframe src="file_anchor_scroll_after_document_open.html"></iframe>
michael@0 49 </p>
michael@0 50 <div id="content" style="display: none">
michael@0 51 </div>
michael@0 52 <pre id="test">
michael@0 53 </pre>
michael@0 54 </body>
michael@0 55 </html>

mercurial