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.transformer.mock; | 5 library barback.test.transformer.mock; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
10 import 'package:barback/src/utils.dart'; | 10 import 'package:barback/src/utils.dart'; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 if (consumePrimary) transform.consumePrimary(); | 183 if (consumePrimary) transform.consumePrimary(); |
184 return newFuture(() => doApply(transform)).then((_) { | 184 return newFuture(() => doApply(transform)).then((_) { |
185 if (_apply != null) return _apply.future; | 185 if (_apply != null) return _apply.future; |
186 }).whenComplete(() { | 186 }).whenComplete(() { |
187 _runningTransforms--; | 187 _runningTransforms--; |
188 if (_runningTransforms == 0) _started = new Completer(); | 188 if (_runningTransforms == 0) _started = new Completer(); |
189 }); | 189 }); |
190 } | 190 } |
191 | 191 |
192 /// The wrapped version of [isPrimary] for subclasses to override. | 192 /// The wrapped version of [isPrimary] for subclasses to override. |
193 /// | 193 Future<bool> doIsPrimary(AssetId id); |
194 /// This may return a `Future<bool>` or, if it's entirely synchronous, a | |
195 /// `bool`. | |
196 doIsPrimary(AssetId id); | |
197 | 194 |
198 /// The wrapped version of [doApply] for subclasses to override. | 195 /// The wrapped version of [doApply] for subclasses to override. |
199 /// | 196 Future doApply(Transform transform); |
200 /// If this does asynchronous work, it should return a [Future] that completes | |
201 /// once it's finished. | |
202 doApply(Transform transform); | |
203 } | 197 } |
OLD | NEW |