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.all_phases_test; | 5 library polymer.test.build.all_phases_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' show MAIN_HEADER; | 8 import 'package:polymer/src/build/script_compactor.dart' show MAIN_HEADER; |
9 import 'package:polymer/transformer.dart'; | 9 import 'package:polymer/transformer.dart'; |
10 import 'package:unittest/compact_vm_config.dart'; | 10 import 'package:unittest/compact_vm_config.dart'; |
(...skipping 22 matching lines...) Expand all Loading... |
33 'a|web/test.html': | 33 'a|web/test.html': |
34 '<!DOCTYPE html><html><head>' | 34 '<!DOCTYPE html><html><head>' |
35 '<script type="application/dart" src="a.dart"></script>', | 35 '<script type="application/dart" src="a.dart"></script>', |
36 'a|web/test.dart': _sampleObservable('A', 'foo'), | 36 'a|web/test.dart': _sampleObservable('A', 'foo'), |
37 }, { | 37 }, { |
38 'a|web/test.html': | 38 'a|web/test.html': |
39 '<!DOCTYPE html><html><head></head><body>' | 39 '<!DOCTYPE html><html><head></head><body>' |
40 '$SHADOW_DOM_TAG' | 40 '$SHADOW_DOM_TAG' |
41 '$CUSTOM_ELEMENT_TAG' | 41 '$CUSTOM_ELEMENT_TAG' |
42 '$INTEROP_TAG' | 42 '$INTEROP_TAG' |
43 '<script type="application/dart" ' | 43 '<script src="test.html_bootstrap.dart.js"></script>' |
44 'src="test.html_bootstrap.dart"></script>' | |
45 '<script src="packages/browser/dart.js"></script>' | |
46 '</body></html>', | 44 '</body></html>', |
47 | 45 |
48 'a|web/test.html_bootstrap.dart': | 46 'a|web/test.html_bootstrap.dart': |
49 '''$MAIN_HEADER | 47 '''$MAIN_HEADER |
50 import 'a.dart' as i0; | 48 import 'a.dart' as i0; |
51 | 49 |
52 void main() { | 50 void main() { |
53 initPolymer([ | 51 initPolymer([ |
54 'a.dart', | 52 'a.dart', |
55 ]); | 53 ]); |
56 } | 54 } |
57 '''.replaceAll('\n ', '\n'), | 55 '''.replaceAll('\n ', '\n'), |
58 'a|web/test.dart': _sampleObservableOutput('A', 'foo'), | 56 'a|web/test.dart': _sampleObservableOutput('A', 'foo'), |
59 }); | 57 }); |
60 | 58 |
61 testPhases('single inline script', phases, { | 59 testPhases('single inline script', phases, { |
62 'a|web/test.html': | 60 'a|web/test.html': |
63 '<!DOCTYPE html><html><head>' | 61 '<!DOCTYPE html><html><head>' |
64 '<script type="application/dart">' | 62 '<script type="application/dart">' |
65 '${_sampleObservable("B", "bar")}</script>', | 63 '${_sampleObservable("B", "bar")}</script>', |
66 }, { | 64 }, { |
67 'a|web/test.html': | 65 'a|web/test.html': |
68 '<!DOCTYPE html><html><head></head><body>' | 66 '<!DOCTYPE html><html><head></head><body>' |
69 '$SHADOW_DOM_TAG' | 67 '$SHADOW_DOM_TAG' |
70 '$CUSTOM_ELEMENT_TAG' | 68 '$CUSTOM_ELEMENT_TAG' |
71 '$INTEROP_TAG' | 69 '$INTEROP_TAG' |
72 '<script type="application/dart" ' | 70 '<script src="test.html_bootstrap.dart.js"></script>' |
73 'src="test.html_bootstrap.dart"></script>' | |
74 '<script src="packages/browser/dart.js"></script>' | |
75 '</body></html>', | 71 '</body></html>', |
76 | 72 |
77 'a|web/test.html_bootstrap.dart': | 73 'a|web/test.html_bootstrap.dart': |
78 '''$MAIN_HEADER | 74 '''$MAIN_HEADER |
79 import 'test.html.0.dart' as i0; | 75 import 'test.html.0.dart' as i0; |
80 | 76 |
81 void main() { | 77 void main() { |
82 initPolymer([ | 78 initPolymer([ |
83 'test.html.0.dart', | 79 'test.html.0.dart', |
84 ]); | 80 ]); |
(...skipping 14 matching lines...) Expand all Loading... |
99 '</div>' | 95 '</div>' |
100 '<script type="application/dart" src="d.dart"></script>', | 96 '<script type="application/dart" src="d.dart"></script>', |
101 'a|web/a.dart': _sampleObservable('A', 'foo'), | 97 'a|web/a.dart': _sampleObservable('A', 'foo'), |
102 }, { | 98 }, { |
103 'a|web/test.html': | 99 'a|web/test.html': |
104 '<!DOCTYPE html><html><head></head><body>' | 100 '<!DOCTYPE html><html><head></head><body>' |
105 '$SHADOW_DOM_TAG' | 101 '$SHADOW_DOM_TAG' |
106 '$CUSTOM_ELEMENT_TAG' | 102 '$CUSTOM_ELEMENT_TAG' |
107 '$INTEROP_TAG' | 103 '$INTEROP_TAG' |
108 '<div></div>' | 104 '<div></div>' |
109 '<script type="application/dart" ' | 105 '<script src="test.html_bootstrap.dart.js"></script>' |
110 'src="test.html_bootstrap.dart"></script>' | |
111 '<script src="packages/browser/dart.js"></script>' | |
112 '</body></html>', | 106 '</body></html>', |
113 | 107 |
114 'a|web/test.html_bootstrap.dart': | 108 'a|web/test.html_bootstrap.dart': |
115 '''$MAIN_HEADER | 109 '''$MAIN_HEADER |
116 import 'a.dart' as i0; | 110 import 'a.dart' as i0; |
117 import 'test.html.0.dart' as i1; | 111 import 'test.html.0.dart' as i1; |
118 import 'test.html.1.dart' as i2; | 112 import 'test.html.1.dart' as i2; |
119 import 'd.dart' as i3; | 113 import 'd.dart' as i3; |
120 | 114 |
121 void main() { | 115 void main() { |
(...skipping 25 matching lines...) Expand all Loading... |
147 '<script type="application/dart">' | 141 '<script type="application/dart">' |
148 '${_sampleObservable("A", "foo")}</script>' | 142 '${_sampleObservable("A", "foo")}</script>' |
149 '</polymer-element></html>', | 143 '</polymer-element></html>', |
150 }, { | 144 }, { |
151 'a|web/index.html': | 145 'a|web/index.html': |
152 '<!DOCTYPE html><html><head></head><body>' | 146 '<!DOCTYPE html><html><head></head><body>' |
153 '$SHADOW_DOM_TAG' | 147 '$SHADOW_DOM_TAG' |
154 '$CUSTOM_ELEMENT_TAG' | 148 '$CUSTOM_ELEMENT_TAG' |
155 '$INTEROP_TAG' | 149 '$INTEROP_TAG' |
156 '<polymer-element>1</polymer-element>' | 150 '<polymer-element>1</polymer-element>' |
157 '<script type="application/dart" ' | 151 '<script src="index.html_bootstrap.dart.js"></script>' |
158 'src="index.html_bootstrap.dart"></script>' | |
159 '<script src="packages/browser/dart.js"></script>' | |
160 '</body></html>', | 152 '</body></html>', |
161 'a|web/index.html_bootstrap.dart': | 153 'a|web/index.html_bootstrap.dart': |
162 '''$MAIN_HEADER | 154 '''$MAIN_HEADER |
163 import 'test2.html.0.dart' as i0; | 155 import 'test2.html.0.dart' as i0; |
164 import 'b.dart' as i1; | 156 import 'b.dart' as i1; |
165 import 'index.html.0.dart' as i2; | 157 import 'index.html.0.dart' as i2; |
166 | 158 |
167 void main() { | 159 void main() { |
168 initPolymer([ | 160 initPolymer([ |
169 'test2.html.0.dart', | 161 'test2.html.0.dart', |
(...skipping 22 matching lines...) Expand all Loading... |
192 "library ${className}_$field;\n" | 184 "library ${className}_$field;\n" |
193 "import 'package:observe/observe.dart';\n\n" | 185 "import 'package:observe/observe.dart';\n\n" |
194 "class $className extends ChangeNotifier {\n" | 186 "class $className extends ChangeNotifier {\n" |
195 " @reflectable @observable int get $field => __\$$field; " | 187 " @reflectable @observable int get $field => __\$$field; " |
196 "int __\$$field; " | 188 "int __\$$field; " |
197 "@reflectable set $field(int value) { " | 189 "@reflectable set $field(int value) { " |
198 "__\$$field = notifyPropertyChange(#$field, __\$$field, value); " | 190 "__\$$field = notifyPropertyChange(#$field, __\$$field, value); " |
199 "}\n" | 191 "}\n" |
200 " $className($field) : __\$$field = $field;\n" | 192 " $className($field) : __\$$field = $field;\n" |
201 "}\n"; | 193 "}\n"; |
OLD | NEW |