| 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="heap-snapshot-test.js"></script> | 4 <script src="heap-snapshot-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var instanceCount = 10; | 9 var instanceCount = 10; |
| 10 function createHeapSnapshot() | 10 function createHeapSnapshot() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 InspectorTest.switchToView("Summary", step1a); | 22 InspectorTest.switchToView("Summary", step1a); |
| 23 } | 23 } |
| 24 | 24 |
| 25 var columns; | 25 var columns; |
| 26 var currentColumn; | 26 var currentColumn; |
| 27 var currentColumnOrder; | 27 var currentColumnOrder; |
| 28 var windowRow; | 28 var windowRow; |
| 29 | 29 |
| 30 function step1a() | 30 function step1a() |
| 31 { | 31 { |
| 32 var row = InspectorTest.findRow("object", "Window"); | 32 var row = InspectorTest.findRow("Window"); |
| 33 InspectorTest.assertEquals(true, !!row, "\"Window\" class row"); | 33 InspectorTest.assertEquals(true, !!row, "\"Window\" class row"); |
| 34 InspectorTest.expandRow(row, step1b); | 34 InspectorTest.expandRow(row, step1b); |
| 35 } | 35 } |
| 36 | 36 |
| 37 function step1b(row) | 37 function step1b(row) |
| 38 { | 38 { |
| 39 InspectorTest.assertEquals(1, row.children.length, "single Windo
w object"); | 39 InspectorTest.assertEquals(1, row.children.length, "single Windo
w object"); |
| 40 windowRow = row.children[0]; | 40 windowRow = row.children[0]; |
| 41 InspectorTest.assertEquals(true, !!windowRow, "\"Window\" instan
ce row"); | 41 InspectorTest.assertEquals(true, !!windowRow, "\"Window\" instan
ce row"); |
| 42 InspectorTest.expandRow(windowRow, step2); | 42 InspectorTest.expandRow(windowRow, step2); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 setTimeout(next, 0); | 56 setTimeout(next, 0); |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 InspectorTest.clickColumn(columns[currentColumn], step4); | 59 InspectorTest.clickColumn(columns[currentColumn], step4); |
| 60 } | 60 } |
| 61 | 61 |
| 62 function step4(newColumnState) | 62 function step4(newColumnState) |
| 63 { | 63 { |
| 64 columns[currentColumn] = newColumnState; | 64 columns[currentColumn] = newColumnState; |
| 65 var columnName = columns[currentColumn].identifier; | 65 var columnName = columns[currentColumn].identifier; |
| 66 var contents = windowRow.children.map(function(obj) { return JSO
N.stringify(obj.data[columnName]); }); | 66 var contents = windowRow.children.map(function(obj) { return obj
.element.children[currentColumn].textContent; }); |
| 67 InspectorTest.assertEquals(instanceCount, contents.length, "colu
mn contents"); | 67 InspectorTest.assertEquals(instanceCount, contents.length, "colu
mn contents"); |
| 68 var sortTypes = { object: "text", distance: "number", count: "nu
mber", shallowSize: "size", retainedSize: "size" }; | 68 var sortTypes = { object: "text", distance: "number", count: "nu
mber", shallowSize: "size", retainedSize: "size" }; |
| 69 InspectorTest.assertEquals(true, !!sortTypes[columns[currentColu
mn].identifier], "sort by identifier"); | 69 InspectorTest.assertEquals(true, !!sortTypes[columns[currentColu
mn].identifier], "sort by identifier"); |
| 70 InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[cur
rentColumn].identifier], columns[currentColumn].sort); | 70 InspectorTest.checkArrayIsSorted(contents, sortTypes[columns[cur
rentColumn].identifier], columns[currentColumn].sort); |
| 71 | 71 |
| 72 if (!currentColumnOrder) | 72 if (!currentColumnOrder) |
| 73 currentColumnOrder = true; | 73 currentColumnOrder = true; |
| 74 else { | 74 else { |
| 75 currentColumnOrder = false; | 75 currentColumnOrder = false; |
| 76 ++currentColumn; | 76 ++currentColumn; |
| 77 } | 77 } |
| 78 step3(); | 78 step3(); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 ]); | 81 ]); |
| 82 } | 82 } |
| 83 | 83 |
| 84 </script> | 84 </script> |
| 85 </head> | 85 </head> |
| 86 <body onload="runTest()"> | 86 <body onload="runTest()"> |
| 87 <p> | 87 <p> |
| 88 Tests sorting in Summary view of detailed heap snapshots. | 88 Tests sorting in Summary view of detailed heap snapshots. |
| 89 </p> | 89 </p> |
| 90 </body> | 90 </body> |
| 91 </html> | 91 </html> |
| OLD | NEW |