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

Unified Diff: sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart

Issue 52853004: Pass in "mode" to transformer plugins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "transformer" -> "configuration". Created 7 years, 2 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
Index: sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart b/sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart
similarity index 66%
copy from sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart
copy to sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart
index e84224573756be3b06fd10af820e12416241073f..f45b8da290f554a0ead2b0af4b032547b2df974f 100644
--- a/sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart
@@ -6,9 +6,9 @@ library pub_tests;
import 'dart:convert';
-import '../../descriptor.dart' as d;
-import '../../test_pub.dart';
-import '../../serve/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import '../serve/utils.dart';
final transformer = """
import 'dart:async';
@@ -16,17 +16,17 @@ import 'dart:convert';
import 'package:barback/barback.dart';
-class ConfigTransformer extends Transformer {
- final Map configuration;
+class ModeTransformer extends Transformer {
+ final BarbackSettings settings;
- ConfigTransformer.asPlugin(this.configuration);
+ ModeTransformer.asPlugin(this.settings);
String get allowedExtensions => '.txt';
Future apply(Transform transform) {
return transform.primaryInput.readAsString().then((contents) {
- var id = transform.primaryInput.id.changeExtension(".json");
- transform.addOutput(new Asset.fromString(id, JSON.encode(configuration)));
+ transform.addOutput(
+ new Asset.fromString(transform.primaryInput.id, settings.mode.name));
});
}
}
@@ -34,7 +34,7 @@ class ConfigTransformer extends Transformer {
main() {
initConfig();
- integration("configuration defaults to an empty map", () {
+ integration("mode defaults to 'debug' in pub serve", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
@@ -51,7 +51,7 @@ main() {
createLockFile('myapp', pkg: ['barback']);
var server = startPubServe();
- requestShouldSucceed("foo.json", JSON.encode({}));
+ requestShouldSucceed("foo.txt", "debug");
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698