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

Unified Diff: pkg/barback/test/package_graph/declaring_transformer_test.dart

Issue 267393009: Transition barback's infrastructure to an aggregate-based model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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/package_graph/declaring_transformer_test.dart
diff --git a/pkg/barback/test/package_graph/declaring_transformer_test.dart b/pkg/barback/test/package_graph/declaring_transformer_test.dart
index dc180aee2151009b4dd7800b556320f97686b714..9a8535f7dd2487703df338e4a76d7bb6f416938b 100644
--- a/pkg/barback/test/package_graph/declaring_transformer_test.dart
+++ b/pkg/barback/test/package_graph/declaring_transformer_test.dart
@@ -191,14 +191,16 @@ main() {
[declaring]
]});
- // Start [declaring] running, because its input became available.
declaring.pauseApply();
updateSources(["app|foo.in"]);
// Give the transformers time to declare their assets.
schedule(pumpEventQueue);
+ // Start [declaring] running, because its input became available.
expectAsset("app|out.one", "app|out.one");
- expectAssetDoesNotComplete("app|out.three");
+
+ // Make sure we're blocking on [declaring.apply].
+ schedule(pumpEventQueue);
// Now [declaring]'s input is dirty, so it shouldn't re-run without an
// explicit request.
@@ -220,6 +222,42 @@ main() {
expect(declaring.numRuns, completion(equals(2)));
});
+ test("a declaring transformer following a lazy transformer does re-run if "
+ "its input becomes available, it's forced, and then its input becomes "
+ "unavailable", () {
+ var declaring = new DeclaringRewriteTransformer("two", "three");
+ initGraph(["app|foo.in"], {"app": [
+ [new LazyAssetsTransformer(["app|out.one", "app|out.two"])],
+ [declaring]
+ ]});
+
+ declaring.pauseApply();
+ updateSources(["app|foo.in"]);
+
+ // Give the transformers time to declare their assets.
+ schedule(pumpEventQueue);
+
+ // Start [declaring] running, because its input became available.
+ expectAsset("app|out.one", "app|out.one");
+
+ // This shouldn't complete because [declaring.apply] is paused, but it
+ // should force the transformer.
+ expectAssetDoesNotComplete("app|out.three");
+
+ // Make sure we're blocking on [declaring.apply]
+ schedule(pumpEventQueue);
+
+ // Now [declaring]'s input is dirty, so it shouldn't re-run without an
+ // explicit request.
+ updateSources(["app|foo.in"]);
+ declaring.resumeApply();
+ buildShouldSucceed();
+
+ // [declaring] should have run twice, once for its original input and once
+ // after the input changed because it was forced.
+ expect(declaring.numRuns, completion(equals(2)));
+ });
+
group("with an error in declareOutputs", () {
test("still runs apply", () {
initGraph(["app|foo.txt"], {"app": [[
« no previous file with comments | « pkg/barback/test/asset_set_test.dart ('k') | pkg/barback/test/package_graph/transform/concurrency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698