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 produceGarbageForGCEvents(callback) |
| 8 { |
| 9 if (window.testRunner) { |
| 10 window.gc(); |
| 11 testRunner.displayAsyncThen(callback); |
| 12 } |
| 13 } |
| 14 |
| 15 function test() |
| 16 { |
| 17 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate)
; |
| 18 |
| 19 function validate(records) |
| 20 { |
| 21 for (var i = 0; i < records.length; ++i) { |
| 22 var record = records[i]; |
| 23 if (record.type === WebInspector.TimelineModel.RecordType.GCEvent) { |
| 24 InspectorTest.addResult("The expected GC event record"); |
| 25 InspectorTest.addObject(record, InspectorTest.timelinePropertyFo
rmatters); |
| 26 break; |
| 27 } |
| 28 } |
| 29 |
| 30 InspectorTest.completeTest(); |
| 31 } |
| 32 } |
| 33 |
| 34 </script> |
| 35 </head> |
| 36 |
| 37 <body onload="runTest()"> |
| 38 <p> |
| 39 Tests the Timeline API instrumentation of a gc event |
| 40 </p> |
| 41 </body> |
| 42 </html> |
OLD | NEW |