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

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

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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
« no previous file with comments | « packages/polymer/test/build/all_phases_test.dart ('k') | packages/polymer/test/build/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/polymer/test/build/build_log_combiner_test.dart
diff --git a/packages/polymer/test/build/build_log_combiner_test.dart b/packages/polymer/test/build/build_log_combiner_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..acb1ae6155a29b1941b1c600d712441512ad4e34
--- /dev/null
+++ b/packages/polymer/test/build/build_log_combiner_test.dart
@@ -0,0 +1,44 @@
+// 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:code_transformers/messages/build_logger.dart'
+ show LOG_EXTENSION;
+import 'package:polymer/src/build/build_log_combiner.dart';
+import 'package:polymer/src/build/common.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':
+ '{"foo#0":[${_logString('Info', 0, 'foo')}]}',
+ 'a|web/test.html$LOG_EXTENSION.2':
+ '{"foo#2":[${_logString('Warning', 2, 'bar')}]}',
+ 'a|web/test.html$LOG_EXTENSION.3': '{'
+ '"foo#2":[${_logString('Error', 2, 'baz1')}],'
+ '"foo#44":[${_logString('Error', 44, 'baz2')}]'
+ '}',
+ }, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html$LOG_EXTENSION': '{'
+ '"foo#0":[${_logString('Info', 0, 'foo')}],'
+ '"foo#2":[${_logString('Warning', 2, 'bar')},'
+ '${_logString('Error', 2, 'baz1')}],'
+ '"foo#44":[${_logString('Error', 44, 'baz2')}]'
+ '}',
+ });
+}
+
+String _logString(String level, int id, String message) =>
+ '{"level":"$level","message":{"id":"foo#$id","snippet":"$message"}}';
« no previous file with comments | « packages/polymer/test/build/all_phases_test.dart ('k') | packages/polymer/test/build/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698