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

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

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp 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-multiple-frames.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcf19cf2b34aecdfdf718e5db920c23e2657cd59
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-multiple-frames.js
@@ -0,0 +1,38 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
+
+ await session.evaluate(`
+ function appendIframe() {
+ var frame = document.createElement('iframe');
+ frame.src = '${testRunner.url('../resources/test-page-trigger-animation.html')}';
+ document.body.appendChild(frame);
+ }
+ `);
+
+ async function appendFrame() {
+ await session.evaluate(`appendIframe()`);
+ testRunner.log('Frame appended');
+ }
+
+ var numberAnimationsCaptured = 0;
+ var lastStartTime = undefined;
+
+ dp.Animation.onAnimationStarted(data => {
+ var animation = data.params.animation;
+
+ if (!lastStartTime || animation.startTime >= lastStartTime)
+ testRunner.log('Animation started: start time is valid');
+ else if (lastStartTime)
+ testRunner.log('Animation started: invalid startTime!' + animation.startTime + '.' + lastStartTime);
+ lastStartTime = animation.startTime;
+ numberAnimationsCaptured++;
+
+ if (numberAnimationsCaptured < 10)
+ appendFrame();
+ else
+ testRunner.completeTest();
+ });
+
+ dp.Animation.enable();
+ appendFrame();
+})

Powered by Google App Engine
This is Rietveld 408576698