| 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 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:code_transformers/tests.dart' show testingDartSdkDirectory; | 9 import 'package:code_transformers/tests.dart' show testingDartSdkDirectory; |
| 10 import 'package:polymer/src/build/common.dart'; | 10 import 'package:polymer/src/build/common.dart'; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 '''.replaceAll('\n ', '\n'), | 239 '''.replaceAll('\n ', '\n'), |
| 240 | 240 |
| 241 }, []); | 241 }, []); |
| 242 | 242 |
| 243 testPhases('several scripts', phases, { | 243 testPhases('several scripts', phases, { |
| 244 'a|web/test.html': | 244 'a|web/test.html': |
| 245 '<!DOCTYPE html><html><head>' | 245 '<!DOCTYPE html><html><head>' |
| 246 '</head><body><div></div>', | 246 '</head><body><div></div>', |
| 247 'a|web/test.html._data': | 247 'a|web/test.html._data': |
| 248 expectedData(['web/a.dart', 'web/b.dart', 'web/c.dart', 'web/d.dart'])
, | 248 expectedData(['web/a.dart', 'web/b.dart', 'web/c.dart', |
| 249 'web/i.dart', 'web/j.dart', 'web/d.dart']), |
| 249 'a|web/d.dart': | 250 'a|web/d.dart': |
| 250 'library d;\n' | 251 'library d;\n' |
| 251 'import "package:polymer/polymer.dart";\n' | 252 'import "package:polymer/polymer.dart";\n' |
| 252 'main(){}\n@initMethod mD(){}', | 253 'main(){}\n@initMethod mD(){}', |
| 253 | 254 |
| 254 'a|web/a.dart': | 255 'a|web/a.dart': |
| 255 'import "package:polymer/polymer.dart";\n' | 256 'import "package:polymer/polymer.dart";\n' |
| 257 'export "i.dart" hide mI2;\n' |
| 256 '@initMethod mA(){}\n', | 258 '@initMethod mA(){}\n', |
| 257 | 259 |
| 258 'a|web/b.dart': | 260 'a|web/b.dart': |
| 259 'import "package:polymer/polymer.dart";\n' | 261 'import "package:polymer/polymer.dart";\n' |
| 260 'export "e.dart";\n' | 262 'export "e.dart";\n' |
| 261 'export "f.dart" show XF1, mF1;\n' | 263 'export "f.dart" show XF1, mF1;\n' |
| 262 'export "g.dart" hide XG1, mG1;\n' | 264 'export "g.dart" hide XG1, mG1;\n' |
| 263 'export "h.dart" show XH1, mH1 hide mH1, mH2;\n' | 265 'export "h.dart" show XH1, mH1 hide mH1, mH2;\n' |
| 264 '@initMethod mB(){}\n', | 266 '@initMethod mB(){}\n', |
| 265 | 267 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 289 '@initMethod mG1(){}\n' | 291 '@initMethod mG1(){}\n' |
| 290 '@CustomTag("x-g2") class XG2 extends PolymerElement {}\n' | 292 '@CustomTag("x-g2") class XG2 extends PolymerElement {}\n' |
| 291 '@initMethod mG2(){}\n', | 293 '@initMethod mG2(){}\n', |
| 292 | 294 |
| 293 'a|web/h.dart': | 295 'a|web/h.dart': |
| 294 'import "package:polymer/polymer.dart";\n' | 296 'import "package:polymer/polymer.dart";\n' |
| 295 '@CustomTag("x-h1") class XH1 extends PolymerElement {}\n' | 297 '@CustomTag("x-h1") class XH1 extends PolymerElement {}\n' |
| 296 '@initMethod mH1(){}\n' | 298 '@initMethod mH1(){}\n' |
| 297 '@CustomTag("x-h2") class XH2 extends PolymerElement {}\n' | 299 '@CustomTag("x-h2") class XH2 extends PolymerElement {}\n' |
| 298 '@initMethod mH2(){}\n', | 300 '@initMethod mH2(){}\n', |
| 301 |
| 302 'a|web/i.dart': |
| 303 'import "package:polymer/polymer.dart";\n' |
| 304 '@CustomTag("x-i") class XI extends PolymerElement {}\n' |
| 305 '@initMethod mI1(){}\n' |
| 306 '@initMethod mI2(){}\n', |
| 307 |
| 308 'a|web/j.dart': |
| 309 'export "a.dart";\n', |
| 299 }, { | 310 }, { |
| 300 'a|web/test.html': | 311 'a|web/test.html': |
| 301 '<!DOCTYPE html><html><head></head><body><div></div>' | 312 '<!DOCTYPE html><html><head></head><body><div></div>' |
| 302 '<script type="application/dart" src="test.html_bootstrap.dart">' | 313 '<script type="application/dart" src="test.html_bootstrap.dart">' |
| 303 '</script>' | 314 '</script>' |
| 304 '</body></html>', | 315 '</body></html>', |
| 305 | 316 |
| 306 'a|web/test.html_bootstrap.dart': | 317 'a|web/test.html_bootstrap.dart': |
| 307 '''$MAIN_HEADER | 318 '''$MAIN_HEADER |
| 308 import 'a.dart' as i0; | 319 import 'a.dart' as i0; |
| 309 import 'b.dart' as i1; | 320 import 'b.dart' as i1; |
| 310 import 'c.dart' as i2; | 321 import 'c.dart' as i2; |
| 311 import 'd.dart' as i3; | 322 import 'i.dart' as i3; |
| 323 import 'j.dart' as i4; |
| 324 import 'd.dart' as i5; |
| 312 ${DEFAULT_IMPORTS.join('\n')} | 325 ${DEFAULT_IMPORTS.join('\n')} |
| 313 import 'e.dart' as smoke_0; | 326 import 'i.dart' as smoke_0; |
| 314 import 'package:polymer/polymer.dart' as smoke_1; | 327 import 'package:polymer/polymer.dart' as smoke_1; |
| 315 import 'f.dart' as smoke_2; | 328 import 'e.dart' as smoke_2; |
| 316 import 'g.dart' as smoke_3; | 329 import 'f.dart' as smoke_3; |
| 317 import 'h.dart' as smoke_4; | 330 import 'g.dart' as smoke_4; |
| 318 import 'c.dart' as smoke_5; | 331 import 'h.dart' as smoke_5; |
| 332 import 'c.dart' as smoke_6; |
| 319 | 333 |
| 320 void main() { | 334 void main() { |
| 321 useGeneratedCode(new StaticConfiguration( | 335 useGeneratedCode(new StaticConfiguration( |
| 322 checkedMode: false, | 336 checkedMode: false, |
| 323 parents: { | 337 parents: { |
| 324 smoke_5.XC1: smoke_1.PolymerElement, | 338 smoke_6.XC1: smoke_1.PolymerElement, |
| 325 smoke_5.XC2: smoke_1.PolymerElement, | 339 smoke_6.XC2: smoke_1.PolymerElement, |
| 326 smoke_0.XE: smoke_1.PolymerElement, | 340 smoke_2.XE: smoke_1.PolymerElement, |
| 327 smoke_2.XF1: smoke_1.PolymerElement, | 341 smoke_3.XF1: smoke_1.PolymerElement, |
| 328 smoke_3.XG2: smoke_1.PolymerElement, | 342 smoke_4.XG2: smoke_1.PolymerElement, |
| 329 smoke_4.XH1: smoke_1.PolymerElement, | 343 smoke_5.XH1: smoke_1.PolymerElement, |
| 344 smoke_0.XI: smoke_1.PolymerElement, |
| 330 }, | 345 }, |
| 331 declarations: { | 346 declarations: { |
| 332 smoke_5.XC1: {}, | 347 smoke_6.XC1: {}, |
| 333 smoke_5.XC2: {}, | 348 smoke_6.XC2: {}, |
| 334 smoke_0.XE: {}, | 349 smoke_2.XE: {}, |
| 335 smoke_2.XF1: {}, | 350 smoke_3.XF1: {}, |
| 336 smoke_3.XG2: {}, | 351 smoke_4.XG2: {}, |
| 337 smoke_4.XH1: {}, | 352 smoke_5.XH1: {}, |
| 353 smoke_0.XI: {}, |
| 338 })); | 354 })); |
| 339 configureForDeployment([ | 355 configureForDeployment([ |
| 340 i0.mA, | 356 i0.mA, |
| 357 i0.mI1, |
| 358 () => Polymer.register('x-i', i0.XI), |
| 341 i1.mB, | 359 i1.mB, |
| 342 i1.mE, | 360 i1.mE, |
| 343 i1.mF1, | 361 i1.mF1, |
| 344 i1.mG2, | 362 i1.mG2, |
| 345 () => Polymer.register('x-e', i1.XE), | 363 () => Polymer.register('x-e', i1.XE), |
| 346 () => Polymer.register('x-f1', i1.XF1), | 364 () => Polymer.register('x-f1', i1.XF1), |
| 347 () => Polymer.register('x-g2', i1.XG2), | 365 () => Polymer.register('x-g2', i1.XG2), |
| 348 () => Polymer.register('x-h1', i1.XH1), | 366 () => Polymer.register('x-h1', i1.XH1), |
| 349 () => Polymer.register('x-c1', i2.XC1), | 367 () => Polymer.register('x-c1', i2.XC1), |
| 350 () => Polymer.register('x-c2', i2.XC2), | 368 () => Polymer.register('x-c2', i2.XC2), |
| 351 i3.mD, | 369 i3.mI2, |
| 370 i5.mD, |
| 352 ]); | 371 ]); |
| 353 i3.main(); | 372 i5.main(); |
| 354 } | 373 } |
| 355 '''.replaceAll('\n ', '\n'), | 374 '''.replaceAll('\n ', '\n'), |
| 356 }, null); | 375 }, null); |
| 357 } | 376 } |
| 358 | 377 |
| 359 initializerTestsExperimental(phases) { | 378 initializerTestsExperimental(phases) { |
| 360 testPhases('no changes', phases, { | 379 testPhases('no changes', phases, { |
| 361 'a|web/test.html': '<!DOCTYPE html><html></html>', | 380 'a|web/test.html': '<!DOCTYPE html><html></html>', |
| 362 'a|web/test.html._data': EMPTY_DATA, | 381 'a|web/test.html._data': EMPTY_DATA, |
| 363 }, { | 382 }, { |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 configureForDeployment([]); | 1204 configureForDeployment([]); |
| 1186 i0.main(); | 1205 i0.main(); |
| 1187 } | 1206 } |
| 1188 '''.replaceAll('\n ', '\n'), | 1207 '''.replaceAll('\n ', '\n'), |
| 1189 'a|web/a.dart': | 1208 'a|web/a.dart': |
| 1190 'library a;\n' | 1209 'library a;\n' |
| 1191 'import "package:polymer/polymer.dart";\n' | 1210 'import "package:polymer/polymer.dart";\n' |
| 1192 'main(){}', | 1211 'main(){}', |
| 1193 }); | 1212 }); |
| 1194 } | 1213 } |
| OLD | NEW |