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 @TestOn('vm') |
4 library web_components.test.build.test_compatibility_test; | 5 library web_components.test.build.test_compatibility_test; |
5 | 6 |
6 import 'package:code_transformers/tests.dart'; | 7 import 'package:transformer_test/utils.dart'; |
7 import 'package:web_components/build/test_compatibility.dart'; | 8 import 'package:web_components/build/test_compatibility.dart'; |
8 import 'package:unittest/compact_vm_config.dart'; | 9 import 'package:test/test.dart'; |
9 import 'package:unittest/unittest.dart'; | |
10 | 10 |
11 var start = new RewriteXDartTestToScript(null); | 11 var start = new RewriteXDartTestToScript(null); |
12 var end = new RewriteScriptToXDartTest(null); | 12 var end = new RewriteScriptToXDartTest(null); |
13 | 13 |
14 main() { | 14 main() { |
15 useCompactVMConfiguration(); | 15 testPhases( |
16 | 16 'can rewrite x-dart-test link tags to script tags', |
17 testPhases('can rewrite x-dart-test link tags to script tags', [[start]], { | 17 [ |
18 'a|test/index.html': ''' | 18 [start] |
| 19 ], |
| 20 { |
| 21 'a|test/index.html': ''' |
19 <!DOCTYPE html> | 22 <!DOCTYPE html> |
20 <html> | 23 <html> |
21 <head> | 24 <head> |
22 <link rel="x-dart-test" href="foo.dart"> | 25 <link rel="x-dart-test" href="foo.dart"> |
23 </head> | 26 </head> |
24 <body></body> | 27 <body></body> |
25 </html>''', | 28 </html>''', |
26 }, { | 29 }, |
27 'a|test/index.html': ''' | 30 { |
| 31 'a|test/index.html': ''' |
28 <!DOCTYPE html> | 32 <!DOCTYPE html> |
29 <html> | 33 <html> |
30 <head> | 34 <head> |
31 <script type="application/dart" src="foo.dart" $testAttribute=""> | 35 <script type="application/dart" src="foo.dart" $testAttribute=""> |
32 </script> | 36 </script> |
33 </head> | 37 </head> |
34 <body></body> | 38 <body></body> |
35 </html>''', | 39 </html>''', |
36 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); | 40 }, |
| 41 messages: [], |
| 42 formatter: StringFormatter.noNewlinesOrSurroundingWhitespace); |
37 | 43 |
38 testPhases('can rewrite script tags to x-dart-test link tags', [[end]], { | 44 testPhases( |
39 'a|test/index.html': ''' | 45 'can rewrite script tags to x-dart-test link tags', |
| 46 [ |
| 47 [end] |
| 48 ], |
| 49 { |
| 50 'a|test/index.html': ''' |
40 <!DOCTYPE html> | 51 <!DOCTYPE html> |
41 <html> | 52 <html> |
42 <head> | 53 <head> |
43 <script type="application/dart" src="foo.dart" $testAttribute=""> | 54 <script type="application/dart" src="foo.dart" $testAttribute=""> |
44 </script> | 55 </script> |
45 </head> | 56 </head> |
46 <body></body> | 57 <body></body> |
47 </html>''', | 58 </html>''', |
48 }, { | 59 }, |
49 'a|test/index.html': ''' | 60 { |
| 61 'a|test/index.html': ''' |
50 <!DOCTYPE html> | 62 <!DOCTYPE html> |
51 <html> | 63 <html> |
52 <head> | 64 <head> |
53 <link rel="x-dart-test" href="foo.dart"> | 65 <link rel="x-dart-test" href="foo.dart"> |
54 </head> | 66 </head> |
55 <body></body> | 67 <body></body> |
56 </html>''', | 68 </html>''', |
57 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); | 69 }, |
| 70 messages: [], |
| 71 formatter: StringFormatter.noNewlinesOrSurroundingWhitespace); |
58 | 72 |
59 testPhases('restores original application at the end', [[start], [end]], { | 73 testPhases( |
60 'a|test/index.html': ''' | 74 'restores original application at the end', |
| 75 [ |
| 76 [start], |
| 77 [end] |
| 78 ], |
| 79 { |
| 80 'a|test/index.html': ''' |
61 <!DOCTYPE html> | 81 <!DOCTYPE html> |
62 <html> | 82 <html> |
63 <head> | 83 <head> |
64 <link rel="x-dart-test" href="foo.dart"> | 84 <link rel="x-dart-test" href="foo.dart"> |
65 </head> | 85 </head> |
66 <body></body> | 86 <body></body> |
67 </html>''', | 87 </html>''', |
68 }, { | 88 }, |
69 'a|test/index.html': ''' | 89 { |
| 90 'a|test/index.html': ''' |
70 <!DOCTYPE html> | 91 <!DOCTYPE html> |
71 <html> | 92 <html> |
72 <head> | 93 <head> |
73 <link rel="x-dart-test" href="foo.dart"> | 94 <link rel="x-dart-test" href="foo.dart"> |
74 </head> | 95 </head> |
75 <body></body> | 96 <body></body> |
76 </html>''', | 97 </html>''', |
77 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); | 98 }, |
| 99 messages: [], |
| 100 formatter: StringFormatter.noNewlinesOrSurroundingWhitespace); |
78 } | 101 } |
OLD | NEW |