Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: client/tests/client/dom/InnerFrameTest.dart

Issue 9453004: Cross frame access tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Frog DOM support for safe cross-frame window access. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW
« client/tests/client/dom/CrossFrameTest.dart ('K') | « client/tests/client/dom/CrossFrameTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698