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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 import 'package:collection/collection.dart'; | 7 import 'package:collection/collection.dart'; |
8 | 8 |
9 import '../frontend/skip.dart'; | 9 import '../frontend/skip.dart'; |
10 import '../frontend/timeout.dart'; | 10 import '../frontend/timeout.dart'; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 "Dart identifiers."); | 245 "Dart identifiers."); |
246 } | 246 } |
247 | 247 |
248 /// Return a new [Metadata] that merges [this] with [other]. | 248 /// Return a new [Metadata] that merges [this] with [other]. |
249 /// | 249 /// |
250 /// If the two [Metadata]s have conflicting properties, [other] wins. If | 250 /// If the two [Metadata]s have conflicting properties, [other] wins. If |
251 /// either has a [forTag] metadata for one of the other's tags, that metadata | 251 /// either has a [forTag] metadata for one of the other's tags, that metadata |
252 /// is merged as well. | 252 /// is merged as well. |
253 Metadata merge(Metadata other) => | 253 Metadata merge(Metadata other) => |
254 new Metadata( | 254 new Metadata( |
255 testOn: testOn.intersect(other.testOn), | 255 testOn: testOn.intersection(other.testOn), |
256 timeout: timeout.merge(other.timeout), | 256 timeout: timeout.merge(other.timeout), |
257 skip: skip || other.skip, | 257 skip: skip || other.skip, |
258 skipReason: other.skipReason == null ? skipReason : other.skipReason, | 258 skipReason: other.skipReason == null ? skipReason : other.skipReason, |
259 verboseTrace: verboseTrace || other.verboseTrace, | 259 verboseTrace: verboseTrace || other.verboseTrace, |
260 tags: tags.union(other.tags), | 260 tags: tags.union(other.tags), |
261 onPlatform: mergeMaps(onPlatform, other.onPlatform, | 261 onPlatform: mergeMaps(onPlatform, other.onPlatform, |
262 value: (metadata1, metadata2) => metadata1.merge(metadata2)), | 262 value: (metadata1, metadata2) => metadata1.merge(metadata2)), |
263 forTag: mergeMaps(forTag, other.forTag, | 263 forTag: mergeMaps(forTag, other.forTag, |
264 value: (metadata1, metadata2) => metadata1.merge(metadata2))); | 264 value: (metadata1, metadata2) => metadata1.merge(metadata2))); |
265 | 265 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 _serializeTimeout(Timeout timeout) { | 316 _serializeTimeout(Timeout timeout) { |
317 if (timeout == Timeout.none) return 'none'; | 317 if (timeout == Timeout.none) return 'none'; |
318 return { | 318 return { |
319 'duration': timeout.duration == null | 319 'duration': timeout.duration == null |
320 ? null | 320 ? null |
321 : timeout.duration.inMicroseconds, | 321 : timeout.duration.inMicroseconds, |
322 'scaleFactor': timeout.scaleFactor | 322 'scaleFactor': timeout.scaleFactor |
323 }; | 323 }; |
324 } | 324 } |
325 } | 325 } |
OLD | NEW |