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'); |