Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: LayoutTests/inspector/console/console-format-array-prototype.html

Issue 844563003: DevTools: Fix console not showing array items inherited from prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-format-array-prototype-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/console/console-format-array-prototype.html
diff --git a/LayoutTests/inspector/console/console-format-array-prototype.html b/LayoutTests/inspector/console/console-format-array-prototype.html
new file mode 100644
index 0000000000000000000000000000000000000000..c997f253cdec9e2787b0739fa5d29def13e39639
--- /dev/null
+++ b/LayoutTests/inspector/console/console-format-array-prototype.html
@@ -0,0 +1,90 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+
+function log(data)
+{
+ console.log(data);
+}
+
+Array.prototype[0] = "arr0";
+Array.prototype[10] = "arr10";
+Object.defineProperty(Object.prototype, "5", {
+ value: "obj5",
+ configurable: true,
+ writable: true,
+ enumerable: false
+});
+
+function tearDown()
+{
+ delete Array.prototype[0];
+ delete Array.prototype[10];
+ delete Object.prototype[5];
+}
+
+var a0 = [];
+var a1 = []; a1.length = 1;
+var a2 = []; a2.length = 5;
+var a3 = [,2,3];
+var a4 = []; a4.length = 15;
+var a5 = []; a5.length = 15; a5[8] = 8;
+var a6 = []; a6.length = 15; a6[0] = 0; a6[10] = 10;
+var a7 = [,,,4]; a7.length = 15;
+for (var i = 0; i < 6; ++i)
+ a7["index" + i] = i;
+var a8 = [];
+for (var i = 0; i < 10; ++i)
+ a8[i] = i;
+var a9 = [];
+for (var i = 1; i < 5; ++i) {
+ a9[i] = i;
+ a9[i + 5] = i + 5;
+}
+a9.length = 11;
+a9.foo = "bar";
+
+function test()
+{
+ loopOverGlobals(0, 10);
+
+ function loopOverGlobals(current, total)
+ {
+ function advance()
+ {
+ var next = current + 1;
+ if (next === total) {
+ InspectorTest.evaluateInPage("tearDown()");
+ InspectorTest.expandConsoleMessages();
+ InspectorTest.runAfterPendingDispatches(finish);
+ } else {
+ loopOverGlobals(next, total);
+ }
+ }
+
+ function finish()
+ {
+ InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
+ InspectorTest.completeTest();
+ }
+
+ InspectorTest.evaluateInConsole("a" + current);
+ InspectorTest.runAfterPendingDispatches(invokeConsoleLog);
+ function invokeConsoleLog()
+ {
+ InspectorTest.evaluateInPage("log(a" + current + ")");
+ InspectorTest.runAfterPendingDispatches(advance);
+ }
+ }
+}
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that console logging dumps array values defined on Array.prototype[].
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-format-array-prototype-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698