Index: pkg/barback/test/package_graph/add_remove_transform_test.dart |
diff --git a/pkg/barback/test/package_graph/add_remove_transform_test.dart b/pkg/barback/test/package_graph/add_remove_transform_test.dart |
index 845ee97f9f8908a12ce69984d8508edb97328297..c7758c225a55576a0a6e9edd13e4a08318b45315 100644 |
--- a/pkg/barback/test/package_graph/add_remove_transform_test.dart |
+++ b/pkg/barback/test/package_graph/add_remove_transform_test.dart |
@@ -360,4 +360,31 @@ main() { |
expectAsset("app|foo.out", "foo.mid.out"); |
buildShouldSucceed(); |
}); |
+ |
+ // Regression test for issue 19540. |
+ solo_test("a phase is removed and then one of its inputs is updated", () { |
Bob Nystrom
2014/06/19 21:07:29
Don't solo! :)
nweiz
2014/06/19 21:10:53
I dunno, I think this is probably the only really
|
+ // Have an empty first phase because the first phase is never removed. |
+ initGraph(["app|foo.txt"], { |
+ "app": [[], [new RewriteTransformer("txt", "out")]] |
+ }); |
+ |
+ updateSources(["app|foo.txt"]); |
+ expectAsset("app|foo.out", "foo.out"); |
+ buildShouldSucceed(); |
+ |
+ // First empty both phases. This allows the second phase to be considered |
+ // idle even when its transformer is no longer running. |
+ updateTransformers("app", [[], []]); |
+ buildShouldSucceed(); |
+ |
+ // Now remove the second phase. It should unsubscribe from its input's |
+ // events. |
+ updateTransformers("app", [[]]); |
+ buildShouldSucceed(); |
+ |
+ // Update the input. With issue 19540, this would cause the removed phase to |
+ // try to update its status, which would crash. |
+ updateSources(["app|foo.txt"]); |
+ buildShouldSucceed(); |
+ }); |
} |