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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/barback/lib/src/phase_input.dart ('k') | pkg/barback/test/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.barback_test; 5 library barback.test.barback_test;
6 6
7 import 'dart:async';
8
9 import 'package:barback/barback.dart';
7 import 'package:scheduled_test/scheduled_test.dart'; 10 import 'package:scheduled_test/scheduled_test.dart';
8 11
9 import '../utils.dart'; 12 import '../utils.dart';
10 13
11 main() { 14 main() {
12 initConfig(); 15 initConfig();
13 16
14 test("gets all source assets", () { 17 test("gets all source assets", () {
15 initGraph(["app|a.txt", "app|b.txt", "app|c.txt"]); 18 initGraph(["app|a.txt", "app|b.txt", "app|c.txt"]);
16 updateSources(["app|a.txt", "app|b.txt", "app|c.txt"]); 19 updateSources(["app|a.txt", "app|b.txt", "app|c.txt"]);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 new BadTransformer(["app|foo.out2"]) 70 new BadTransformer(["app|foo.out2"])
68 ] 71 ]
69 ]}); 72 ]});
70 73
71 updateSources(["app|foo.txt"]); 74 updateSources(["app|foo.txt"]);
72 expectAllAssetsShouldFail(isAggregateException([ 75 expectAllAssetsShouldFail(isAggregateException([
73 isTransformerException(equals(BadTransformer.ERROR)), 76 isTransformerException(equals(BadTransformer.ERROR)),
74 isTransformerException(equals(BadTransformer.ERROR)) 77 isTransformerException(equals(BadTransformer.ERROR))
75 ])); 78 ]));
76 }); 79 });
80
81 // Regression test.
82 test("getAllAssets() is called synchronously after after initializing "
83 "barback", () {
84 var provider = new MockProvider({
85 "app|a.txt": "a",
86 "app|b.txt": "b",
87 "app|c.txt": "c"
88 });
89 var barback = new Barback(provider);
90 barback.updateSources([
91 new AssetId.parse("app|a.txt"),
92 new AssetId.parse("app|b.txt"),
93 new AssetId.parse("app|c.txt")
94 ]);
95
96 expect(barback.getAllAssets().then((assets) {
97 return Future.wait(assets.map((asset) => asset.readAsString()));
98 }), completion(unorderedEquals(["a", "b", "c"])));
99 });
77 } 100 }
OLDNEW
« 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