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

Unified Diff: tests/html/inner_frame_test.dart

Issue 10378040: Generate and use cross frame wrappers for types in other frames/windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Factored out template Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« lib/html/frog/html_frog.dart ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/inner_frame_test.dart
diff --git a/tests/html/inner_frame_test.dart b/tests/html/inner_frame_test.dart
index f330de7c47a640ccac3008e35164e184900e6559..2c72a1fb99093e971170f6088028b6b76e15aac4 100644
--- a/tests/html/inner_frame_test.dart
+++ b/tests/html/inner_frame_test.dart
@@ -18,6 +18,7 @@ main() {
parentDocument.body.nodes.add(div);
Expect.fail('Should not reach here.');
} catch (NoSuchMethodException e) {
+ // TODO(vsm): This should be UnsupportedOperationException.
sra1 2012/05/10 00:12:06 Do you think it is worth catching both exceptions?
// Expected.
}
@@ -29,10 +30,17 @@ main() {
div.id = "illegalTop";
parentDocument.body.nodes.add(div);
Expect.fail('Should not reach here.');
- } catch (var e) {
+ } catch (NoSuchMethodException e) {
+ // TODO(vsm): This should be UnsupportedOperationException.
// Expected.
- // TODO(vsm): Enforce this is a NoSuchMethodException.
}
+
+ // Install Message Handler.
+ window.on.message.add((e) {
+ if (e.data == 'test1') {
+ window.parent.postMessage('test2', '*');
+ }
+ });
return;
}
@@ -47,6 +55,18 @@ main() {
document.body.nodes.add(iframe);
});
+ asyncTest('postMessage', 1, () {
+ window.on.message.add((e) {
+ if (e.data == 'test2') {
+ // Ensure that equality is implemented in cross frame
+ // wrapper.
+ Expect.equals(iframe.contentWindow, e.source);
+ callbackDone();
+ }
+ });
+ iframe.contentWindow.postMessage('test1', '*');
+ });
+
test('frameElement', () {
var div = document.query('#illegalFrameElement');
« lib/html/frog/html_frog.dart ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698