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

Unified Diff: LayoutTests/dart/Window-postMessage.html

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 11 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
« no previous file with comments | « LayoutTests/dart/Window-onload-expected.txt ('k') | LayoutTests/dart/Window-postMessage-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/Window-postMessage.html
diff --git a/LayoutTests/dart/Window-postMessage.html b/LayoutTests/dart/Window-postMessage.html
deleted file mode 100644
index 996613a9e38fb7441bebb0d46b7e56d19d5a62c5..0000000000000000000000000000000000000000
--- a/LayoutTests/dart/Window-postMessage.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<html>
-<body>
-
-<div id='status'></div>
-<iframe src='resources/pong.html'></iframe>
-
-<script type='application/dart'>
-#import('dart:dom');
-
-class MessageQueue {
- MessageQueue(this._main, this._target, this._messages) : _pos = -1;
-
- void run() {
- scheduleNext();
- }
-
- void scheduleNext() {
- _pos++;
- if (_pos == _messages.length) {
- _notifyDone();
- return;
- }
-
- if (_pos % 2 == 0) {
- _target.postMessage(currentMessage, [], '*');
- } else {
- _target.postMessage(currentMessage, '*');
- }
- output('message sent: $currentMessage');
- }
-
- get currentMessage() => _messages[_pos];
-
- final Window _main;
- final Window _target;
- final List<Object> _messages;
- int _pos;
-
- void _notifyDone() {
- assert(null !== layoutTestController);
- layoutTestController.notifyDone();
- }
-}
-
-void main() {
- if (null !== layoutTestController) {
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
- }
-
- HTMLIFrameElement iframeElement = document.getElementsByTagName('iframe')[0];
- iframeElement.addEventListener('load', test, true);
-}
-
-test(Event e) {
- Window other = document.getElementsByTagName('iframe')[0].contentWindow;
-
- // FIXME: consider support for WebCore objects like File, FileList.
- MessageQueue messageQueue = new MessageQueue(window, other, [null, 'I am a string']);
-
- window.addEventListener(
- 'message',
- (Event event) {
- output('response received: ${event.data}');
- output('event.source === other: ' + (event.source === other));
- messageQueue.scheduleNext();
- },
- false);
-
- try {
- other.postMessage();
- } catch (var e) {
- output('.postMessage() throws: ${e}');
- }
-
- try {
- other.postMessage(null);
- } catch (var e) {
- output('.postMessage(null) throws: ${e}');
- }
-
- messageQueue.run();
-}
-
-output(var object) {
- final status = document.getElementById('status');
- status.innerHTML += '$object<br>';
-}
-
-</script>
-
-<script>
-// Fake script to trigger Dart execution.
-</script>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/dart/Window-onload-expected.txt ('k') | LayoutTests/dart/Window-postMessage-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698