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

Side by Side Diff: pkg/barback/test/package_graph/errors_test.dart

Issue 199443003: Asset load failures in Barback should produce AssetNotFoundExceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
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.package_graph.source_test; 5 library barback.test.package_graph.source_test;
6 6
7 import 'package:barback/src/utils.dart'; 7 import 'package:barback/src/utils.dart';
8 import 'package:scheduled_test/scheduled_test.dart'; 8 import 'package:scheduled_test/scheduled_test.dart';
9 9
10 import '../utils.dart'; 10 import '../utils.dart';
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 setAssetError("app|foo.txt"); 140 setAssetError("app|foo.txt");
141 updateSources(["app|foo.txt"]); 141 updateSources(["app|foo.txt"]);
142 expectNoAsset("app|foo.txt"); 142 expectNoAsset("app|foo.txt");
143 buildShouldFail([ 143 buildShouldFail([
144 isAssetLoadException("app|foo.txt", isMockLoadException("app|foo.txt")) 144 isAssetLoadException("app|foo.txt", isMockLoadException("app|foo.txt"))
145 ]); 145 ]);
146 }); 146 });
147 147
148 test("an asset isn't passed through a transformer with an error", () { 148 test("an asset isn't passed through a transformer with an error", () {
149 initGraph(["app|foo.txt",], {"app": [[new BadTransformer([])]]}); 149 initGraph(["app|foo.txt"], {"app": [[new BadTransformer([])]]});
150 150
151 updateSources(["app|foo.txt"]); 151 updateSources(["app|foo.txt"]);
152 expectNoAsset("app|foo.txt"); 152 expectNoAsset("app|foo.txt");
153 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]); 153 buildShouldFail([isTransformerException(equals(BadTransformer.ERROR))]);
154 }); 154 });
155
156 test("a transformer can catch an error loading a secondary input", () {
157 initGraph(["app|foo.txt"], {"app": [
158 [new CatchAssetNotFoundTransformer(".txt", "app|nothing")]
159 ]});
160
161 updateSources(["app|foo.txt"]);
162 expectAsset("app|foo.txt", "failed to load app|nothing");
163 buildShouldSucceed();
164 });
155 } 165 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | pkg/barback/test/transformer/catch_asset_not_found.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698