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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 /// Deserializes [group] into a concrete [Group]. | 113 /// Deserializes [group] into a concrete [Group]. |
114 Group deserializeGroup(Map group) { | 114 Group deserializeGroup(Map group) { |
115 var metadata = new Metadata.deserialize(group['metadata']); | 115 var metadata = new Metadata.deserialize(group['metadata']); |
116 return new Group(group['name'], (group['entries'] as List).map((entry) { | 116 return new Group(group['name'], (group['entries'] as List).map((entry) { |
117 var map = entry as Map; | 117 var map = entry as Map; |
118 if (map['type'] == 'group') return deserializeGroup(map); | 118 if (map['type'] == 'group') return deserializeGroup(map); |
119 return _deserializeTest(map); | 119 return _deserializeTest(map); |
120 }), | 120 }), |
121 metadata: metadata, | 121 metadata: metadata, |
| 122 trace: group['trace'] == null ? null : new Trace.parse(group['trace']), |
122 setUpAll: _deserializeTest(group['setUpAll']), | 123 setUpAll: _deserializeTest(group['setUpAll']), |
123 tearDownAll: _deserializeTest(group['tearDownAll'])); | 124 tearDownAll: _deserializeTest(group['tearDownAll'])); |
124 } | 125 } |
125 | 126 |
126 /// Deserializes [test] into a concrete [Test] class. | 127 /// Deserializes [test] into a concrete [Test] class. |
127 /// | 128 /// |
128 /// Returns `null` if [test] is `null`. | 129 /// Returns `null` if [test] is `null`. |
129 Test _deserializeTest(Map test) { | 130 Test _deserializeTest(Map test) { |
130 if (test == null) return null; | 131 if (test == null) return null; |
131 | 132 |
132 var metadata = new Metadata.deserialize(test['metadata']); | 133 var metadata = new Metadata.deserialize(test['metadata']); |
| 134 var trace = test['trace'] == null ? null : new Trace.parse(test['trace']); |
133 var testChannel = _channel.virtualChannel(test['channel']); | 135 var testChannel = _channel.virtualChannel(test['channel']); |
134 return new RunnerTest(test['name'], metadata, testChannel, _mapTrace); | 136 return new RunnerTest( |
| 137 test['name'], metadata, trace, testChannel, _mapTrace); |
135 } | 138 } |
136 } | 139 } |
OLD | NEW |