| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
| 5 <script> | |
| 6 function appendIframe() | |
| 7 { | |
| 8 var frame = document.createElement("iframe"); | |
| 9 frame.src = "../resources/test-page-trigger-animation.html"; | |
| 10 document.body.appendChild(frame); | |
| 11 } | |
| 12 | |
| 13 function test() | |
| 14 { | |
| 15 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; | |
| 16 InspectorTest.sendCommand("Animation.enable", {}); | |
| 17 InspectorTest.evaluateInPage("appendIframe()", frameAttached); | |
| 18 var numberAnimationsCaptured = 0; | |
| 19 var lastStartTime = undefined; | |
| 20 | |
| 21 function frameAttached() | |
| 22 { | |
| 23 InspectorTest.log("Frame appended"); | |
| 24 } | |
| 25 | |
| 26 function onStarted(data) | |
| 27 { | |
| 28 var animation = data.params.animation; | |
| 29 | |
| 30 if (!lastStartTime || animation.startTime >= lastStartTime) | |
| 31 InspectorTest.log("Animation started: start time is valid"); | |
| 32 else if (lastStartTime) | |
| 33 InspectorTest.log("Animation started: invalid startTime!" + animatio
n.startTime + "." + lastStartTime); | |
| 34 lastStartTime = animation.startTime; | |
| 35 numberAnimationsCaptured++; | |
| 36 | |
| 37 if (numberAnimationsCaptured < 10) | |
| 38 InspectorTest.evaluateInPage("appendIframe()", frameAttached); | |
| 39 else | |
| 40 InspectorTest.completeTest(); | |
| 41 } | |
| 42 } | |
| 43 </script> | |
| 44 </head> | |
| 45 <body onload="runTest()"> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |