| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function performActions() | 7 function performActions(callback) |
| 8 { | 8 { |
| 9 var timerOne = setTimeout("1 + 1", 10); | 9 var timerOne = setTimeout("1 + 1", 10); |
| 10 var timerTwo = setInterval(intervalTimerWork, 20); | 10 var timerTwo = setInterval(intervalTimerWork, 20); |
| 11 var iteration = 0; | 11 var iteration = 0; |
| 12 | 12 |
| 13 function intervalTimerWork() | 13 function intervalTimerWork() |
| 14 { | 14 { |
| 15 if (++iteration < 2) | 15 if (++iteration < 2) |
| 16 return; | 16 return; |
| 17 clearInterval(timerTwo); | 17 clearInterval(timerTwo); |
| 18 callback(); |
| 18 } | 19 } |
| 19 } | 20 } |
| 20 | 21 |
| 21 function test() | 22 function test() |
| 22 { | 23 { |
| 23 InspectorTest.startTimeline(function() { | 24 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 24 InspectorTest.evaluateInPage("performActions()"); | |
| 25 }); | |
| 26 | |
| 27 InspectorTest.waitForRecordType("TimerRemove", finish); | |
| 28 | 25 |
| 29 function finish() | 26 function finish() |
| 30 { | 27 { |
| 31 InspectorTest.printTimelineRecords("TimerInstall"); | 28 InspectorTest.printTimelineRecords("TimerInstall"); |
| 32 InspectorTest.printTimelineRecords("TimerFire"); | 29 InspectorTest.printTimelineRecords("TimerFire"); |
| 33 InspectorTest.printTimelineRecords("TimerRemove"); | 30 InspectorTest.printTimelineRecords("TimerRemove"); |
| 34 InspectorTest.printTimelineRecords("FunctionCall"); | 31 InspectorTest.printTimelineRecords("FunctionCall"); |
| 35 InspectorTest.printTimelineRecords("EvaluateScript"); | 32 InspectorTest.printTimelineRecords("EvaluateScript"); |
| 36 InspectorTest.completeTest(); | 33 InspectorTest.completeTest(); |
| 37 } | 34 } |
| 38 } | 35 } |
| 39 | 36 |
| 40 if (!window.testRunner) | 37 if (!window.testRunner) |
| 41 setTimeout(performActions, 2000); | 38 setTimeout(performActions, 2000); |
| 42 | 39 |
| 43 </script> | 40 </script> |
| 44 </head> | 41 </head> |
| 45 | 42 |
| 46 <body onload="runTest()"> | 43 <body onload="runTest()"> |
| 47 <p> | 44 <p> |
| 48 Tests the Timeline events for Timers | 45 Tests the Timeline events for Timers |
| 49 </p> | 46 </p> |
| 50 </body> | 47 </body> |
| 51 </html> | 48 </html> |
| OLD | NEW |