|
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="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 |
|
11 </head> |
|
12 <body> |
|
13 <p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=564115">Mozilla Bug 564115</a> |
|
14 |
|
15 <pre id="test"> |
|
16 <script> |
|
17 |
|
18 const TEST_URL = "/tests/layout/forms/test/bug564115_window.html"; |
|
19 |
|
20 addLoadEvent(function() { |
|
21 var win = open(TEST_URL, "", "width=600,height=600"); |
|
22 SimpleTest.waitForFocus(function() { |
|
23 var doc = win.document; |
|
24 var input = doc.querySelector("input"); |
|
25 |
|
26 // Focus the input box, and wait for the focus to actually happen |
|
27 input.focus(); |
|
28 setTimeout(function() { |
|
29 // Scroll down a bit |
|
30 win.scrollTo(0, 5000); |
|
31 |
|
32 setTimeout(function() { |
|
33 is(win.pageYOffset, 5000, "Page should be scrolled correctly"); |
|
34 |
|
35 // Refocus the window |
|
36 SimpleTest.waitForFocus(function() { |
|
37 SimpleTest.waitForFocus(function() { |
|
38 is(win.pageYOffset, 5000, |
|
39 "The page's scroll offset should not have been changed"); |
|
40 |
|
41 win.close(); |
|
42 SimpleTest.finish(); |
|
43 }, win); |
|
44 }); |
|
45 }, 0); |
|
46 }, 0); |
|
47 }, win); |
|
48 }); |
|
49 |
|
50 SimpleTest.waitForExplicitFinish(); |
|
51 </script> |
|
52 </pre> |
|
53 |
|
54 </body> |
|
55 </html> |