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

Side by Side Diff: test/build/test_compatibility_test.dart

Issue 1104453007: add support for x-dart-test link tags in the new test package (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: clarify some comments, and make sure the test/dart.js script remains in the right place Created 5 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 unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | test/build/transformer_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 library web_components.test.build.test_compatibility_test;
5
6 import 'package:code_transformers/tests.dart';
7 import 'package:web_components/build/test_compatibility.dart';
8 import 'package:unittest/compact_vm_config.dart';
9 import 'package:unittest/unittest.dart';
10
11 var start = new RewriteXDartTestToScript(null);
12 var end = new RewriteScriptToXDartTest(null);
13
14 main() {
15 useCompactVMConfiguration();
16
17 testPhases('can rewrite x-dart-test link tags to script tags', [[start]], {
18 'a|test/index.html': '''
19 <!DOCTYPE html>
20 <html>
21 <head>
22 <link rel="x-dart-test" href="foo.dart">
23 </head>
24 <body></body>
25 </html>''',
26 }, {
27 'a|test/index.html': '''
28 <!DOCTYPE html>
29 <html>
30 <head>
31 <script type="application/dart" src="foo.dart" $testAttribute="">
32 </script>
33 </head>
34 <body></body>
35 </html>''',
36 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
37
38
39 testPhases('can rewrite script tags to x-dart-test link tags', [[end]], {
40 'a|test/index.html': '''
41 <!DOCTYPE html>
42 <html>
43 <head>
44 <script type="application/dart" src="foo.dart" $testAttribute="">
45 </script>
46 </head>
47 <body></body>
48 </html>''',
49 }, {
50 'a|test/index.html': '''
51 <!DOCTYPE html>
52 <html>
53 <head>
54 <link rel="x-dart-test" href="foo.dart">
55 </head>
56 <body></body>
57 </html>''',
58 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
59
60
61 testPhases('restores original application at the end', [[start], [end]], {
62 'a|test/index.html': '''
63 <!DOCTYPE html>
64 <html>
65 <head>
66 <link rel="x-dart-test" href="foo.dart">
67 </head>
68 <body></body>
69 </html>''',
70 }, {
71 'a|test/index.html': '''
72 <!DOCTYPE html>
73 <html>
74 <head>
75 <link rel="x-dart-test" href="foo.dart">
76 </head>
77 <body></body>
78 </html>''',
79 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
80 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/build/transformer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698