| OLD | NEW |
| 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.package_graph.transform_test; | 5 library barback.test.package_graph.transform_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
| 10 import 'package:barback/src/utils.dart'; | 10 import 'package:barback/src/utils.dart'; |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 | 912 |
| 913 updateSources(["app|foo.in"]); | 913 updateSources(["app|foo.in"]); |
| 914 expectAsset("app|foo.mid", "foo.mid.phase3"); | 914 expectAsset("app|foo.mid", "foo.mid.phase3"); |
| 915 buildShouldSucceed(); | 915 buildShouldSucceed(); |
| 916 | 916 |
| 917 modifyAsset("app|foo.in", "bar"); | 917 modifyAsset("app|foo.in", "bar"); |
| 918 updateSources(["app|foo.in"]); | 918 updateSources(["app|foo.in"]); |
| 919 expectAsset("app|foo.mid", "bar.mid.phase2"); | 919 expectAsset("app|foo.mid", "bar.mid.phase2"); |
| 920 buildShouldSucceed(); | 920 buildShouldSucceed(); |
| 921 }); | 921 }); |
| 922 |
| 923 test("doesn't pass an asset through if it's removed during isPrimary", () { |
| 924 var check = new CheckContentTransformer("bar", " modified"); |
| 925 initGraph(["app|foo.txt"], {"app": [[check]]}); |
| 926 |
| 927 updateSources(["app|foo.txt"]); |
| 928 expectAsset("app|foo.txt", "foo"); |
| 929 buildShouldSucceed(); |
| 930 |
| 931 check.pauseIsPrimary("app|foo.txt"); |
| 932 modifyAsset("app|foo.txt", "bar"); |
| 933 updateSources(["app|foo.txt"]); |
| 934 // Ensure we're waiting on [check.isPrimary] |
| 935 schedule(pumpEventQueue); |
| 936 |
| 937 removeSources(["app|foo.txt"]); |
| 938 check.resumeIsPrimary("app|foo.txt"); |
| 939 expectNoAsset("app|foo.txt"); |
| 940 buildShouldSucceed(); |
| 941 }); |
| 922 }); | 942 }); |
| 923 | 943 |
| 924 group('cross-package transforms', () { | 944 group('cross-package transforms', () { |
| 925 test("can access other packages' source assets", () { | 945 test("can access other packages' source assets", () { |
| 926 initGraph({ | 946 initGraph({ |
| 927 "pkg1|a.txt": "pkg2|a.inc", | 947 "pkg1|a.txt": "pkg2|a.inc", |
| 928 "pkg2|a.inc": "a" | 948 "pkg2|a.inc": "a" |
| 929 }, {"pkg1": [[new ManyToOneTransformer("txt")]]}); | 949 }, {"pkg1": [[new ManyToOneTransformer("txt")]]}); |
| 930 | 950 |
| 931 updateSources(["pkg1|a.txt", "pkg2|a.inc"]); | 951 updateSources(["pkg1|a.txt", "pkg2|a.inc"]); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 buildShouldSucceed(); | 1053 buildShouldSucceed(); |
| 1034 | 1054 |
| 1035 modifyAsset("pkg2|a.inc", "b"); | 1055 modifyAsset("pkg2|a.inc", "b"); |
| 1036 updateSources(["pkg2|a.inc"]); | 1056 updateSources(["pkg2|a.inc"]); |
| 1037 expectAsset("pkg1|b", "spread out"); | 1057 expectAsset("pkg1|b", "spread out"); |
| 1038 expectNoAsset("pkg1|c.done"); | 1058 expectNoAsset("pkg1|c.done"); |
| 1039 buildShouldSucceed(); | 1059 buildShouldSucceed(); |
| 1040 }); | 1060 }); |
| 1041 }); | 1061 }); |
| 1042 } | 1062 } |
| OLD | NEW |