| 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: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/script_compactor.dart'; | 9 import 'package:polymer/src/build/script_compactor.dart'; |
| 10 import 'package:smoke/codegen/generator.dart' show DEFAULT_IMPORTS; | 10 import 'package:smoke/codegen/generator.dart' show DEFAULT_IMPORTS; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 }, null); | 285 }, null); |
| 286 } | 286 } |
| 287 | 287 |
| 288 codegenTests(phases) { | 288 codegenTests(phases) { |
| 289 testPhases('bindings', phases, { | 289 testPhases('bindings', phases, { |
| 290 'a|web/test.html': | 290 'a|web/test.html': |
| 291 '<!DOCTYPE html><html><body>' | 291 '<!DOCTYPE html><html><body>' |
| 292 '<polymer-element name="foo-bar"><template>' | 292 '<polymer-element name="foo-bar"><template>' |
| 293 '<div>{{a.node}}</div>' | 293 '<div>{{a.node}}</div>' |
| 294 '<div>{{anotherNode}}</div>' | 294 '<div>{{anotherNode}}</div>' |
| 295 '<div>{{a.call1(a)}}</div>' |
| 296 '<div>{{call2(a)}}</div>' |
| 295 '<div class="{{an.attribute}}"></div>' | 297 '<div class="{{an.attribute}}"></div>' |
| 296 '<a href="path/{{within.an.attribute}}/foo/bar"></a>' | 298 '<a href="path/{{within.an.attribute}}/foo/bar"></a>' |
| 297 '<div data-attribute="{{anotherAttribute}}"></div>' | 299 '<div data-attribute="{{anotherAttribute}}"></div>' |
| 298 // input and custom-element attributes are treated as 2-way bindings: | 300 // input and custom-element attributes are treated as 2-way bindings: |
| 299 '<input value="{{this.is.twoWay}}">' | 301 '<input value="{{this.is.twoWay}}">' |
| 300 '<input value="{{this.is.twoWayInt | intToStringTransformer}}">' | 302 '<input value="{{this.is.twoWayInt | intToStringTransformer}}">' |
| 301 '<something-else my-attribute="{{here.too}}"></something-else>' | 303 '<something-else my-attribute="{{here.too}}"></something-else>' |
| 302 '<div on-click="{{methodName}}"></div>' | 304 '<div on-click="{{methodName}}"></div>' |
| 303 '<div on-click="{{@read.method}}"></div>' | 305 '<div on-click="{{@read.method}}"></div>' |
| 304 '</template></polymer-element>', | 306 '</template></polymer-element>', |
| (...skipping 10 matching lines...) Expand all Loading... |
| 315 | 317 |
| 316 void main() { | 318 void main() { |
| 317 useGeneratedCode(new StaticConfiguration( | 319 useGeneratedCode(new StaticConfiguration( |
| 318 checkedMode: false, | 320 checkedMode: false, |
| 319 getters: { | 321 getters: { |
| 320 #a: (o) => o.a, | 322 #a: (o) => o.a, |
| 321 #an: (o) => o.an, | 323 #an: (o) => o.an, |
| 322 #anotherAttribute: (o) => o.anotherAttribute, | 324 #anotherAttribute: (o) => o.anotherAttribute, |
| 323 #anotherNode: (o) => o.anotherNode, | 325 #anotherNode: (o) => o.anotherNode, |
| 324 #attribute: (o) => o.attribute, | 326 #attribute: (o) => o.attribute, |
| 327 #call1: (o) => o.call1, |
| 328 #call2: (o) => o.call2, |
| 325 #here: (o) => o.here, | 329 #here: (o) => o.here, |
| 326 #intToStringTransformer: (o) => o.intToStringTransformer, | 330 #intToStringTransformer: (o) => o.intToStringTransformer, |
| 327 #is: (o) => o.is, | 331 #is: (o) => o.is, |
| 328 #method: (o) => o.method, | 332 #method: (o) => o.method, |
| 329 #methodName: (o) => o.methodName, | 333 #methodName: (o) => o.methodName, |
| 330 #node: (o) => o.node, | 334 #node: (o) => o.node, |
| 331 #read: (o) => o.read, | 335 #read: (o) => o.read, |
| 332 #too: (o) => o.too, | 336 #too: (o) => o.too, |
| 333 #twoWay: (o) => o.twoWay, | 337 #twoWay: (o) => o.twoWay, |
| 334 #twoWayInt: (o) => o.twoWayInt, | 338 #twoWayInt: (o) => o.twoWayInt, |
| 335 #within: (o) => o.within, | 339 #within: (o) => o.within, |
| 336 }, | 340 }, |
| 337 setters: { | 341 setters: { |
| 338 #too: (o, v) { o.too = v; }, | 342 #too: (o, v) { o.too = v; }, |
| 339 #twoWay: (o, v) { o.twoWay = v; }, | 343 #twoWay: (o, v) { o.twoWay = v; }, |
| 340 #twoWayInt: (o, v) { o.twoWayInt = v; }, | 344 #twoWayInt: (o, v) { o.twoWayInt = v; }, |
| 341 }, | 345 }, |
| 342 names: { | 346 names: { |
| 343 #a: r'a', | 347 #a: r'a', |
| 344 #an: r'an', | 348 #an: r'an', |
| 345 #anotherAttribute: r'anotherAttribute', | 349 #anotherAttribute: r'anotherAttribute', |
| 346 #anotherNode: r'anotherNode', | 350 #anotherNode: r'anotherNode', |
| 347 #attribute: r'attribute', | 351 #attribute: r'attribute', |
| 352 #call1: r'call1', |
| 353 #call2: r'call2', |
| 348 #here: r'here', | 354 #here: r'here', |
| 349 #intToStringTransformer: r'intToStringTransformer', | 355 #intToStringTransformer: r'intToStringTransformer', |
| 350 #is: r'is', | 356 #is: r'is', |
| 351 #method: r'method', | 357 #method: r'method', |
| 352 #methodName: r'methodName', | 358 #methodName: r'methodName', |
| 353 #node: r'node', | 359 #node: r'node', |
| 354 #read: r'read', | 360 #read: r'read', |
| 355 #too: r'too', | 361 #too: r'too', |
| 356 #twoWay: r'twoWay', | 362 #twoWay: r'twoWay', |
| 357 #twoWayInt: r'twoWayInt', | 363 #twoWayInt: r'twoWayInt', |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 names: { | 598 names: { |
| 593 #registerCallback: r'registerCallback', | 599 #registerCallback: r'registerCallback', |
| 594 })); | 600 })); |
| 595 startPolymer([ | 601 startPolymer([ |
| 596 () => Polymer.register(\'x-foo\', i0.XFoo), | 602 () => Polymer.register(\'x-foo\', i0.XFoo), |
| 597 ]); | 603 ]); |
| 598 } | 604 } |
| 599 '''.replaceAll('\n ', '\n'), | 605 '''.replaceAll('\n ', '\n'), |
| 600 }); | 606 }); |
| 601 } | 607 } |
| OLD | NEW |