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

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: added tests for the log widget 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..c45af0e5bdf4fcfabe363f5bb0479a03fefd9c80
--- /dev/null
+++ b/pkg/polymer/test/build/build_log_combiner_test.dart
@@ -0,0 +1,40 @@
+// 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();
+ group('combines logs', logCombiningTests);
Siggi Cherem (dart-lang) 2014/08/05 19:37:21 nit: I'd inline the tests below and get rid of the
jakemac 2014/08/05 22:58:23 Done.
+}
+
+void logCombiningTests() {
+ testPhases('combines multiple logs', phases, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html$LOG_EXTENSION.1': '[${buildLogString('Info', 'foo')}]',
+ 'a|web/test.html$LOG_EXTENSION.2':
+ '[${buildLogString('Warning', 'bar')}]',
+ 'a|web/test.html$LOG_EXTENSION.3': '[${buildLogString('Error', 'baz')}]',
+ }, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html$LOG_EXTENSION':
+ '[${buildLogString('Info', 'foo')},'
+ '${buildLogString('Warning', 'bar')},'
+ '${buildLogString('Error', 'baz')}]',
+ });
+}
+
+String buildLogString(String level, String message) {
Siggi Cherem (dart-lang) 2014/08/05 19:37:21 - I'd make this private, and being private, it's o
jakemac 2014/08/05 22:58:23 Done.
+ return '{"level":"$level","message":"$message"}';
+}

Powered by Google App Engine
This is Rietveld 408576698