4 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
6 function appendIframe()
8 var frame
= document
.createElement("iframe");
9 frame
.src
= "../resources/test-page-trigger-animation.html";
10 document
.body
.appendChild(frame
);
15 InspectorTest
.eventHandler
["Animation.animationCreated"] = onCreated
;
16 InspectorTest
.sendCommand("Animation.enable", {});
17 InspectorTest
.evaluateInPage("appendIframe()", frameAttached
);
18 var numberAnimationsCaptured
= 0;
19 var lastStartTime
= undefined;
21 function frameAttached()
23 InspectorTest
.log("Frame appended");
26 function onCreated(data
)
28 var player
= data
.params
.player
;
30 if (!lastStartTime
|| player
.startTime
> lastStartTime
)
31 InspectorTest
.log("Animation created: start time is valid");
32 lastStartTime
= player
.startTime
;
33 numberAnimationsCaptured
++;
35 if (numberAnimationsCaptured
< 10)
36 InspectorTest
.evaluateInPage("appendIframe()", frameAttached
);
38 InspectorTest
.completeTest();
43 <body onload=
"runTest()">