| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../../http/tests/inspector/timeline-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function performActions(callback) | |
| 8 { | |
| 9 var skipUpdateFrameNumber = 2; | |
| 10 var lastFrame = 4; | |
| 11 var frameCount = 0; | |
| 12 | |
| 13 requestAnimationFrame(onFrame); | |
| 14 function onFrame() | |
| 15 { | |
| 16 ++frameCount; | |
| 17 console.timeStamp("FRAME " + frameCount); | |
| 18 // Do not update doc for one of the frames | |
| 19 if (frameCount !== skipUpdateFrameNumber) { | |
| 20 output("invalidating document"); | |
| 21 } | |
| 22 if (frameCount === lastFrame) | |
| 23 testRunner.displayAsyncThen(callback); | |
| 24 else | |
| 25 requestAnimationFrame(onFrame); | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 function test() | |
| 30 { | |
| 31 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | |
| 32 | |
| 33 function finish() | |
| 34 { | |
| 35 // Filter timestamp records | |
| 36 var timeStampRecords = []; | |
| 37 InspectorTest.printTimestampRecords(null, appendRecord); | |
| 38 function appendRecord(record) | |
| 39 { | |
| 40 timeStampRecords.push(record); | |
| 41 } | |
| 42 | |
| 43 var frames = InspectorTest.timelineFrameModel().frames(); | |
| 44 var recordIndex = 0; | |
| 45 | |
| 46 for (var frameIndex = 0; frameIndex < frames.length; ++frameIndex) { | |
| 47 InspectorTest.addResult("Frame " + frameIndex); | |
| 48 var nextFrameStartTime = frameIndex + 1 < frames.length ? frames[fra
meIndex + 1].startTime : Infinity; | |
| 49 for (;recordIndex < timeStampRecords.length && timeStampRecords[reco
rdIndex].startTime() < nextFrameStartTime; ++recordIndex) | |
| 50 InspectorTest.dumpTimelineRecord(timeStampRecords[recordIndex]); | |
| 51 } | |
| 52 InspectorTest.completeTest(); | |
| 53 } | |
| 54 } | |
| 55 | |
| 56 </script> | |
| 57 </head> | |
| 58 | |
| 59 <body onload="runTest()"> | |
| 60 <p> | |
| 61 Tests reporting and canceling of didBeginFrame events in Timeline | |
| 62 </p> | |
| 63 | |
| 64 </body> | |
| 65 </html> | |
| OLD | NEW |