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

Unified Diff: LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js

Issue 16358010: [CSS Exclusions] Add CSS parsing support for image URI shape-inside and shape-outside values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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: LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
diff --git a/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js b/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
index 88dd5ceb1ecae0d2cd1970e3df5d6bd1d9ca8861..540badd4d295b52c24820459072f9d0d5d349e77 100644
--- a/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
+++ b/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
@@ -49,6 +49,20 @@ function test(value, expected) {
shouldBeEqualToString('testComputedStyle(' + unevaledString + ')', expected);
}
+// Need to remove the base URL to avoid having local paths in the expected results.
+function removeBaseURL(src) {
+ var urlRegexp = /url\(([^\)]*)\)/g;
+ return src.replace(urlRegexp, function(match, url) {
+ return "url(" + url.substr(url.lastIndexOf("/") + 1) + ")";
+ });
+}
+
+function testLocalURL(value, expected) {
+ var unevaledString = '"' + value.replace(/\\/g, "\\\\").replace(/"/g, "\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
+ shouldBeEqualToString('removeBaseURL(testCSSText(' + unevaledString + '))', expected);
+ shouldBeEqualToString('removeBaseURL(testComputedStyle(' + unevaledString + '))', expected);
+}
+
function negative_test(value) {
var unevaledString = '"' + value.replace(/\\/g, "\\\\").replace(/"/g, "\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
shouldBeEqualToString('testCSSText(' + unevaledString + ')', '');
@@ -71,6 +85,8 @@ test("polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30
test("polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)");
test("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
+testLocalURL("url(\'image\')", "url(image)");
+
shouldBeEqualToString('testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)")', "parent: auto, child: rectangle(10px, 20px, 30px, 40px)");
shouldBeEqualToString('testNotInherited("outside-shape", "rectangle(10px, 20px, 30px, 40px)")', "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px)");
shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial")', "parent: rectangle(10px, 20px, 30px, 40px), child: outside-shape");

Powered by Google App Engine
This is Rietveld 408576698