blob: f8d49c97afbf000b3fadf1f06224baf3ec8bfac8 [file] [log] [blame]
<!doctype html>
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
function appendIframe()
{
var frame = document.createElement("iframe");
frame.src = "../resources/test-page-trigger-animation.html";
document.body.appendChild(frame);
}
function test()
{
InspectorTest.eventHandler["Animation.animationStarted"] = onStarted;
InspectorTest.sendCommand("Animation.enable", {});
InspectorTest.evaluateInPage("appendIframe()", frameAttached);
var numberAnimationsCaptured = 0;
var lastStartTime = undefined;
function frameAttached()
{
InspectorTest.log("Frame appended");
}
function onStarted(data)
{
var animation = data.params.animation;
if (!lastStartTime || animation.startTime >= lastStartTime)
InspectorTest.log("Animation started: start time is valid");
else if (lastStartTime)
InspectorTest.log("Animation started: invalid startTime!" + animation.startTime + "." + lastStartTime);
lastStartTime = animation.startTime;
numberAnimationsCaptured++;
if (numberAnimationsCaptured < 10)
InspectorTest.evaluateInPage("appendIframe()", frameAttached);
else
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
</body>
</html>