diff options
Diffstat (limited to 'devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js')
-rw-r--r-- | devtools/client/webconsole/test/node/fixtures/stubs/cssMessage.js | 85 |
1 files changed, 85 insertions, 0 deletions
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, +}; |