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

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

Issue 343963003: Fix a barback bug where a closed stream could get an event. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « pkg/barback/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ });
}
« no previous file with comments | « pkg/barback/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698