Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: test/build/import_inliner_test.dart

Issue 1014423002: add option to pass in bindings delimiters (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: format Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library web_components.test.build.import_inliner_test; 4 library web_components.test.build.import_inliner_test;
5 5
6 import 'package:code_transformers/tests.dart'; 6 import 'package:code_transformers/tests.dart';
7 import 'package:web_components/build/import_inliner.dart'; 7 import 'package:web_components/build/import_inliner.dart';
8 import 'package:web_components/build/messages.dart'; 8 import 'package:web_components/build/messages.dart';
9 import 'package:unittest/compact_vm_config.dart'; 9 import 'package:unittest/compact_vm_config.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
11 11
12 var transformer = new ImportInlinerTransformer(); 12 var transformer = new ImportInlinerTransformer(null, ['{{', '[[']);
13 var phases = [[transformer]]; 13 var phases = [[transformer]];
14 14
15 main() { 15 main() {
16 useCompactVMConfiguration(); 16 useCompactVMConfiguration();
17 17
18 group('rel=import', importTests); 18 group('rel=import', importTests);
19 group('url attributes', urlAttributeTests); 19 group('url attributes', urlAttributeTests);
20 group('deep entrypoints', entryPointTests); 20 group('deep entrypoints', entryPointTests);
21 } 21 }
22 22
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 }, { 703 }, {
704 'a|web/test.html': ''' 704 'a|web/test.html': '''
705 <!DOCTYPE html><html><head></head><body> 705 <!DOCTYPE html><html><head></head><body>
706 <div hidden=""> 706 <div hidden="">
707 <img _src="foo/{{bar}}"> 707 <img _src="foo/{{bar}}">
708 <a _href="foo/{{bar}}">test</a> 708 <a _href="foo/{{bar}}">test</a>
709 </div> 709 </div>
710 </body></html>''', 710 </body></html>''',
711 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); 711 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
712 712
713 testPhases('paths starting with a binding are treated as absolute', phases, {
714 'a|web/test.html': '''
715 <!DOCTYPE html><html><head>
716 <link rel="import" href="packages/a/foo.html">
717 </head></html>''',
718 'a|lib/foo.html': '''
719 <img _src="{{bar}}">
720 <img _src="[[bar]]">''',
721 }, {
722 'a|web/test.html': '''
723 <!DOCTYPE html><html><head></head><body>
724 <div hidden="">
725 <img _src="{{bar}}">
726 <img _src="[[bar]]">
727 </div>
728 </body></html>''',
729 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
730
713 testPhases('arbitrary bindings can exist in paths', phases, { 731 testPhases('arbitrary bindings can exist in paths', phases, {
714 'a|web/test.html': ''' 732 'a|web/test.html': '''
715 <!DOCTYPE html><html><head></head><body> 733 <!DOCTYPE html><html><head></head><body>
716 <img src="./{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg"> 734 <img src="./{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">
717 <img src="./[[bar[2]]].jpg"> 735 <img src="./[[bar[2]]].jpg">
718 </body></html>''', 736 </body></html>''',
719 }, { 737 }, {
720 'a|web/test.html': ''' 738 'a|web/test.html': '''
721 <!DOCTYPE html><html><head></head><body> 739 <!DOCTYPE html><html><head></head><body>
722 <img src="{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg"> 740 <img src="{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 console.log("here");''', 823 console.log("here");''',
806 }, { 824 }, {
807 'a|web/test/well/test.html': ''' 825 'a|web/test/well/test.html': '''
808 <!DOCTYPE html><html><head></head><body> 826 <!DOCTYPE html><html><head></head><body>
809 <div hidden=""> 827 <div hidden="">
810 <script rel="import" href="../../packages/b/bar/bar.js"></script> 828 <script rel="import" href="../../packages/b/bar/bar.js"></script>
811 </div> 829 </div>
812 </body></html>''', 830 </body></html>''',
813 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace); 831 }, [], StringFormatter.noNewlinesOrSurroundingWhitespace);
814 } 832 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698