| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 barback.test.utils; | 5 library barback.test.utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert' show Encoding; | 9 import 'dart:convert' show Encoding; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 /// Calls to [buildShouldSucceed] and [buildShouldFail] set expectations on | 33 /// Calls to [buildShouldSucceed] and [buildShouldFail] set expectations on |
| 34 /// successive [BuildResult]s from [_barback]. This keeps track of how many | 34 /// successive [BuildResult]s from [_barback]. This keeps track of how many |
| 35 /// calls have already been made so later calls know which result to look for. | 35 /// calls have already been made so later calls know which result to look for. |
| 36 int _nextBuildResult; | 36 int _nextBuildResult; |
| 37 | 37 |
| 38 void initConfig() { | 38 void initConfig() { |
| 39 if (_configured) return; | 39 if (_configured) return; |
| 40 _configured = true; | 40 _configured = true; |
| 41 useCompactVMConfiguration(); | 41 useCompactVMConfiguration(); |
| 42 filterStacks = true; |
| 42 } | 43 } |
| 43 | 44 |
| 44 /// Creates a new [PackageProvider] and [PackageGraph] with the given [assets] | 45 /// Creates a new [PackageProvider] and [PackageGraph] with the given [assets] |
| 45 /// and [transformers]. | 46 /// and [transformers]. |
| 46 /// | 47 /// |
| 47 /// This graph is used internally by most of the other functions in this | 48 /// This graph is used internally by most of the other functions in this |
| 48 /// library so you must call it in the test before calling any of the other | 49 /// library so you must call it in the test before calling any of the other |
| 49 /// functions. | 50 /// functions. |
| 50 /// | 51 /// |
| 51 /// [assets] may either be an [Iterable] or a [Map]. If it's an [Iterable], | 52 /// [assets] may either be an [Iterable] or a [Map]. If it's an [Iterable], |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 520 |
| 520 _MockAsset(this.id, this.contents); | 521 _MockAsset(this.id, this.contents); |
| 521 | 522 |
| 522 Future<String> readAsString({Encoding encoding}) => | 523 Future<String> readAsString({Encoding encoding}) => |
| 523 new Future.value(contents); | 524 new Future.value(contents); |
| 524 | 525 |
| 525 Stream<List<int>> read() => throw new UnimplementedError(); | 526 Stream<List<int>> read() => throw new UnimplementedError(); |
| 526 | 527 |
| 527 String toString() => "MockAsset $id $contents"; | 528 String toString() => "MockAsset $id $contents"; |
| 528 } | 529 } |
| OLD | NEW |