OLD | NEW |
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; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 import 'dart:convert'; | 6 import 'dart:convert'; |
9 import 'dart:html'; | 7 import 'dart:html'; |
10 import 'dart:js' as js; | 8 import 'dart:js' as js; |
11 | 9 |
12 import 'package:stack_trace/stack_trace.dart'; | 10 import 'package:stack_trace/stack_trace.dart'; |
13 import 'package:test/src/util/multi_channel.dart'; | 11 import 'package:test/src/util/multi_channel.dart'; |
14 import 'package:test/src/util/stream_channel.dart'; | 12 import 'package:test/src/util/stream_channel.dart'; |
15 | 13 |
16 /// The iframes created for each loaded test suite, indexed by the suite id. | 14 /// The iframes created for each loaded test suite, indexed by the suite id. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (!readyCompleter.isCompleted) readyCompleter.complete(); | 154 if (!readyCompleter.isCompleted) readyCompleter.complete(); |
157 }); | 155 }); |
158 | 156 |
159 outputController.stream.listen((message) async { | 157 outputController.stream.listen((message) async { |
160 await readyCompleter.future; | 158 await readyCompleter.future; |
161 iframe.contentWindow.postMessage(message, window.location.origin); | 159 iframe.contentWindow.postMessage(message, window.location.origin); |
162 }); | 160 }); |
163 | 161 |
164 return new StreamChannel(inputController.stream, outputController.sink); | 162 return new StreamChannel(inputController.stream, outputController.sink); |
165 } | 163 } |
OLD | NEW |