| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.declaring_transformer_test; | 5 library barback.test.package_graph.declaring_transformer_test; |
| 6 | 6 |
| 7 import 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
| 8 import 'package:barback/src/utils.dart'; | 8 import 'package:barback/src/utils.dart'; |
| 9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 initGraph(["app|foo.blub"], {"app": [[transformer]]}); | 54 initGraph(["app|foo.blub"], {"app": [[transformer]]}); |
| 55 | 55 |
| 56 transformer.pauseApply(); | 56 transformer.pauseApply(); |
| 57 updateSources(["app|foo.blub"]); | 57 updateSources(["app|foo.blub"]); |
| 58 expectAsset("app|foo.blub", "foo"); | 58 expectAsset("app|foo.blub", "foo"); |
| 59 | 59 |
| 60 transformer.resumeApply(); | 60 transformer.resumeApply(); |
| 61 buildShouldSucceed(); | 61 buildShouldSucceed(); |
| 62 }); | 62 }); |
| 63 | 63 |
| 64 test("fails to get a consumed asset before apply is finished", () { | 64 // TODO(nweiz): Enable this test when issue 18226 is fixed. |
| 65 var transformer = new DeclaringRewriteTransformer("blub", "blab") | 65 // test("fails to get a consumed asset before apply is finished", () { |
| 66 ..consumePrimary = true; | 66 // var transformer = new DeclaringRewriteTransformer("blub", "blab") |
| 67 initGraph(["app|foo.blub"], {"app": [[transformer]]}); | 67 // ..consumePrimary = true; |
| 68 | 68 // initGraph(["app|foo.blub"], {"app": [[transformer]]}); |
| 69 transformer.pauseApply(); | 69 // |
| 70 updateSources(["app|foo.blub"]); | 70 // transformer.pauseApply(); |
| 71 expectNoAsset("app|foo.blub"); | 71 // updateSources(["app|foo.blub"]); |
| 72 | 72 // expectNoAsset("app|foo.blub"); |
| 73 transformer.resumeApply(); | 73 // |
| 74 buildShouldSucceed(); | 74 // transformer.resumeApply(); |
| 75 }); | 75 // buildShouldSucceed(); |
| 76 // }); |
| 76 | 77 |
| 77 test("waits until apply is finished to get an overwritten asset", () { | 78 test("waits until apply is finished to get an overwritten asset", () { |
| 78 var transformer = new DeclaringRewriteTransformer("blub", "blub"); | 79 var transformer = new DeclaringRewriteTransformer("blub", "blub"); |
| 79 initGraph(["app|foo.blub"], {"app": [[transformer]]}); | 80 initGraph(["app|foo.blub"], {"app": [[transformer]]}); |
| 80 | 81 |
| 81 transformer.pauseApply(); | 82 transformer.pauseApply(); |
| 82 updateSources(["app|foo.blub"]); | 83 updateSources(["app|foo.blub"]); |
| 83 expectAssetDoesNotComplete("app|foo.blub"); | 84 expectAssetDoesNotComplete("app|foo.blub"); |
| 84 | 85 |
| 85 transformer.resumeApply(); | 86 transformer.resumeApply(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 test("can declare outputs it doesn't emit", () { | 162 test("can declare outputs it doesn't emit", () { |
| 162 initGraph(["app|foo.txt"], {"app": [ | 163 initGraph(["app|foo.txt"], {"app": [ |
| 163 [new DeclareAssetsTransformer(["app|out.txt"], [])] | 164 [new DeclareAssetsTransformer(["app|out.txt"], [])] |
| 164 ]}); | 165 ]}); |
| 165 | 166 |
| 166 updateSources(["app|foo.txt"]); | 167 updateSources(["app|foo.txt"]); |
| 167 expectNoAsset("app|out.txt"); | 168 expectNoAsset("app|out.txt"); |
| 168 buildShouldSucceed(); | 169 buildShouldSucceed(); |
| 169 }); | 170 }); |
| 170 } | 171 } |
| OLD | NEW |