Source code

Revision control

Copy as Markdown

Other Tools

/* Any copyright is dedicated to the Public Domain.
/* eslint-disable max-len */
"use strict";
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. SEE devtools/client/webconsole/test/README.md.
*/
const {
parsePacketsWithFronts,
const { prepareMessage } = require("resource://devtools/client/webconsole/utils/messages.js");
const {
ConsoleMessage,
NetworkEventMessage,
} = require("resource://devtools/client/webconsole/types.js");
const rawPackets = new Map();
rawPackets.set(`ReferenceError: asdf is not defined`, {
"pageError": {
"errorMessage": "ReferenceError: asdf is not defined",
"errorMessageName": "JSMSG_NOT_DEFINED",
"sourceId": "server0.conn0.child1/source22",
"lineNumber": 3,
"columnNumber": 5,
"category": "content javascript",
"innerWindowID": 8589934593,
"timeStamp": 1572867483805,
"warning": false,
"error": true,
"info": false,
"private": false,
"stacktrace": [
{
"sourceId": "server0.conn0.child1/source22",
"lineNumber": 3,
"columnNumber": 5,
"functionName": "bar"
},
{
"sourceId": "server0.conn0.child1/source22",
"lineNumber": 6,
"columnNumber": 5,
"functionName": "foo"
},
{
"sourceId": "server0.conn0.child1/source22",
"lineNumber": 9,
"columnNumber": 3,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js line 112 > eval",
"sourceId": null,
"lineNumber": 6,
"columnNumber": 29,
"functionName": null
},
{
"sourceId": null,
"lineNumber": 113,
"columnNumber": 33,
"functionName": null
},
{
"sourceId": null,
"lineNumber": 66,
"columnNumber": 19,
"functionName": null,
"asyncCause": "MessageListener.receiveMessage"
}
],
"notes": null,
"chromeContext": false,
"isPromiseRejection": false,
"isForwardedFromContentProcess": false,
"exception": {
"_grip": {
"type": "object",
"actor": "server0.conn0.process8//obj22",
"class": "ReferenceError",
"ownPropertyLength": 4,
"extensible": true,
"frozen": false,
"sealed": false,
"isError": true,
"preview": {
"kind": "Error",
"name": "ReferenceError",
"message": "asdf is not defined",
"lineNumber": 3,
"columnNumber": 5
}
},
"actorID": "server0.conn0.process8//obj22"
},
"hasException": true
},
"resourceType": "error-message",
"isAlreadyExistingResource": false
});
rawPackets.set(`TypeError longString message`, {
"pageError": {
"errorMessage": {
"_grip": {
"type": "longString",
"actor": "server0.conn0.process8//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.process8//longstractor24"
},
"errorMessageName": "",
"sourceId": "server0.conn0.child1/source23",
"lineNumber": 1,
"columnNumber": 7,
"category": "content javascript",
"innerWindowID": 8589934593,
"timeStamp": 1572867483805,
"warning": false,
"error": true,
"info": false,
"private": false,
"stacktrace": [
{
"sourceId": "server0.conn0.child1/source23",
"lineNumber": 1,
"columnNumber": 7,
"functionName": null
},
{
"filename": "resource://testing-common/content-task.js line 112 > eval",
"sourceId": null,
"lineNumber": 6,
"columnNumber": 29,
"functionName": null
},
{
"sourceId": null,
"lineNumber": 113,
"columnNumber": 33,
"functionName": null
},
{
"sourceId": null,
"lineNumber": 66,
"columnNumber": 19,
"functionName": null,
"asyncCause": "MessageListener.receiveMessage"
}
],
"notes": null,
"chromeContext": false,
"isPromiseRejection": false,
"isForwardedFromContentProcess": false,
"exception": {
"_grip": {
"type": "object",
"actor": "server0.conn0.process8//obj25",
"class": "Error",
"ownPropertyLength": 4,
"extensible": true,
"frozen": false,
"sealed": false,
"isError": true,
"preview": {
"kind": "Error",
"name": "Error",
"message": {
"_grip": {
"type": "longString",
"actor": "server0.conn0.process8//longstractor26",
"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.process8//longstractor26"
},
"lineNumber": 1,
"columnNumber": 7
}
},
"actorID": "server0.conn0.process8//obj25"
},
"hasException": true
},
"resourceType": "error-message",
"isAlreadyExistingResource": 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 = ConsoleMessage(transformedPacket);
stubPreparedMessages.set(key, message);
}
module.exports = {
rawPackets,
stubPreparedMessages,
stubPackets,
};