OLD | NEW |
---|---|
(Empty) | |
1 #library('InnerFrameTest'); | |
2 #import('../../../testing/unittest/unittest.dart'); | |
3 #import('dart:dom'); | |
4 | |
5 main() { | |
6 if (window != window.top) { | |
antonm
2012/02/24 09:28:54
nit: I think it should be !==
| |
7 // Child frame. | |
8 | |
9 // The child's frame should not be able to access its parent's | |
10 // document. | |
11 var parentDocument = window.frameElement.ownerDocument; | |
12 var div = parentDocument.createElement("div"); | |
13 div.id = "illegal"; | |
14 parentDocument.body.appendChild(div); | |
15 return; | |
16 } | |
17 | |
18 // Parent / test frame | |
19 forLayoutTests(); | |
20 | |
21 final iframe = document.createElement('iframe'); | |
22 iframe.src = window.location.href; | |
23 | |
24 asyncTest('prepare', 1, () { | |
25 iframe.addEventListener('load', (e) => callbackDone(), false); | |
sra1
2012/02/24 03:38:30
Will the script have completed by this time, or do
| |
26 document.body.appendChild(iframe); | |
27 }); | |
28 | |
29 test('frameElement', () { | |
30 var div = document.getElementById('illegal'); | |
31 | |
32 // Ensure that this parent frame was not modified by its child. | |
33 Expect.isNull(div); | |
34 }); | |
35 } | |
OLD | NEW |