| 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 produceGarbageForGCEvents(callback) | 7 function produceGarbageForGCEvents(callback) |
| 8 { | 8 { |
| 9 if (window.testRunner) { | 9 if (window.testRunner) { |
| 10 window.gc(); | 10 window.gc(); |
| 11 testRunner.displayAsyncThen(callback); | 11 testRunner.displayAsyncThen(callback); |
| 12 } | 12 } |
| 13 } | 13 } |
| 14 | 14 |
| 15 function test() | 15 function test() |
| 16 { | 16 { |
| 17 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate)
; | 17 InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate)
; |
| 18 | 18 |
| 19 function validate(records) | 19 function validate() |
| 20 { | 20 { |
| 21 var gcRecords = InspectorTest.filterTimelineRecords(WebInspector.Timelin
eModel.RecordType.GCEvent, true); | 21 var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.Timeli
neModel.RecordType.GCEvent); |
| 22 if (gcRecords.length) { | 22 if (gcRecord) |
| 23 InspectorTest.addResult("The expected GC event record"); | 23 InspectorTest.addResult("SUCCESS: Found expected GC event record"); |
| 24 InspectorTest.addObject(gcRecords[0], InspectorTest.timelineProperty
Formatters); | 24 else |
| 25 } else { | 25 InspectorTest.addResult("FAIL: GC event record wasn't found"); |
| 26 InspectorTest.addResult("FAILED: GC event record wasn't found"); | |
| 27 } | |
| 28 | |
| 29 InspectorTest.completeTest(); | 26 InspectorTest.completeTest(); |
| 30 } | 27 } |
| 31 } | 28 } |
| 32 | 29 |
| 33 </script> | 30 </script> |
| 34 </head> | 31 </head> |
| 35 | 32 |
| 36 <body onload="runTest()"> | 33 <body onload="runTest()"> |
| 37 <p> | 34 <p> |
| 38 Tests the Timeline API instrumentation of a gc event | 35 Tests the Timeline API instrumentation of a gc event |
| 39 </p> | 36 </p> |
| 40 </body> | 37 </body> |
| 41 </html> | 38 </html> |
| OLD | NEW |