|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=583889 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 583889</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=583889">Mozilla Bug 583889</a> |
|
13 <iframe id="inner" style="width: 10px; height: 10px;"></iframe> |
|
14 <pre id="test"> |
|
15 <script type="application/javascript;version=1.8"> |
|
16 |
|
17 /** Test for Bug 583889 **/ |
|
18 SimpleTest.waitForExplicitFinish(); |
|
19 |
|
20 function grabEventAndGo(event) { |
|
21 gen.send(event); |
|
22 } |
|
23 |
|
24 function runTest() { |
|
25 window.onload = grabEventAndGo; |
|
26 // Wait for onLoad event. |
|
27 yield; |
|
28 |
|
29 var inner = $("inner"); |
|
30 inner.src = "bug583889_inner1.html"; |
|
31 window.onmessage = grabEventAndGo; |
|
32 // Wait for message from 'inner' iframe. |
|
33 event = yield; |
|
34 |
|
35 while (event.data != "done") { |
|
36 data = JSON.parse(event.data); |
|
37 is(data.top, 300, "should remain at same top"); |
|
38 is(data.left, 300, "should remain at same left"); |
|
39 |
|
40 // Wait for message from 'inner' iframe. |
|
41 event = yield; |
|
42 } |
|
43 |
|
44 // finish(), yet let the test actually end first, to be safe. |
|
45 SimpleTest.executeSoon(SimpleTest.finish); |
|
46 // "End" generator. |
|
47 yield; |
|
48 } |
|
49 |
|
50 var gen = runTest(); |
|
51 gen.next(); |
|
52 </script> |
|
53 </pre> |
|
54 </body> |
|
55 </html> |