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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 (async function(testRunner) {
2 let {page, session, dp} = await testRunner.startBlank('');
3
4 await session.evaluate(`
5 function appendIframe() {
6 var frame = document.createElement('iframe');
7 frame.src = '${testRunner.url('../resources/test-page-trigger-animation.ht ml')}';
8 document.body.appendChild(frame);
9 }
10 `);
11
12 async function appendFrame() {
13 await session.evaluate(`appendIframe()`);
14 testRunner.log('Frame appended');
15 }
16
17 var numberAnimationsCaptured = 0;
18 var lastStartTime = undefined;
19
20 dp.Animation.onAnimationStarted(data => {
21 var animation = data.params.animation;
22
23 if (!lastStartTime || animation.startTime >= lastStartTime)
24 testRunner.log('Animation started: start time is valid');
25 else if (lastStartTime)
26 testRunner.log('Animation started: invalid startTime!' + animation.startTi me + '.' + lastStartTime);
27 lastStartTime = animation.startTime;
28 numberAnimationsCaptured++;
29
30 if (numberAnimationsCaptured < 10)
31 appendFrame();
32 else
33 testRunner.completeTest();
34 });
35
36 dp.Animation.enable();
37 appendFrame();
38 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698