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

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

Issue 238503003: Make [Barback.getAllAssets] work when called synchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/lib/src/phase_input.dart ('k') | pkg/barback/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/package_graph/get_all_assets_test.dart
diff --git a/pkg/barback/test/package_graph/get_all_assets_test.dart b/pkg/barback/test/package_graph/get_all_assets_test.dart
index 7cadbdfb17b61b6d67340de4278bd4a0a240863b..08da238cc34b414c4c5e24d4c4b64008870d5e63 100644
--- a/pkg/barback/test/package_graph/get_all_assets_test.dart
+++ b/pkg/barback/test/package_graph/get_all_assets_test.dart
@@ -4,6 +4,9 @@
library barback.test.barback_test;
+import 'dart:async';
+
+import 'package:barback/barback.dart';
import 'package:scheduled_test/scheduled_test.dart';
import '../utils.dart';
@@ -74,4 +77,24 @@ main() {
isTransformerException(equals(BadTransformer.ERROR))
]));
});
+
+ // Regression test.
+ test("getAllAssets() is called synchronously after after initializing "
+ "barback", () {
+ var provider = new MockProvider({
+ "app|a.txt": "a",
+ "app|b.txt": "b",
+ "app|c.txt": "c"
+ });
+ var barback = new Barback(provider);
+ barback.updateSources([
+ new AssetId.parse("app|a.txt"),
+ new AssetId.parse("app|b.txt"),
+ new AssetId.parse("app|c.txt")
+ ]);
+
+ expect(barback.getAllAssets().then((assets) {
+ return Future.wait(assets.map((asset) => asset.readAsString()));
+ }), completion(unorderedEquals(["a", "b", "c"])));
+ });
}
« no previous file with comments | « pkg/barback/lib/src/phase_input.dart ('k') | pkg/barback/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698