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

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

Issue 227123007: Only run [declareOutputs] once for each asset/transformer pair. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 8 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/lazy_transformer_test.dart
diff --git a/pkg/barback/test/package_graph/lazy_transformer_test.dart b/pkg/barback/test/package_graph/lazy_transformer_test.dart
index df249b326b0238f54ddbd09d25e4a8eb13564e06..2f08772bc14a1f517f6d0ca1929181a82014182d 100644
--- a/pkg/barback/test/package_graph/lazy_transformer_test.dart
+++ b/pkg/barback/test/package_graph/lazy_transformer_test.dart
@@ -82,9 +82,6 @@ main() {
expect(transformer.numRuns, completion(equals(1)));
});
- // TODO(nweiz): enable these once DeclaringTransformers forward laziness
- // properly (issue 16442).
- //
// test("a lazy asset piped into a declaring transformer isn't eagerly "
// "compiled", () {
// var transformer1 = new LazyRewriteTransformer("blub", "blab");
@@ -229,4 +226,27 @@ main() {
expectAllAssets(["app|foo.txt"]);
buildShouldSucceed();
});
+
+ // Regression test.
+ test("a lazy transformer that doesn't apply updates its passed-through asset",
+ () {
+ initGraph(["app|foo.txt"], {"app": [
+ [new LazyRewriteTransformer("blub", "blab")]
+ ]});
+
+ // Pause the provider so that the transformer will start forwarding the
+ // asset while it's dirty.
+ pauseProvider();
+ updateSources(["app|foo.txt"]);
+ expectAssetDoesNotComplete("app|foo.txt");
+
+ resumeProvider();
+ expectAsset("app|foo.txt", "foo");
+ buildShouldSucceed();
+
+ modifyAsset("app|foo.txt", "bar");
+ updateSources(["app|foo.txt"]);
+ expectAsset("app|foo.txt", "bar");
+ buildShouldSucceed();
+ });
}

Powered by Google App Engine
This is Rietveld 408576698