OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 4 |
5 library polymer.test.build.script_compactor_test; | 5 library polymer.test.build.script_compactor_test; |
6 | 6 |
7 import 'package:polymer/src/build/common.dart'; | 7 import 'package:polymer/src/build/common.dart'; |
8 import 'package:polymer/src/build/script_compactor.dart'; | 8 import 'package:polymer/src/build/script_compactor.dart'; |
9 import 'package:unittest/compact_vm_config.dart'; | 9 import 'package:unittest/compact_vm_config.dart'; |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 'a|web/a.dart': 'library a;\nmain(){}', | 39 'a|web/a.dart': 'library a;\nmain(){}', |
40 }, { | 40 }, { |
41 'a|web/test.html': | 41 'a|web/test.html': |
42 '<!DOCTYPE html><html><head>' | 42 '<!DOCTYPE html><html><head>' |
43 '<script type="application/dart" ' | 43 '<script type="application/dart" ' |
44 'src="test.html_bootstrap.dart"></script>' | 44 'src="test.html_bootstrap.dart"></script>' |
45 '</head><body></body></html>', | 45 '</head><body></body></html>', |
46 | 46 |
47 'a|web/test.html_bootstrap.dart': | 47 'a|web/test.html_bootstrap.dart': |
48 '''$MAIN_HEADER | 48 '''$MAIN_HEADER |
49 import 'a.dart_modified.dart' as i0; | 49 import 'a.dart' as i0; |
50 | 50 |
51 void main() { | 51 void main() { |
52 configureForDeployment([ | 52 configureForDeployment([ |
53 'a.dart_modified.dart', | 53 'a.dart', |
54 ]); | 54 ]); |
55 i0.polymerMainWrapper(); | 55 i0.main(); |
56 } | 56 } |
57 '''.replaceAll('\n ', '\n'), | 57 '''.replaceAll('\n ', '\n'), |
58 'a|web/a.dart': 'library a;\nmain(){}', | 58 'a|web/a.dart': 'library a;\nmain(){}', |
59 'a|web/a.dart_modified.dart': | |
60 'library a;\nmain(){}' | |
61 '\n\npolymerMainWrapper() => main();\n', | |
62 }); | 59 }); |
63 | 60 |
64 testPhases('several scripts', phases, { | 61 testPhases('several scripts', phases, { |
65 'a|web/test.html': | 62 'a|web/test.html': |
66 '<!DOCTYPE html><html><head>' | 63 '<!DOCTYPE html><html><head>' |
67 '</head><body><div>' | 64 '</head><body><div>' |
68 '<script type="application/dart" src="d.dart"></script>' | 65 '<script type="application/dart" src="d.dart"></script>' |
69 '</div>', | 66 '</div>', |
70 'a|web/test.html.scriptUrls': | 67 'a|web/test.html.scriptUrls': |
71 '[["a", "web/a.dart"],["a", "web/b.dart"],["a", "web/c.dart"]]', | 68 '[["a", "web/a.dart"],["a", "web/b.dart"],["a", "web/c.dart"]]', |
72 'a|web/d.dart': 'library d;\nmain(){}', | 69 'a|web/d.dart': 'library d;\nmain(){}', |
73 }, { | 70 }, { |
74 'a|web/test.html': | 71 'a|web/test.html': |
75 '<!DOCTYPE html><html><head></head><body><div>' | 72 '<!DOCTYPE html><html><head></head><body><div>' |
76 '<script type="application/dart" src="test.html_bootstrap.dart">' | 73 '<script type="application/dart" src="test.html_bootstrap.dart">' |
77 '</script>' | 74 '</script>' |
78 '</div>' | 75 '</div>' |
79 '</body></html>', | 76 '</body></html>', |
80 | 77 |
81 'a|web/test.html_bootstrap.dart': | 78 'a|web/test.html_bootstrap.dart': |
82 '''$MAIN_HEADER | 79 '''$MAIN_HEADER |
83 import 'a.dart' as i0; | 80 import 'a.dart' as i0; |
84 import 'b.dart' as i1; | 81 import 'b.dart' as i1; |
85 import 'c.dart' as i2; | 82 import 'c.dart' as i2; |
86 import 'd.dart_modified.dart' as i3; | 83 import 'd.dart' as i3; |
87 | 84 |
88 void main() { | 85 void main() { |
89 configureForDeployment([ | 86 configureForDeployment([ |
90 'a.dart', | 87 'a.dart', |
91 'b.dart', | 88 'b.dart', |
92 'c.dart', | 89 'c.dart', |
93 'd.dart_modified.dart', | 90 'd.dart', |
94 ]); | 91 ]); |
95 i3.polymerMainWrapper(); | 92 i3.main(); |
96 } | 93 } |
97 '''.replaceAll('\n ', '\n'), | 94 '''.replaceAll('\n ', '\n'), |
98 }); | 95 }); |
99 } | 96 } |
OLD | NEW |