Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: pkg/barback/test/transformer/mock.dart

Issue 36213002: Only run at most 10 transformers at once in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bug fixes Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/barback/test/transformer/mock.dart
diff --git a/pkg/barback/test/transformer/mock.dart b/pkg/barback/test/transformer/mock.dart
index 57d3f078644544760f1404be26f7d51f8183c282..cfbb21a577a0f6d30488f9984ce13f647f1a2963 100644
--- a/pkg/barback/test/transformer/mock.dart
+++ b/pkg/barback/test/transformer/mock.dart
@@ -27,6 +27,9 @@ abstract class MockTransformer extends Transformer {
Future<int> get numRuns => schedule(() => _numRuns);
var _numRuns = 0;
+ Future<int> get maxParallelRuns => schedule(() => _maxParallelRuns);
Bob Nystrom 2013/10/28 17:32:21 Doc comment.
+ var _maxParallelRuns = 0;
+
/// The number of currently running transforms.
int _runningTransforms = 0;
@@ -176,6 +179,9 @@ abstract class MockTransformer extends Transformer {
_numRuns++;
if (_runningTransforms == 0) _started.complete();
_runningTransforms++;
+ if (_runningTransforms > _maxParallelRuns) {
+ _maxParallelRuns = _runningTransforms;
+ }
return newFuture(() => doApply(transform)).then((_) {
if (_apply != null) return _apply.future;
}).whenComplete(() {

Powered by Google App Engine
This is Rietveld 408576698