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

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

Issue 2724083002: [SPv2] Decomposite otherwise-compositable animations that paint nothing. (Closed)
Patch Set: Add unit tests. Created 3 years, 9 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/resources/composited-animation-test.js
diff --git a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js
index c542583f92558c3a7986a8a1d6782222ff95879b..889984bfa4ef2ce1294146ed196c6fa4c3989d14 100644
--- a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js
+++ b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js
@@ -5,6 +5,7 @@ class CompositedAnimationTestCommon {
this.composited = composited;
this.tests = [];
this.nextInstanceId = 1;
+ this.errorCount = 0;
this.createStyles();
this.createStaticElements();
@@ -33,9 +34,10 @@ class CompositedAnimationTestCommon {
createStaticElements() {
this.error = document.createElement('span');
- this.error.style.color = 'red';
- // The element must have some painted content in order to be composited.
- this.error.textContent = 'x';
+ this.error.style = 'color: red; font-family: monospace; font-size: 12px';
+ // The error element must have some painted content in order to be
+ // composited when animated in SPv2.
+ this.error.innerText = '(no errors)';
document.body.appendChild(this.error);
this.wrapper = document.createElement('div');
@@ -108,6 +110,7 @@ class CompositedAnimationTestCommon {
var instance = test.instances[i];
// Use negative animation delays to specify sampled time for each animation.
+ // console.log('Creating test instance [duration=' + duration + ', delay=' + (-duration * sample.at) + ', easing=' + test.data.easing + '].');
pdr. 2017/03/24 20:37:47 nit: did you mean to leave this in?
wkorman 2017/03/24 20:59:26 Ah, good catch, removed.
instance.animation = instance.element.animate(test.data.keyframes, {
duration: duration,
iterations: Infinity,
@@ -129,16 +132,19 @@ class CompositedAnimationTestCommon {
test.instances.forEach(instance => {
var composited = internals.isCompositedAnimation(instance.animation);
if (composited != this.composited)
- this.reportError(test, `Animation ${composited ? 'is' : 'is not'} running on the compositor.`);
+ this.reportError(test, `Animation ${composited ? 'is' : 'is not'} running on the compositor [id=${instance.id}].`);
});
});
}
reportError(test, message) {
- if (!this.error.textContent)
- this.error.textContent = `${this.composited ? 'Tests:' : 'TestExpectations:'} `;
+ if (this.errorCount == 0)
+ this.error.innerHTML = `${this.composited ? 'Tests:' : 'TestExpectations:'}<br>`;
- this.error.textContent += `${test.name}: ${message} `;
+ if (this.errorCount > 0)
+ this.error.innerHTML += '<br>';
+ this.error.innerHTML += `${test.name}: ${message} `;
+ this.errorCount++;
}
waitForCompositor() {

Powered by Google App Engine
This is Rietveld 408576698