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

Side by Side Diff: pkg/barback/test/utils.dart

Issue 187263003: Move Barback to a more thoroughly push-based model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // by MockProvider to exist. 91 // by MockProvider to exist.
92 for (var package in transformers.keys) { 92 for (var package in transformers.keys) {
93 assetMap.putIfAbsent(package, () => new AssetSet()); 93 assetMap.putIfAbsent(package, () => new AssetSet());
94 } 94 }
95 95
96 _provider = new MockProvider(assetMap); 96 _provider = new MockProvider(assetMap);
97 _barback = new Barback(_provider); 97 _barback = new Barback(_provider);
98 _nextBuildResult = 0; 98 _nextBuildResult = 0;
99 _nextLog = 0; 99 _nextLog = 0;
100 100
101 transformers.forEach(_barback.updateTransformers); 101 schedule(() => transformers.forEach(_barback.updateTransformers));
102 102
103 // There should be one successful build after adding all the transformers but 103 // There should be one successful build after adding all the transformers but
104 // before adding any sources. 104 // before adding any sources.
105 if (!transformers.isEmpty) buildShouldSucceed(); 105 if (!transformers.isEmpty) buildShouldSucceed();
106 } 106 }
107 107
108 /// Updates [assets] in the current [PackageProvider]. 108 /// Updates [assets] in the current [PackageProvider].
109 /// 109 ///
110 /// Each item in the list may either be an [AssetId] or a string that can be 110 /// Each item in the list may either be an [AssetId] or a string that can be
111 /// parsed as one. 111 /// parsed as one.
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 _MockAsset(this.id, this.contents); 565 _MockAsset(this.id, this.contents);
566 566
567 Future<String> readAsString({Encoding encoding}) => 567 Future<String> readAsString({Encoding encoding}) =>
568 new Future.value(contents); 568 new Future.value(contents);
569 569
570 Stream<List<int>> read() => throw new UnimplementedError(); 570 Stream<List<int>> read() => throw new UnimplementedError();
571 571
572 String toString() => "MockAsset $id $contents"; 572 String toString() => "MockAsset $id $contents";
573 } 573 }
OLDNEW
« no previous file with comments | « pkg/barback/test/package_graph/errors_test.dart ('k') | sdk/lib/_internal/pub/lib/src/barback/load_all_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698