Chromium Code Reviews| Index: LayoutTests/inspector/timeline/timeline-gc-event.html |
| diff --git a/LayoutTests/inspector/timeline/timeline-gc-event.html b/LayoutTests/inspector/timeline/timeline-gc-event.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cffb4fbfc9194ea374c4a0ef997f308315116609 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/timeline/timeline-gc-event.html |
| @@ -0,0 +1,49 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/timeline-test.js"></script> |
| +<script> |
| + |
| +function produceGarbageForGCEvents(callback) |
| +{ |
| + var array = []; |
| + for (var i = 0; i < 1000; ++i) { |
| + array = []; |
| + for (var j = 0; j < 10000; ++j) |
| + array.push(Math.random()); |
| + } |
| + if (window.testRunner) |
|
yurys
2014/04/11 13:46:03
maybe call testRunner.gc() instead?
|
| + testRunner.displayAsyncThen(callback); |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.invokeAsyncWithTimeline("produceGarbageForGCEvents", validate); |
| + |
| + function validate(records) |
| + { |
| + for (var i = 0; i < records.length; ++i) { |
| + var record = records[i]; |
| + if (record.type === WebInspector.TimelineModel.RecordType.GCEvent) { |
|
yurys
2014/04/11 13:46:03
What if there is more than one GCEvent?
|
| + InspectorTest.addResult("The expected GC event record"); |
| + InspectorTest.addObject(record, InspectorTest.timelinePropertyFormatters); |
| + |
| + InspectorTest.addResult("The expected first call frame for GC event record call stack"); |
| + InspectorTest.addObject(record.stackTrace[0], InspectorTest.timelinePropertyFormatters); |
| + break; |
| + } |
| + } |
| + |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| +<p> |
| +Tests the Timeline API instrumentation of a gc event |
| +</p> |
| +</body> |
| +</html> |