d3c0e629016374d212d6e455da57768da50422a9
[WebKit-https.git] / LayoutTests / inspector / heap / gc.html
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
5 <script>
6 function test()
7 {
8     let suite = InspectorTest.createAsyncSuite("Heap.gc");
9
10     suite.addTestCase({
11         name: "TriggerGCShouldCreateGCEvent",
12         description: "Calling Heap.gc should trigger Heap.garbageCollected event if enabled.",
13         test: (resolve, reject) => {
14             HeapAgent.gc();
15             WebInspector.heapManager.singleFireEventListener(WebInspector.HeapManager.Event.GarbageCollected, (event) => {
16                 InspectorTest.expectThat(event.data.collection instanceof WebInspector.GarbageCollection, "Event should have GarbageCollection data.");
17                 InspectorTest.expectThat(event.data.collection.type === WebInspector.GarbageCollection.Type.Full, "GarbageCollection type should be Full.");
18                 resolve();
19             });
20         }
21     });
22
23     suite.runTestCasesAndFinish();
24 }
25 </script>
26 </head>
27 <body onload="runTest()">
28 <p>Test for the Heap.gc command.</p>
29 </body>
30 </html>