diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/client/webconsole/test/node/fixtures | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/webconsole/test/node/fixtures')
14 files changed, 5053 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/node/fixtures/.eslintrc.js b/devtools/client/webconsole/test/node/fixtures/.eslintrc.js new file mode 100644 index 0000000000..56bfc52fb1 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/.eslintrc.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = { + // Extend from the shared list of defined globals for mochitests. + extends: "../../../../../.eslintrc.mochitests.js", +}; diff --git a/devtools/client/webconsole/test/node/fixtures/DevToolsUtils.js b/devtools/client/webconsole/test/node/fixtures/DevToolsUtils.js new file mode 100644 index 0000000000..5be367a60e --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/DevToolsUtils.js @@ -0,0 +1,8 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + getTopWindow: () => ({}), +}; diff --git a/devtools/client/webconsole/test/node/fixtures/WebConsoleUtils.js b/devtools/client/webconsole/test/node/fixtures/WebConsoleUtils.js new file mode 100644 index 0000000000..17714bee64 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/WebConsoleUtils.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const L10n = require("devtools/client/webconsole/test/node/fixtures/L10n"); + +const Utils = { + L10n, + supportsString: function(s) { + return s; + }, +}; + +module.exports = { + Utils, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/async-storage.js b/devtools/client/webconsole/test/node/fixtures/async-storage.js new file mode 100644 index 0000000000..35ed2f594f --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/async-storage.js @@ -0,0 +1,13 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + getItem: () => Promise.resolve(), + setItem: () => Promise.resolve(), + removeItem: () => Promise.resolve(), + clear: () => Promise.resolve(), + length: () => Promise.resolve(), + key: () => Promise.resolve(), +}; diff --git a/devtools/client/webconsole/test/node/fixtures/serviceContainer.js b/devtools/client/webconsole/test/node/fixtures/serviceContainer.js new file mode 100644 index 0000000000..f78712c3aa --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/serviceContainer.js @@ -0,0 +1,31 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + attachRefToWebConsoleUI: () => {}, + emitForTests: () => {}, + proxy: { + client: {}, + releaseActor: actor => console.log("Release actor", actor), + }, + onViewSourceInDebugger: () => {}, + onViewSourceInStyleEditor: () => {}, + openNetworkPanel: () => {}, + resendNetworkRequest: () => {}, + sourceMapURLService: { + subscribeByURL: () => { + return () => {}; + }, + subscribeByID: () => { + return () => {}; + }, + subscribeByLocation: () => { + return () => {}; + }, + }, + openLink: () => {}, + // eslint-disable-next-line react/display-name + createElement: tagName => document.createElement(tagName), +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/browser_dummy.js b/devtools/client/webconsole/test/node/fixtures/stubs/browser_dummy.js new file mode 100644 index 0000000000..8a9353cd7e --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/browser_dummy.js @@ -0,0 +1,11 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// This file is a fake test so we can have support files in the stubs.ini, which are then +// referenced as support files in the webconsole mochitest ini file. + +"use strict"; + +add_task(function() { + ok(true, "this is not a test"); +}); diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js new file mode 100644 index 0000000000..d40621cc34 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/consoleApi.js @@ -0,0 +1,2042 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`console.log('foobar', 'test')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "foobar", + "test" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log(undefined)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "type": "undefined" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.warn('danger, will robinson!')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "danger, will robinson!" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "warn", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log(NaN)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "type": "NaN" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log(null)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "type": "null" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('鼬')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "鼬" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.clear()`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "clear", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": { + "count": 1, + "label": "bar" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.assert(false, {message: 'foobar'})`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj31", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "message": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "foobar" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj31" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "assert", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source30", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "stacktrace": [ + { + "columnNumber": 35, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "lineNumber": 1, + "sourceId": "server0.conn0.child1/source30" + } + ], + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('úṇĩçödê țĕșť')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "úṇĩçödê țĕșť" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.dirxml(window)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj34", + "class": "Window", + "ownPropertyLength": 818, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "ObjectWithURL", + "url": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html" + } + }, + "actorID": "server0.conn0.child1/obj34" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "dirxml", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('myarray', ['red', 'green', 'blue'])`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "myarray", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj36", + "class": "Array", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "ArrayLike", + "length": 3, + "items": [ + "red", + "green", + "blue" + ] + } + }, + "actorID": "server0.conn0.child1/obj36" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('myregex', /a.b.c/)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "myregex", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj38", + "class": "RegExp", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "displayString": "/a.b.c/" + }, + "actorID": "server0.conn0.child1/obj38" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.table(['red', 'green', 'blue']);`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj40", + "class": "Array", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": null, + "ownProperties": { + "0": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "red" + }, + "1": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "green" + }, + "2": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "blue" + } + } + }, + "actorID": "server0.conn0.child1/obj40" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "table", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "myobject", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj42", + "class": "Object", + "ownPropertyLength": 3, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "red": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "redValue" + }, + "green": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "greenValue" + }, + "blue": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "blueValue" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 3, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj42" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.debug('debug message');`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "debug message" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "debug", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.info('info message');`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "info message" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "info", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.error('error message');`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "error message" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "error", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source30", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "stacktrace": [ + { + "columnNumber": 35, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "lineNumber": 1, + "sourceId": "server0.conn0.child1/source30" + } + ], + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('mymap')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "mymap", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj47", + "class": "Map", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "MapLike", + "size": 2, + "entries": [ + [ + "key1", + "value1" + ], + [ + "key2", + "value2" + ] + ] + } + }, + "actorID": "server0.conn0.child1/obj47" + } + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 5, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source46", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log('myset')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "myset", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj49", + "class": "Set", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "ArrayLike", + "length": 2, + "items": [ + "a", + "b" + ] + } + }, + "actorID": "server0.conn0.child1/obj49" + } + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.trace()`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 13, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "testStacktraceFiltering", + "groupName": "", + "level": "trace", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source50", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "stacktrace": [ + { + "columnNumber": 13, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "testStacktraceFiltering", + "lineNumber": 3, + "sourceId": "server0.conn0.child1/source50" + }, + { + "columnNumber": 5, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "foo", + "lineNumber": 6, + "sourceId": "server0.conn0.child1/source50" + }, + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "lineNumber": 9, + "sourceId": "server0.conn0.child1/source50" + } + ], + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.trace('bar', {'foo': 'bar'}, [1,2,3])`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj52", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "foo": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "bar" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj52" + }, + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj53", + "class": "Array", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "ArrayLike", + "length": 3, + "items": [ + 1, + 2, + 3 + ] + } + }, + "actorID": "server0.conn0.child1/obj53" + } + ], + "chromeContext": false, + "columnNumber": 13, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "testStacktraceWithLog", + "groupName": "", + "level": "trace", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source51", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "stacktrace": [ + { + "columnNumber": 13, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "testStacktraceWithLog", + "lineNumber": 3, + "sourceId": "server0.conn0.child1/source51" + }, + { + "columnNumber": 5, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "foo", + "lineNumber": 6, + "sourceId": "server0.conn0.child1/source50" + }, + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "lineNumber": 9, + "sourceId": "server0.conn0.child1/source50" + } + ], + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.trace("%cHello%c|%cWorld")`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "Hello", + "|", + "World" + ], + "chromeContext": false, + "columnNumber": 13, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "trace", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child3/source57", + "styles": [ + "color:red", + "", + "color: blue" + ], + "timeStamp": 1572867483805, + "timer": null, + "stacktrace": [ + { + "columnNumber": 13, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "lineNumber": 2, + "sourceId": "server0.conn0.child3/source57" + } + ], + "workerType": "none", + "category": "webdev", + "innerWindowID": 10737418241 + } +}); + +rawPackets.set(`console.time('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "time", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "timeStamp": 1572867483805, + "timer": { + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`timerAlreadyExists`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "time", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": { + "error": "timerAlreadyExists", + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.timeLog('bar') - 1`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeLog", + "lineNumber": 4, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": { + "duration": 4, + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.timeLog('bar') - 2`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar", + "second call", + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj55", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "state": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": 1 + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj55" + } + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeLog", + "lineNumber": 5, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source46", + "timeStamp": 1572867483805, + "timer": { + "duration": 5, + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.timeEnd('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeEnd", + "lineNumber": 6, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": { + "duration": 9, + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`timeEnd.timerDoesntExist`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeEnd", + "lineNumber": 7, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": { + "error": "timerDoesntExist", + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`timeLog.timerDoesntExist`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeLog", + "lineNumber": 8, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": { + "error": "timerDoesntExist", + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.table('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "table", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.table(['a', 'b', 'c'])`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj58", + "class": "Array", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": null, + "ownProperties": { + "0": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "a" + }, + "1": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "b" + }, + "2": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "c" + } + } + }, + "actorID": "server0.conn0.child1/obj58" + } + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "table", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.group('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "bar", + "level": "group", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupEnd('bar')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "bar", + "level": "groupEnd", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupCollapsed('foo')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "foo" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo", + "level": "groupCollapsed", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupEnd('foo')`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo", + "level": "groupEnd", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.group()`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "group", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupEnd()`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "groupEnd", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log(%cfoobar)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "foo", + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [ + "color:blue; font-size:1.3em; background:url('http://example.com/test'); position:absolute; top:10px; ", + "color:red; line-height: 1.5; background:url('http://example.com/test')" + ], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log("%cHello%c|%cWorld")`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "Hello", + "|", + "World" + ], + "chromeContext": false, + "columnNumber": 13, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source63", + "styles": [ + "color:red", + "", + "color: blue" + ], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.group(%cfoo%cbar)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "foo", + "bar" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo bar", + "level": "group", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [ + "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px", + "color:red;background:url('http://example.com/test')" + ], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupEnd(%cfoo%cbar)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo bar", + "level": "groupEnd", + "lineNumber": 6, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupCollapsed(%cfoo%cbaz)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "foo", + "baz" + ], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo baz", + "level": "groupCollapsed", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source48", + "styles": [ + "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px", + "color:red;background:url('http://example.com/test')" + ], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.groupEnd(%cfoo%cbaz)`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 11, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "foo baz", + "level": "groupEnd", + "lineNumber": 6, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source54", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.dir({C, M, Y, K})`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj67", + "class": "Object", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "cyan": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "C" + }, + "magenta": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "M" + }, + "yellow": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "Y" + }, + "black": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "K" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 4, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj67" + } + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "dir", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | default: 1`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "default" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 1, + "label": "default" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 2, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | default: 2`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "default" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 2, + "label": "default" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 3, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | test counter: 1`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "test counter" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 1, + "label": "test counter" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 4, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | test counter: 2`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "test counter" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 2, + "label": "test counter" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 5, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | default: 3`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "default" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 3, + "label": "default" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 6, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | clear`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [], + "chromeContext": false, + "columnNumber": 15, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "clear", + "lineNumber": 7, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | default: 4`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "default" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 4, + "label": "default" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 8, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.count | test counter: 3`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "test counter" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 3, + "label": "test counter" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 9, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.countReset | test counter: 0`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "test counter" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "count": 0, + "label": "test counter" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "countReset", + "lineNumber": 10, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.countReset | counterDoesntExist`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "test counter" + ], + "chromeContext": false, + "columnNumber": 15, + "counter": { + "error": "counterDoesntExist", + "label": "test counter" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "countReset", + "lineNumber": 11, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source68", + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + +rawPackets.set(`console.log escaped characters`, { + "resourceType": "console-message", + "message": { + "addonId": "", + "arguments": [ + "hello \nfrom \rthe \"string world!" + ], + "chromeContext": false, + "columnNumber": 35, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "prefix": "", + "private": false, + "sourceId": "server0.conn0.child1/source22", + "styles": [], + "timeStamp": 1572867483805, + "timer": null, + "workerType": "none", + "category": "webdev", + "innerWindowID": 8589934593 + } +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = ConsoleMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js b/devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js new file mode 100644 index 0000000000..cda3465e39 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js @@ -0,0 +1,85 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`Unknown property ‘such-unknown-property’. Declaration dropped.`, { + "pageError": { + "errorMessage": "Unknown property ‘such-unknown-property’. Declaration dropped.", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-css-message.html", + "sourceId": null, + "lineText": "", + "lineNumber": 3, + "columnNumber": 27, + "category": "CSS Parser", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": true, + "error": false, + "info": false, + "private": false, + "stacktrace": null, + "notes": null, + "chromeContext": false, + "isForwardedFromContentProcess": false + }, + "resourceType": "css-message", + "cssSelectors": "p" +}); + +rawPackets.set(`Error in parsing value for ‘padding-top’. Declaration dropped.`, { + "pageError": { + "errorMessage": "Error in parsing value for ‘padding-top’. Declaration dropped.", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-css-message.html", + "sourceId": null, + "lineText": "", + "lineNumber": 3, + "columnNumber": 18, + "category": "CSS Parser", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": true, + "error": false, + "info": false, + "private": false, + "stacktrace": null, + "notes": null, + "chromeContext": false, + "isForwardedFromContentProcess": false + }, + "resourceType": "css-message", + "cssSelectors": "p" +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = ConsoleMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/evaluationResult.js b/devtools/client/webconsole/test/node/fixtures/stubs/evaluationResult.js new file mode 100644 index 0000000000..f8837393a0 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/evaluationResult.js @@ -0,0 +1,809 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`new Date(0)`, { + "resultID": "1573832025018-0", + "hasException": false, + "input": "new Date(0)", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj23", + "class": "Date", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "timestamp": 0 + } + }, + "actorID": "server0.conn0.child1/obj23" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`asdf()`, { + "resultID": "1573832025112-1", + "errorMessageName": "JSMSG_NOT_DEFINED", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj25", + "class": "ReferenceError", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "ReferenceError", + "message": "asdf is not defined", + "stack": "@debugger eval code:1:1\n", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 1 + } + }, + "actorID": "server0.conn0.child1/obj25" + }, + "exceptionMessage": "ReferenceError: asdf is not defined", + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn0.child1/source24", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 1 + }, + "input": "asdf()", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`1 + @`, { + "resultID": "1573832025117-2", + "errorMessageName": "JSMSG_ILLEGAL_CHARACTER", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj26", + "class": "SyntaxError", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "SyntaxError", + "message": "illegal character U+0040", + "stack": "", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 4 + } + }, + "actorID": "server0.conn0.child1/obj26" + }, + "exceptionMessage": "SyntaxError: illegal character U+0040", + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", + "hasException": true, + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 4 + }, + "input": "1 + @", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`inspect({a: 1})`, { + "resultID": "1573832025122-3", + "hasException": false, + "helperResult": { + "type": "inspectObject", + "input": "inspect({a: 1})", + "object": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj28", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "a": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": 1 + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn0.child1/obj28" + }, + "forceExpandInConsole": false + }, + "input": "inspect({a: 1})", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`undefined`, { + "resultID": "1573832025127-5", + "hasException": false, + "input": "undefined", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`longString message Error`, { + "resultID": "1573832025130-6", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child1/obj32", + "class": "Error", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "Error", + "message": { + "_grip": { + "type": "longString", + "actor": "server0.conn0.child1/longstractor33", + "length": 110000, + "initial": "Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error" + }, + "actorID": "server0.conn0.child1/longstractor33" + }, + "stack": "@debugger eval code:1:7\n", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 7 + } + }, + "actorID": "server0.conn0.child1/obj32" + }, + "exceptionMessage": { + "_grip": { + "type": "longString", + "actor": "server0.conn0.child1/longstractor34", + "length": 110007, + "initial": "Error: Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Lon" + }, + "actorID": "server0.conn0.child1/longstractor34" + }, + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn0.child1/source31", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn0.child1/source31", + "line": 1, + "column": 7 + }, + "input": "throw new Error(\"Long error \".repeat(10000))", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw ""`, { + "resultID": "1573832025134-7", + "exception": "", + "exceptionMessage": "", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn0.child1/source24", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn0.child1/source24", + "line": 1, + "column": 1 + }, + "input": "throw \"\"", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw "tomato"`, { + "resultID": "1573832025137-8", + "exception": "tomato", + "exceptionMessage": "tomato", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn0.child1/source24", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn0.child1/source24", + "line": 1, + "column": 1 + }, + "input": "throw \"tomato\"", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw false`, { + "resultID": "1588154002962-9", + "exception": false, + "exceptionMessage": "false", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "line": 1, + "column": 1 + }, + "input": "throw false", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw 0`, { + "resultID": "1588154002979-10", + "exception": 0, + "exceptionMessage": "0", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "line": 1, + "column": 1 + }, + "input": "throw 0", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw null`, { + "resultID": "1588154003064-11", + "exception": { + "type": "null" + }, + "exceptionMessage": "null", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "line": 1, + "column": 1 + }, + "input": "throw null", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw undefined`, { + "resultID": "1588154003073-12", + "exception": { + "type": "undefined" + }, + "exceptionMessage": "undefined", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "line": 1, + "column": 1 + }, + "input": "throw undefined", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw Symbol`, { + "resultID": "1588154003077-13", + "exception": { + "type": "symbol", + "actor": "server0.conn2.child2/symbol44", + "name": "potato" + }, + "exceptionMessage": "Symbol(potato)", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source33", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source33", + "line": 1, + "column": 7 + }, + "input": "throw Symbol(\"potato\")", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw Object`, { + "resultID": "1588154003082-14", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn2.child2/obj46", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "vegetable": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "cucumber" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn2.child2/obj46" + }, + "exceptionMessage": "[object Object]", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source26", + "line": 1, + "column": 1 + }, + "input": "throw {vegetable: \"cucumber\"}", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw Error Object`, { + "resultID": "1588154003093-15", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn2.child2/obj48", + "class": "Error", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "Error", + "message": "pumpkin", + "stack": "@debugger eval code:1:7\n", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 7 + } + }, + "actorID": "server0.conn2.child2/obj48" + }, + "exceptionMessage": "Error: pumpkin", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source33", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source33", + "line": 1, + "column": 7 + }, + "input": "throw new Error(\"pumpkin\")", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval throw Error Object with custom name`, { + "resultID": "1588154003097-16", + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn2.child2/obj50", + "class": "Error", + "ownPropertyLength": 6, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "JuicyError", + "message": "pineapple", + "stack": "@debugger eval code:2:15\n", + "fileName": "debugger eval code", + "lineNumber": 2, + "columnNumber": 15 + } + }, + "actorID": "server0.conn2.child2/obj50" + }, + "exceptionMessage": "JuicyError: pineapple", + "exceptionStack": [ + { + "filename": "debugger eval code", + "sourceId": "server0.conn2.child2/source49", + "lineNumber": 5, + "columnNumber": 5, + "functionName": null + } + ], + "hasException": true, + "frame": { + "source": "debugger eval code", + "sourceId": "server0.conn2.child2/source49", + "line": 5, + "column": 5 + }, + "input": "\n var err = new Error(\"pineapple\");\n err.name = \"JuicyError\";\n err.flavor = \"delicious\";\n throw err;\n ", + "result": { + "type": "undefined" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval pending promise`, { + "resultID": "1609858965386-17", + "hasException": false, + "input": "new Promise(() => {})", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child3/obj53", + "class": "Promise", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "<state>": { + "value": "pending" + } + }, + "ownPropertiesLength": 1 + } + }, + "actorID": "server0.conn0.child3/obj53" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval Promise.resolve`, { + "resultID": "1609858965388-18", + "hasException": false, + "input": "Promise.resolve(123)", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child3/obj55", + "class": "Promise", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "<state>": { + "value": "fulfilled" + }, + "<value>": { + "value": 123 + } + }, + "ownPropertiesLength": 2 + } + }, + "actorID": "server0.conn0.child3/obj55" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval Promise.reject`, { + "resultID": "1609858965389-19", + "hasException": false, + "input": "Promise.reject(\"ouch\")", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child3/obj57", + "class": "Promise", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "<state>": { + "value": "rejected" + }, + "<reason>": { + "value": "ouch" + } + }, + "ownPropertiesLength": 2 + } + }, + "actorID": "server0.conn0.child3/obj57" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval resolved promise`, { + "resultID": "1609858965393-20", + "hasException": false, + "input": "Promise.resolve().then(() => 246)", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child3/obj59", + "class": "Promise", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "<state>": { + "value": "fulfilled" + }, + "<value>": { + "value": 246 + } + }, + "ownPropertiesLength": 2 + } + }, + "actorID": "server0.conn0.child3/obj59" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + +rawPackets.set(`eval rejected promise`, { + "resultID": "1609858965397-21", + "hasException": false, + "input": "Promise.resolve().then(() => a.b.c)", + "result": { + "_grip": { + "type": "object", + "actor": "server0.conn0.child3/obj61", + "class": "Promise", + "ownPropertyLength": 0, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "<state>": { + "value": "rejected" + }, + "<reason>": { + "value": { + "type": "object", + "actor": "server0.conn0.child3/obj62", + "class": "ReferenceError", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "ReferenceError", + "message": "a is not defined", + "stack": "@debugger eval code:1:30\npromise callback*@debugger eval code:1:19\n", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 30 + } + } + } + }, + "ownPropertiesLength": 2 + } + }, + "actorID": "server0.conn0.child3/obj61" + }, + "startTime": 1572867483805, + "timestamp": 1572867483805 +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = ConsoleMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/index.js b/devtools/client/webconsole/test/node/fixtures/stubs/index.js new file mode 100644 index 0000000000..9e5de16308 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/index.js @@ -0,0 +1,37 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const maps = []; + +[ + "consoleApi", + "cssMessage", + "evaluationResult", + "networkEvent", + "pageError", + "platformMessage", +].forEach(filename => { + maps[filename] = require(`./${filename}`); +}); + +// Combine all the maps into a single map. +module.exports = { + stubPreparedMessages: new Map([ + ...maps.consoleApi.stubPreparedMessages, + ...maps.cssMessage.stubPreparedMessages, + ...maps.evaluationResult.stubPreparedMessages, + ...maps.networkEvent.stubPreparedMessages, + ...maps.pageError.stubPreparedMessages, + ...maps.platformMessage.stubPreparedMessages, + ]), + stubPackets: new Map([ + ...maps.consoleApi.stubPackets, + ...maps.cssMessage.stubPackets, + ...maps.evaluationResult.stubPackets, + ...maps.networkEvent.stubPackets, + ...maps.pageError.stubPackets, + ...maps.platformMessage.stubPackets, + ]), +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/networkEvent.js b/devtools/client/webconsole/test/node/fixtures/stubs/networkEvent.js new file mode 100644 index 0000000000..d06191698c --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/networkEvent.js @@ -0,0 +1,269 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`GET request`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent4", + "startedDateTime": "2019-11-04T11:06:34.542Z", + "method": "GET", + "url": "http://example.com/inexistent.html", + "isXHR": false, + "cause": { + "type": "img", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 3, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 2, + "securityState": "insecure", + "isRacing": false +}); + +rawPackets.set(`GET request update`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent5", + "startedDateTime": "2020-07-07T14:41:14.572Z", + "method": "GET", + "url": "http://example.com/inexistent.html", + "isXHR": false, + "cause": { + "type": "img", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 3, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 3, + "securityState": "insecure", + "isRacing": false +}); + +rawPackets.set(`XHR GET request`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent21", + "startedDateTime": "2020-07-07T14:41:14.612Z", + "method": "GET", + "url": "http://example.com/inexistent.html", + "isXHR": true, + "cause": { + "type": "xhr", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 4, + "columnNumber": 5, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 1, + "securityState": "insecure", + "isRacing": false +}); + +rawPackets.set(`XHR GET request update`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent20", + "method": "GET", + "url": "http://example.com/inexistent.html", + "isXHR": true, + "cause": { + "type": "xhr", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 4, + "columnNumber": 5, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 1, + "securityState": "insecure", + "isRacing": false +}); + +rawPackets.set(`XHR POST request`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent36", + "startedDateTime": "2019-11-04T11:06:35.007Z", + "method": "POST", + "url": "http://example.com/inexistent.html", + "isXHR": true, + "cause": { + "type": "xhr", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 4, + "columnNumber": 5, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 1, + "securityState": "insecure", + "isRacing": false +}); + +rawPackets.set(`XHR POST request update`, { + "resourceType": "network-event", + "timeStamp": 1572867483805, + "actor": "server0.conn0.netEvent36", + "method": "POST", + "url": "http://example.com/inexistent.html", + "isXHR": true, + "cause": { + "type": "xhr", + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "stacktraceAvailable": true, + "lastFrame": { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/stub-generators/test-network-event.html", + "lineNumber": 4, + "columnNumber": 5, + "functionName": "triggerPacket", + "asyncCause": null + } + }, + "httpVersion": "HTTP/1.1", + "status": "404", + "statusText": "Not Found", + "remoteAddress": "127.0.0.1", + "remotePort": 8888, + "mimeType": "text/html; charset=utf-8", + "waitingTime": 1, + "contentSize": 418, + "transferredSize": 578, + "timings": {}, + "private": false, + "isThirdPartyTrackingResource": false, + "referrerPolicy": "no-referrer-when-downgrade", + "blockedReason": 0, + "totalTime": 2, + "securityState": "insecure", + "isRacing": false +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = NetworkEventMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js b/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js new file mode 100644 index 0000000000..c6a41811ae --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js @@ -0,0 +1,1657 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`ReferenceError: asdf is not defined`, { + "pageError": { + "errorMessage": "ReferenceError: asdf is not defined", + "errorMessageName": "JSMSG_NOT_DEFINED", + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source22", + "lineText": "", + "lineNumber": 3, + "columnNumber": 5, + "category": "content javascript", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source22", + "lineNumber": 3, + "columnNumber": 5, + "functionName": "bar" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source22", + "lineNumber": 6, + "columnNumber": 5, + "functionName": "foo" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source22", + "lineNumber": 9, + "columnNumber": 3, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj25", + "class": "ReferenceError", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "ReferenceError", + "message": "asdf is not defined", + "stack": "bar@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:3:5\nfoo@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:6:5\n@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:9:3\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 3, + "columnNumber": 5 + } + }, + "actorID": "server0.conn4.child2/obj25" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`SyntaxError: redeclaration of let a`, { + "pageError": { + "errorMessage": "SyntaxError: redeclaration of let a", + "errorMessageName": "JSMSG_REDECLARED_VAR", + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": " let a, a;", + "lineNumber": 2, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": [ + { + "messageBody": "Previously declared at line 2, column 6", + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "line": 2, + "column": 6 + } + } + ], + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj26", + "class": "SyntaxError", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "SyntaxError", + "message": "redeclaration of let a", + "stack": "", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 2, + "columnNumber": 9 + } + }, + "actorID": "server0.conn4.child2/obj26" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`TypeError longString message`, { + "pageError": { + "errorMessage": { + "_grip": { + "type": "longString", + "actor": "server0.conn0.child1/longstractor24", + "length": 110007, + "initial": "Error: Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Lon" + }, + "actorID": "server0.conn0.child1/longstractor24" + }, + "errorMessageName": "", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source23", + "lineText": "", + "lineNumber": 1, + "columnNumber": 7, + "category": "content javascript", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source23", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj29", + "class": "Error", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "Error", + "message": { + "_grip": { + "type": "longString", + "actor": "server0.conn4.child2/longstractor30", + "length": 110000, + "initial": "Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error Long error" + }, + "actorID": "server0.conn4.child2/longstractor30" + }, + "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:1:7\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 1, + "columnNumber": 7 + } + }, + "actorID": "server0.conn4.child2/obj29" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw string with URL`, { + "pageError": { + "errorMessage": "uncaught exception: “https://evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is evil and “https://not-so-evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is not good either", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 10737418241, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": "“https://evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is evil and “https://not-so-evil.com/?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa“ is not good either", + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw ""`, { + "pageError": { + "errorMessage": "uncaught exception: ", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source25", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": "", + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw "tomato"`, { + "pageError": { + "errorMessage": "uncaught exception: tomato", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 8589934593, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn0.child1/source25", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": "tomato", + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw false`, { + "pageError": { + "errorMessage": "uncaught exception: false", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": false, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw 0`, { + "pageError": { + "errorMessage": "uncaught exception: 0", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": 0, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw null`, { + "pageError": { + "errorMessage": "uncaught exception: null", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "type": "null" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw undefined`, { + "pageError": { + "errorMessage": "uncaught exception: undefined", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "type": "undefined" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw Symbol`, { + "pageError": { + "errorMessage": "uncaught exception: Symbol(potato)", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source27", + "lineText": "", + "lineNumber": 1, + "columnNumber": 7, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source27", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "type": "symbol", + "actor": "server0.conn4.child2/symbol38", + "name": "potato" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw Object`, { + "pageError": { + "errorMessage": "uncaught exception: [object Object]", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineText": "", + "lineNumber": 1, + "columnNumber": 1, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source31", + "lineNumber": 1, + "columnNumber": 1, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj40", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "vegetable": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "cucumber" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn4.child2/obj40" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw Error Object`, { + "pageError": { + "errorMessage": "Error: pumpkin", + "errorMessageName": "", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source41", + "lineText": "", + "lineNumber": 1, + "columnNumber": 7, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source27", + "lineNumber": 1, + "columnNumber": 7, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj42", + "class": "Error", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "Error", + "message": "pumpkin", + "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:1:7\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 1, + "columnNumber": 7 + } + }, + "actorID": "server0.conn4.child2/obj42" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`throw Error Object with custom name`, { + "pageError": { + "errorMessage": "JuicyError: pineapple", + "errorMessageName": "", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source43", + "lineText": "", + "lineNumber": 2, + "columnNumber": 15, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source43", + "lineNumber": 2, + "columnNumber": 15, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": false, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj44", + "class": "Error", + "ownPropertyLength": 6, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "JuicyError", + "message": "pineapple", + "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:2:15\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 2, + "columnNumber": 15 + } + }, + "actorID": "server0.conn4.child2/obj44" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject ""`, { + "pageError": { + "errorMessage": "uncaught exception: ", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": "", + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject "tomato"`, { + "pageError": { + "errorMessage": "uncaught exception: tomato", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": "tomato", + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject false`, { + "pageError": { + "errorMessage": "uncaught exception: false", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": false, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject 0`, { + "pageError": { + "errorMessage": "uncaught exception: 0", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": 0, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject null`, { + "pageError": { + "errorMessage": "uncaught exception: null", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "type": "null" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject undefined`, { + "pageError": { + "errorMessage": "uncaught exception: undefined", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "type": "undefined" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject Symbol`, { + "pageError": { + "errorMessage": "uncaught exception: Symbol(potato)", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "type": "symbol", + "actor": "server0.conn4.child2/symbol52", + "name": "potato" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject Object`, { + "pageError": { + "errorMessage": "uncaught exception: Object", + "errorMessageName": "JSMSG_UNCAUGHT_EXCEPTION", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineText": "", + "lineNumber": 1, + "columnNumber": 9, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj54", + "class": "Object", + "ownPropertyLength": 1, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": false, + "preview": { + "kind": "Object", + "ownProperties": { + "vegetable": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "cucumber" + } + }, + "ownSymbols": [], + "ownPropertiesLength": 1, + "ownSymbolsLength": 0, + "safeGetterValues": {} + } + }, + "actorID": "server0.conn4.child2/obj54" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject Error Object`, { + "pageError": { + "errorMessage": "Error: pumpkin", + "errorMessageName": "", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source55", + "lineText": "", + "lineNumber": 1, + "columnNumber": 16, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 1, + "columnNumber": 9, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj56", + "class": "Error", + "ownPropertyLength": 4, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "Error", + "message": "pumpkin", + "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:1:16\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 1, + "columnNumber": 16 + } + }, + "actorID": "server0.conn4.child2/obj56" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + +rawPackets.set(`Promise reject Error Object with custom name`, { + "pageError": { + "errorMessage": "JuicyError: pineapple", + "errorMessageName": "", + "sourceName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": "server0.conn4.child2/source57", + "lineText": "", + "lineNumber": 2, + "columnNumber": 15, + "category": "content javascript", + "innerWindowID": 6442450946, + "timeStamp": 1572867483805, + "warning": false, + "error": true, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "sourceId": null, + "lineNumber": 5, + "columnNumber": 13, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js line 110 > eval", + "sourceId": null, + "lineNumber": 6, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 111, + "columnNumber": 29, + "functionName": null + }, + { + "filename": "resource://testing-common/content-task.js", + "sourceId": null, + "lineNumber": 64, + "columnNumber": 19, + "functionName": null, + "asyncCause": "MessageListener.receiveMessage" + } + ], + "notes": null, + "chromeContext": false, + "isPromiseRejection": true, + "isForwardedFromContentProcess": false, + "exception": { + "_grip": { + "type": "object", + "actor": "server0.conn4.child2/obj58", + "class": "Error", + "ownPropertyLength": 6, + "extensible": true, + "frozen": false, + "sealed": false, + "isError": true, + "preview": { + "kind": "Error", + "name": "JuicyError", + "message": "pineapple", + "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:2:15\n", + "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", + "lineNumber": 2, + "columnNumber": 15 + } + }, + "actorID": "server0.conn4.child2/obj58" + }, + "hasException": true + }, + "resourceType": "error-message" +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = ConsoleMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/platformMessage.js b/devtools/client/webconsole/test/node/fixtures/stubs/platformMessage.js new file mode 100644 index 0000000000..83ec867a98 --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/platformMessage.js @@ -0,0 +1,54 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable max-len */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { + parsePacketsWithFronts, +} = require("chrome://mochitests/content/browser/devtools/client/webconsole/test/browser/stub-generator-helpers"); +const { prepareMessage } = require("devtools/client/webconsole/utils/messages"); +const { + ConsoleMessage, + NetworkEventMessage, +} = require("devtools/client/webconsole/types"); + +const rawPackets = new Map(); +rawPackets.set(`platform-simple-message`, { + "message": "foobar test", + "timeStamp": 1572867483805, + "resourceType": "platform-message" +}); + +rawPackets.set(`platform-longString-message`, { + "message": { + "type": "longString", + "actor": "server0.conn0.longstractor43", + "length": 20002, + "initial": "a\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "timeStamp": 1572867483805, + "resourceType": "platform-message" +}); + + +const stubPackets = parsePacketsWithFronts(rawPackets); + +const stubPreparedMessages = new Map(); +for (const [key, packet] of Array.from(stubPackets.entries())) { + const transformedPacket = prepareMessage(packet, { + getNextId: () => "1", + }); + const message = ConsoleMessage(transformedPacket); + stubPreparedMessages.set(key, message); +} + +module.exports = { + rawPackets, + stubPreparedMessages, + stubPackets, +}; diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/stubs.ini b/devtools/client/webconsole/test/node/fixtures/stubs/stubs.ini new file mode 100644 index 0000000000..4c8b42030e --- /dev/null +++ b/devtools/client/webconsole/test/node/fixtures/stubs/stubs.ini @@ -0,0 +1,14 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +support-files = + consoleApi.js + cssMessage.js + evaluationResult.js + index.js + networkEvent.js + pageError.js + platformMessage.js + +[browser_dummy.js] +skip-if=true #This is only here so we can expose the support files in other ini files. |