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(records) |
20 { | 20 { |
21 for (var i = 0; i < records.length; ++i) { | 21 var gcRecords = InspectorTest.filterTimelineRecords(WebInspector.Timelin
eModel.RecordType.GCEvent, true); |
22 var record = records[i]; | 22 if (gcRecords.length) { |
23 if (record.type === WebInspector.TimelineModel.RecordType.GCEvent) { | 23 InspectorTest.addResult("The expected GC event record"); |
24 InspectorTest.addResult("The expected GC event record"); | 24 InspectorTest.addObject(gcRecords[0], InspectorTest.timelineProperty
Formatters); |
25 InspectorTest.addObject(record, InspectorTest.timelinePropertyFo
rmatters); | 25 } else { |
26 break; | 26 InspectorTest.addResult("FAILED: GC event record wasn't found"); |
27 } | |
28 } | 27 } |
29 | 28 |
30 InspectorTest.completeTest(); | 29 InspectorTest.completeTest(); |
31 } | 30 } |
32 } | 31 } |
33 | 32 |
34 </script> | 33 </script> |
35 </head> | 34 </head> |
36 | 35 |
37 <body onload="runTest()"> | 36 <body onload="runTest()"> |
38 <p> | 37 <p> |
39 Tests the Timeline API instrumentation of a gc event | 38 Tests the Timeline API instrumentation of a gc event |
40 </p> | 39 </p> |
41 </body> | 40 </body> |
42 </html> | 41 </html> |
OLD | NEW |