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

Unified Diff: lib/src/runner/browser/iframe_listener.dart

Issue 1080103002: Add support for running tests on Dartium. (Closed) Base URL: git@github.com:dart-lang/test@wip.dartium
Patch Set: Code review changes Created 5 years, 8 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 | « lib/src/runner/browser/dartium.dart ('k') | lib/src/runner/browser/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/iframe_listener.dart
diff --git a/lib/src/runner/browser/iframe_listener.dart b/lib/src/runner/browser/iframe_listener.dart
index cdc9edad9321aad065e5434f6b7aee5d99377deb..322f46a63ab3dd1fbe88ac21cb1efbe9ae826415 100644
--- a/lib/src/runner/browser/iframe_listener.dart
+++ b/lib/src/runner/browser/iframe_listener.dart
@@ -75,9 +75,6 @@ class IframeListener {
var inputController = new StreamController(sync: true);
var outputController = new StreamController(sync: true);
- // Wait for the first message, which indicates the source [Window] to which
- // we should send further communication.
- var first = true;
window.onMessage.listen((message) {
// A message on the Window can theoretically come from any website. It's
// very unlikely that a malicious site would care about hacking someone's
@@ -85,21 +82,16 @@ class IframeListener {
// running, but it's good practice to check the origin anyway.
if (message.origin != window.location.origin) return;
message.stopPropagation();
+ inputController.add(message.data);
+ });
- if (!first) {
- inputController.add(message.data);
- return;
- }
-
- outputController.stream.listen((data) {
- // TODO(nweiz): Stop manually adding href here once issue 22554 is
- // fixed.
- message.source.postMessage({
- "href": window.location.href,
- "data": data
- }, window.location.origin);
- });
- first = false;
+ outputController.stream.listen((data) {
+ // TODO(nweiz): Stop manually adding href here once issue 22554 is
+ // fixed.
+ window.parent.postMessage({
+ "href": window.location.href,
+ "data": data
+ }, window.location.origin);
});
return new MultiChannel(inputController.stream, outputController.sink);
« no previous file with comments | « lib/src/runner/browser/dartium.dart ('k') | lib/src/runner/browser/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698