OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library web_components.test.build.transformer_test; | 4 library web_components.test.build.transformer_test; |
5 | 5 |
6 import 'package:code_transformers/tests.dart'; | 6 import 'package:code_transformers/tests.dart'; |
7 import 'package:web_components/transformer.dart'; | 7 import 'package:web_components/transformer.dart'; |
8 import 'package:unittest/compact_vm_config.dart'; | 8 import 'package:unittest/compact_vm_config.dart'; |
9 import 'common.dart'; | 9 import 'common.dart'; |
10 | 10 |
11 var transformer = new WebComponentsTransformerGroup( | 11 var transformer = new WebComponentsTransformerGroup( |
12 new TransformOptions(['web/index.html'], false)); | 12 new TransformOptions(['web/index.html', 'test/index.html'], false)); |
13 var phases = [[transformer]]; | 13 var phases = [[transformer]]; |
14 | 14 |
15 main() { | 15 main() { |
16 useCompactVMConfiguration(); | 16 useCompactVMConfiguration(); |
17 | 17 |
18 testPhases('full app', phases, { | 18 testPhases('full app', phases, { |
19 'a|web/index.html': ''' | 19 'a|web/index.html': ''' |
20 <!DOCTYPE html> | 20 <!DOCTYPE html> |
21 <html> | 21 <html> |
22 <head> | 22 <head> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 <div>c</div> | 165 <div>c</div> |
166 <div>b</div> | 166 <div>b</div> |
167 <script type="application/dart" src="index.bootstrap.initialize.da
rt"> | 167 <script type="application/dart" src="index.bootstrap.initialize.da
rt"> |
168 </script> | 168 </script> |
169 <script>var y;</script> | 169 <script>var y;</script> |
170 </div> | 170 </div> |
171 </body> | 171 </body> |
172 </html> | 172 </html> |
173 ''', | 173 ''', |
174 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); | 174 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); |
| 175 |
| 176 testPhases('test compatibility', phases, { |
| 177 'a|test/index.html': ''' |
| 178 <!DOCTYPE html> |
| 179 <html> |
| 180 <head> |
| 181 <link rel="x-dart-test" href="index.dart"> |
| 182 <script src="packages/test/dart.js"></script> |
| 183 </head> |
| 184 <body></body> |
| 185 </html> |
| 186 ''', |
| 187 'a|test/index.dart': ''' |
| 188 library a; |
| 189 |
| 190 main() {} |
| 191 ''', |
| 192 'initialize|lib/initialize.dart': mockInitialize, |
| 193 'web_components|lib/html_import_annotation.dart': mockHtmlImportAnnotation, |
| 194 }, { |
| 195 'a|test/index.html': ''' |
| 196 <!DOCTYPE html> |
| 197 <html> |
| 198 <head> |
| 199 <link rel="x-dart-test" href="index.bootstrap.initialize.dart"> |
| 200 <script src="packages/test/dart.js"></script> |
| 201 </head> |
| 202 <body></body> |
| 203 </html> |
| 204 ''', |
| 205 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); |
175 } | 206 } |
OLD | NEW |