Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-seek-past-end.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-seek-past-end.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-seek-past-end.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..53ecb415aa478b1dfa7ec966319d0be8998f2a85 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-seek-past-end.js |
@@ -0,0 +1,26 @@ |
+(async function(testRunner) { |
+ let {page, session, dp} = await testRunner.startHTML(` |
+ <div id='node' style='background-color: red; height: 100px; width: 100px'></div> |
+ `, ''); |
+ |
+ dp.Animation.enable(); |
+ session.evaluate(` |
+ node.animate([{ width: '1000px' }, { width: '2000px' }], 1000); |
+ `); |
+ |
+ var response = await dp.Animation.onceAnimationStarted(); |
+ testRunner.log('Animation started'); |
+ await dp.Animation.seekAnimations({ animations: [ response.params.animation.id ], currentTime: 2000 }); |
+ |
+ var rafWidth = await session.evaluateAsync(` |
+ (function rafWidth() { |
+ var callback; |
+ var promise = new Promise((fulfill) => callback = fulfill); |
+ if (window.testRunner) |
+ testRunner.layoutAndPaintAsyncThen(() => callback(node.offsetWidth)); |
+ return promise; |
+ })() |
+ `); |
+ testRunner.log(rafWidth); |
+ testRunner.completeTest(); |
+}) |