| Index: packages/web_components/test/build/transformer_test.dart
|
| diff --git a/packages/web_components/test/build/transformer_test.dart b/packages/web_components/test/build/transformer_test.dart
|
| index 446ecede51881a610eaef35bcd18bf295e6c896d..0e05cf8a2a42cd51cf8e5c5607a034a7dab1a227 100644
|
| --- a/packages/web_components/test/build/transformer_test.dart
|
| +++ b/packages/web_components/test/build/transformer_test.dart
|
| @@ -1,22 +1,26 @@
|
| // Copyright (c) 2015, 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.
|
| +@TestOn('vm')
|
| library web_components.test.build.transformer_test;
|
|
|
| -import 'package:code_transformers/tests.dart';
|
| +import 'package:transformer_test/utils.dart';
|
| import 'package:web_components/transformer.dart';
|
| -import 'package:unittest/compact_vm_config.dart';
|
| +import 'package:test/test.dart';
|
| import 'common.dart';
|
|
|
| var transformer = new WebComponentsTransformerGroup(
|
| new TransformOptions(['web/index.html', 'test/index.html'], false));
|
| -var phases = [[transformer]];
|
| +var phases = [
|
| + [transformer]
|
| +];
|
|
|
| main() {
|
| - useCompactVMConfiguration();
|
| -
|
| - testPhases('full app', phases, {
|
| - 'a|web/index.html': '''
|
| + testPhases(
|
| + 'full app',
|
| + phases,
|
| + {
|
| + 'a|web/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| @@ -27,7 +31,7 @@ main() {
|
| </body>
|
| </html>
|
| ''',
|
| - 'a|web/index.dart': '''
|
| + 'a|web/index.dart': '''
|
| library a;
|
|
|
| import 'package:initialize/initialize.dart';
|
| @@ -35,15 +39,15 @@ main() {
|
| @initMethod
|
| startup() {}
|
| ''',
|
| - 'b|lib/foo.html': '''
|
| + 'b|lib/foo.html': '''
|
| <link rel="import" href="bar.html">
|
| <script type="application/dart" src="foo.dart"></script>
|
| <div>foo</div>
|
| ''',
|
| - 'b|lib/foo.dart': '''
|
| + 'b|lib/foo.dart': '''
|
| library b.foo;
|
| ''',
|
| - 'b|lib/bar.html': '''
|
| + 'b|lib/bar.html': '''
|
| <script type="application/dart">
|
| // Must use package:urls inside inline script tags,
|
| @HtmlImport('package:b/bar_nodart.html')
|
| @@ -58,13 +62,15 @@ main() {
|
| </script>
|
| <div>bar</div>
|
| ''',
|
| - 'b|lib/bar_nodart.html': '''
|
| + 'b|lib/bar_nodart.html': '''
|
| <div>bar no_dart!</div>
|
| ''',
|
| - 'initialize|lib/initialize.dart': mockInitialize,
|
| - 'web_components|lib/html_import_annotation.dart': mockHtmlImportAnnotation,
|
| - }, {
|
| - 'a|web/index.html': '''
|
| + 'initialize|lib/initialize.dart': mockInitialize,
|
| + 'web_components|lib/html_import_annotation.dart':
|
| + mockHtmlImportAnnotation,
|
| + },
|
| + {
|
| + 'a|web/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head></head>
|
| @@ -79,7 +85,7 @@ main() {
|
| </body>
|
| </html>
|
| ''',
|
| - 'a|web/index.bootstrap.initialize.dart': '''
|
| + 'a|web/index.bootstrap.initialize.dart': '''
|
| import 'package:initialize/src/static_loader.dart';
|
| import 'package:initialize/initialize.dart';
|
| import 'index.bootstrap.dart' as i0;
|
| @@ -96,7 +102,7 @@ main() {
|
| return i0.main();
|
| }
|
| ''',
|
| - 'a|web/index.bootstrap.dart': '''
|
| + 'a|web/index.bootstrap.dart': '''
|
| library a.web.index_bootstrap_dart;
|
|
|
| import 'index.html.0.dart' as i0;
|
| @@ -105,7 +111,7 @@ main() {
|
|
|
| main() => i2.main();
|
| ''',
|
| - 'a|web/index.html.0.dart': '''
|
| + 'a|web/index.html.0.dart': '''
|
| // Must use package:urls inside inline script tags,
|
| @HtmlImport('package:b/bar_nodart.html')
|
| library b.bar;
|
| @@ -117,10 +123,15 @@ main() {
|
| @initMethod
|
| bar() {}
|
| ''',
|
| - }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
|
| + },
|
| + messages: [],
|
| + formatter: StringFormatter.noNewlinesOrSurroundingWhitespace);
|
|
|
| - testPhases('imports go above the dart script', phases, {
|
| - 'b|web/index.html': '''
|
| + testPhases(
|
| + 'imports go above the dart script',
|
| + phases,
|
| + {
|
| + 'b|web/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| @@ -132,29 +143,31 @@ main() {
|
| </body>
|
| </html>
|
| ''',
|
| - 'b|web/index.dart': '''
|
| + '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': '''
|
| + 'b|lib/b.html': '''
|
| <div>b</div>
|
| ''',
|
| - 'c|lib/c.dart': '''
|
| + 'c|lib/c.dart': '''
|
| @HtmlImport('c.html')
|
| library c;
|
|
|
| import 'package:web_components/html_import_annotation.dart';
|
| ''',
|
| - 'c|lib/c.html': '''
|
| + 'c|lib/c.html': '''
|
| <div>c</div>
|
| ''',
|
| - 'initialize|lib/initialize.dart': mockInitialize,
|
| - 'web_components|lib/html_import_annotation.dart': mockHtmlImportAnnotation,
|
| - }, {
|
| - 'b|web/index.html': '''
|
| + 'initialize|lib/initialize.dart': mockInitialize,
|
| + 'web_components|lib/html_import_annotation.dart':
|
| + mockHtmlImportAnnotation,
|
| + },
|
| + {
|
| + 'b|web/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| @@ -171,10 +184,15 @@ main() {
|
| </body>
|
| </html>
|
| ''',
|
| - }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
|
| + },
|
| + messages: [],
|
| + formatter: StringFormatter.noNewlinesOrSurroundingWhitespace);
|
|
|
| - testPhases('test compatibility', phases, {
|
| - 'a|test/index.html': '''
|
| + testPhases(
|
| + 'test compatibility',
|
| + phases,
|
| + {
|
| + 'a|test/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| @@ -184,15 +202,17 @@ main() {
|
| <body></body>
|
| </html>
|
| ''',
|
| - 'a|test/index.dart': '''
|
| + 'a|test/index.dart': '''
|
| library a;
|
|
|
| main() {}
|
| ''',
|
| - 'initialize|lib/initialize.dart': mockInitialize,
|
| - 'web_components|lib/html_import_annotation.dart': mockHtmlImportAnnotation,
|
| - }, {
|
| - 'a|test/index.html': '''
|
| + 'initialize|lib/initialize.dart': mockInitialize,
|
| + 'web_components|lib/html_import_annotation.dart':
|
| + mockHtmlImportAnnotation,
|
| + },
|
| + {
|
| + 'a|test/index.html': '''
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| @@ -202,5 +222,7 @@ main() {
|
| <body></body>
|
| </html>
|
| ''',
|
| - }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
|
| + },
|
| + messages: [],
|
| + formatter: StringFormatter.noNewlinesOrSurroundingWhitespace);
|
| }
|
|
|