OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:stack_trace/stack_trace.dart'; | 7 import 'package:stack_trace/stack_trace.dart'; |
8 import 'package:stream_channel/stream_channel.dart'; | 8 import 'package:stream_channel/stream_channel.dart'; |
9 | 9 |
10 import '../../backend/group.dart'; | 10 import '../../backend/group.dart'; |
(...skipping 23 matching lines...) Expand all Loading... |
34 TestPlatform platform, Metadata metadata, Environment environment, | 34 TestPlatform platform, Metadata metadata, Environment environment, |
35 StreamChannel channel, {StackTrace mapTrace(StackTrace trace)}) async { | 35 StreamChannel channel, {StackTrace mapTrace(StackTrace trace)}) async { |
36 if (mapTrace == null) mapTrace = (trace) => trace; | 36 if (mapTrace == null) mapTrace = (trace) => trace; |
37 | 37 |
38 var disconnector = new Disconnector(); | 38 var disconnector = new Disconnector(); |
39 var suiteChannel = new MultiChannel(channel.transform(disconnector)); | 39 var suiteChannel = new MultiChannel(channel.transform(disconnector)); |
40 | 40 |
41 suiteChannel.sink.add({ | 41 suiteChannel.sink.add({ |
42 'platform': platform.identifier, | 42 'platform': platform.identifier, |
43 'metadata': metadata.serialize(), | 43 'metadata': metadata.serialize(), |
44 'os': platform == TestPlatform.vm ? currentOS.name : null | 44 'os': platform == TestPlatform.vm ? currentOS.identifier : null |
45 }); | 45 }); |
46 | 46 |
47 var completer = new Completer(); | 47 var completer = new Completer(); |
48 | 48 |
49 handleError(error, stackTrace) { | 49 handleError(error, stackTrace) { |
50 disconnector.disconnect(); | 50 disconnector.disconnect(); |
51 | 51 |
52 if (completer.isCompleted) { | 52 if (completer.isCompleted) { |
53 // If we've already provided a controller, send the error to the | 53 // If we've already provided a controller, send the error to the |
54 // LoadSuite. This will cause the virtual load test to fail, which will | 54 // LoadSuite. This will cause the virtual load test to fail, which will |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 /// | 126 /// |
127 /// Returns `null` if [test] is `null`. | 127 /// Returns `null` if [test] is `null`. |
128 Test _deserializeTest(Map test) { | 128 Test _deserializeTest(Map test) { |
129 if (test == null) return null; | 129 if (test == null) return null; |
130 | 130 |
131 var metadata = new Metadata.deserialize(test['metadata']); | 131 var metadata = new Metadata.deserialize(test['metadata']); |
132 var testChannel = _channel.virtualChannel(test['channel']); | 132 var testChannel = _channel.virtualChannel(test['channel']); |
133 return new RunnerTest(test['name'], metadata, testChannel, _mapTrace); | 133 return new RunnerTest(test['name'], metadata, testChannel, _mapTrace); |
134 } | 134 } |
135 } | 135 } |
OLD | NEW |