OLD | NEW |
(Empty) | |
| 1 (async function() { |
| 2 let {page, session, Protocol} = await InspectorTest.startHTML(` |
| 3 <div id='node' style='background-color: red; height: 100px; width: 100px'></
div> |
| 4 `, ''); |
| 5 |
| 6 Protocol.Animation.enable(); |
| 7 session.evaluate(` |
| 8 node.animate([{ width: '1000px' }, { width: '2000px' }], 1000); |
| 9 `); |
| 10 |
| 11 var response = await Protocol.Animation.onceAnimationStarted(); |
| 12 InspectorTest.log('Animation started'); |
| 13 await Protocol.Animation.seekAnimations({ animations: [ response.params.animat
ion.id ], currentTime: 2000 }); |
| 14 |
| 15 var rafWidth = await session.evaluateAsync(` |
| 16 (function rafWidth() { |
| 17 var callback; |
| 18 var promise = new Promise((fulfill) => callback = fulfill); |
| 19 if (window.testRunner) |
| 20 testRunner.layoutAndPaintAsyncThen(() => callback(node.offsetWidth))
; |
| 21 return promise; |
| 22 })() |
| 23 `); |
| 24 InspectorTest.log(rafWidth); |
| 25 InspectorTest.completeTest(); |
| 26 })(); |
OLD | NEW |