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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
new file mode 100644
index 0000000000000000000000000000000000000000..015d7a377e7831d4bdfaa59d1854b73d553182db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-start-cancel.js
@@ -0,0 +1,27 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startHTML(`
+ <div id='node' style='background-color: red; width: 100px'></div>
+ `, '');
+
+ dp.Animation.onAnimationCreated(() => testRunner.log('Animation created'));
+ dp.Animation.onAnimationStarted(() => testRunner.log('Animation started'));
+ dp.Animation.onAnimationCanceled(() => {
+ testRunner.log('Animation canceled')
+ testRunner.completeTest();
+ });
+ dp.Animation.enable();
+
+ session.evaluate(`
+ node.style.transition = '1s';
+ node.offsetTop;
+ node.style.width = '200px';
+ node.offsetTop;
+ // Deliberately delay for two RAFs, which causes the animation to start
+ // before we cancel it by clearing the transition.
+ window.requestAnimationFrame(function() {
+ window.requestAnimationFrame(function() {
+ node.style.transition = '';
+ });
+ });
+ `);
+})

Powered by Google App Engine
This is Rietveld 408576698