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

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

Issue 22371005: Consistently schedule operations in the barback tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 4 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/test/package_graph/errors_test.dart ('k') | pkg/barback/test/package_graph/transform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/package_graph/source_test.dart
diff --git a/pkg/barback/test/package_graph/source_test.dart b/pkg/barback/test/package_graph/source_test.dart
index e6627e73bbbec87853bb8be0c42a6e63cccabd50..4c47df355f7f3b26691c60810c29f0fb781c1464 100644
--- a/pkg/barback/test/package_graph/source_test.dart
+++ b/pkg/barback/test/package_graph/source_test.dart
@@ -61,10 +61,7 @@ main() {
expectAsset("app|foo.txt");
buildShouldSucceed();
- schedule(() {
- removeSources(["app|foo.txt"]);
- });
-
+ removeSources(["app|foo.txt"]);
expectNoAsset("app|foo.txt");
buildShouldSucceed();
});
@@ -75,26 +72,24 @@ main() {
schedule(() {
// Make a bunch of synchronous update calls.
- updateSources(["app|foo.blub"]);
- updateSources(["app|foo.blub"]);
- updateSources(["app|foo.blub"]);
- updateSources(["app|foo.blub"]);
+ updateSourcesSync(["app|foo.blub"]);
+ updateSourcesSync(["app|foo.blub"]);
+ updateSourcesSync(["app|foo.blub"]);
+ updateSourcesSync(["app|foo.blub"]);
});
expectAsset("app|foo.blab", "foo.blab");
buildShouldSucceed();
- schedule(() {
- expect(transformer.numRuns, equals(1));
- });
+ expect(transformer.numRuns, completion(equals(1)));
});
test("a removal cancels out an update", () {
initGraph(["app|foo.txt"]);
schedule(() {
- updateSources(["app|foo.txt"]);
- removeSources(["app|foo.txt"]);
+ updateSourcesSync(["app|foo.txt"]);
+ removeSourcesSync(["app|foo.txt"]);
});
expectNoAsset("app|foo.txt");
@@ -105,8 +100,8 @@ main() {
initGraph(["app|foo.txt"]);
schedule(() {
- removeSources(["app|foo.txt"]);
- updateSources(["app|foo.txt"]);
+ removeSourcesSync(["app|foo.txt"]);
+ updateSourcesSync(["app|foo.txt"]);
});
expectAsset("app|foo.txt");
@@ -117,14 +112,12 @@ main() {
initGraph({"app|foo.txt": "foo"});
pauseProvider();
- schedule(() {
- // The mock provider synchronously loads the value of the assets, so this
- // will kick off two loads with different values. The second one should
- // win.
- updateSources(["app|foo.txt"]);
- modifyAsset("app|foo.txt", "bar");
- updateSources(["app|foo.txt"]);
- });
+ // The mock provider synchronously loads the value of the assets, so this
+ // will kick off two loads with different values. The second one should
+ // win.
+ updateSources(["app|foo.txt"]);
+ modifyAsset("app|foo.txt", "bar");
+ updateSources(["app|foo.txt"]);
resumeProvider();
expectAsset("app|foo.txt", "bar");
@@ -145,23 +138,16 @@ main() {
// Make the provider slow to load a source.
pauseProvider();
- schedule(() {
- // Update an asset that doesn't trigger any transformers.
- updateSources(["app|other.bar"]);
- });
+ // Update an asset that doesn't trigger any transformers.
+ updateSources(["app|other.bar"]);
- schedule(() {
- // Now update an asset that does trigger a transformer.
- updateSources(["app|foo.txt"]);
- });
+ // Now update an asset that does trigger a transformer.
+ updateSources(["app|foo.txt"]);
resumeProvider();
buildShouldSucceed();
- waitForBuild();
- schedule(() {
- expect(transformer.numRuns, equals(2));
- });
+ expect(transformer.numRuns, completion(equals(2)));
});
}
« no previous file with comments | « pkg/barback/test/package_graph/errors_test.dart ('k') | pkg/barback/test/package_graph/transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698