Chromium Code Reviews| 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.import_inliner_test; | 5 library polymer.test.build.import_inliner_test; |
| 6 | 6 |
| 7 import 'dart:convert' show JSON; | 7 import 'dart:convert' show JSON; |
| 8 import 'package:polymer/src/build/common.dart'; | 8 import 'package:polymer/src/build/common.dart'; |
| 9 import 'package:polymer/src/build/import_inliner.dart'; | 9 import 'package:polymer/src/build/import_inliner.dart'; |
| 10 import 'package:unittest/compact_vm_config.dart'; | 10 import 'package:unittest/compact_vm_config.dart'; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 '<script type="application/dart">/*1*/</script>' | 166 '<script type="application/dart">/*1*/</script>' |
| 167 '</head></html>', | 167 '</head></html>', |
| 168 'a|web/foo_02_test.html': | 168 'a|web/foo_02_test.html': |
| 169 '<!DOCTYPE html><html><head>' | 169 '<!DOCTYPE html><html><head>' |
| 170 '<script type="application/dart">/*2*/</script>' | 170 '<script type="application/dart">/*2*/</script>' |
| 171 '</head></html>', | 171 '</head></html>', |
| 172 'a|web/test_03.html': | 172 'a|web/test_03.html': |
| 173 '<!DOCTYPE html><html><head>' | 173 '<!DOCTYPE html><html><head>' |
| 174 '<script type="application/dart">/*3*/</script>' | 174 '<script type="application/dart">/*3*/</script>' |
| 175 '</head></html>', | 175 '</head></html>', |
| 176 'a|web/*test_%foo_04!.html': | 176 'a|web/test_fo*o_04!.html': |
|
jakemac
2014/07/31 15:06:37
Barback started complaining about paths that don't
Siggi Cherem (dart-lang)
2014/07/31 21:54:22
Weird, I'm surprised it didn't fail in the bots to
jakemac
2014/08/01 15:20:47
Oddly enough this just stopped happening. I have r
| |
| 177 '<!DOCTYPE html><html><head>' | 177 '<!DOCTYPE html><html><head>' |
| 178 '<script type="application/dart">/*4*/</script>' | 178 '<script type="application/dart">/*4*/</script>' |
| 179 '</head></html>', | 179 '</head></html>', |
| 180 'a|web/%05_test.html': | 180 'a|web/foo_05_test.html': |
| 181 '<!DOCTYPE html><html><head>' | 181 '<!DOCTYPE html><html><head>' |
| 182 '<script type="application/dart">/*5*/</script>' | 182 '<script type="application/dart">/*5*/</script>' |
| 183 '</head></html>', | 183 '</head></html>', |
| 184 }, { | 184 }, { |
| 185 'a|web/01_test.html.0.dart': | 185 'a|web/01_test.html.0.dart': |
| 186 'library a.web._01_test_html_0;\n/*1*/', // Appends an _ if i t starts with a number. | 186 'library a.web._01_test_html_0;\n/*1*/', // Appends an _ if i t starts with a number. |
| 187 'a|web/foo_02_test.html.0.dart': | 187 'a|web/foo_02_test.html.0.dart': |
| 188 'library a.web.foo_02_test_html_0;\n/*2*/', // Allows numbers in the middle. | 188 'library a.web.foo_02_test_html_0;\n/*2*/', // Allows numbers in the middle. |
| 189 'a|web/test_03.html.0.dart': | 189 'a|web/test_03.html.0.dart': |
| 190 'library a.web.test_03_html_0;\n/*3*/', // Allows numbers at the end. | 190 'library a.web.test_03_html_0;\n/*3*/', // Allows numbers at the end. |
| 191 'a|web/*test_%foo_04!.html.0.dart': | 191 'a|web/test_fo*o_04!.html.0.dart': |
| 192 'library a.web._test__foo_04__html_0;\n/*4*/', // Replaces invalid characters with _. | 192 'library a.web.test_fo_o_04__html_0;\n/*4*/', // Replaces invalid c haracters with _. |
| 193 'a|web/%05_test.html.0.dart': | 193 'a|web/foo_05_test.html.0.dart': |
| 194 'library a.web._05_test_html_0;\n/*5*/', // Replace invalid c haracter followed by number. | 194 'library a.web.foo_05_test_html_0;\n/*5*/', // Replace invali d character followed by number. |
| 195 }); | 195 }); |
| 196 | 196 |
| 197 testPhases('no transformation outside web/', phases, | 197 testPhases('no transformation outside web/', phases, |
| 198 { | 198 { |
| 199 'a|lib/test.html': | 199 'a|lib/test.html': |
| 200 '<!DOCTYPE html><html><head>' | 200 '<!DOCTYPE html><html><head>' |
| 201 '<link rel="import" href="test2.html">' | 201 '<link rel="import" href="test2.html">' |
| 202 '</head></html>', | 202 '</head></html>', |
| 203 'a|lib/test2.html': | 203 'a|lib/test2.html': |
| 204 '<!DOCTYPE html><html><head>' | 204 '<!DOCTYPE html><html><head>' |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 876 'a|web/foo/test.html': | 876 'a|web/foo/test.html': |
| 877 '<img src="baz/{{bar}}">' | 877 '<img src="baz/{{bar}}">' |
| 878 '<img src="./{{bar}}">', | 878 '<img src="./{{bar}}">', |
| 879 }, { | 879 }, { |
| 880 'a|web/test.html': | 880 'a|web/test.html': |
| 881 '<!DOCTYPE html><html><head></head><body>' | 881 '<!DOCTYPE html><html><head></head><body>' |
| 882 '<img src="foo/baz/{{bar}}">' | 882 '<img src="foo/baz/{{bar}}">' |
| 883 '<img src="foo/{{bar}}">' | 883 '<img src="foo/{{bar}}">' |
| 884 '</body></html>', | 884 '</body></html>', |
| 885 }); | 885 }); |
| 886 | |
| 887 testPhases('arbitrary bindings can exist in paths', phases, { | |
| 888 'a|web/test.html': | |
| 889 '<!DOCTYPE html><html><head></head><body>' | |
| 890 '<img src="./{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">' | |
| 891 '</body></html>', | |
| 892 }, { | |
| 893 'a|web/test.html': | |
| 894 '<!DOCTYPE html><html><head></head><body>' | |
| 895 '<img src="{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">' | |
| 896 '</body></html>', | |
| 897 }); | |
| 898 | |
| 899 testPhases('multiple bindings can exist in paths', phases, { | |
| 900 'a|web/test.html': | |
| 901 '<!DOCTYPE html><html><head></head><body>' | |
| 902 '<img src="./{{bar[0]}}/{{baz[1]}}.{{extension}}">' | |
| 903 '</body></html>', | |
| 904 }, { | |
| 905 'a|web/test.html': | |
| 906 '<!DOCTYPE html><html><head></head><body>' | |
| 907 '<img src="{{bar[0]}}/{{baz[1]}}.{{extension}}">' | |
| 908 '</body></html>', | |
| 909 }); | |
| 886 } | 910 } |
| 887 | 911 |
| 888 void entryPointTests() { | 912 void entryPointTests() { |
| 889 testPhases('one level deep entry points normalize correctly', phases, { | 913 testPhases('one level deep entry points normalize correctly', phases, { |
| 890 'a|web/test/test.html': | 914 'a|web/test/test.html': |
| 891 '<!DOCTYPE html><html><head>' | 915 '<!DOCTYPE html><html><head>' |
| 892 '<link rel="import" href="../../packages/a/foo/foo.html">' | 916 '<link rel="import" href="../../packages/a/foo/foo.html">' |
| 893 '</head></html>', | 917 '</head></html>', |
| 894 'a|lib/foo/foo.html': | 918 'a|lib/foo/foo.html': |
| 895 '<script rel="import" href="../../../packages/b/bar/bar.js">' | 919 '<script rel="import" href="../../../packages/b/bar/bar.js">' |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 926 '<script rel="import" href="../../../packages/b/bar/bar.js"></script>', | 950 '<script rel="import" href="../../../packages/b/bar/bar.js"></script>', |
| 927 'b|lib/bar/bar.js': | 951 'b|lib/bar/bar.js': |
| 928 'console.log("here");', | 952 'console.log("here");', |
| 929 }, { | 953 }, { |
| 930 'a|web/test/well/test.html': | 954 'a|web/test/well/test.html': |
| 931 '<!DOCTYPE html><html><head></head><body>' | 955 '<!DOCTYPE html><html><head></head><body>' |
| 932 '<script rel="import" href="../../packages/b/bar/bar.js"></script>' | 956 '<script rel="import" href="../../packages/b/bar/bar.js"></script>' |
| 933 '</body></html>', | 957 '</body></html>', |
| 934 }); | 958 }); |
| 935 } | 959 } |
| OLD | NEW |