Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-summary-sorting-instances.html
blobc88b73ba85de0a034cec6d483560e219cae22446
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 var instanceCount = 10;
10 function createHeapSnapshot()
12 return InspectorTest.createHeapSnapshot(instanceCount);
15 InspectorTest.runHeapSnapshotTestSuite([
16 function testSorting(next)
18 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1);
20 function step1()
22 InspectorTest.switchToView("Summary", step1a);
25 var columns;
26 var currentColumn;
27 var currentColumnOrder;
29 function step1a()
31 var row = InspectorTest.findRow("B");
32 InspectorTest.assertEquals(true, !!row, "\"B\" row");
33 InspectorTest.expandRow(row, step2);
36 function step2(row)
38 columns = InspectorTest.viewColumns();
39 currentColumn = 0;
40 currentColumnOrder = false;
41 step3();
44 function step3()
46 if (currentColumn >= columns.length) {
47 setTimeout(next, 0);
48 return;
51 InspectorTest.clickColumn(columns[currentColumn], step4);
54 function step4(newColumnState)
56 columns[currentColumn] = newColumnState;
57 var columnName = columns[currentColumn].identifier;
58 var row = InspectorTest.findRow("B");
59 InspectorTest.assertEquals(true, !!row, "\"B\" row");
60 var contents = row.children.map(function(obj) { return obj.element().children[currentColumn].textContent; });
61 InspectorTest.assertEquals(instanceCount, contents.length, "column contents");
62 var sortTypes = { object: "text", distance: "number", count: "number", shallowSize: "size", retainedSize: "size" };
63 InspectorTest.assertEquals(true, !!sortTypes[columns[currentColumn].identifier], "sort by identifier");
64 InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[currentColumn].identifier], columns[currentColumn].sort);
66 if (!currentColumnOrder)
67 currentColumnOrder = true;
68 else {
69 currentColumnOrder = false;
70 ++currentColumn;
72 step3();
75 ]);
78 </script>
79 </head>
80 <body onload="runTest()">
81 <p>
82 Tests sorting in Summary view of detailed heap snapshots.
83 </p>
84 </body>
85 </html>