summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector-protocol/animation/animation-resolve.html
blob: ada0e6b8be45d198ac87dedc21e83ea0d0c1f9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>

var player;

function startAnimation()
{
    player = node.animate([{ width: "100px" }, { width: "200px" }], 2000);
}

function test()
{
    InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
    InspectorTest.sendCommand("Animation.enable", {});
    InspectorTest.evaluateInPage("startAnimation()", function() {});

    function onStarted(result)
    {
        InspectorTest.log("Animation started");
        InspectorTest.sendCommand("Animation.resolveAnimation", { animationId: result.params.animation.id }, animationResolved);
    }

    function animationResolved(response)
    {
        InspectorTest.log("Remote object:");
        InspectorTest.log(response.result.remoteObject.className);
        InspectorTest.completeTest();
    }
}

</script>
</head>
<body onload="runTest()">
    <div id="node" style="background-color: red; height: 100px"></div>
</body>
</html>