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

Side by Side Diff: lib/src/runner/browser/static/host.dart

Issue 1087693002: Don't double-complete in host.dart. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/src/runner/browser/static/host.dart.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.runner.browser.host; 5 library test.runner.browser.host;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:html'; 9 import 'dart:html';
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // unit tests, let alone be able to find the test server while it's 119 // unit tests, let alone be able to find the test server while it's
120 // running, but it's good practice to check the origin anyway. 120 // running, but it's good practice to check the origin anyway.
121 if (message.origin != window.location.origin) return; 121 if (message.origin != window.location.origin) return;
122 122
123 // TODO(nweiz): Stop manually checking href here once issue 22554 is 123 // TODO(nweiz): Stop manually checking href here once issue 22554 is
124 // fixed. 124 // fixed.
125 if (message.data["href"] != iframe.src) return; 125 if (message.data["href"] != iframe.src) return;
126 126
127 message.stopPropagation(); 127 message.stopPropagation();
128 inputController.add(message.data["data"]); 128 inputController.add(message.data["data"]);
129 readyCompleter.complete(); 129 if (!readyCompleter.isCompleted) readyCompleter.complete();
130 }); 130 });
131 131
132 outputController.stream.listen((message) { 132 outputController.stream.listen((message) {
133 readyCompleter.future.then((_) => 133 readyCompleter.future.then((_) =>
134 iframe.contentWindow.postMessage(message, window.location.origin)); 134 iframe.contentWindow.postMessage(message, window.location.origin));
135 }); 135 });
136 136
137 return new StreamChannel(inputController.stream, outputController.sink); 137 return new StreamChannel(inputController.stream, outputController.sink);
138 } 138 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/runner/browser/static/host.dart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698