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

Unified Diff: test/build/transformer_test.dart

Issue 993673002: append html imports before the dart script tag (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: add some js script tags to the head around the dart script tag Created 5 years, 9 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/build/transformer_test.dart
diff --git a/test/build/transformer_test.dart b/test/build/transformer_test.dart
index bafdbcbe9a1d1a60cffc26708729904496d28214..369dc5888958d991eaf7314e0d17b5d49b8f13e8 100644
--- a/test/build/transformer_test.dart
+++ b/test/build/transformer_test.dart
@@ -118,4 +118,58 @@ main() {
bar() {}
''',
}, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
+
+ testPhases('imports go above the dart script', phases, {
+ 'b|web/index.html': '''
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <script>var x;</script>
+ <script type="application/dart" src="index.dart"></script>
+ <script>var y;</script>
+ </head>
+ <body>
+ </body>
+ </html>
+ ''',
+ 'b|web/index.dart': '''
+ @HtmlImport('package:b/b.html')
+ library b;
+
+ import 'package:web_components/html_import_annotation.dart';
+ import 'package:c/c.dart';
+ ''',
+ 'b|lib/b.html': '''
+ <div>b</div>
+ ''',
+ 'c|lib/c.dart': '''
+ @HtmlImport('c.html')
+ library c;
+
+ import 'package:web_components/html_import_annotation.dart';
+ ''',
+ 'c|lib/c.html': '''
+ <div>c</div>
+ ''',
+ 'initialize|lib/initialize.dart': mockInitialize,
+ 'web_components|lib/html_import_annotation.dart': mockHtmlImportAnnotation,
+ }, {
+ 'b|web/index.html': '''
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <script>var x;</script>
+ </head>
+ <body>
+ <div hidden="">
+ <div>c</div>
+ <div>b</div>
+ <script type="application/dart" src="index.bootstrap.initialize.dart">
+ </script>
+ <script>var y;</script>
+ </div>
+ </body>
+ </html>
+ ''',
+ }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
}
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698