Commit 277fb712 authored by chenwilliam's avatar chenwilliam Committed by Commit Bot

DevTools: prepare migration for a batch of console tests

Make our git diffs decent!
Preparation for:
https://chromium-review.googlesource.com/c/572164/

Bug=667560

Review-Url: https://codereview.chromium.org/2982263002
Cr-Commit-Position: refs/heads/master@{#488477}
parent 37f9a307
...@@ -650,6 +650,39 @@ crbug.com/728378 virtual/layout_ng/overflow/overflow-position-004.html [ Failure ...@@ -650,6 +650,39 @@ crbug.com/728378 virtual/layout_ng/overflow/overflow-position-004.html [ Failure
# ====== LayoutNG-only failures until here ====== # ====== LayoutNG-only failures until here ======
# ====== DevTools test migration failures from here ======
# Temporary failures (these tests are copies from html to js)
# See crbug.com/667560 for details
crbug.com/667560 http/tests/devtools/console/console-assert.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-big-array.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-custom-formatters.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-dir-es6.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-dirxml.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-edit-expanded-tree.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-external-array.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-format-array-prototype.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-format-es6-2.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-format-es6-symbols-error.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-format-es6.js [ Skip ]
crbug.com/667560 http/tests/devtools/console/console-format-style.js [ Skip ]
### virtual/mojo-loading/http/tests/devtools
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-assert.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-big-array.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-custom-formatters.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-dir-es6.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-dirxml.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-edit-expanded-tree.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-external-array.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-format-array-prototype.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-format-es6-2.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-format-es6-symbols-error.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-format-es6.js [ Skip ]
crbug.com/667560 virtual/mojo-loading/http/tests/devtools/console/console-format-style.js [ Skip ]
# ====== DevTools test migration failures until here ======
# Run these tests with under virtual/scalefactor... only. # Run these tests with under virtual/scalefactor... only.
crbug.com/567837 fast/hidpi/static [ Skip ] crbug.com/567837 fast/hidpi/static [ Skip ]
......
CONSOLE ERROR: line 9: 1
CONSOLE ERROR: line 10: a
Tests that console.assert() will dump a message and stack trace with source URLs and line numbers.
console-assert.html:4 Assertion failed: 1
b @ console-assert.html:4
a @ console-assert.html:10
setTimeout (async)
(anonymous) @ VM:1
console-assert.html:5 Assertion failed: a b
b @ console-assert.html:5
a @ console-assert.html:10
setTimeout (async)
(anonymous) @ VM:1
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function b()
{
console.assert(false, 1);
console.assert(false, "a", "b");
}
function a()
{
b();
}
//# sourceURL=console-assert.html
</script>
<script>
function test()
{
var callCount = 0;
function callback()
{
if (++callCount === 2)
InspectorTest.expandConsoleMessages(onExpandedMessages);
}
function onExpandedMessages()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
InspectorTest.evaluateInPage("setTimeout(a, 0)");
InspectorTest.addConsoleSniffer(callback, true);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that console.assert() will dump a message and stack trace with source URLs and line numbers.
</p>
</body>
</html>
CONSOLE MESSAGE: line 13: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100
CONSOLE MESSAGE: line 18: ,,,,,,,,,
CONSOLE MESSAGE: line 24: 0,1,2,3,4,5,6,7,8,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100
CONSOLE MESSAGE: line 29: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404
CONSOLE MESSAGE: line 42: %O
CONSOLE MESSAGE: line 52: %O
CONSOLE MESSAGE: line 55: [object Uint8Array]
Tests that console logging dumps large arrays properly.
console-big-array.html:13 Array(101)
[0 … 19]
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: 10
11: 11
12: 12
13: 13
14: 14
15: 15
16: 16
17: 17
18: 18
19: 19
[20 … 39]
20: 20
21: 21
22: 22
23: 23
24: 24
25: 25
26: 26
27: 27
28: 28
29: 29
30: 30
31: 31
32: 32
33: 33
34: 34
35: 35
36: 36
37: 37
38: 38
39: 39
[40 … 100]
40: 40
41: 41
100: 100
length: 101
__proto__: Array(0)
console-big-array.html:18 Array(10)
0: undefined
1: undefined
2: undefined
3: undefined
4: undefined
5: undefined
6: undefined
7: undefined
8: undefined
9: undefined
length: 10
__proto__: Array(0)
console-big-array.html:24 Array(101)
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
100: 100
length: 101
__proto__: Array(0)
console-big-array.html:29 Array(405)
[0 … 399]
[0 … 19]
[20 … 39]
[40 … 59]
[60 … 79]
[80 … 99]
[100 … 119]
[120 … 139]
[140 … 159]
[160 … 179]
[180 … 199]
[200 … 219]
[220 … 239]
[240 … 259]
[260 … 279]
[280 … 299]
[300 … 319]
[320 … 339]
[340 … 359]
[360 … 379]
[380 … 399]
[400 … 404]
400: 400
401: 401
402: 402
403: 403
404: 404
length: 405
__proto__: Array(0)
console-big-array.html:42 Array(124)
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
123: 123
-Infinity: -Infinity
3.14: 3.14
4294967295: 4294967295
4294967296: 4294967296
Infinity: Infinity
-123: -123
NaN: NaN
length: 124
__proto__: Array(0)
console-big-array.html:52 Array(4294967295)
[0 … 19]
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10: 10
11: 11
12: 12
13: 13
14: 14
15: 15
16: 16
17: 17
18: 18
19: 19
[20 … 8388608]
20: 20
32: 32
64: 64
128: 128
256: 256
512: 512
1024: 1024
2048: 2048
4096: 4096
8192: 8192
16384: 16384
32768: 32768
65536: 65536
131072: 131072
262144: 262144
524288: 524288
1048576: 1048576
2097152: 2097152
4194304: 4194304
8388608: 8388608
[16777216 … 4294967294]
16777216: 16777216
33554432: 33554432
67108864: 67108864
134217728: 134217728
268435456: 268435456
536870912: 536870912
1073741824: 1073741824
2147483648: 2147483648
4294967294: 4294967294
4294967296: 4294967296
8589934592: 8589934592
length: 4294967295
__proto__: Array(0)
console-big-array.html:55 Uint8Array(64160003)
[0 … 63999999]
[0 … 3199999]
[3200000 … 6399999]
[6400000 … 9599999]
[9600000 … 12799999]
[12800000 … 15999999]
[16000000 … 19199999]
[19200000 … 22399999]
[22400000 … 25599999]
[25600000 … 28799999]
[28800000 … 31999999]
[32000000 … 35199999]
[35200000 … 38399999]
[38400000 … 41599999]
[41600000 … 44799999]
[44800000 … 47999999]
[48000000 … 51199999]
[51200000 … 54399999]
[54400000 … 57599999]
[57600000 … 60799999]
[60800000 … 63999999]
[64000000 … 64160002]
[64000000 … 64159999]
[64160000 … 64160002]
__proto__: TypedArray
<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] = undefined;
console.dir(b);
var c = [];
for (var i = 0; i < 10; ++i)
c[i] = i;
c[100] = 100;
console.dir(c);
var d = [];
for (var i = 0; i < 405; ++i)
d[i] = i;
console.dir(d);
var e = [];
for (var i = 0; i < 10; ++i)
e[i] = i;
e[123] = 123;
e[-123] = -123;
e[3.14] = 3.14;
e[4294967295] = 4294967295;
e[4294967296] = 4294967296;
e[Infinity] = Infinity;
e[-Infinity] = -Infinity;
e[NaN] = NaN;
console.log("%O", e);
var f = [];
f[4294967294] = 4294967294;
for (var i = 20; i >= 0; i -= 2)
f[i] = i;
for (var i = 2, n = 33; n--; i *= 2)
f[i] = i;
for (var i = 1; i < 20; i += 2)
f[i] = i;
console.log("%O", f)
var g = new Uint8Array(new ArrayBuffer(Math.pow(20, 6) + Math.pow(20, 4) + 3));
console.dir(g);
runTest();
}
function test()
{
ObjectUI.ArrayGroupingTreeElement._bucketThreshold = 20;
var messages = Console.ConsoleView.instance()._visibleViewMessages;
var sections = [];
for (var i = 0; i < messages.length; ++i) {
var consoleMessage = messages[i].consoleMessage();
var element = messages[i].toMessageElement();
var node = element.traverseNextNode(element);
while (node) {
if (node._section) {
sections.push(node._section);
node._section.expand();
}
node = node.traverseNextNode(element);
}
}
InspectorTest.addSniffer(ObjectUI.ArrayGroupingTreeElement.prototype, "onpopulate", populateCalled, true);
var populated = false;
function populateCalled()
{
populated = true;
}
InspectorTest.deprecatedRunAfterPendingDispatches(expandRecursively);
function expandRecursively()
{
for (var i = 0; i < sections.length; ++i) {
var children = sections[i].rootElement().children();
for (var j = 0; j < children.length; ++j) {
for (var treeElement = children[j]; treeElement; treeElement = treeElement.traverseNextTreeElement(true, null, true)) {
if (treeElement.listItemElement.textContent.indexOf("__proto__") === -1)
treeElement.expand();
}
}
}
if (populated)
InspectorTest.deprecatedRunAfterPendingDispatches(completeTest);
else
InspectorTest.deprecatedRunAfterPendingDispatches(expandRecursively);
}
function completeTest()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="onload()">
<p>
Tests that console logging dumps large arrays properly.
</p>
</body>
</html>
CONSOLE MESSAGE: line 123: [object Object]
CONSOLE MESSAGE: line 124: [object Object]
CONSOLE MESSAGE: line 125: [object Object]
CONSOLE MESSAGE: line 126: [object Object]
CONSOLE MESSAGE: line 127: [object Object]
CONSOLE ERROR: Custom Formatter Failed: Too deep hierarchy of inlined custom previews
Tests that console logging dumps properly when there are multiple custom formatters on the page
console-custom-formatters.html:123 Header formatted by 1 aBody formatted by 1 a
console-custom-formatters.html:124 Header formatted by 2 bBody formatted by 2 b
console-custom-formatters.html:125 Header formatted by 1 cBody formatted by 1 c
console-custom-formatters.html:126 Formatter with config Header info: additional infobodyinfo: additional info
console-custom-formatters.html:127 Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Object
Custom Formatter Failed: Too deep hierarchy of inlined custom previews undefined
Promise resolved (async)
logVars @ console-custom-formatters.html:127
(anonymous) @ VM:1
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
var a = {name: "a"};
var b = {name: "b"};
var c = {name: "c"};
a.formattableBy1 = true;
b.formattableBy2 = true;
c.formattableBy1 = true;
c.formattableBy2 = true;
var formatter1 = {
header: function(x)
{
if (!x.formattableBy1)
return null;
return ["span", {}, "Header formatted by 1 ", x.name];
},
hasBody: function(x)
{
return true;
},
body: function(x)
{
return ["span", {}, "Body formatted by 1 ", x.name]
}
};
var formatter2 = {
header: function(x)
{
if (!x.formattableBy2)
return null;
return ["span", {}, "Header formatted by 2 ", x.name];
},
hasBody: function(x)
{
return true;
},
body: function(x)
{
return ["span", {}, "Body formatted by 2 ", x.name]
}
};
var configTest = {};
var formatterWithConfig1 = {
header: function(x, config)
{
if (x !== configTest || config)
return null;
return ["span", {}, "Formatter with config ", ["object", {"object": x, "config": {"info": "additional info"}}]];
},
hasBody: function(x)
{
return false;
},
body: function(x)
{
throw "Unreachable"
}
}
var formatterWithConfig2 = {
header: function(x, config)
{
if (x !== configTest || !config)
return null;
return ["span", {}, "Header ", "info: ", config.info];
},
hasBody: function(x, config)
{
return config && config.info;
},
body: function(x, config)
{
return ["span", {}, "body", "info: ", config.info]
}
}
var selfReferenceTest = {};
var selfReferencingFormatter = {
header: function(x)
{
if (x !== selfReferenceTest)
return null;
return ["span", {}, "Formatter with config ", ["object", {"object": x}]];
},
hasBody: function(x)
{
return false;
},
body: function(x)
{
throw "Unreachable"
}
}
window.devtoolsFormatters = [formatter1, formatter2, formatterWithConfig1, formatterWithConfig2, selfReferencingFormatter];
function logVars()
{
console.log(a);
console.log(b);
console.log(c);
console.log(configTest);
console.log(selfReferenceTest);
//swap first formatters: test that header+body should be generated by the same formatter
window.devtoolsFormatters = [formatter2, formatter1, formatterWithConfig1, formatterWithConfig2, selfReferencingFormatter];
}
function test()
{
InspectorTest.mainTarget.runtimeAgent().setCustomObjectFormatterEnabled(true);
InspectorTest.evaluateInPage("logVars()", expandVariablesInConsole);
function expandVariablesInConsole()
{
var consoleView = Console.ConsoleView.instance();
if (consoleView._needsFullUpdate)
consoleView._updateMessageList();
var viewMessages = consoleView._visibleViewMessages;
for (var i = 0; i < viewMessages.length; ++i) {
var uiMessage = viewMessages[i];
var shadowRoot = uiMessage.contentElement().querySelector(".console-message-text *").shadowRoot;
var customElement = shadowRoot ? shadowRoot.querySelector(".custom-expandable-section-header") : null;
if (customElement)
customElement.click();
}
InspectorTest.deprecatedRunAfterPendingDispatches(dumpExpanded);
}
function dumpExpanded()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>Tests that console logging dumps properly when there are multiple custom formatters on the page</p>
</body>
</html>
CONSOLE MESSAGE: line 15: [object Object]
CONSOLE MESSAGE: line 18: Symbol()
CONSOLE MESSAGE: line 22: [object Map]
CONSOLE MESSAGE: line 22: [object WeakMap]
CONSOLE MESSAGE: line 26: [object Set]
CONSOLE MESSAGE: line 26: [object WeakSet]
CONSOLE MESSAGE: line 34: [object Set]
CONSOLE MESSAGE: line 37: [object WeakMap]
CONSOLE MESSAGE: line 45: [object Map Iterator]
CONSOLE MESSAGE: line 46: [object Map Iterator]
CONSOLE MESSAGE: line 47: [object Map Iterator]
CONSOLE MESSAGE: line 45: [object Set Iterator]
CONSOLE MESSAGE: line 46: [object Set Iterator]
CONSOLE MESSAGE: line 47: [object Set Iterator]
CONSOLE MESSAGE: line 85: class{method(){ return 1 }},class classWithWhitespace { method(){ return 1 } },class FooClass {
jump(x) { return 1 }
badArrow(x = a => 2) { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" }
},jump(x) { return 1 },class BarClass extends FooClass{},class BarClass2 extends class base{} {},class BarClass3 extends function base2(a, b) {} {},_ => { return 1 },(x) => { return 1 },(x, y, z) => { return 1 },({}) => { return 1 },([]) => { return 1 },() => { return "short" },() => { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" },(...x) => { return 1 },(x, y, ...z) => { return 1 },function (...x) { return 1 },function (x, y, ...z) { return 1 },function ({a}){ return 1 },function ([a]){ return 1 },function ({a, b}){ return 1 },function (...{a}){ return 1 },function (a = (1), b){ return 1 },function (a = {x: (1)}, b){ return 1 },function (a = (x) => { return 1 }, b){ return 2 },function ({a: b}){ return 1 },function (c = ")", {a: b}){ return 1 }
CONSOLE MESSAGE: line 93: badArrow(x = a => 2) { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" },function (a = ") {", b){ return 1 },function (a = function(){ return 1 }, b){ return 2 },function (a = class{ constructor(){} }){ return 2 }
Tests that console logging dumps proper messages.
console-dir-es6.html:15 Object
a: 1
Symbol(): 2
Symbol(Symbol.iterator): Symbol(foo)
Symbol(a): 3
Symbol(a): Symbol(Symbol.iterator)
__proto__: Object
console-dir-es6.html:18 Symbol()
console-dir-es6.html:22 Map(1)
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-dir-es6.html:22 WeakMap
__proto__: WeakMap
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-dir-es6.html:26 Set(1)
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:26 WeakSet
__proto__: WeakSet
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:34 Set(1)
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: Set(1)
length: 1
console-dir-es6.html:37 WeakMap
__proto__: WeakMap
[[Entries]]: Array(0)
length: 0
console-dir-es6.html:45 MapIterator
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "keys"
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:46 MapIterator
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:47 MapIterator
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-dir-es6.html:45 SetIterator
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:46 SetIterator
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:47 SetIterator
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(1)
0: Object
length: 1
console-dir-es6.html:85 Array(27)
0: class
1: class classWithWhitespace
2: class FooClass
3: ƒ jump(x)
4: class BarClass
5: class BarClass2
6: class BarClass3
7: _ => { return 1 }
8: (x) => { return 1 }
9: (x, y, z) => { return 1 }
10: ({}) => { return 1 }
11: ([]) => { return 1 }
12: () => { return "short" }
13: () => {…}
14: (...x) => { return 1 }
15: (x, y, ...z) => { return 1 }
16: ƒ (...x)
17: ƒ (x, y, ...z)
18: ƒ ({a})
19: ƒ ([a])
20: ƒ ({a, b})
21: ƒ (...{a})
22: ƒ (a = (1), b)
23: ƒ (a = {x: (1)}, b)
24: ƒ (a = (x) => { return 1 }, b)
25: ƒ ({a: b})
26: ƒ (c = ")", {a: b})
length: 27
__proto__: Array(0)
console-dir-es6.html:93 Array(4)
0: badArrow(x = a => {…}
1: ƒ (a = ")
2: ƒ (a = function()
3: ƒ (a = class{ constructor()
length: 4
__proto__: Array(0)
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function onload()
{
var obj = new Object();
obj["a"] = 1;
obj[Symbol()] = 2;
obj[Symbol("a")] = 3;
obj[Symbol("a")] = Symbol.iterator;
obj[Symbol.iterator] = Symbol("foo");
console.dir(obj);
// This used to crash in debug build.
console.dir(Symbol());
[new Map(), new WeakMap()].forEach(function(m) {
m.set(obj, {foo: 1});
console.dir(m);
});
[new Set(), new WeakSet()].forEach(function(s) {
s.add(obj);
console.dir(s);
});
// Test circular dependency by entries.
var s1 = new Set();
var s2 = new Set();
s1.add(s2);
s2.add(s1);
console.dir(s1);
// Test "No Entries" placeholder.
console.dir(new WeakMap());
// Test Map/Set iterators.
var m = new Map();
m.set(obj, {foo: 1});
var s = new Set();
s.add(obj);
[m, s].forEach(function(c) {
console.dir(c.keys());
console.dir(c.values());
console.dir(c.entries());
});
class FooClass {
jump(x) { return 1 }
badArrow(x = a => 2) { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" }
}
var fooInstance = new FooClass();
var fns = [
class{method(){ return 1 }},
class classWithWhitespace { method(){ return 1 } },
FooClass,
fooInstance.jump,
class BarClass extends FooClass{},
class BarClass2 extends class base{} {},
class BarClass3 extends function base2(a, b) {} {},
_ => { return 1 },
(x) => { return 1 },
(x, y, z) => { return 1 },
({}) => { return 1 },
([]) => { return 1 },
() => { return "short" },
() => { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" },
(...x) => { return 1 },
(x, y, ...z) => { return 1 },
function (...x) { return 1 },
function (x, y, ...z) { return 1 },
function({a}){ return 1 },
function([a]){ return 1 },
function({a, b}){ return 1 },
function(...{a}){ return 1 },
function(a = (1), b){ return 1 },
function(a = {x: (1)}, b){ return 1 },
function(a = (x) => { return 1 }, b){ return 2 },
function({a: b}){ return 1 },
function(c = ")", {a: b}){ return 1 }
];
console.dir(fns);
var badFns = [
fooInstance.badArrow,
function(a = ") {", b){ return 1 },
function(a = function(){ return 1 }, b){ return 2 },
function(a = class{ constructor(){} }){ return 2 }
];
console.dir(badFns);
runTest();
}
function test()
{
InspectorTest.expandConsoleMessages(dumpConsoleMessages);
function dumpConsoleMessages()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="onload()">
<p>
Tests that console logging dumps proper messages.
</p>
</body>
</html>
CONSOLE MESSAGE: line 12: [object HTMLDocument]
CONSOLE MESSAGE: line 13: [object DocumentFragment]
CONSOLE MESSAGE: line 14: [object HTMLParagraphElement]
CONSOLE MESSAGE: line 15: [object HTMLParagraphElement]
CONSOLE MESSAGE: line 16: [object HTMLDocument],[object DocumentFragment],[object HTMLSpanElement]
Tests that console logging dumps proper messages.
console-dirxml.html:12 #document
console-dirxml.html:13 #document-fragment
console-dirxml.html:14 <p></p>
console-dirxml.html:15 [p]
console-dirxml.html:16 (3) [document, document-fragment, span]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function logToConsole()
{
var fragment = document.createDocumentFragment();
fragment.appendChild(document.createElement("p"));
console.dirxml(document);
console.dirxml(fragment);
console.dirxml(fragment.firstChild);
console.log([fragment.firstChild]);
console.dirxml([document, fragment, document.createElement("span")]);
}
function test()
{
runtime.loadModulePromise("elements").then(function() {
InspectorTest.evaluateInPage("logToConsole()", onLoggedToConsole);
});
function onLoggedToConsole()
{
InspectorTest.waitForRemoteObjectsConsoleMessages(onRemoteObjectsLoaded)
}
function onRemoteObjectsLoaded()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that console logging dumps proper messages.
</p>
</body>
</html>
CONSOLE MESSAGE: line 12: [object Object]
Tests that expanded tree element is editable in console.
After viewport refresh tree element remains in editing mode: true
<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 < 100; ++i)
a[i] = i;
console.dir(a);
runTest();
}
function test()
{
InspectorTest.expandConsoleMessages(onConsoleMessageExpanded);
function onConsoleMessageExpanded()
{
var messages = Console.ConsoleView.instance()._visibleViewMessages;
for (var i = 0; i < messages.length; ++i) {
var message = messages[i];
var node = message.contentElement();
for (var node = message.contentElement(); node; node = node.traverseNextNode(message.contentElement())) {
if (node.treeElement) {
onTreeElement(node.treeElement.firstChild());
return;
}
}
}
}
function onTreeElement(treeElement)
{
treeElement._startEditing();
Console.ConsoleView.instance()._viewport.refresh();
InspectorTest.addResult("After viewport refresh tree element remains in editing mode: " + !!treeElement._prompt);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="onload()">
<p>
Tests that expanded tree element is editable in console.
</p>
</body>
</html>
CONSOLE MESSAGE: line 9: [object Int8Array]
CONSOLE MESSAGE: line 10: [object Int16Array]
CONSOLE MESSAGE: line 11: [object Int32Array]
CONSOLE MESSAGE: line 12: [object Uint8Array]
CONSOLE MESSAGE: line 13: [object Uint16Array]
CONSOLE MESSAGE: line 14: [object Uint32Array]
CONSOLE MESSAGE: line 15: [object Float32Array]
CONSOLE MESSAGE: line 16: [object Float64Array]
CONSOLE MESSAGE: line 18: [object Int8Array]
CONSOLE MESSAGE: line 19: [object Int16Array]
CONSOLE MESSAGE: line 20: [object Int32Array]
CONSOLE MESSAGE: line 21: [object Uint8Array]
CONSOLE MESSAGE: line 22: [object Uint16Array]
CONSOLE MESSAGE: line 23: [object Uint32Array]
CONSOLE MESSAGE: line 24: [object Float32Array]
CONSOLE MESSAGE: line 25: [object Float64Array]
Tests that console logging detects external arrays as arrays.
console-external-array.html:9 Int8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:10 Int16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:11 Int32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:12 Uint8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:13 Uint16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:14 Uint32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:15 Float32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:16 Float64Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
console-external-array.html:18 Int8Array(10)
console-external-array.html:19 Int16Array(10)
console-external-array.html:20 Int32Array(10)
console-external-array.html:21 Uint8Array(10)
console-external-array.html:22 Uint16Array(10)
console-external-array.html:23 Uint32Array(10)
console-external-array.html:24 Float32Array(10)
console-external-array.html:25 Float64Array(10)
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function logToConsole()
{
console.log(new Int8Array(10));
console.log(new Int16Array(10));
console.log(new Int32Array(10));
console.log(new Uint8Array(10));
console.log(new Uint16Array(10));
console.log(new Uint32Array(10));
console.log(new Float32Array(10));
console.log(new Float64Array(10));
console.dir(new Int8Array(10));
console.dir(new Int16Array(10));
console.dir(new Int32Array(10));
console.dir(new Uint8Array(10));
console.dir(new Uint16Array(10));
console.dir(new Uint32Array(10));
console.dir(new Float32Array(10));
console.dir(new Float64Array(10));
}
function test()
{
InspectorTest.evaluateInPage("logToConsole()", onLoggedToConsole);
function onLoggedToConsole()
{
InspectorTest.waitForRemoteObjectsConsoleMessages(onRemoteObjectsLoaded)
}
function onRemoteObjectsLoaded()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that console logging detects external arrays as arrays.
</p>
</body>
</html>
CONSOLE MESSAGE: line 9:
CONSOLE MESSAGE: line 9:
CONSOLE MESSAGE: line 9: ,,,,
CONSOLE MESSAGE: line 9: ,2,3
CONSOLE MESSAGE: line 9: ,,,,,,,,,,,,,,
CONSOLE MESSAGE: line 9: ,,,,,,,,8,,,,,,
CONSOLE MESSAGE: line 9: 0,,,,,,,,,,10,,,,
CONSOLE MESSAGE: line 9: ,,,4,,,,,,,,,,,
CONSOLE MESSAGE: line 9: 0,1,2,3,4,5,6,7,8,9
CONSOLE MESSAGE: line 9: ,1,2,3,4,,6,7,8,9,
CONSOLE MESSAGE: line 9: [object Object]
Tests that console logging dumps array values defined on Array.prototype[].
a0
[]
console-format-array-prototype.html:4 []
a1
[empty × 1]
console-format-array-prototype.html:4 [empty × 1]
a2
(5) [empty × 5]
console-format-array-prototype.html:4 (5) [empty × 5]
a3
(3) [empty × 1, 2, 3]
console-format-array-prototype.html:4 (3) [empty × 1, 2, 3]
a4
(15) [empty × 15]
console-format-array-prototype.html:4 (15) [empty × 15]
a5
(15) [empty × 8, 8, empty × 6]
console-format-array-prototype.html:4 (15) [empty × 8, 8, empty × 6]
a6
(15) [0, empty × 9, 10, empty × 4]
console-format-array-prototype.html:4 (15) [0, empty × 9, 10, empty × 4]
a7
(15) [3: 4, index0: 0, index1: 1, index2: 2, index3: 3, index4: 4, …]
console-format-array-prototype.html:4 (15) [3: 4, index0: 0, index1: 1, index2: 2, index3: 3, index4: 4, …]
a8
(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
console-format-array-prototype.html:4 (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
a9
(11) [empty × 1, 1, 2, 3, 4, empty × 1, 6, 7, 8, 9, empty × 1, foo: "bar"]
console-format-array-prototype.html:4 (11) [empty × 1, 1, 2, 3, 4, empty × 1, 6, 7, 8, 9, empty × 1, foo: "bar"]
a10
Array {}
console-format-array-prototype.html:4 Array {}
<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);
}
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";
a10 = Object.create([1,2]);
//# sourceURL=console-format-array-prototype.html
</script>
<script>
function test()
{
loopOverGlobals(0, 11);
function loopOverGlobals(current, total)
{
function advance()
{
var next = current + 1;
if (next === total) {
InspectorTest.evaluateInPage("tearDown()");
InspectorTest.deprecatedRunAfterPendingDispatches(finish);
} else {
loopOverGlobals(next, total);
}
}
function finish()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
InspectorTest.evaluateInConsole("a" + current);
InspectorTest.deprecatedRunAfterPendingDispatches(invokeConsoleLog);
function invokeConsoleLog()
{
InspectorTest.evaluateInPage("log(a" + current + ")");
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that console logging dumps array values defined on Array.prototype[].
</p>
</body>
</html>
CONSOLE MESSAGE: line 11: [object Map Iterator]
CONSOLE MESSAGE: line 12: [object Map Iterator]
CONSOLE MESSAGE: line 11: [object Map Iterator]
CONSOLE MESSAGE: line 12: [object Map Iterator]
CONSOLE MESSAGE: line 11: [object Map Iterator]
CONSOLE MESSAGE: line 12: [object Map Iterator]
CONSOLE MESSAGE: line 11: [object Set Iterator]
CONSOLE MESSAGE: line 12: [object Set Iterator]
CONSOLE MESSAGE: line 11: [object Set Iterator]
CONSOLE MESSAGE: line 12: [object Set Iterator]
CONSOLE MESSAGE: line 11: [object Set Iterator]
CONSOLE MESSAGE: line 12: [object Set Iterator]
CONSOLE MESSAGE: line 11: [object Map Iterator]
CONSOLE MESSAGE: line 12: [object Map Iterator]
CONSOLE MESSAGE: line 11: [object Set Iterator]
CONSOLE MESSAGE: line 12: [object Set Iterator]
Tests that console properly displays information about ES6 features.
console-format-es6-2.html:11 MapIterator {41, {…}}
console-format-es6-2.html:12 [MapIterator]
globals[0]
MapIterator {41, {…}}
console-format-es6-2.html:11 MapIterator {42, {…}}
console-format-es6-2.html:12 [MapIterator]
globals[1]
MapIterator {42, {…}}
console-format-es6-2.html:11 MapIterator {41 => 42, {…} => {…}}
console-format-es6-2.html:12 [MapIterator]
globals[2]
MapIterator {41 => 42, {…} => {…}}
console-format-es6-2.html:11 SetIterator {41, {…}}
console-format-es6-2.html:12 [SetIterator]
globals[3]
SetIterator {41, {…}}
console-format-es6-2.html:11 SetIterator {41, {…}}
console-format-es6-2.html:12 [SetIterator]
globals[4]
SetIterator {41, {…}}
console-format-es6-2.html:11 SetIterator {41, {…}}
console-format-es6-2.html:12 [SetIterator]
globals[5]
SetIterator {41, {…}}
console-format-es6-2.html:11 MapIterator {{…}}
console-format-es6-2.html:12 [MapIterator]
globals[6]
MapIterator {{…}}
console-format-es6-2.html:11 SetIterator {{…}}
console-format-es6-2.html:12 [SetIterator]
globals[7]
SetIterator {{…}}
Expanded all messages
console-format-es6-2.html:11 MapIterator {41, {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "keys"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:12 [MapIterator]
0: MapIterator {41, {…}}
length: 1
__proto__: Array(0)
globals[0]
MapIterator {41, {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "keys"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:11 MapIterator {42, {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 42
1: Object
length: 2
console-format-es6-2.html:12 [MapIterator]
0: MapIterator {42, {…}}
length: 1
__proto__: Array(0)
globals[1]
MapIterator {42, {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 42
1: Object
length: 2
console-format-es6-2.html:11 MapIterator {41 => 42, {…} => {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(2)
0: {41 => 42}
1: {Object => Object}
length: 2
console-format-es6-2.html:12 [MapIterator]
0: MapIterator {41 => 42, {…} => {…}}
length: 1
__proto__: Array(0)
globals[2]
MapIterator {41 => 42, {…} => {…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(2)
0: {41 => 42}
1: {Object => Object}
length: 2
console-format-es6-2.html:11 SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:12 [SetIterator]
0: SetIterator {41, {…}}
length: 1
__proto__: Array(0)
globals[3]
SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:11 SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:12 [SetIterator]
0: SetIterator {41, {…}}
length: 1
__proto__: Array(0)
globals[4]
SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "values"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:11 SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:12 [SetIterator]
0: SetIterator {41, {…}}
length: 1
__proto__: Array(0)
globals[5]
SetIterator {41, {…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 0
[[IteratorKind]]: "entries"
[[Entries]]: Array(2)
0: 41
1: Object
length: 2
console-format-es6-2.html:11 MapIterator {{…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 1
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6-2.html:12 [MapIterator]
0: MapIterator {{…}}
length: 1
__proto__: Array(0)
globals[6]
MapIterator {{…}}
__proto__: Map Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 1
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6-2.html:11 SetIterator {{…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 1
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6-2.html:12 [SetIterator]
0: SetIterator {{…}}
length: 1
__proto__: Array(0)
globals[7]
SetIterator {{…}}
__proto__: Set Iterator
[[IteratorHasMore]]: true
[[IteratorIndex]]: 1
[[IteratorKind]]: "values"
[[Entries]]: Array(1)
0: Object
length: 1
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
var globals = [];
function log(current)
{
console.log(globals[current]);
console.log([globals[current]]);
}
function onload()
{
var map2 = new Map();
map2.set(41, 42);
map2.set({foo: 1}, {foo: 2});
var iter1 = map2.values();
iter1.next();
var set2 = new Set();
set2.add(41);
set2.add({foo: 1});
var iter2 = set2.keys();
iter2.next();
globals = [
map2.keys(), map2.values(), map2.entries(),
set2.keys(), set2.values(), set2.entries(),
iter1, iter2,
];
runTest();
}
function test()
{
InspectorTest.evaluateInPage("globals.length", loopOverGlobals.bind(this, 0));
function loopOverGlobals(current, total)
{
function advance()
{
var next = current + 1;
if (next == total.description)
finish();
else
loopOverGlobals(next, total);
}
function finish()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.addResult("Expanded all messages");
InspectorTest.expandConsoleMessages(dumpConsoleMessages);
}
function dumpConsoleMessages()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
InspectorTest.evaluateInPage("log(" + current + ")");
InspectorTest.deprecatedRunAfterPendingDispatches(evalInConsole);
function evalInConsole()
{
InspectorTest.evaluateInConsole("globals[" + current + "]");
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
</script>
</head>
<body onload="onload()">
<p>
Tests that console properly displays information about ES6 features.
</p>
</body>
</html>
CONSOLE MESSAGE: line 11: [object Promise]
CONSOLE MESSAGE: line 12: [object Promise]
CONSOLE MESSAGE: line 11: Symbol()
CONSOLE MESSAGE: line 12: Symbol()
CONSOLE MESSAGE: line 11: Symbol(a)
CONSOLE MESSAGE: line 12: Symbol(a)
CONSOLE MESSAGE: line 11: [object Object]
CONSOLE MESSAGE: line 12: [object Object]
CONSOLE MESSAGE: line 11: [object Map]
CONSOLE MESSAGE: line 12: [object Map]
CONSOLE MESSAGE: line 11: [object WeakMap]
CONSOLE MESSAGE: line 12: [object WeakMap]
CONSOLE MESSAGE: line 11: [object Set]
CONSOLE MESSAGE: line 12: [object Set]
CONSOLE MESSAGE: line 11: [object WeakSet]
CONSOLE MESSAGE: line 12: [object WeakSet]
CONSOLE MESSAGE: line 11: [object Map]
CONSOLE MESSAGE: line 12: [object Map]
CONSOLE MESSAGE: line 11: [object Map]
CONSOLE MESSAGE: line 12: [object Map]
CONSOLE MESSAGE: line 11: [object Set]
CONSOLE MESSAGE: line 12: [object Set]
CONSOLE MESSAGE: line 11: [object Set]
CONSOLE MESSAGE: line 12: [object Set]
CONSOLE MESSAGE: line 11: [object Map]
CONSOLE MESSAGE: line 12: [object Map]
CONSOLE MESSAGE: line 11: [object Generator]
CONSOLE MESSAGE: line 12: [object Generator]
Tests that console properly displays information about ES6 features.
console-format-es6.html:11 Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0}
console-format-es6.html:12 [Promise]
globals[0]
Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0}
console-format-es6.html:11 Symbol()
console-format-es6.html:12 [Symbol()]
globals[1]
Symbol()
console-format-es6.html:11 Symbol(a)
console-format-es6.html:12 [Symbol(a)]
globals[2]
Symbol(a)
console-format-es6.html:11 {a: Symbol(), Symbol(a): 2}
console-format-es6.html:12 [{…}]
globals[3]
{a: Symbol(), Symbol(a): 2}
console-format-es6.html:11 Map(1) {{…} => {…}}
console-format-es6.html:12 [Map(1)]
globals[4]
Map(1) {{…} => {…}}
console-format-es6.html:11 WeakMap {{…} => {…}}
console-format-es6.html:12 [WeakMap]
globals[5]
WeakMap {{…} => {…}}
console-format-es6.html:11 Set(1) {{…}}
console-format-es6.html:12 [Set(1)]
globals[6]
Set(1) {{…}}
console-format-es6.html:11 WeakSet {{…}}
console-format-es6.html:12 [WeakSet]
globals[7]
WeakSet {{…}}
console-format-es6.html:11 Map(1) {Map(0) => WeakMap}
console-format-es6.html:12 [Map(1)]
globals[8]
Map(1) {Map(0) => WeakMap}
console-format-es6.html:11 Map(1) {Map(1) => WeakMap}
console-format-es6.html:12 [Map(1)]
globals[9]
Map(1) {Map(1) => WeakMap}
console-format-es6.html:11 Set(1) {WeakSet}
console-format-es6.html:12 [Set(1)]
globals[10]
Set(1) {WeakSet}
console-format-es6.html:11 Set(1) {WeakSet}
console-format-es6.html:12 [Set(1)]
globals[11]
Set(1) {WeakSet}
console-format-es6.html:11 Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, {…} => {…}, …}
console-format-es6.html:12 [Map(6)]
globals[12]
Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, {…} => {…}, …}
console-format-es6.html:11 genFunction {[[GeneratorStatus]]: "suspended"}
console-format-es6.html:12 [genFunction]
globals[13]
genFunction {[[GeneratorStatus]]: "suspended"}
Expanded all messages
console-format-es6.html:11 Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0}
__proto__: Promise
[[PromiseStatus]]: "rejected"
[[PromiseValue]]: -0
console-format-es6.html:12 [Promise]
0: Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0}
length: 1
__proto__: Array(0)
globals[0]
Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0}
__proto__: Promise
[[PromiseStatus]]: "rejected"
[[PromiseValue]]: -0
console-format-es6.html:11 Symbol()
console-format-es6.html:12 [Symbol()]
0: Symbol()
length: 1
__proto__: Array(0)
globals[1]
Symbol()
console-format-es6.html:11 Symbol(a)
console-format-es6.html:12 [Symbol(a)]
0: Symbol(a)
length: 1
__proto__: Array(0)
globals[2]
Symbol(a)
console-format-es6.html:11 {a: Symbol(), Symbol(a): 2}
a: Symbol()
getter: (...)
Symbol(a): 2
get getter: ƒ getter()
__proto__: Object
console-format-es6.html:12 [{…}]
0: {a: Symbol(), Symbol(a): 2}
length: 1
__proto__: Array(0)
globals[3]
{a: Symbol(), Symbol(a): 2}
a: Symbol()
getter: (...)
Symbol(a): 2
get getter: ƒ getter()
__proto__: Object
console-format-es6.html:11 Map(1) {{…} => {…}}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-format-es6.html:12 [Map(1)]
0: Map(1) {{…} => {…}}
length: 1
__proto__: Array(0)
globals[4]
Map(1) {{…} => {…}}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-format-es6.html:11 WeakMap {{…} => {…}}
__proto__: WeakMap
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-format-es6.html:12 [WeakMap]
0: WeakMap {{…} => {…}}
length: 1
__proto__: Array(0)
globals[5]
WeakMap {{…} => {…}}
__proto__: WeakMap
[[Entries]]: Array(1)
0: {Object => Object}
length: 1
console-format-es6.html:11 Set(1) {{…}}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6.html:12 [Set(1)]
0: Set(1) {{…}}
length: 1
__proto__: Array(0)
globals[6]
Set(1) {{…}}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6.html:11 WeakSet {{…}}
__proto__: WeakSet
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6.html:12 [WeakSet]
0: WeakSet {{…}}
length: 1
__proto__: Array(0)
globals[7]
WeakSet {{…}}
__proto__: WeakSet
[[Entries]]: Array(1)
0: Object
length: 1
console-format-es6.html:11 Map(1) {Map(0) => WeakMap}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Map(0) => WeakMap}
length: 1
console-format-es6.html:12 [Map(1)]
0: Map(1) {Map(0) => WeakMap}
length: 1
__proto__: Array(0)
globals[8]
Map(1) {Map(0) => WeakMap}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Map(0) => WeakMap}
length: 1
console-format-es6.html:11 Map(1) {Map(1) => WeakMap}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Map(1) => WeakMap}
length: 1
console-format-es6.html:12 [Map(1)]
0: Map(1) {Map(1) => WeakMap}
length: 1
__proto__: Array(0)
globals[9]
Map(1) {Map(1) => WeakMap}
size: (...)
__proto__: Map
[[Entries]]: Array(1)
0: {Map(1) => WeakMap}
length: 1
console-format-es6.html:11 Set(1) {WeakSet}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: WeakSet
length: 1
console-format-es6.html:12 [Set(1)]
0: Set(1) {WeakSet}
length: 1
__proto__: Array(0)
globals[10]
Set(1) {WeakSet}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: WeakSet
length: 1
console-format-es6.html:11 Set(1) {WeakSet}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: WeakSet
length: 1
console-format-es6.html:12 [Set(1)]
0: Set(1) {WeakSet}
length: 1
__proto__: Array(0)
globals[11]
Set(1) {WeakSet}
size: (...)
__proto__: Set
[[Entries]]: Array(1)
0: WeakSet
length: 1
console-format-es6.html:11 Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, {…} => {…}, …}
size: (...)
__proto__: Map
[[Entries]]: Array(6)
0: {" from str " => " to str "}
1: {undefined => undefined}
2: {null => null}
3: {42 => 42}
4: {Object => Object}
5: {Array(1) => Array(1)}
length: 6
console-format-es6.html:12 [Map(6)]
0: Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, {…} => {…}, …}
length: 1
__proto__: Array(0)
globals[12]
Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, {…} => {…}, …}
size: (...)
__proto__: Map
[[Entries]]: Array(6)
0: {" from str " => " to str "}
1: {undefined => undefined}
2: {null => null}
3: {42 => 42}
4: {Object => Object}
5: {Array(1) => Array(1)}
length: 6
console-format-es6.html:11 genFunction {[[GeneratorStatus]]: "suspended"}
__proto__: Generator
[[GeneratorStatus]]: "suspended"
[[GeneratorFunction]]: ƒ* ()
[[GeneratorReceiver]]: Window
[[GeneratorLocation]]: console-format-es6.html:56
[[Scopes]]: Scopes[2]
console-format-es6.html:12 [genFunction]
0: genFunction {[[GeneratorStatus]]: "suspended"}
length: 1
__proto__: Array(0)
globals[13]
genFunction {[[GeneratorStatus]]: "suspended"}
__proto__: Generator
[[GeneratorStatus]]: "suspended"
[[GeneratorFunction]]: ƒ* ()
[[GeneratorReceiver]]: Window
[[GeneratorLocation]]: console-format-es6.html:56
[[Scopes]]: Scopes[2]
CONSOLE MESSAGE: line 11: Symbol()
Tests that console properly displays information about ES6 Symbols.
console-format-es6-symbols-error.html:11 Symbol
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function logSymbolToConsoleWithError()
{
Symbol.prototype.toString = function (arg) { throw new Error(); };
var smb = Symbol();
console.log(smb);
}
function test()
{
InspectorTest.evaluateInPage("logSymbolToConsoleWithError()", complete);
function complete()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that console properly displays information about ES6 Symbols.
</p>
</body>
</html>
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
var globals = [];
function log(current)
{
console.log(globals[current]);
console.log([globals[current]]);
}
function onload()
{
var p = Promise.reject(-0);
p.catch(function() {});
var smb1 = Symbol();
var smb2 = Symbol("a");
var obj = {
get getter() {}
};
obj["a"] = smb1;
obj[smb2] = 2;
var map = new Map();
var weakMap = new WeakMap();
map.set(obj, {foo: 1});
weakMap.set(obj, {foo: 1});
var set = new Set();
var weakSet = new WeakSet();
set.add(obj);
weakSet.add(obj);
var mapMap0 = new Map();
mapMap0.set(new Map(), new WeakMap());
var mapMap = new Map();
mapMap.set(map, weakMap);
var setSet0 = new Set();
setSet0.add(new WeakSet());
var setSet = new Set();
setSet.add(weakSet);
var bigmap = new Map();
bigmap.set(" from str ", " to str ");
bigmap.set(undefined, undefined);
bigmap.set(null, null);
bigmap.set(42, 42);
bigmap.set({foo:"from"}, {foo:"to"});
bigmap.set(["from"], ["to"]);
var genFunction = function *() {
yield 1;
yield 2;
}
var generator = genFunction();
globals = [
p, smb1, smb2, obj, map, weakMap, set, weakSet,
mapMap0, mapMap, setSet0, setSet, bigmap, generator
];
runTest();
}
function test()
{
InspectorTest.evaluateInPage("globals.length", loopOverGlobals.bind(this, 0));
function loopOverGlobals(current, total)
{
function advance()
{
var next = current + 1;
if (next == total.description)
finish();
else
loopOverGlobals(next, total);
}
function finish()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.addResult("Expanded all messages");
InspectorTest.expandConsoleMessages(dumpConsoleMessages);
}
function dumpConsoleMessages()
{
InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
InspectorTest.evaluateInPage("log(" + current + ")");
InspectorTest.deprecatedRunAfterPendingDispatches(evalInConsole);
function evalInConsole()
{
InspectorTest.evaluateInConsole("globals[" + current + "]");
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
</script>
</head>
<body onload="onload()">
<p>
Tests that console properly displays information about ES6 features.
</p>
</body>
</html>
CONSOLE MESSAGE: line 8: %cBlue!.
CONSOLE MESSAGE: line 9: %cBlue! %cRed!
CONSOLE MESSAGE: line 10: %cwww.google.com
Tests that console logging dumps properly styled messages.
console-format-style.html:8 Blue!.
Styled text #0: color: blue;
console-format-style.html:9 Blue! Red!
Styled text #0: color: blue;
Styled text #1: color: red;
console-format-style.html:10 www.google.com
Styled text #0: color: blue;
Styled text #1: color: blue;
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function onload()
{
console.log("%cBlue!.", "color: blue;");
console.log("%cBlue! %cRed!", "color: blue;", "color: red;");
console.log("%cwww.google.com", "color: blue");
runTest();
}
function test()
{
InspectorTest.expandConsoleMessages(onExpanded);
function onExpanded()
{
InspectorTest.dumpConsoleMessagesWithStyles();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="onload()">
<p>Tests that console logging dumps properly styled messages.</p>
</body>
</html>
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
<html> <!-- NOTE: Test is being migrated (see crbug.com/667560) !--><html>
<head> <head>
<script src="../../http/tests/inspector/inspector-test.js"></script> <script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script> <script src="../../http/tests/inspector/console-test.js"></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment