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

Unified Diff: pkg/polymer/test/build/import_inliner_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/import_inliner_test.dart
diff --git a/pkg/polymer/test/build/import_inliner_test.dart b/pkg/polymer/test/build/import_inliner_test.dart
index ffa1aa23b2f877a14b54c84b2a40b820d9c42a99..9adc56dc205ea951a32ce8916257f4932f9052b9 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -4,7 +4,7 @@
library polymer.test.build.import_inliner_test;
-import 'dart:convert' show JSON;
+import 'dart:convert';
import 'package:polymer/src/build/common.dart';
import 'package:polymer/src/build/import_inliner.dart';
import 'package:unittest/compact_vm_config.dart';
@@ -22,6 +22,7 @@ void main() {
group('script type=dart', codeExtractorTests);
group('url attributes', urlAttributeTests);
group('deep entrypoints', entryPointTests);
+ group('output logs', logOutputTests);
}
void importTests() {
@@ -675,7 +676,8 @@ void importTests() {
'<link rel="import" href="foo.html">'
'</head></html>',
}, {}, [
- 'error: Failed to inline html import: '
+ // We are wrapping errors and converting to warnings.
Siggi Cherem (dart-lang) 2014/08/05 19:37:21 I think we should repeat this test two or three ti
jakemac 2014/08/05 22:58:23 Done.
+ 'warning: Failed to inline html import: '
'Could not find asset a|web/foo.html. (web/test.html 0 27)',
]);
}
@@ -1083,3 +1085,32 @@ void entryPointTests() {
'</body></html>',
});
}
+
+void logOutputTests() {
+ final outputLogsPhases = [[new ImportInliner(
+ new TransformOptions(injectBuildLogsInOutput: true))]];
+
+ testPhases("logs are output and converted to warnings", outputLogsPhases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>'
+ '<link rel="import" href="foo.html">'
+ '</head></html>',
+ }, {
+ 'a|web/test.html._buildLogs.1':
+ '[{'
+ '"level":"Error",'
+ '"message":"Failed to inline html import: '
+ 'Could not find asset a|web/foo.html.",'
+ '"assetId":{"package":"a","path":"web/foo.html"},'
+ '"span":{'
+ '"location":"web/test.html:1:28",'
+ '"text":"${new HtmlEscape().convert(
+ '<link rel="import" href="foo.html">')}"'
+ '}'
+ '}]',
+ }, [
+ // We are wrapping errors and converting to warnings.
+ 'warning: Failed to inline html import: '
+ 'Could not find asset a|web/foo.html. (web/test.html 0 27)',
+ ]);
+}

Powered by Google App Engine
This is Rietveld 408576698