| 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 /// This library contains tests for transformer behavior that relates to actions | 5 /// This library contains tests for transformer behavior that relates to actions |
| 6 /// happening concurrently or other complex asynchronous timing behavior. | 6 /// happening concurrently or other complex asynchronous timing behavior. |
| 7 library barback.test.package_graph.transform.concurrency_test; | 7 library barback.test.package_graph.transform.concurrency_test; |
| 8 | 8 |
| 9 import 'package:barback/src/utils.dart'; | 9 import 'package:barback/src/utils.dart'; |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 removeSources(["app|foo.txt"]); | 463 removeSources(["app|foo.txt"]); |
| 464 | 464 |
| 465 // Make sure the removal is processed completely before we restart rewrite2. | 465 // Make sure the removal is processed completely before we restart rewrite2. |
| 466 schedule(pumpEventQueue); | 466 schedule(pumpEventQueue); |
| 467 rewrite1.resumeApply(); | 467 rewrite1.resumeApply(); |
| 468 | 468 |
| 469 buildShouldSucceed(); | 469 buildShouldSucceed(); |
| 470 expectNoAsset("app|foo.out1"); | 470 expectNoAsset("app|foo.out1"); |
| 471 expectNoAsset("app|foo.out2"); | 471 expectNoAsset("app|foo.out2"); |
| 472 }); | 472 }); |
| 473 |
| 474 test("a transformer in a later phase gets a slow secondary input from an " |
| 475 "earlier phase", () { |
| 476 var rewrite = new RewriteTransformer("in", "in"); |
| 477 initGraph({ |
| 478 "app|foo.in": "foo", |
| 479 "app|bar.txt": "foo.in" |
| 480 }, {"app": [ |
| 481 [rewrite], |
| 482 [new ManyToOneTransformer("txt")] |
| 483 ]}); |
| 484 |
| 485 rewrite.pauseApply(); |
| 486 updateSources(["app|foo.in", "app|bar.txt"]); |
| 487 expectAssetDoesNotComplete("app|bar.out"); |
| 488 |
| 489 rewrite.resumeApply(); |
| 490 expectAsset("app|bar.out", "foo.in"); |
| 491 buildShouldSucceed(); |
| 492 }); |
| 473 } | 493 } |
| OLD | NEW |