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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library polymer.test.build.build_log_combiner_test;
6
7 import 'package:polymer/src/build/common.dart';
8 import 'package:polymer/src/build/build_log_combiner.dart';
9 import 'package:unittest/compact_vm_config.dart';
10 import 'package:unittest/unittest.dart';
11
12 import 'common.dart';
13
14 final options = new TransformOptions(injectBuildLogsInOutput: true);
15 final phases = [[new BuildLogCombiner(options)]];
16
17 void main() {
18 useCompactVMConfiguration();
19 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.
20 }
21
22 void logCombiningTests() {
23 testPhases('combines multiple logs', phases, {
24 'a|web/test.html': '<!DOCTYPE html><html></html>',
25 'a|web/test.html$LOG_EXTENSION.1': '[${buildLogString('Info', 'foo')}]',
26 'a|web/test.html$LOG_EXTENSION.2':
27 '[${buildLogString('Warning', 'bar')}]',
28 'a|web/test.html$LOG_EXTENSION.3': '[${buildLogString('Error', 'baz')}]',
29 }, {
30 'a|web/test.html': '<!DOCTYPE html><html></html>',
31 'a|web/test.html$LOG_EXTENSION':
32 '[${buildLogString('Info', 'foo')},'
33 '${buildLogString('Warning', 'bar')},'
34 '${buildLogString('Error', 'baz')}]',
35 });
36 }
37
38 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.
39 return '{"level":"$level","message":"$message"}';
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698