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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-seek-past-end.html

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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5 function startAnimation()
6 {
7 node.animate([{ width: "1000px" }, { width: "2000px" }], 1000);
8 }
9
10 function rafWidth(resolve, reject)
11 {
12 var callback;
13 var promise = new Promise((fulfill) => callback = fulfill);
14 if (window.testRunner)
15 testRunner.layoutAndPaintAsyncThen(() => callback(node.offsetWidth));
16 return promise;
17 }
18
19 function test()
20 {
21 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
22 InspectorTest.sendCommand("Animation.enable", {});
23 InspectorTest.evaluateInPage("startAnimation()", function() {});
24
25 function onStarted(response)
26 {
27 InspectorTest.log("Animation started");
28 seekAnimation(response.params.animation.id);
29 }
30
31 function seekAnimation(id)
32 {
33 InspectorTest.sendCommand("Animation.seekAnimations", { animations: [ id ], currentTime: 2000 }, logWidth);
34 }
35
36 function logWidth()
37 {
38 InspectorTest.evaluateInPageAsync("rafWidth()")
39 .then(function(result) {
40 InspectorTest.log(result);
41 InspectorTest.completeTest();
42 });
43 }
44 }
45
46 </script>
47 </head>
48 <body onload="runTest()">
49 <div id="node" style="background-color: red; height: 100px; width: 100px"></ div>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698