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

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

Issue 1422713012: Devtools Animations: Listen to all animation play state changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 var player;
7
8 function startAnimation() 6 function startAnimation()
9 { 7 {
10 player = node.animate([{ width: "100px" }, { width: "200px" }], 2000); 8 node.animate([{ width: "100px" }, { width: "200px" }], 2000);
11 }
12
13 function cancelAnimation()
14 {
15 player.cancel();
16 } 9 }
17 10
18 function test() 11 function test()
19 { 12 {
20 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; 13 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated;
21 InspectorTest.eventHandler["Animation.animationCanceled"] = onCanceled;
22 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; 14 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
23 InspectorTest.sendCommand("Animation.enable", {}); 15 InspectorTest.sendCommand("Animation.enable", {});
24 InspectorTest.evaluateInPage("startAnimation()", function() {}); 16 InspectorTest.evaluateInPage("startAnimation()", function() {});
25 17
26 function onCreated() 18 function onCreated()
27 { 19 {
28 InspectorTest.log("Animation created"); 20 InspectorTest.log("Animation created");
29 } 21 }
30 22
31 function onStarted() 23 function onStarted()
32 { 24 {
33 InspectorTest.log("Animation started"); 25 InspectorTest.log("Animation started");
34 InspectorTest.evaluateInPage("cancelAnimation()", function() {});
35 }
36
37 function onCanceled()
38 {
39 InspectorTest.log("Animation canceled");
40 InspectorTest.completeTest(); 26 InspectorTest.completeTest();
41 } 27 }
42 } 28 }
43 29
44 </script> 30 </script>
45 </head> 31 </head>
46 <body onload="runTest()"> 32 <body onload="runTest()">
47 <div id="node" style="background-color: red; height: 100px"></div> 33 <div id="node" style="background-color: red; height: 100px"></div>
48 </body> 34 </body>
49 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698