Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause-infinite.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause-infinite.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause-infinite.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b8add92806e40c82186745e4e0b7343b96a82705 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause-infinite.js |
@@ -0,0 +1,27 @@ |
+(async function() { |
+ let {page, session, Protocol} = await InspectorTest.startHTML(` |
+ <div id='node' style='background-color: red; height: 100px'></div> |
+ `, 'Tests that the animation is correctly paused.'); |
+ |
+ Protocol.Animation.enable(); |
+ session.evaluate(` |
+ window.animation = node.animate([{ width: '100px' }, { width: '2000px' }], { duration: 10000, iterations: Infinity }); |
+ `); |
+ |
+ var response = await Protocol.Animation.onceAnimationStarted(); |
+ InspectorTest.log('Animation started'); |
+ await Protocol.Animation.setPaused({ animations: [ response.params.animation.id ], paused: true }); |
+ |
+ var nodeWidth = await session.evaluate('node.offsetWidth'); |
+ 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; |
+ })() |
+ `); |
+ InspectorTest.log(rafWidth === nodeWidth); |
+ InspectorTest.completeTest(); |
+})(); |