| Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dcf19cf2b34aecdfdf718e5db920c23e2657cd59
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js
|
| @@ -0,0 +1,38 @@
|
| +(async function(testRunner) {
|
| + let {page, session, dp} = await testRunner.startBlank('');
|
| +
|
| + await session.evaluate(`
|
| + function appendIframe() {
|
| + var frame = document.createElement('iframe');
|
| + frame.src = '${testRunner.url('../resources/test-page-trigger-animation.html')}';
|
| + document.body.appendChild(frame);
|
| + }
|
| + `);
|
| +
|
| + async function appendFrame() {
|
| + await session.evaluate(`appendIframe()`);
|
| + testRunner.log('Frame appended');
|
| + }
|
| +
|
| + var numberAnimationsCaptured = 0;
|
| + var lastStartTime = undefined;
|
| +
|
| + dp.Animation.onAnimationStarted(data => {
|
| + var animation = data.params.animation;
|
| +
|
| + if (!lastStartTime || animation.startTime >= lastStartTime)
|
| + testRunner.log('Animation started: start time is valid');
|
| + else if (lastStartTime)
|
| + testRunner.log('Animation started: invalid startTime!' + animation.startTime + '.' + lastStartTime);
|
| + lastStartTime = animation.startTime;
|
| + numberAnimationsCaptured++;
|
| +
|
| + if (numberAnimationsCaptured < 10)
|
| + appendFrame();
|
| + else
|
| + testRunner.completeTest();
|
| + });
|
| +
|
| + dp.Animation.enable();
|
| + appendFrame();
|
| +})
|
|
|