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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js

Issue 2950193003: [DevTools] Migrate inspector-protocol/animation tests to new harness (Closed)
Patch Set: 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.startHTML(`
3 <div id='node' style='background-color: red; width: 100px'></div>
4 `, '');
5
6 dp.Animation.onAnimationCreated(() => testRunner.log('Animation created'));
7 dp.Animation.onAnimationStarted(() => testRunner.log('Animation started'));
8 dp.Animation.onAnimationCanceled(() => {
9 testRunner.log('Animation canceled')
10 testRunner.completeTest();
11 });
12 dp.Animation.enable();
13
14 session.evaluate(`
15 node.style.transition = '1s';
16 node.offsetTop;
17 node.style.width = '200px';
18 node.offsetTop;
19 // Deliberately delay for two RAFs, which causes the animation to start
20 // before we cancel it by clearing the transition.
21 window.requestAnimationFrame(function() {
22 window.requestAnimationFrame(function() {
23 node.style.transition = '';
24 });
25 });
26 `);
27 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698