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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.js

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.js
new file mode 100644
index 0000000000000000000000000000000000000000..df14b4521839f2da991a4f432d9210e3748a945b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-release.js
@@ -0,0 +1,25 @@
+(async function() {
+ let {page, session, Protocol} = await InspectorTest.startHTML(`
+ <div id='node' style='background-color: red; width: 100px'></div>
+ `, 'Tests that the animation is correctly paused.');
+
+ Protocol.Animation.enable();
+ session.evaluate(`
+ window.animation = node.animate([{ width: '100px' }, { width: '2000px' }], { duration: 0, fill: 'forwards' });
+ `);
+
+ var id = (await Protocol.Animation.onceAnimationStarted()).params.animation.id;
+ InspectorTest.log('Animation started');
+ var width = await session.evaluate('node.offsetWidth');
+ InspectorTest.log('Box is animating: ' + (width != 100).toString());
+ Protocol.Animation.setPaused({ animations: [ id ], paused: true });
+ session.evaluate('animation.cancel()');
+ width = await session.evaluate('node.offsetWidth');
+ InspectorTest.log('Animation paused');
+ InspectorTest.log('Box is animating: ' + (width != 100).toString());
+ Protocol.Animation.releaseAnimations({ animations: [ id ] });
+ width = await session.evaluate('node.offsetWidth');
+ InspectorTest.log('Animation released');
+ InspectorTest.log('Box is animating: ' + (width != 100).toString());
+ InspectorTest.completeTest();
+})();

Powered by Google App Engine
This is Rietveld 408576698