Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-statistics.html
blob6838a313714bbfbdaf2f0afa76ad4fdc1a45f70e
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="heap-snapshot-test.js"></script>
5 <script>
7 function test()
9 function createHeapSnapshot()
11 var builder = new InspectorTest.HeapSnapshotBuilder();
12 var index = 0;
13 for (type in InspectorTest.HeapNode.Type) {
14 if (!InspectorTest.HeapNode.Type.hasOwnProperty(type)) continue;
15 if (type === InspectorTest.HeapNode.Type.synthetic) continue;
16 if (type === InspectorTest.HeapNode.Type.number) continue;
17 ++index;
18 var size = index * Math.pow(10, index - 1);
19 var node = new InspectorTest.HeapNode(type, size, InspectorTest.HeapNode.Type[type]);
20 InspectorTest.addResult(type + " node size: " + size);
21 builder.rootNode.linkNode(node, InspectorTest.HeapEdge.Type.internal, type + "Link");
23 var jsArrayNode = new InspectorTest.HeapNode("Array", 8, InspectorTest.HeapNode.Type.object);
24 builder.rootNode.linkNode(jsArrayNode, InspectorTest.HeapEdge.Type.internal, "JSArrayLink");
25 var jsArrayContentsNode = new InspectorTest.HeapNode("", 12, InspectorTest.HeapNode.Type.array);
26 jsArrayNode.linkNode(jsArrayContentsNode, InspectorTest.HeapEdge.Type.internal, "elements");
27 var gcRootsNode = new InspectorTest.HeapNode("(GC roots)", 0, InspectorTest.HeapNode.Type.synthetic);
28 builder.rootNode.linkNode(gcRootsNode, InspectorTest.HeapEdge.Type.internal, "0");
29 var strongRoots = new InspectorTest.HeapNode("(Strong roots)", 0, InspectorTest.HeapNode.Type.synthetic);
30 gcRootsNode.linkNode(strongRoots, InspectorTest.HeapEdge.Type.internal, "0");
31 var systemObj = new InspectorTest.HeapNode("SystemObject", 900000000, InspectorTest.HeapNode.Type.object);
32 strongRoots.linkNode(systemObj, InspectorTest.HeapEdge.Type.internal, "0");
33 return builder.generateSnapshot();
36 InspectorTest.runHeapSnapshotTestSuite([
37 function testStatistics(next)
39 InspectorTest.addSniffer(WebInspector.HeapSnapshotView.prototype, "_gotStatistics", step1, true);
40 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, function() {});
42 function step1(statistics)
44 InspectorTest.addResult(JSON.stringify(statistics));
45 setTimeout(next, 0);
48 ]);
51 </script>
52 </head>
53 <body onload="runTest()">
54 <p>
55 Tests Statistics view of detailed heap snapshots.
56 </p>
57 </body>
58 </html>