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

Unified Diff: pkg/polymer/test/build/import_inliner_test.dart

Issue 433913002: Strip bindings before calling Uri.parse (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: made new path building a bit more efficient Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/polymer/test/build/import_inliner_test.dart
diff --git a/pkg/polymer/test/build/import_inliner_test.dart b/pkg/polymer/test/build/import_inliner_test.dart
index 15cfa45603723fe29a2b349ebfaaea35627fcec8..4cbf630320d689ddcc58a5fb03e01e35ccb28fa4 100644
--- a/pkg/polymer/test/build/import_inliner_test.dart
+++ b/pkg/polymer/test/build/import_inliner_test.dart
@@ -898,7 +898,7 @@ void urlAttributeTests() {
'a|web/foo/test.html':
'<img src="{{bar}}">'
'<img src="[[bar]]">',
- }, {
+ }, {
'a|web/test.html':
'<!DOCTYPE html><html><head></head><body>'
'<img src="{{bar}}">'
@@ -907,7 +907,7 @@ void urlAttributeTests() {
'a|web/foo/test.html':
'<img src="{{bar}}">'
'<img src="[[bar]]">',
- });
+ });
testPhases('relative paths followed by bindings are normalized', phases, {
'a|web/test.html':
@@ -956,6 +956,32 @@ void urlAttributeTests() {
'Please change to the "href" attribute. (web/test.html 0 63)',
]);
+
+ testPhases('arbitrary bindings can exist in paths', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="./{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">'
+ '<img src="./[[bar[2]]].jpg">'
+ '</body></html>',
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="{{(bar[2] + baz[\'foo\']) * 14 / foobar() - 0.5}}.jpg">'
+ '<img src="[[bar[2]]].jpg">'
+ '</body></html>',
+ });
+
+ testPhases('multiple bindings can exist in paths', phases, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="./{{bar[0]}}/{{baz[1]}}.{{extension}}">'
+ '</body></html>',
+ }, {
+ 'a|web/test.html':
+ '<!DOCTYPE html><html><head></head><body>'
+ '<img src="{{bar[0]}}/{{baz[1]}}.{{extension}}">'
+ '</body></html>',
+ });
}
void entryPointTests() {

Powered by Google App Engine
This is Rietveld 408576698