| 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:code_transformers/tests.dart' show testingDartSdkDirectory; | 7 import 'package:code_transformers/tests.dart' show testingDartSdkDirectory; |
| 8 import 'package:polymer/src/build/common.dart'; | 8 import 'package:polymer/src/build/common.dart'; |
| 9 import 'package:polymer/src/build/messages.dart'; | 9 import 'package:polymer/src/build/messages.dart'; |
| 10 import 'package:polymer/src/build/script_compactor.dart' show MAIN_HEADER; | 10 import 'package:polymer/src/build/script_compactor.dart' show MAIN_HEADER; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 testPhases('single script', phases, { | 36 testPhases('single script', phases, { |
| 37 'a|web/test.html': | 37 'a|web/test.html': |
| 38 '<!DOCTYPE html><html><head>' | 38 '<!DOCTYPE html><html><head>' |
| 39 '<link rel="import" href="packages/polymer/polymer.html">' | 39 '<link rel="import" href="packages/polymer/polymer.html">' |
| 40 '<script type="application/dart" src="a.dart"></script>', | 40 '<script type="application/dart" src="a.dart"></script>', |
| 41 'a|web/a.dart': _sampleInput('A', 'foo'), | 41 'a|web/a.dart': _sampleInput('A', 'foo'), |
| 42 }, { | 42 }, { |
| 43 'a|web/test.html': | 43 'a|web/test.html': |
| 44 '<!DOCTYPE html><html><head>' | 44 '<!DOCTYPE html><html><head>' |
| 45 '$WEB_COMPONENTS_TAG' | 45 '$COMPATIBILITY_JS_TAGS' |
| 46 '</head><body>' | 46 '</head><body>' |
| 47 '<script src="test.html_bootstrap.dart.js" async=""></script>' | 47 '<script src="test.html_bootstrap.dart.js" async=""></script>' |
| 48 '</body></html>', | 48 '</body></html>', |
| 49 | 49 |
| 50 'a|web/test.html_bootstrap.dart': | 50 'a|web/test.html_bootstrap.dart': |
| 51 '''$MAIN_HEADER | 51 '''$MAIN_HEADER |
| 52 import 'a.dart' as i0; | 52 import 'a.dart' as i0; |
| 53 ${DEFAULT_IMPORTS.join('\n')} | 53 ${DEFAULT_IMPORTS.join('\n')} |
| 54 import 'a.dart' as smoke_0; | 54 import 'a.dart' as smoke_0; |
| 55 import 'package:polymer/polymer.dart' as smoke_1; | 55 import 'package:polymer/polymer.dart' as smoke_1; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 testPhases('single inline script', phases, { | 76 testPhases('single inline script', phases, { |
| 77 'a|web/test.html': | 77 'a|web/test.html': |
| 78 '<!DOCTYPE html><html><head>' | 78 '<!DOCTYPE html><html><head>' |
| 79 '<link rel="import" href="packages/polymer/polymer.html">' | 79 '<link rel="import" href="packages/polymer/polymer.html">' |
| 80 '<script type="application/dart">' | 80 '<script type="application/dart">' |
| 81 '${_sampleInput("B", "bar")}</script>', | 81 '${_sampleInput("B", "bar")}</script>', |
| 82 }, { | 82 }, { |
| 83 'a|web/test.html': | 83 'a|web/test.html': |
| 84 '<!DOCTYPE html><html><head>' | 84 '<!DOCTYPE html><html><head>' |
| 85 '$WEB_COMPONENTS_TAG' | 85 '$COMPATIBILITY_JS_TAGS' |
| 86 '</head><body>' | 86 '</head><body>' |
| 87 '<script src="test.html_bootstrap.dart.js" async=""></script>' | 87 '<script src="test.html_bootstrap.dart.js" async=""></script>' |
| 88 '</body></html>', | 88 '</body></html>', |
| 89 | 89 |
| 90 'a|web/test.html_bootstrap.dart': | 90 'a|web/test.html_bootstrap.dart': |
| 91 '''$MAIN_HEADER | 91 '''$MAIN_HEADER |
| 92 import 'test.html.0.dart' as i0; | 92 import 'test.html.0.dart' as i0; |
| 93 ${DEFAULT_IMPORTS.join('\n')} | 93 ${DEFAULT_IMPORTS.join('\n')} |
| 94 import 'test.html.0.dart' as smoke_0; | 94 import 'test.html.0.dart' as smoke_0; |
| 95 import 'package:polymer/polymer.dart' as smoke_1; | 95 import 'package:polymer/polymer.dart' as smoke_1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 123 '${_sampleInput("B", "bar")}</script>' | 123 '${_sampleInput("B", "bar")}</script>' |
| 124 '</head><body><div>\n' | 124 '</head><body><div>\n' |
| 125 '<script type="application/dart">' | 125 '<script type="application/dart">' |
| 126 '${_sampleInput("C", "car")}</script>' | 126 '${_sampleInput("C", "car")}</script>' |
| 127 '</div>\n' | 127 '</div>\n' |
| 128 '<script type="application/dart" src="d.dart"></script>', | 128 '<script type="application/dart" src="d.dart"></script>', |
| 129 'a|web/a.dart': _sampleInput('A', 'foo'), | 129 'a|web/a.dart': _sampleInput('A', 'foo'), |
| 130 }, { | 130 }, { |
| 131 'a|web/test.html': | 131 'a|web/test.html': |
| 132 '<!DOCTYPE html><html><head>' | 132 '<!DOCTYPE html><html><head>' |
| 133 '$WEB_COMPONENTS_TAG\n\n' | 133 '$COMPATIBILITY_JS_TAGS\n\n' |
| 134 '</head><body>' | 134 '</head><body>' |
| 135 '<div>\n</div>\n' | 135 '<div>\n</div>\n' |
| 136 '<script src="test.html_bootstrap.dart.js" async=""></script>' | 136 '<script src="test.html_bootstrap.dart.js" async=""></script>' |
| 137 '</body></html>', | 137 '</body></html>', |
| 138 'a|web/test.html_bootstrap.dart': | 138 'a|web/test.html_bootstrap.dart': |
| 139 '''$MAIN_HEADER | 139 '''$MAIN_HEADER |
| 140 import 'a.dart' as i0; | 140 import 'a.dart' as i0; |
| 141 import 'test.html.0.dart' as i1; | 141 import 'test.html.0.dart' as i1; |
| 142 import 'test.html.1.dart' as i2; | 142 import 'test.html.1.dart' as i2; |
| 143 ${DEFAULT_IMPORTS.join('\n')} | 143 ${DEFAULT_IMPORTS.join('\n')} |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 '<!DOCTYPE html><html><head>' | 193 '<!DOCTYPE html><html><head>' |
| 194 '<link rel="import" href="../../packages/polymer/polymer.html">' | 194 '<link rel="import" href="../../packages/polymer/polymer.html">' |
| 195 '</head><body>' | 195 '</head><body>' |
| 196 '<polymer-element name="x-a">1' | 196 '<polymer-element name="x-a">1' |
| 197 '<script type="application/dart">' | 197 '<script type="application/dart">' |
| 198 '${_sampleInput("A", "foo")}</script>' | 198 '${_sampleInput("A", "foo")}</script>' |
| 199 '</polymer-element></html>', | 199 '</polymer-element></html>', |
| 200 }, { | 200 }, { |
| 201 'a|web/index.html': | 201 'a|web/index.html': |
| 202 '<!DOCTYPE html><html><head>' | 202 '<!DOCTYPE html><html><head>' |
| 203 '$WEB_COMPONENTS_TAG' | 203 '$COMPATIBILITY_JS_TAGS' |
| 204 '</head><body>' | 204 '</head><body>' |
| 205 '<div hidden="">' | 205 '<div hidden="">' |
| 206 '<polymer-element name="x-a">1</polymer-element>' | 206 '<polymer-element name="x-a">1</polymer-element>' |
| 207 '</div>' | 207 '</div>' |
| 208 '<script src="index.html_bootstrap.dart.js" async=""></script>' | 208 '<script src="index.html_bootstrap.dart.js" async=""></script>' |
| 209 '</body></html>', | 209 '</body></html>', |
| 210 'a|web/index.html_bootstrap.dart': | 210 'a|web/index.html_bootstrap.dart': |
| 211 '''$MAIN_HEADER | 211 '''$MAIN_HEADER |
| 212 import 'index.html.0.dart' as i0; | 212 import 'index.html.0.dart' as i0; |
| 213 import 'b.dart' as i1; | 213 import 'b.dart' as i1; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 '<polymer-element name="x-a">1' | 255 '<polymer-element name="x-a">1' |
| 256 '<script type="application/dart">' | 256 '<script type="application/dart">' |
| 257 '${_sampleInput("A", "foo")}</script>' | 257 '${_sampleInput("A", "foo")}</script>' |
| 258 '</polymer-element></html>', | 258 '</polymer-element></html>', |
| 259 'a|lib/load_b.html': | 259 'a|lib/load_b.html': |
| 260 '<!DOCTYPE html><html><head></head><body>' | 260 '<!DOCTYPE html><html><head></head><body>' |
| 261 '<script type="application/dart" src="b.dart"></script>', | 261 '<script type="application/dart" src="b.dart"></script>', |
| 262 }, { | 262 }, { |
| 263 'a|web/index.html': | 263 'a|web/index.html': |
| 264 '<!DOCTYPE html><html><head>' | 264 '<!DOCTYPE html><html><head>' |
| 265 '$WEB_COMPONENTS_TAG' | 265 '$COMPATIBILITY_JS_TAGS' |
| 266 '</head><body>' | 266 '</head><body>' |
| 267 '<div hidden="">' | 267 '<div hidden="">' |
| 268 '<polymer-element name="x-a">1</polymer-element>' | 268 '<polymer-element name="x-a">1</polymer-element>' |
| 269 '</div>' | 269 '</div>' |
| 270 '<script src="index.html_bootstrap.dart.js" async=""></script>' | 270 '<script src="index.html_bootstrap.dart.js" async=""></script>' |
| 271 '</body></html>', | 271 '</body></html>', |
| 272 'a|web/index.html_bootstrap.dart': | 272 'a|web/index.html_bootstrap.dart': |
| 273 '''$MAIN_HEADER | 273 '''$MAIN_HEADER |
| 274 import 'index.html.0.dart' as i0; | 274 import 'index.html.0.dart' as i0; |
| 275 import 'package:a/b.dart' as i1; | 275 import 'package:a/b.dart' as i1; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 @CustomTag('x-$className') | 341 @CustomTag('x-$className') |
| 342 class X${className} extends PolymerElement { | 342 class X${className} extends PolymerElement { |
| 343 X${className}.created() : super.created(); | 343 X${className}.created() : super.created(); |
| 344 } | 344 } |
| 345 @initMethod m_$fieldName() {} | 345 @initMethod m_$fieldName() {} |
| 346 main() {} | 346 main() {} |
| 347 '''; | 347 '''; |
| 348 } | 348 } |
| OLD | NEW |