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

Side by Side Diff: pkg/barback/test/transformer/bad_log.dart

Issue 223553008: Only pass an AssetId to isPrimary and declareOutputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix script_compactor 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
OLDNEW
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 library barback.test.transformer.bad_log; 5 library barback.test.transformer.bad_log;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:barback/src/utils.dart'; 10 import 'package:barback/src/utils.dart';
11 11
12 import 'mock.dart'; 12 import 'mock.dart';
13 13
14 /// A transformer that logs an error when run, Before generating the given 14 /// A transformer that logs an error when run, Before generating the given
15 /// outputs. 15 /// outputs.
16 class BadLogTransformer extends MockTransformer { 16 class BadLogTransformer extends MockTransformer {
17 /// The list of asset names that it should output. 17 /// The list of asset names that it should output.
18 final List<String> outputs; 18 final List<String> outputs;
19 19
20 BadLogTransformer(this.outputs); 20 BadLogTransformer(this.outputs);
21 21
22 Future<bool> doIsPrimary(Asset asset) => new Future.value(true); 22 Future<bool> doIsPrimary(AssetId id) => new Future.value(true);
23 23
24 Future doApply(Transform transform) { 24 Future doApply(Transform transform) {
25 return newFuture(() { 25 return newFuture(() {
26 transform.logger.error("first error"); 26 transform.logger.error("first error");
27 transform.logger.error("second error"); 27 transform.logger.error("second error");
28 28
29 for (var output in outputs) { 29 for (var output in outputs) {
30 var id = new AssetId.parse(output); 30 var id = new AssetId.parse(output);
31 transform.addOutput(new Asset.fromString(id, output)); 31 transform.addOutput(new Asset.fromString(id, output));
32 } 32 }
33 }); 33 });
34 } 34 }
35 } 35 }
OLDNEW
« no previous file with comments | « pkg/barback/test/transformer/bad.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