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

Unified Diff: third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js

Issue 2891743003: Enable interpolation of CSS property font-variation-settings (Closed)
Patch Set: updatetest Created 3 years, 7 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/animations/interpolation/resources/interpolation-test.js
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js b/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
index 07b085363fa84f015281ceb58145fa3ad64126c4..3f98f56f3c7c4459b592dcc659a8f1f298aa1173 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/resources/interpolation-test.js
@@ -276,12 +276,19 @@
compositionTests.push({options, expectations});
}
+ function stringify(text) {
+ if (!text.includes("'")) {
+ return `'${text}'`;
+ }
+ return `"${text.replace('"', '\\"')}"`;
+ }
+
function keyframeText(keyframe) {
return isNeutralKeyframe(keyframe) ? 'neutral' : `[${keyframe}]`;
}
function keyframeCode(keyframe) {
- return isNeutralKeyframe(keyframe) ? 'neutralKeyframe' : `'${keyframe}'`;
+ return isNeutralKeyframe(keyframe) ? 'neutralKeyframe' : `${stringify(keyframe)}`;
}
function createInterpolationTestTargets(interpolationMethod, interpolationMethodContainer, interpolationTest, rebaselineContainer) {
@@ -330,7 +337,7 @@ assertInterpolation({
normalizeValue(getComputedStyle(expectedTargetContainer.target).getPropertyValue(property)));
}, `${testText} at (${expectation.at}) is [${sanitizeUrls(actualValue)}]`);
if (rebaselineExpectation) {
- rebaselineExpectation.textContent += ` {at: ${expectation.at}, is: '${actualValue}'},\n`;
+ rebaselineExpectation.textContent += ` {at: ${expectation.at}, is: ${stringify(actualValue)}},\n`;
}
};
return target;
@@ -359,9 +366,9 @@ assertInterpolation({
rebaseline.appendChild(document.createTextNode(`\
assertComposition({
property: '${property}',
- underlying: '${underlying}',
- ${fromComposite}From: '${from}',
- ${toComposite}To: '${to}',
+ underlying: '${stringify(underlying)}',
+ ${fromComposite}From: '${stringify(from)}',
+ ${toComposite}To: '${stringify(to)}',
}, [\n`));
var rebaselineExpectation;
rebaseline.appendChild(rebaselineExpectation = document.createTextNode(''));
@@ -387,7 +394,7 @@ assertComposition({
normalizeValue(getComputedStyle(expectedTargetContainer.target).getPropertyValue(property)));
}, `${testText} at (${expectation.at}) is [${sanitizeUrls(actualValue)}]`);
if (rebaselineExpectation) {
- rebaselineExpectation.textContent += ` {at: ${expectation.at}, is: '${actualValue}'},\n`;
+ rebaselineExpectation.textContent += ` {at: ${expectation.at}, is: ${stringify(actualValue)}},\n`;
}
};
return target;

Powered by Google App Engine
This is Rietveld 408576698