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

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

Issue 239433012: Detect and warn about missing scripts (rather than fail during the build) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « pkg/polymer/test/build/import_inliner_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/build/script_compactor_test.dart
diff --git a/pkg/polymer/test/build/script_compactor_test.dart b/pkg/polymer/test/build/script_compactor_test.dart
index cfb82e65dd29c8138d827afa63cb41ed0f8d3800..6c3119e8ebb06f16ea02b00e0559e5d6dd196140 100644
--- a/pkg/polymer/test/build/script_compactor_test.dart
+++ b/pkg/polymer/test/build/script_compactor_test.dart
@@ -108,7 +108,7 @@ initializerTests(phases) {
}
'''.replaceAll('\n ', '\n'),
});
-
+
testPhases('use const expressions', phases, {
'a|web/test.html':
'<!DOCTYPE html><html><head>',
@@ -163,9 +163,59 @@ initializerTests(phases) {
'class XFoo extends PolymerElement {\n'
'}\n'
'main(){}',
- }, {}, [
+ }, {
+ 'a|web/test.html_bootstrap.dart':
+ '''$MAIN_HEADER
+ import 'a.dart' as i0;
+ ${DEFAULT_IMPORTS.join('\n')}
+ import 'a.dart' as smoke_0;
+ import 'package:polymer/polymer.dart' as smoke_1;
+
+ void main() {
+ useGeneratedCode(new StaticConfiguration(
+ checkedMode: false,
+ parents: {
+ smoke_0.XFoo: smoke_1.PolymerElement,
+ },
+ declarations: {
+ smoke_0.XFoo: const {},
+ }));
+ startPolymer([]);
+ }
+ '''.replaceAll('\n ', '\n'),
+
+ }, [
'warning: The parameter to @CustomTag seems to be invalid. '
'(web/a.dart 2 11)',
+ 'warning: $NO_INITIALIZERS_ERROR',
+ ]);
+
+ testPhases('no polymer import (no warning, but no crash either)', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head>',
+ 'a|web/test.html.scriptUrls': '[["a","web/a.dart"]]',
+ 'a|web/a.dart':
+ 'library a;\n'
+ 'import "package:polymer/polymer.broken.import.dart";\n'
+ '@CustomTag("x-foo")\n'
+ 'class XFoo extends PolymerElement {\n'
+ '}\n'
+ 'main(){}',
+ }, {
+ 'a|web/test.html_bootstrap.dart':
+ '''$MAIN_HEADER
+ import 'a.dart' as i0;
+ ${DEFAULT_IMPORTS.join('\n')}
+
+ void main() {
+ useGeneratedCode(new StaticConfiguration(
+ checkedMode: false));
+ startPolymer([]);
+ }
+ '''.replaceAll('\n ', '\n'),
+
+ }, [
+ 'warning: $NO_INITIALIZERS_ERROR',
]);
testPhases('several scripts', phases, {
@@ -256,7 +306,7 @@ initializerTests(phases) {
smoke_2.XF1: smoke_1.PolymerElement,
smoke_3.XG2: smoke_1.PolymerElement,
smoke_4.XH1: smoke_1.PolymerElement,
- },
+ },
declarations: {
smoke_5.XC1: const {},
smoke_5.XC2: const {},
« no previous file with comments | « pkg/polymer/test/build/import_inliner_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698