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

Unified Diff: sdk/lib/_internal/pub/test/serve/defaults_to_debug_mode_test.dart

Issue 69043003: Allow user to specify mode for pub build/serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Get rid of "--minify" flags. Created 7 years, 1 month 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
Index: sdk/lib/_internal/pub/test/serve/defaults_to_debug_mode_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart b/sdk/lib/_internal/pub/test/serve/defaults_to_debug_mode_test.dart
similarity index 72%
copy from sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart
copy to sdk/lib/_internal/pub/test/serve/defaults_to_debug_mode_test.dart
index 1484c769d29c980fe217af314067868f9b15e3c8..5da99487a7f09908480c38f00fc07427068abeea 100644
--- a/sdk/lib/_internal/pub/test/transformer/can_use_read_input_as_string_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/defaults_to_debug_mode_test.dart
@@ -12,17 +12,18 @@ const TRANSFORMER = """
import 'dart:async';
import 'package:barback/barback.dart';
+import 'package:source_maps/source_maps.dart';
-class RewriteTransformer extends Transformer {
- RewriteTransformer.asPlugin();
+class ModeTransformer extends Transformer {
+ final BarbackSettings settings;
+ ModeTransformer.asPlugin(this.settings);
String get allowedExtensions => '.txt';
Future apply(Transform transform) {
- return transform.readInputAsString(transform.primaryInput.id)
- .then((contents) {
+ return new Future.value().then((_) {
var id = transform.primaryInput.id.changeExtension(".out");
- transform.addOutput(new Asset.fromString(id, "\$contents.out"));
+ transform.addOutput(new Asset.fromString(id, settings.mode.toString()));
});
}
}
@@ -30,7 +31,7 @@ class RewriteTransformer extends Transformer {
main() {
initConfig();
- integration("a transform can use readInputAsString", () {
+ integration("defaults to debug mode", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
@@ -47,7 +48,7 @@ main() {
createLockFile('myapp', pkg: ['barback']);
pubServe();
- requestShouldSucceed("foo.out", "foo.out");
+ requestShouldSucceed("foo.out", "debug");
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698