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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js

Issue 1363233003: Make sure <url>s are being serialized according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CSSPrimitiveValue and CSSSVGDocumentValue customCSSText changes Created 5 years, 3 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: third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js
diff --git a/third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js b/third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js
index 1a655ab42c6125ccb6297c471c931762f928479c..77f476e8522abeb2d9e26092c876fff198894fe4 100644
--- a/third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js
+++ b/third_party/WebKit/LayoutTests/fast/css/script-tests/image-set-parsing.js
@@ -2,54 +2,64 @@ description("Test the parsing of the -webkit-image-set function.");
var result;
-function testImageSetRule(description, property, rule, expectedTexts)
+function testImageSetRule(description, property, rule, expected)
{
debug("");
debug(description + " : " + rule);
var div = document.createElement("div");
rule = "-webkit-image-set(" + rule + ")";
+ expected = "-webkit-image-set(" + expected + ")";
div.style[property] = rule;
document.body.appendChild(div);
- result = div.style[property].replace(/url\([^#]*#/g, "url(#");
- shouldBeEqualToString("result", rule);
+ result = div.style[property].replace(/url\([^#]*#/g, "url(\"#");
+ shouldBeEqualToString("result", expected);
document.body.removeChild(div);
}
testImageSetRule("Single value for background-image",
"background-image",
- "url(#a) 1x");
+ "url(#a) 1x",
+ "url(\"#a\") 1x");
testImageSetRule("Multiple values for background-image",
"background-image",
- "url(#a) 1x, url(#b) 2x");
+ "url(#a) 1x, url(#b) 2x",
+ "url(\"#a\") 1x, url(\"#b\") 2x");
testImageSetRule("Multiple values for background-image, out of order",
"background-image",
- "url(#c) 3x, url(#b) 2x, url(#a) 1x");
+ "url(#c) 3x, url(#b) 2x, url(#a) 1x",
+ "url(\"#c\") 3x, url(\"#b\") 2x, url(\"#a\") 1x");
testImageSetRule("Single value for content",
"content",
- "url(#a) 1x");
+ "url(#a) 1x",
+ "url(\"#a\") 1x");
testImageSetRule("Multiple values for content",
"content",
- "url(#a) 1x, url(#b) 2x");
+ "url(#a) 1x, url(#b) 2x",
+ "url(\"#a\") 1x, url(\"#b\") 2x");
testImageSetRule("Single value for border-image",
"-webkit-border-image",
- "url(#a) 1x");
+ "url(#a) 1x",
+ "url(\"#a\") 1x");
testImageSetRule("Multiple values for border-image",
"-webkit-border-image",
- "url(#a) 1x, url(#b) 2x");
+ "url(#a) 1x, url(#b) 2x",
+ "url(\"#a\") 1x, url(\"#b\") 2x");
testImageSetRule("Single value for -webkit-mask-box-image-source",
"-webkit-mask-box-image-source",
- "url(#a) 1x");
+ "url(#a) 1x",
+ "url(\"#a\") 1x");
testImageSetRule("Multiple values for -webkit-mask-box-image-source",
"-webkit-mask-box-image-source",
- "url(#a) 1x, url(#b) 2x");
+ "url(#a) 1x, url(#b) 2x",
+ "url(\"#a\") 1x, url(\"#b\") 2x");
successfullyParsed = true;

Powered by Google App Engine
This is Rietveld 408576698