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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 | 649 |
650 codegenTests(phases) { | 650 codegenTests(phases) { |
651 testPhases('bindings', phases, { | 651 testPhases('bindings', phases, { |
652 'a|web/test.html': | 652 'a|web/test.html': |
653 '<!DOCTYPE html><html><body>' | 653 '<!DOCTYPE html><html><body>' |
654 '<polymer-element name="foo-bar"><template>' | 654 '<polymer-element name="foo-bar"><template>' |
655 '<div>{{a.node}}</div>' | 655 '<div>{{a.node}}</div>' |
656 '<div>{{anotherNode}}</div>' | 656 '<div>{{anotherNode}}</div>' |
657 '<div>{{a.call1(a)}}</div>' | 657 '<div>{{a.call1(a)}}</div>' |
658 '<div>{{call2(a)}}</div>' | 658 '<div>{{call2(a)}}</div>' |
659 '<div>{{}}</div>' | |
659 '<div class="{{an.attribute}}"></div>' | 660 '<div class="{{an.attribute}}"></div>' |
660 '<a href="path/{{within.an.attribute}}/foo/bar"></a>' | 661 '<a href="path/{{within.an.attribute}}/foo/bar"></a>' |
661 '<div data-attribute="{{anotherAttribute}}"></div>' | 662 '<div data-attribute="{{anotherAttribute}}"></div>' |
662 // input and custom-element attributes are treated as 2-way bindings: | 663 // input and custom-element attributes are treated as 2-way bindings: |
663 '<input value="{{this.is.twoWay}}">' | 664 '<input value="{{this.iS.twoWay}}">' |
Siggi Cherem (dart-lang)
2014/05/29 00:05:18
"is" is a reserved word, so now smoke made this pa
Jennifer Messerly
2014/05/29 00:27:42
interesting! longer term we might have an issue th
| |
664 '<input value="{{this.is.twoWayInt | intToStringTransformer}}">' | 665 '<input value="{{this.iS.twoWayInt | intToStringTransformer}}">' |
665 '<something-else my-attribute="{{here.too}}"></something-else>' | 666 '<something-else my-attribute="{{here.too}}"></something-else>' |
666 '<div on-click="{{methodName}}"></div>' | 667 '<div on-click="{{methodName}}"></div>' |
667 '<div on-click="{{@read.method}}"></div>' | 668 '<div on-click="{{@read.method}}"></div>' |
669 '<div on-click="{{}}"></div>' | |
668 '</template></polymer-element>', | 670 '</template></polymer-element>', |
669 'a|web/test.html._data': expectedData(['web/a.dart']), | 671 'a|web/test.html._data': expectedData(['web/a.dart']), |
670 'a|web/a.dart': | 672 'a|web/a.dart': |
671 'library a;\n' | 673 'library a;\n' |
672 'import "package:polymer/polymer.dart";\n' | 674 'import "package:polymer/polymer.dart";\n' |
673 'main(){}', | 675 'main(){}', |
674 }, { | 676 }, { |
675 'a|web/test.html_bootstrap.dart': | 677 'a|web/test.html_bootstrap.dart': |
676 '''$MAIN_HEADER | 678 '''$MAIN_HEADER |
677 import 'a.dart' as i0; | 679 import 'a.dart' as i0; |
678 ${DEFAULT_IMPORTS.join('\n')} | 680 ${DEFAULT_IMPORTS.join('\n')} |
679 | 681 |
680 void main() { | 682 void main() { |
681 useGeneratedCode(new StaticConfiguration( | 683 useGeneratedCode(new StaticConfiguration( |
682 checkedMode: false, | 684 checkedMode: false, |
683 getters: { | 685 getters: { |
684 #a: (o) => o.a, | 686 #a: (o) => o.a, |
685 #an: (o) => o.an, | 687 #an: (o) => o.an, |
686 #anotherAttribute: (o) => o.anotherAttribute, | 688 #anotherAttribute: (o) => o.anotherAttribute, |
687 #anotherNode: (o) => o.anotherNode, | 689 #anotherNode: (o) => o.anotherNode, |
688 #attribute: (o) => o.attribute, | 690 #attribute: (o) => o.attribute, |
689 #call1: (o) => o.call1, | 691 #call1: (o) => o.call1, |
690 #call2: (o) => o.call2, | 692 #call2: (o) => o.call2, |
691 #here: (o) => o.here, | 693 #here: (o) => o.here, |
694 #iS: (o) => o.iS, | |
692 #intToStringTransformer: (o) => o.intToStringTransformer, | 695 #intToStringTransformer: (o) => o.intToStringTransformer, |
693 #is: (o) => o.is, | |
694 #method: (o) => o.method, | 696 #method: (o) => o.method, |
695 #methodName: (o) => o.methodName, | 697 #methodName: (o) => o.methodName, |
696 #node: (o) => o.node, | 698 #node: (o) => o.node, |
697 #read: (o) => o.read, | 699 #read: (o) => o.read, |
698 #too: (o) => o.too, | 700 #too: (o) => o.too, |
699 #twoWay: (o) => o.twoWay, | 701 #twoWay: (o) => o.twoWay, |
700 #twoWayInt: (o) => o.twoWayInt, | 702 #twoWayInt: (o) => o.twoWayInt, |
701 #within: (o) => o.within, | 703 #within: (o) => o.within, |
702 }, | 704 }, |
703 setters: { | 705 setters: { |
704 #too: (o, v) { o.too = v; }, | 706 #too: (o, v) { o.too = v; }, |
705 #twoWay: (o, v) { o.twoWay = v; }, | 707 #twoWay: (o, v) { o.twoWay = v; }, |
706 #twoWayInt: (o, v) { o.twoWayInt = v; }, | 708 #twoWayInt: (o, v) { o.twoWayInt = v; }, |
707 }, | 709 }, |
708 names: { | 710 names: { |
709 #a: r'a', | 711 #a: r'a', |
710 #an: r'an', | 712 #an: r'an', |
711 #anotherAttribute: r'anotherAttribute', | 713 #anotherAttribute: r'anotherAttribute', |
712 #anotherNode: r'anotherNode', | 714 #anotherNode: r'anotherNode', |
713 #attribute: r'attribute', | 715 #attribute: r'attribute', |
714 #call1: r'call1', | 716 #call1: r'call1', |
715 #call2: r'call2', | 717 #call2: r'call2', |
716 #here: r'here', | 718 #here: r'here', |
719 #iS: r'iS', | |
717 #intToStringTransformer: r'intToStringTransformer', | 720 #intToStringTransformer: r'intToStringTransformer', |
718 #is: r'is', | |
719 #method: r'method', | 721 #method: r'method', |
720 #methodName: r'methodName', | 722 #methodName: r'methodName', |
721 #node: r'node', | 723 #node: r'node', |
722 #read: r'read', | 724 #read: r'read', |
723 #too: r'too', | 725 #too: r'too', |
724 #twoWay: r'twoWay', | 726 #twoWay: r'twoWay', |
725 #twoWayInt: r'twoWayInt', | 727 #twoWayInt: r'twoWayInt', |
726 #within: r'within', | 728 #within: r'within', |
727 })); | 729 })); |
728 configureForDeployment([]); | 730 configureForDeployment([]); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
964 })); | 966 })); |
965 configureForDeployment([ | 967 configureForDeployment([ |
966 () => Polymer.register(\'x-foo\', i0.XFoo), | 968 () => Polymer.register(\'x-foo\', i0.XFoo), |
967 ]); | 969 ]); |
968 i0.main(); | 970 i0.main(); |
969 } | 971 } |
970 '''.replaceAll('\n ', '\n'), | 972 '''.replaceAll('\n ', '\n'), |
971 }); | 973 }); |
972 } | 974 } |
973 | 975 |
OLD | NEW |