Composited Animations: Introduce pixel-ref layout tests.
We get the animation to effectively start paused at the time fraction we care about.
In order to test a number of time fractions with a single pixel result, we're creating a new
element for each sample so we can check them simultaneously.
Migrated from this blink CL: https://codereview.chromium.org/1270303002/
BUG=509482
Committed: https://crrev.com/fabe15e0f2bb2ae79e93b69828733018f5c41402
Cr-Commit-Position: refs/heads/master@{#352539}
5 years, 2 months ago
(2015-10-06 01:47:50 UTC)
#5
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
File
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js
(right):
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:7:
this.next_sample_id = 1;
On 2015/09/30 01:45:27, alancutter wrote:
> Use camel cased variable names.
> It's not clear what a sample is, can this be named nextInstanceId instead?
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:32:
}`;
On 2015/09/30 01:45:27, alancutter wrote:
> Can't these be part of the same stylesheet?
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:46:
document.body.appendChild(wrapper);
On 2015/09/30 01:45:27, alancutter wrote:
> We shouldn't rely on the automatic element id global variable for elements
> created from Javascript since we already have the handle to them in our
current
> context. Just add them as members.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:52:
this.tests.forEach(function(test) {
On 2015/09/30 01:45:27, alancutter wrote:
> Use fat arrow notation so you don't have to .bind(this) everywhere.
> Alternatively just use for-of instead of forEach.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:59:
styleForSamples.type = 'text/css';
On 2015/09/30 01:45:27, alancutter wrote:
> No need to set type.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:60:
styleForSamples.textContent = '.test' + testId + ' {' + test.data.style + '}';
On 2015/09/30 01:45:27, alancutter wrote:
> Nit, this would be a suitable place to use backtick notation for embedded
> expressions.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:63:
if (test.data.markerStyle && test.data.markerStyle != '') {
On 2015/09/30 01:45:27, alancutter wrote:
> No need to check for empty string.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:68:
}
On 2015/09/30 01:45:27, alancutter wrote:
> Instead of adding separate stylesheets just set the inline style of the
> elements, check if doing this removes the need for testId entirely.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:77:
var content = document.createElement("div");
On 2015/09/30 01:45:27, alancutter wrote:
> Stick with single quotes in this file for consistency.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:114:
this.tests.forEach(function(test) {
On 2015/09/30 01:45:27, alancutter wrote:
> Assert that samples and instances are the same length.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:138:
assertAnimationsRunningOnCompositorThread() {
On 2015/09/30 01:45:27, alancutter wrote:
> assertAnimationCompositedState() since we could be asserting that they're not
> composited.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:142:
if (composited != !this.disableThreadedAnimation)
On 2015/09/30 01:45:27, alancutter wrote:
> This is very confusing to read. If we rename this.disableThreadedAnimation to
> this.composited it would be much clearer.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:157:
}
On 2015/09/30 01:45:27, alancutter wrote:
> Can we use requestAnimationFrame instead? We should try to make these tests
work
> with "content_shell --expose-internals-for-testing".
Done. layoutAndPaintAsyncThen implicitly posts message for
RenderWidgetCompositor::LayoutAndUpdateLayers and waits for tree activation and
drawing to happen. requestAnimationFrame works (by accident?) but I have no
explanations why. It might be fragile/flaky.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:200:
for (var i=0; i<=n; i++) {
On 2015/09/30 01:45:27, alancutter wrote:
> Spaces around binary operators.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
File
third_party/WebKit/LayoutTests/animations/resources/composited-animations-data/rotate-zero-degrees.js
(right):
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animations-data/rotate-zero-degrees.js:6:
style: `background: magenta; margin: 5px;`,
On 2015/09/30 01:45:27, alancutter wrote:
> No need for backtick string notation here and below.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animations-data/rotate-zero-degrees.js:60:
style: `background: blue; margin: 5px;`,
On 2015/09/30 01:45:27, alancutter wrote:
> margin: 5px; appears in every instance.
> I would consider making the interface to be something like:
> var testSuite = {
> style: 'margin: 5px;',
> tests: {
> testA: {
> keyframes: ...,
> style: ...,
> fractions: ...,
> },
> ...
> },
> };
>
> This allows you to include the test name on the test instances for easier
> debugging and doesn't require each test name to be typed a second time in a
test
> list.
Done.
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
File
third_party/WebKit/LayoutTests/animations/resources/composited-animations-data/simple.js
(right):
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/animations/resources/composited-animations-data/simple.js:7:
samples: [
On 2015/09/30 01:45:27, alancutter wrote:
> Is it necessary to wrap the fraction in {at:}?
> Can this just be "fractions: [0, 0.15, ...]"?
I want to keep it extensible (we have more Manual Tests to automate), so we can
add extra properties to individual samples.
(dstockwell@ coined "samples" BTW)
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
File
third_party/WebKit/LayoutTests/virtual/threaded/animations/composited-animations-translate-rotate-scale.html
(right):
https://chromiumcodereview.appspot.com/1360233004/diff/1/third_party/WebKit/L...
third_party/WebKit/LayoutTests/virtual/threaded/animations/composited-animations-translate-rotate-scale.html:9:
test.run();
On 2015/09/30 01:45:28, alancutter wrote:
> Can we simplify this to just
> runCompositedAnimationTests(translateRotateScaleTests) and
> runCompositedAnimationTestExpectations(translateRotateScaleTests) for the
> expected file?
Done.
alancutter (OOO until 2018)
lgtm with nits. https://codereview.chromium.org/1360233004/diff/20001/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js File third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js (right): https://codereview.chromium.org/1360233004/diff/20001/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js#newcode44 third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js:44: var testId = 1; This is ...
5 years, 2 months ago
(2015-10-06 03:42:49 UTC)
#6
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1360233004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1360233004/40001
5 years, 2 months ago
(2015-10-06 04:58:25 UTC)
#10
Issue 1360233004: Composited Animations: Introduce pixel-ref layout tests.
(Closed)
Created 5 years, 2 months ago by loyso (OOO)
Modified 5 years, 2 months ago
Reviewers: alancutter (OOO until 2018), ajuma, dstockwell, Ian Vollick
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 44