CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / layout / forms / test / test_bug564115.html
blob942661e7e62870170eb99ad6b4d883619c548e79
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=564115
5 -->
6 <head>
7 <title>Test for Bug 564115</title>
8 <script type="text/javascript" src="/MochiKit/packed.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12 </head>
13 <body>
14 <p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=564115">Mozilla Bug 564115</a>
16 <pre id="test">
17 <script>
19 const TEST_URL = "/tests/layout/forms/test/bug564115_window.html";
21 addLoadEvent(function() {
22 var win = open(TEST_URL, "", "width=600,height=600");
23 window.childLoaded = function() {
24 var doc = win.document;
25 var input = doc.querySelector("input");
27 // Focus the input box, and wait for the focus to actually happen
28 input.focus();
29 setTimeout(function() {
30 // Scroll down a bit
31 win.scrollTo(0, 5000);
33 setTimeout(function() {
34 is(win.pageYOffset, 5000, "Page should be scrolled correctly");
36 // Refocus the window
37 SimpleTest.waitForFocus(function() {
38 SimpleTest.waitForFocus(function() {
39 is(win.pageYOffset, 5000,
40 "The page's scroll offset should not have been changed");
42 win.close();
43 SimpleTest.finish();
44 }, win);
45 });
46 }, 0);
47 }, 0);
49 });
51 SimpleTest.waitForExplicitFinish();
52 </script>
53 </pre>
55 </body>
56 </html>