| <html> | |
| <head> | |
| <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| <script src="../../http/tests/inspector/console-test.js"></script> | |
| <script> | |
| function onload() | |
| { | |
| var a = []; | |
| for (var i = 0; i < 42; ++i) | |
| a[i] = i; | |
| a[100] = 100; | |
| console.dir(a); | |
| var b = []; | |
| for (var i = 0; i < 10; ++i) | |
| b[i] = i; | |
| b[100] = 100; | |
| console.dir(b); | |
| runTest(); | |
| } | |
| function test() | |
| { | |
| WebInspector.ArrayGroupingTreeElement._bucketThreshold = 20; | |
| var messages = WebInspector.console.messages; | |
| var sections = []; | |
| for (var i = 0; i < messages.length; ++i) { | |
| var element = messages[i].toMessageElement(); | |
| var node = element.traverseNextNode(element); | |
| while (node) { | |
| if (node._section) { | |
| sections.push(node._section); | |
| messages[i].section = node._section; | |
| node._section.expanded = true; | |
| } | |
| node = node.traverseNextNode(element); | |
| } | |
| } | |
| InspectorTest.addSniffer(WebInspector.ArrayGroupingTreeElement.prototype, "onpopulate", populateCalled, true); | |
| var populated = false; | |
| function populateCalled() | |
| { | |
| populated = this._toIndex == 100; | |
| } | |
| InspectorTest.runAfterPendingDispatches(expandRecursively); | |
| function expandRecursively() | |
| { | |
| for (var i = 0; i < sections.length; ++i) { | |
| for (var j = 0; j < sections[i].propertiesTreeOutline.children.length; ++j) { | |
| for (var treeElement = sections[i].propertiesTreeOutline.children[j]; treeElement; treeElement = treeElement.traverseNextTreeElement(false, null, false)) { | |
| if (treeElement.listItemElement.textContent.indexOf("__proto__") === -1) | |
| treeElement.expand(); | |
| } | |
| } | |
| } | |
| if (populated) | |
| InspectorTest.runAfterPendingDispatches(completeTest); | |
| else | |
| InspectorTest.runAfterPendingDispatches(expandRecursively); | |
| } | |
| function completeTest() | |
| { | |
| InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(WebInspector.consoleView.messagesElement)); | |
| InspectorTest.completeTest(); | |
| } | |
| } | |
| </script> | |
| </head> | |
| <body onload="onload()"> | |
| <p> | |
| Tests that console logging dumps large arrays properly. | |
| </p> | |
| </body> | |
| </html> |