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

Unified Diff: pkg/polymer/test/build/build_log_combiner_test.dart

Issue 427623002: Polymer transformer logs now show on the frontend for pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: dont wrap the logger in release mode Created 6 years, 4 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: pkg/polymer/test/build/build_log_combiner_test.dart
diff --git a/pkg/polymer/test/build/build_log_combiner_test.dart b/pkg/polymer/test/build/build_log_combiner_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6f98e9ac51741dc453080115b1bafae9c39cfa26
--- /dev/null
+++ b/pkg/polymer/test/build/build_log_combiner_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library polymer.test.build.build_log_combiner_test;
+
+import 'package:polymer/src/build/common.dart';
+import 'package:polymer/src/build/build_log_combiner.dart';
+import 'package:unittest/compact_vm_config.dart';
+import 'package:unittest/unittest.dart';
+
+import 'common.dart';
+
+final options = new TransformOptions(injectBuildLogsInOutput: true);
+final phases = [[new BuildLogCombiner(options)]];
+
+void main() {
+ useCompactVMConfiguration();
+
+ testPhases('combines multiple logs', phases, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html$LOG_EXTENSION.1': '[${_logString('Info', 'foo')}]',
+ 'a|web/test.html$LOG_EXTENSION.2': '[${_logString('Warning', 'bar')}]',
+ 'a|web/test.html$LOG_EXTENSION.3': '[${_logString('Error', 'baz')}]',
+ }, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html$LOG_EXTENSION':
+ '[${_logString('Info', 'foo')},'
+ '${_logString('Warning', 'bar')},'
+ '${_logString('Error', 'baz')}]',
+ });
+}
+
+String _logString(String level, String message) =>
+ '{"level":"$level","message":"$message"}';

Powered by Google App Engine
This is Rietveld 408576698