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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-pause.html

Issue 1417173002: Devtools Animations: Pause button based on groups not global (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
6 var animation;
7
8 function startAnimation()
9 {
10 animation = node.animate([{ width: "100px" }, { width: "200px" }], 2000);
11 }
12
13 function getWidth()
14 {
15 return node.offsetWidth;
16 }
17
18 function test()
19 {
20 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
21 InspectorTest.sendCommand("Animation.enable", {});
22 InspectorTest.evaluateInPage("startAnimation()", function() {});
23
24 function onStarted(response)
25 {
26 InspectorTest.log("Animation started");
27 InspectorTest.evaluateInPage("logPaused()");
28 InspectorTest.sendCommand("Animation.setPaused", { animations: [ respons e.params.animation.id ], paused: true }, animPaused);
29 }
30
31 function animPaused()
32 {
33 InspectorTest.evaluateInPage("getWidth()", saveWidth);
34 }
35
36 var width;
37 function saveWidth(result)
38 {
39 width = result;
40 // Allow some frames to be painted to ensure it stays paused.
41 setTimeout(InspectorTest.evaluateInPage.bind(InspectorTest, "getWidth()" , checkWidth), 50);
pfeldman 2015/10/21 22:53:10 timeout is in most cases a source of the flake. th
samli 2015/10/21 22:54:21 That it is indeed truly paused.
pfeldman 2015/10/26 18:20:50 But 50 gives you nothing, it could result in 0 or
samli 2015/10/26 18:30:49 If its correctly paused, it doesn't matter if I me
42 }
43
44 function checkWidth(result)
45 {
46 InspectorTest.log(result == width);
47 InspectorTest.completeTest();
48 }
49
50 }
51
52 </script>
53 </head>
54 <body onload="runTest()">
55 Tests that the animation is correctly paused.
56 <div id="node" style="background-color: red; height: 100px"></div>
57 </body>
58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698