diff options
Diffstat (limited to 'devtools/client/webconsole/new-console-output/test/fixtures')
25 files changed, 2697 insertions, 0 deletions
diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js new file mode 100644 index 000000000..bb34bb477 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/L10n.js @@ -0,0 +1,27 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// @TODO Load the actual strings from webconsole.properties instead. +class L10n { + getStr(str) { + switch (str) { + case "level.error": + return "Error"; + case "consoleCleared": + return "Console was cleared."; + case "webConsoleXhrIndicator": + return "XHR"; + case "webConsoleMoreInfoLabel": + return "Learn More"; + } + return str; + } + + getFormatStr(str) { + return this.getStr(str); + } +} + +module.exports = L10n; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/LocalizationHelper.js b/devtools/client/webconsole/new-console-output/test/fixtures/LocalizationHelper.js new file mode 100644 index 000000000..8e6e9428c --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/LocalizationHelper.js @@ -0,0 +1,10 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const LocalizationHelper = require("devtools/client/webconsole/new-console-output/test/fixtures/L10n"); + +module.exports = { + LocalizationHelper +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/ObjectClient.js b/devtools/client/webconsole/new-console-output/test/fixtures/ObjectClient.js new file mode 100644 index 000000000..87a058d5c --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/ObjectClient.js @@ -0,0 +1,9 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +class ObjectClient { +} + +module.exports = ObjectClient; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/PluralForm.js b/devtools/client/webconsole/new-console-output/test/fixtures/PluralForm.js new file mode 100644 index 000000000..9ab3ad3ec --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/PluralForm.js @@ -0,0 +1,18 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + PluralForm: { + get: function (occurence, str) { + // @TODO Remove when loading the actual strings from webconsole.properties + // is done in the L10n fixture. + if (str === "messageRepeats.tooltip2") { + return `${occurence} repeats`; + } + + return str; + } + } +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/Services.js b/devtools/client/webconsole/new-console-output/test/fixtures/Services.js new file mode 100644 index 000000000..61b3d5e13 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/Services.js @@ -0,0 +1,27 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { PREFS } = require("devtools/client/webconsole/new-console-output/constants"); + +module.exports = { + prefs: { + getIntPref: pref => { + switch (pref) { + case "devtools.hud.loglimit": + return 1000; + } + }, + getBoolPref: pref => { + const falsey = [ + PREFS.FILTER.NET, + PREFS.FILTER.NETXHR, + PREFS.UI.FILTER_BAR, + ]; + return !falsey.includes(pref); + }, + setBoolPref: () => {}, + clearUserPref: () => {}, + } +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/WebConsoleUtils.js b/devtools/client/webconsole/new-console-output/test/fixtures/WebConsoleUtils.js new file mode 100644 index 000000000..5ab1c0bb4 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/WebConsoleUtils.js @@ -0,0 +1,14 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const L10n = require("devtools/client/webconsole/new-console-output/test/fixtures/L10n"); + +const Utils = { + L10n +}; + +module.exports = { + Utils +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/moz.build b/devtools/client/webconsole/new-console-output/test/fixtures/moz.build new file mode 100644 index 000000000..ff41d6c80 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/moz.build @@ -0,0 +1,9 @@ +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DIRS += [ + 'stub-generators', + 'stubs' +] diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/serviceContainer.js b/devtools/client/webconsole/new-console-output/test/fixtures/serviceContainer.js new file mode 100644 index 000000000..04b15c88b --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/serviceContainer.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + attachRefToHud: () => {}, + emitNewMessage: () => {}, + hudProxyClient: {}, + onViewSourceInDebugger: () => {}, + openNetworkPanel: () => {}, + sourceMapService: { + subscribe: () => {}, + }, + openLink: () => {}, + createElement: tagName => document.createElement(tagName) +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini new file mode 100644 index 000000000..9f348544f --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser.ini @@ -0,0 +1,18 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +support-files = + head.js + !/devtools/client/framework/test/shared-head.js + test-console-api.html + test-network-event.html + test-tempfile.js + +[browser_webconsole_update_stubs_console_api.js] +skip-if=true # This is only used to update stubs. It is not an actual test. +[browser_webconsole_update_stubs_evaluation_result.js] +skip-if=true # This is only used to update stubs. It is not an actual test. +[browser_webconsole_update_stubs_network_event.js] +skip-if=true # This is only used to update stubs. It is not an actual test. +[browser_webconsole_update_stubs_page_error.js] +skip-if=true # This is only used to update stubs. It is not an actual test. diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js new file mode 100644 index 000000000..fc859a002 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_console_api.js @@ -0,0 +1,56 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; +requestLongerTimeout(2) + +Cu.import("resource://gre/modules/osfile.jsm"); +const { consoleApi: snippets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); + +const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html"; + +let stubs = { + preparedMessages: [], + packets: [], +}; + +add_task(function* () { + for (var [key, {keys, code}] of snippets) { + yield OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); + + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); + let {ui} = toolbox.getCurrentPanel().hud; + + ok(ui.jsterm, "jsterm exists"); + ok(ui.newConsoleOutput, "newConsoleOutput exists"); + + let received = new Promise(resolve => { + let i = 0; + let listener = (type, res) => { + stubs.packets.push(formatPacket(keys[i], res)); + stubs.preparedMessages.push(formatStub(keys[i], res)); + if(++i === keys.length ){ + toolbox.target.client.removeListener("consoleAPICall", listener); + resolve(); + } + }; + toolbox.target.client.addListener("consoleAPICall", listener); + }); + + yield ContentTask.spawn(gBrowser.selectedBrowser, key, function(key) { + var script = content.document.createElement("script"); + script.src = "test-tempfile.js?key=" + encodeURIComponent(key); + script.onload = function() { content.wrappedJSObject.triggerPacket(); } + content.document.body.appendChild(script); + }); + + yield received; + + yield closeTabAndToolbox(); + } + let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "consoleApi.js"); + OS.File.writeAtomic(filePath, formatFile(stubs)); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_evaluation_result.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_evaluation_result.js new file mode 100644 index 000000000..507201a24 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_evaluation_result.js @@ -0,0 +1,32 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +Cu.import("resource://gre/modules/osfile.jsm"); +const TEST_URI = "data:text/html;charset=utf-8,stub generation"; + +const { evaluationResult: snippets} = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); + +let stubs = { + preparedMessages: [], + packets: [], +}; + +add_task(function* () { + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); + ok(true, "make the test not fail"); + + for (var [code,key] of snippets) { + const packet = yield new Promise(resolve => { + toolbox.target.activeConsole.evaluateJS(code, resolve); + }); + stubs.packets.push(formatPacket(key, packet)); + stubs.preparedMessages.push(formatStub(key, packet)); + } + + let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "evaluationResult.js"); + OS.File.writeAtomic(filePath, formatFile(stubs)); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js new file mode 100644 index 000000000..cc018f634 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_network_event.js @@ -0,0 +1,47 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +Cu.import("resource://gre/modules/osfile.jsm"); +const TARGET = "networkEvent"; +const { [TARGET]: snippets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); +const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html"; + +let stubs = { + preparedMessages: [], + packets: [], +}; + +add_task(function* () { + for (var [key, {keys, code}] of snippets) { + OS.File.writeAtomic(TEMP_FILE_PATH, `function triggerPacket() {${code}}`); + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); + let {ui} = toolbox.getCurrentPanel().hud; + + ok(ui.jsterm, "jsterm exists"); + ok(ui.newConsoleOutput, "newConsoleOutput exists"); + + let received = new Promise(resolve => { + let i = 0; + toolbox.target.client.addListener(TARGET, (type, res) => { + stubs.packets.push(formatPacket(keys[i], res)); + stubs.preparedMessages.push(formatNetworkStub(keys[i], res)); + if(++i === keys.length ){ + resolve(); + } + }); + }); + + yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() { + content.wrappedJSObject.triggerPacket(); + }); + + yield received; + } + let filePath = OS.Path.join(`${BASE_PATH}/stubs/${TARGET}.js`); + OS.File.writeAtomic(filePath, formatFile(stubs)); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js new file mode 100644 index 000000000..9323e0031 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/browser_webconsole_update_stubs_page_error.js @@ -0,0 +1,48 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +Cu.import("resource://gre/modules/osfile.jsm"); +const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html"; + +const { pageError: snippets} = require("devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js"); + +let stubs = { + preparedMessages: [], + packets: [], +}; + +add_task(function* () { + let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); + ok(true, "make the test not fail"); + + for (var [key,code] of snippets) { + OS.File.writeAtomic(TEMP_FILE_PATH, `${code}`); + let received = new Promise(resolve => { + toolbox.target.client.addListener("pageError", function onPacket(e, packet) { + toolbox.target.client.removeListener("pageError", onPacket); + info("Received page error:" + e + " " + JSON.stringify(packet, null, "\t")); + + let message = prepareMessage(packet, {getNextId: () => 1}); + stubs.packets.push(formatPacket(message.messageText, packet)); + stubs.preparedMessages.push(formatStub(message.messageText, packet)); + resolve(); + }); + }); + + yield ContentTask.spawn(gBrowser.selectedBrowser, key, function(key) { + var script = content.document.createElement("script"); + script.src = "test-tempfile.js?key=" + encodeURIComponent(key); + content.document.body.appendChild(script); + }); + + yield received; + } + + let filePath = OS.Path.join(`${BASE_PATH}/stubs`, "pageError.js"); + OS.File.writeAtomic(filePath, formatFile(stubs)); + OS.File.writeAtomic(TEMP_FILE_PATH, ""); +}); diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js new file mode 100644 index 000000000..be988b9d8 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js @@ -0,0 +1,192 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ +/* import-globals-from ../../../../framework/test/shared-head.js */ + +"use strict"; + +// shared-head.js handles imports, constants, and utility functions +// Load the shared-head file first. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", + this); + +Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", true); +registerCleanupFunction(() => { + Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled"); +}); + +const { prepareMessage } = require("devtools/client/webconsole/new-console-output/utils/messages"); +const { stubPackets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js"); + +const BASE_PATH = "../../../../devtools/client/webconsole/new-console-output/test/fixtures"; +const TEMP_FILE_PATH = OS.Path.join(`${BASE_PATH}/stub-generators`, "test-tempfile.js"); + +let cachedPackets = {}; + +function getCleanedPacket(key, packet) { + if(Object.keys(cachedPackets).includes(key)) { + return cachedPackets[key]; + } + + // Strip escaped characters. + let safeKey = key + .replace(/\\n/g, "\n") + .replace(/\\r/g, "\r") + .replace(/\\\"/g, `\"`) + .replace(/\\\'/g, `\'`); + + // If the stub already exist, we want to ignore irrelevant properties + // (actor, timeStamp, timer, ...) that might changed and "pollute" + // the diff resulting from this stub generation. + let res; + if(stubPackets.has(safeKey)) { + + let existingPacket = stubPackets.get(safeKey); + res = Object.assign({}, packet, { + from: existingPacket.from + }); + + // Clean root timestamp. + if(res.timestamp) { + res.timestamp = existingPacket.timestamp; + } + + if (res.message) { + // Clean timeStamp on the message prop. + res.message.timeStamp = existingPacket.message.timeStamp; + if (res.message.timer) { + // Clean timer properties on the message. + // Those properties are found on console.time and console.timeEnd calls, + // and those time can vary, which is why we need to clean them. + if (res.message.timer.started) { + res.message.timer.started = existingPacket.message.timer.started; + } + if (res.message.timer.duration) { + res.message.timer.duration = existingPacket.message.timer.duration; + } + } + + if(Array.isArray(res.message.arguments)) { + // Clean actor ids on each message.arguments item. + res.message.arguments.forEach((argument, i) => { + if (argument && argument.actor) { + argument.actor = existingPacket.message.arguments[i].actor; + } + }); + } + } + + if (res.result) { + // Clean actor ids on evaluation result messages. + res.result.actor = existingPacket.result.actor; + if (res.result.preview) { + if(res.result.preview.timestamp) { + // Clean timestamp there too. + res.result.preview.timestamp = existingPacket.result.preview.timestamp; + } + } + } + + if (res.exception) { + // Clean actor ids on exception messages. + res.exception.actor = existingPacket.exception.actor; + if (res.exception.preview) { + if(res.exception.preview.timestamp) { + // Clean timestamp there too. + res.exception.preview.timestamp = existingPacket.exception.preview.timestamp; + } + } + } + + if (res.eventActor) { + // Clean actor ids, timeStamp and startedDateTime on network messages. + res.eventActor.actor = existingPacket.eventActor.actor; + res.eventActor.startedDateTime = existingPacket.eventActor.startedDateTime; + res.eventActor.timeStamp = existingPacket.eventActor.timeStamp; + } + + if (res.pageError) { + // Clean timeStamp on pageError messages. + res.pageError.timeStamp = existingPacket.pageError.timeStamp; + } + + } else { + res = packet; + } + + cachedPackets[key] = res; + return res; +} + +function formatPacket(key, packet) { + return ` +stubPackets.set("${key}", ${JSON.stringify(getCleanedPacket(key, packet), null, "\t")}); +`; +} + +function formatStub(key, packet) { + let prepared = prepareMessage( + getCleanedPacket(key, packet), + {getNextId: () => "1"} + ); + + return ` +stubPreparedMessages.set("${key}", new ConsoleMessage(${JSON.stringify(prepared, null, "\t")})); +`; +} + +function formatNetworkStub(key, packet) { + let actor = packet.eventActor; + let networkInfo = { + _type: "NetworkEvent", + timeStamp: actor.timeStamp, + node: null, + actor: actor.actor, + discardRequestBody: true, + discardResponseBody: true, + startedDateTime: actor.startedDateTime, + request: { + url: actor.url, + method: actor.method, + }, + isXHR: actor.isXHR, + cause: actor.cause, + response: {}, + timings: {}, + // track the list of network event updates + updates: [], + private: actor.private, + fromCache: actor.fromCache, + fromServiceWorker: actor.fromServiceWorker + }; + let prepared = prepareMessage(networkInfo, {getNextId: () => "1"}); + return ` +stubPreparedMessages.set("${key}", new NetworkEventMessage(${JSON.stringify(prepared, null, "\t")})); +`; +} + +function formatFile(stubs) { + return `/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + +${stubs.preparedMessages.join("")} +${stubs.packets.join("")} + +module.exports = { + stubPreparedMessages, + stubPackets, +}`; +} diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/moz.build b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/moz.build new file mode 100644 index 000000000..4b4e8a1d8 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/moz.build @@ -0,0 +1,8 @@ +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules( + 'stub-snippets.js', +) diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js new file mode 100644 index 000000000..f79548e7b --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/stub-snippets.js @@ -0,0 +1,148 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +var {DebuggerServer} = require("devtools/server/main"); +var longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 4)).join("a"); +var initialString = longString.substring(0, DebuggerServer.LONG_STRING_INITIAL_LENGTH); + +// Console API + +const consoleApiCommands = [ + "console.log('foobar', 'test')", + "console.log(undefined)", + "console.warn('danger, will robinson!')", + "console.log(NaN)", + "console.log(null)", + "console.log('\u9f2c')", + "console.clear()", + "console.count('bar')", + "console.assert(false, {message: 'foobar'})", + "console.log('hello \\nfrom \\rthe \\\"string world!')", + "console.log('\xFA\u1E47\u0129\xE7\xF6d\xEA \u021B\u0115\u0219\u0165')", + "console.dirxml(window)", +]; + +let consoleApi = new Map(consoleApiCommands.map( + cmd => [cmd, {keys: [cmd], code: cmd}])); + +consoleApi.set("console.trace()", { + keys: ["console.trace()"], + code: ` +function testStacktraceFiltering() { + console.trace() +} +function foo() { + testStacktraceFiltering() +} + +foo() +`}); + +consoleApi.set("console.time('bar')", { + keys: ["console.time('bar')", "console.timeEnd('bar')"], + code: ` +console.time("bar"); +console.timeEnd("bar"); +`}); + +consoleApi.set("console.table('bar')", { + keys: ["console.table('bar')"], + code: ` +console.table('bar'); +`}); + +consoleApi.set("console.table(['a', 'b', 'c'])", { + keys: ["console.table(['a', 'b', 'c'])"], + code: ` +console.table(['a', 'b', 'c']); +`}); + +consoleApi.set("console.group('bar')", { + keys: ["console.group('bar')", "console.groupEnd('bar')"], + code: ` +console.group("bar"); +console.groupEnd("bar"); +`}); + +consoleApi.set("console.groupCollapsed('foo')", { + keys: ["console.groupCollapsed('foo')", "console.groupEnd('foo')"], + code: ` +console.groupCollapsed("foo"); +console.groupEnd("foo"); +`}); + +consoleApi.set("console.group()", { + keys: ["console.group()", "console.groupEnd()"], + code: ` +console.group(); +console.groupEnd(); +`}); + +consoleApi.set("console.log(%cfoobar)", { + keys: ["console.log(%cfoobar)"], + code: ` +console.log( + "%cfoo%cbar", + "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px", + "color:red;background:\\165rl('http://example.com/test')"); +`}); + +// Evaluation Result +const evaluationResultCommands = [ + "new Date(0)", + "asdf()", + "1 + @" +]; + +let evaluationResult = new Map(evaluationResultCommands.map(cmd => [cmd, cmd])); + +// Network Event + +let networkEvent = new Map(); + +networkEvent.set("GET request", { + keys: ["GET request"], + code: ` +let i = document.createElement("img"); +i.src = "inexistent.html"; +`}); + +networkEvent.set("XHR GET request", { + keys: ["XHR GET request"], + code: ` +const xhr = new XMLHttpRequest(); +xhr.open("GET", "inexistent.html"); +xhr.send(); +`}); + +networkEvent.set("XHR POST request", { + keys: ["XHR POST request"], + code: ` +const xhr = new XMLHttpRequest(); +xhr.open("POST", "inexistent.html"); +xhr.send(); +`}); + +// Page Error + +let pageError = new Map(); + +pageError.set("Reference Error", ` + function bar() { + asdf() + } + function foo() { + bar() + } + + foo() +`); + +module.exports = { + consoleApi, + evaluationResult, + networkEvent, + pageError, +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html new file mode 100644 index 000000000..3246cff15 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Stub generator</title> + </head> + <body> + <p>Stub generator</p> + <script src="test-tempfile.js"></script> + </body> +</html> diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html new file mode 100644 index 000000000..c234acea6 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Stub generator for network event</title> + </head> + <body> + <p>Stub generator for network event</p> + <script src="test-tempfile.js"></script> + </body> +</html> diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js new file mode 100644 index 000000000..26e95fe39 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js @@ -0,0 +1,1482 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + + +stubPreparedMessages.set("console.log('foobar', 'test')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "foobar", + "test" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"foobar\",\"test\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log(undefined)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + { + "type": "undefined" + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"undefined\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.warn('danger, will robinson!')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "warn", + "level": "warn", + "messageText": null, + "parameters": [ + "danger, will robinson!" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"warn\",\"level\":\"warn\",\"messageText\":null,\"parameters\":[\"danger, will robinson!\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log(NaN)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + { + "type": "NaN" + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"NaN\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log(null)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + { + "type": "null" + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"null\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log('鼬')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "鼬" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"鼬\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.clear()", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "clear", + "level": "log", + "messageText": null, + "parameters": [ + "Console was cleared." + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"clear\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"Console was cleared.\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.count('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "debug", + "messageText": "bar: 1", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"debug\",\"messageText\":\"bar: 1\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.assert(false, {message: 'foobar'})", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "assert", + "level": "error", + "messageText": null, + "parameters": [ + { + "type": "object", + "actor": "server1.conn8.child1/obj31", + "class": "Object", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 1, + "preview": { + "kind": "Object", + "ownProperties": { + "message": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "foobar" + } + }, + "ownPropertiesLength": 1, + "safeGetterValues": {} + } + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"assert\",\"level\":\"error\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn8.child1/obj31\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"message\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"foobar\"}},\"ownPropertiesLength\":1,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":27,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":1}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": [ + { + "columnNumber": 27, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 1 + } + ], + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log('hello \nfrom \rthe \"string world!')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "hello \nfrom \rthe \"string world!" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"hello \\nfrom \\rthe \\\"string world!\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log('úṇĩçödê țĕșť')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "úṇĩçödê țĕșť" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"úṇĩçödê țĕșť\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.dirxml(window)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + { + "type": "object", + "actor": "server1.conn11.child1/obj31", + "class": "Window", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 804, + "preview": { + "kind": "ObjectWithURL", + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html" + } + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn11.child1/obj31\",\"class\":\"Window\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":804,\"preview\":{\"kind\":\"ObjectWithURL\",\"url\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\"}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.dirxml(window)\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.dirxml(window)", + "line": 1, + "column": 27 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.trace()", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "trace", + "level": "log", + "messageText": null, + "parameters": [], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"trace\",\"level\":\"log\",\"messageText\":null,\"parameters\":[],\"repeatId\":null,\"stacktrace\":[{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"testStacktraceFiltering\",\"language\":2,\"lineNumber\":3},{\"columnNumber\":3,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"foo\",\"language\":2,\"lineNumber\":6},{\"columnNumber\":1,\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"functionName\":\"triggerPacket\",\"language\":2,\"lineNumber\":9}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()\",\"line\":3,\"column\":3},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": [ + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "testStacktraceFiltering", + "language": 2, + "lineNumber": 3 + }, + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "foo", + "language": 2, + "lineNumber": 6 + }, + { + "columnNumber": 1, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 9 + } + ], + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "line": 3, + "column": 3 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.time('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "nullMessage", + "level": "log", + "messageText": null, + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"nullMessage\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.timeEnd('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "timeEnd", + "level": "log", + "messageText": "bar: 1.36ms", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"timeEnd\",\"level\":\"log\",\"messageText\":\"bar: 1.36ms\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)\",\"line\":3,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", + "line": 3, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.table('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "bar" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"bar\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%27bar%27)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%27bar%27)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.table(['a', 'b', 'c'])", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "table", + "level": "log", + "messageText": null, + "parameters": [ + { + "type": "object", + "actor": "server1.conn15.child1/obj31", + "class": "Array", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 4, + "preview": { + "kind": "ArrayLike", + "length": 3, + "items": [ + "a", + "b", + "c" + ] + } + } + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"table\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn15.child1/obj31\",\"class\":\"Array\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":4,\"preview\":{\"kind\":\"ArrayLike\",\"length\":3,\"items\":[\"a\",\"b\",\"c\"]}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%5B%27a%27%2C%20%27b%27%2C%20%27c%27%5D)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%5B%27a%27%2C%20%27b%27%2C%20%27c%27%5D)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.group('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "startGroup", + "level": "log", + "messageText": "bar", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"startGroup\",\"level\":\"log\",\"messageText\":\"bar\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.groupEnd('bar')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "endGroup", + "level": "log", + "messageText": null, + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"endGroup\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)\",\"line\":3,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)", + "line": 3, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.groupCollapsed('foo')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "startGroupCollapsed", + "level": "log", + "messageText": "foo", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"startGroupCollapsed\",\"level\":\"log\",\"messageText\":\"foo\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.groupEnd('foo')", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "endGroup", + "level": "log", + "messageText": null, + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"endGroup\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)\",\"line\":3,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)", + "line": 3, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.group()", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "startGroup", + "level": "log", + "messageText": "<no group label>", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"startGroup\",\"level\":\"log\",\"messageText\":\"<no group label>\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.groupEnd()", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "endGroup", + "level": "log", + "messageText": null, + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"endGroup\",\"level\":\"log\",\"messageText\":null,\"parameters\":null,\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()\",\"line\":3,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()", + "line": 3, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [] +})); + +stubPreparedMessages.set("console.log(%cfoobar)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "console-api", + "type": "log", + "level": "log", + "messageText": null, + "parameters": [ + "foo", + "bar" + ], + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"foo\",\"bar\"],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%25cfoobar)\",\"line\":2,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[\"color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px\",\"color:red;background:url('http://example.com/test')\"]}", + "stacktrace": null, + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%25cfoobar)", + "line": 2, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": null, + "userProvidedStyles": [ + "color:blue;font-size:1.3em;background:url('http://example.com/test');position:absolute;top:10px", + "color:red;background:url('http://example.com/test')" + ] +})); + + +stubPackets.set("console.log('foobar', 'test')", { + "from": "server1.conn0.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "foobar", + "test" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27foobar%27%2C%20%27test%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086261590, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log(undefined)", { + "from": "server1.conn1.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "undefined" + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(undefined)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086264886, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.warn('danger, will robinson!')", { + "from": "server1.conn2.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "danger, will robinson!" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.warn(%27danger%2C%20will%20robinson!%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "warn", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086267284, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log(NaN)", { + "from": "server1.conn3.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "NaN" + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(NaN)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086269484, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log(null)", { + "from": "server1.conn4.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "null" + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(null)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086271418, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log('鼬')", { + "from": "server1.conn5.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "鼬" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%E9%BC%AC%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086273549, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.clear()", { + "from": "server1.conn6.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.clear()", + "functionName": "triggerPacket", + "groupName": "", + "level": "clear", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086275587, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.count('bar')", { + "from": "server1.conn7.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 27, + "counter": { + "count": 1, + "label": "bar" + }, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.count(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "count", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086277812, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.assert(false, {message: 'foobar'})", { + "from": "server1.conn8.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "object", + "actor": "server1.conn8.child1/obj31", + "class": "Object", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 1, + "preview": { + "kind": "Object", + "ownProperties": { + "message": { + "configurable": true, + "enumerable": true, + "writable": true, + "value": "foobar" + } + }, + "ownPropertiesLength": 1, + "safeGetterValues": {} + } + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", + "functionName": "triggerPacket", + "groupName": "", + "level": "assert", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086280131, + "timer": null, + "stacktrace": [ + { + "columnNumber": 27, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.assert(false%2C%20%7Bmessage%3A%20%27foobar%27%7D)", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 1 + } + ], + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", { + "from": "server1.conn9.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "hello \nfrom \rthe \"string world!" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27hello%20%5Cnfrom%20%5Crthe%20%5C%22string%20world!%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086281936, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.log('úṇĩçödê țĕșť')", { + "from": "server1.conn10.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "úṇĩçödê țĕșť" + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%27%C3%BA%E1%B9%87%C4%A9%C3%A7%C3%B6d%C3%AA%20%C8%9B%C4%95%C8%99%C5%A5%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "styles": [], + "timeStamp": 1477086283713, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + +stubPackets.set("console.dirxml(window)", { + "from": "server1.conn11.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "object", + "actor": "server1.conn11.child1/obj31", + "class": "Window", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 804, + "preview": { + "kind": "ObjectWithURL", + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html" + } + } + ], + "columnNumber": 27, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.dirxml(window)", + "functionName": "triggerPacket", + "groupName": "", + "level": "dirxml", + "lineNumber": 1, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086285483, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.trace()", { + "from": "server1.conn12.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [], + "columnNumber": 3, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "testStacktraceFiltering", + "groupName": "", + "level": "trace", + "lineNumber": 3, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086287286, + "timer": null, + "stacktrace": [ + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "testStacktraceFiltering", + "language": 2, + "lineNumber": 3 + }, + { + "columnNumber": 3, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "foo", + "language": 2, + "lineNumber": 6 + }, + { + "columnNumber": 1, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.trace()", + "functionName": "triggerPacket", + "language": 2, + "lineNumber": 9 + } + ], + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.time('bar')", { + "from": "server1.conn13.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "time", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086289137, + "timer": { + "name": "bar", + "started": 1166.305 + }, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.timeEnd('bar')", { + "from": "server1.conn13.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.time(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "timeEnd", + "lineNumber": 3, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086289138, + "timer": { + "duration": 1.3550000000000182, + "name": "bar" + }, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.table('bar')", { + "from": "server1.conn14.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "", + "level": "table", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086290984, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.table(['a', 'b', 'c'])", { + "from": "server1.conn15.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + { + "type": "object", + "actor": "server1.conn15.child1/obj31", + "class": "Array", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 4, + "preview": { + "kind": "ArrayLike", + "length": 3, + "items": [ + "a", + "b", + "c" + ] + } + } + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.table(%5B%27a%27%2C%20%27b%27%2C%20%27c%27%5D)", + "functionName": "triggerPacket", + "groupName": "", + "level": "table", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086292762, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.group('bar')", { + "from": "server1.conn16.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "bar", + "level": "group", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086294628, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.groupEnd('bar')", { + "from": "server1.conn16.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group(%27bar%27)", + "functionName": "triggerPacket", + "groupName": "bar", + "level": "groupEnd", + "lineNumber": 3, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086294630, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.groupCollapsed('foo')", { + "from": "server1.conn17.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "foo" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)", + "functionName": "triggerPacket", + "groupName": "foo", + "level": "groupCollapsed", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086296567, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.groupEnd('foo')", { + "from": "server1.conn17.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "foo" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.groupCollapsed(%27foo%27)", + "functionName": "triggerPacket", + "groupName": "foo", + "level": "groupEnd", + "lineNumber": 3, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086296570, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.group()", { + "from": "server1.conn18.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()", + "functionName": "triggerPacket", + "groupName": "", + "level": "group", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086298462, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.groupEnd()", { + "from": "server1.conn18.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.group()", + "functionName": "triggerPacket", + "groupName": "", + "level": "groupEnd", + "lineNumber": 3, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "timeStamp": 1477086298464, + "timer": null, + "workerType": "none", + "styles": [], + "category": "webdev" + } +}); + +stubPackets.set("console.log(%cfoobar)", { + "from": "server1.conn19.child1/consoleActor2", + "type": "consoleAPICall", + "message": { + "arguments": [ + "foo", + "bar" + ], + "columnNumber": 1, + "counter": null, + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=console.log(%25cfoobar)", + "functionName": "triggerPacket", + "groupName": "", + "level": "log", + "lineNumber": 2, + "originAttributes": { + "addonId": "", + "appId": 0, + "firstPartyDomain": "", + "inIsolatedMozBrowser": false, + "privateBrowsingId": 0, + "userContextId": 0 + }, + "private": false, + "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": 1477086300265, + "timer": null, + "workerType": "none", + "category": "webdev" + } +}); + + +module.exports = { + stubPreparedMessages, + stubPackets, +}
\ No newline at end of file diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js new file mode 100644 index 000000000..098086044 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/evaluationResult.js @@ -0,0 +1,182 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + + +stubPreparedMessages.set("new Date(0)", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "javascript", + "type": "result", + "level": "log", + "parameters": { + "type": "object", + "actor": "server1.conn0.child1/obj30", + "class": "Date", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 0, + "preview": { + "timestamp": 0 + } + }, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"result\",\"level\":\"log\",\"parameters\":{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj30\",\"class\":\"Date\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":0,\"preview\":{\"timestamp\":0}},\"repeatId\":null,\"stacktrace\":null,\"frame\":null,\"groupId\":null,\"userProvidedStyles\":null}", + "stacktrace": null, + "frame": null, + "groupId": null, + "userProvidedStyles": null +})); + +stubPreparedMessages.set("asdf()", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "javascript", + "type": "result", + "level": "error", + "messageText": "ReferenceError: asdf is not defined", + "parameters": { + "type": "undefined" + }, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"result\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":{\"type\":\"undefined\"},\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"debugger eval code\",\"line\":1,\"column\":1},\"groupId\":null,\"exceptionDocURL\":\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default\",\"userProvidedStyles\":null}", + "stacktrace": null, + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 1 + }, + "groupId": null, + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default", + "userProvidedStyles": null +})); + +stubPreparedMessages.set("1 + @", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "javascript", + "type": "result", + "level": "error", + "messageText": "SyntaxError: illegal character", + "parameters": { + "type": "undefined" + }, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"result\",\"level\":\"error\",\"messageText\":\"SyntaxError: illegal character\",\"parameters\":{\"type\":\"undefined\"},\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"debugger eval code\",\"line\":1,\"column\":4},\"groupId\":null,\"userProvidedStyles\":null}", + "stacktrace": null, + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 4 + }, + "groupId": null, + "userProvidedStyles": null +})); + + +stubPackets.set("new Date(0)", { + "from": "server1.conn0.child1/consoleActor2", + "input": "new Date(0)", + "result": { + "type": "object", + "actor": "server1.conn0.child1/obj30", + "class": "Date", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 0, + "preview": { + "timestamp": 0 + } + }, + "timestamp": 1476573073424, + "exception": null, + "frame": null, + "helperResult": null +}); + +stubPackets.set("asdf()", { + "from": "server1.conn0.child1/consoleActor2", + "input": "asdf()", + "result": { + "type": "undefined" + }, + "timestamp": 1476573073442, + "exception": { + "type": "object", + "actor": "server1.conn0.child1/obj32", + "class": "Error", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 4, + "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 + } + }, + "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", + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 1 + }, + "helperResult": null +}); + +stubPackets.set("1 + @", { + "from": "server1.conn0.child1/consoleActor2", + "input": "1 + @", + "result": { + "type": "undefined" + }, + "timestamp": 1478755616654, + "exception": { + "type": "object", + "actor": "server1.conn0.child1/obj33", + "class": "Error", + "extensible": true, + "frozen": false, + "sealed": false, + "ownPropertyLength": 4, + "preview": { + "kind": "Error", + "name": "SyntaxError", + "message": "illegal character", + "stack": "", + "fileName": "debugger eval code", + "lineNumber": 1, + "columnNumber": 4 + } + }, + "exceptionMessage": "SyntaxError: illegal character", + "frame": { + "source": "debugger eval code", + "line": 1, + "column": 4 + }, + "helperResult": null +}); + + +module.exports = { + stubPreparedMessages, + stubPackets, +}
\ No newline at end of file diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js new file mode 100644 index 000000000..59b420180 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/index.js @@ -0,0 +1,29 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +let maps = []; + +[ + "consoleApi", + "evaluationResult", + "networkEvent", + "pageError", +].forEach((filename) => { + maps[filename] = require(`./${filename}`); +}); + +// Combine all the maps into a single map. +module.exports = { + stubPreparedMessages: new Map([ + ...maps.consoleApi.stubPreparedMessages, + ...maps.evaluationResult.stubPreparedMessages, + ...maps.networkEvent.stubPreparedMessages, + ...maps.pageError.stubPreparedMessages, ]), + stubPackets: new Map([ + ...maps.consoleApi.stubPackets, + ...maps.evaluationResult.stubPackets, + ...maps.networkEvent.stubPackets, + ...maps.pageError.stubPackets, ]), +}; diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/moz.build b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/moz.build new file mode 100644 index 000000000..88e9c46df --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/moz.build @@ -0,0 +1,11 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules( + 'consoleApi.js', + 'evaluationResult.js', + 'index.js', + 'networkEvent.js', + 'pageError.js', +) diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js new file mode 100644 index 000000000..58a40d30b --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/networkEvent.js @@ -0,0 +1,189 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + + +stubPreparedMessages.set("GET request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn0.child1/netEvent29", + "level": "log", + "isXHR": false, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET" + }, + "response": {}, + "source": "network", + "type": "log", + "groupId": null +})); + +stubPreparedMessages.set("XHR GET request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn1.child1/netEvent29", + "level": "log", + "isXHR": true, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET" + }, + "response": {}, + "source": "network", + "type": "log", + "groupId": null +})); + +stubPreparedMessages.set("XHR POST request", new NetworkEventMessage({ + "id": "1", + "actor": "server1.conn2.child1/netEvent29", + "level": "log", + "isXHR": true, + "request": { + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "POST" + }, + "response": {}, + "source": "network", + "type": "log", + "groupId": null +})); + + +stubPackets.set("GET request", { + "from": "server1.conn0.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn0.child1/netEvent29", + "startedDateTime": "2016-10-15T23:12:04.196Z", + "timeStamp": 1476573124196, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET", + "isXHR": false, + "cause": { + "type": 3, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 3, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + +stubPackets.set("XHR GET request", { + "from": "server1.conn1.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn1.child1/netEvent29", + "startedDateTime": "2016-10-15T23:12:05.690Z", + "timeStamp": 1476573125690, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "GET", + "isXHR": true, + "cause": { + "type": 11, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 4, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + +stubPackets.set("XHR POST request", { + "from": "server1.conn2.child1/consoleActor2", + "type": "networkEvent", + "eventActor": { + "actor": "server1.conn2.child1/netEvent29", + "startedDateTime": "2016-10-15T23:12:07.158Z", + "timeStamp": 1476573127158, + "url": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/inexistent.html", + "method": "POST", + "isXHR": true, + "cause": { + "type": 11, + "loadingDocumentUri": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-network-event.html", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js", + "lineNumber": 4, + "columnNumber": 1, + "functionName": "triggerPacket", + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js line 52 > eval", + "lineNumber": 4, + "columnNumber": 7, + "functionName": null, + "asyncCause": null + }, + { + "filename": "chrome://mochikit/content/tests/BrowserTestUtils/content-task.js", + "lineNumber": 53, + "columnNumber": 20, + "functionName": null, + "asyncCause": null + } + ] + }, + "private": false + } +}); + + +module.exports = { + stubPreparedMessages, + stubPackets, +}
\ No newline at end of file diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js new file mode 100644 index 000000000..eda8e8b83 --- /dev/null +++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/pageError.js @@ -0,0 +1,102 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* + * THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE. + */ + +const { ConsoleMessage, NetworkEventMessage } = require("devtools/client/webconsole/new-console-output/types"); + +let stubPreparedMessages = new Map(); +let stubPackets = new Map(); + + +stubPreparedMessages.set("ReferenceError: asdf is not defined", new ConsoleMessage({ + "id": "1", + "allowRepeating": true, + "source": "javascript", + "type": "log", + "level": "error", + "messageText": "ReferenceError: asdf is not defined", + "parameters": null, + "repeat": 1, + "repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"javascript\",\"type\":\"log\",\"level\":\"error\",\"messageText\":\"ReferenceError: asdf is not defined\",\"parameters\":null,\"repeatId\":null,\"stacktrace\":[{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":3,\"columnNumber\":5,\"functionName\":\"bar\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":6,\"columnNumber\":5,\"functionName\":\"foo\"},{\"filename\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"lineNumber\":9,\"columnNumber\":3,\"functionName\":null}],\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error\",\"line\":3,\"column\":5},\"groupId\":null,\"exceptionDocURL\":\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default\"}", + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 3, + "columnNumber": 5, + "functionName": "bar" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 6, + "columnNumber": 5, + "functionName": "foo" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 9, + "columnNumber": 3, + "functionName": null + } + ], + "frame": { + "source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "line": 3, + "column": 5 + }, + "groupId": null, + "exceptionDocURL": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_defined?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default" +})); + + +stubPackets.set("ReferenceError: asdf is not defined", { + "from": "server1.conn0.child1/consoleActor2", + "type": "pageError", + "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/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineText": "", + "lineNumber": 3, + "columnNumber": 5, + "category": "content javascript", + "timeStamp": 1476573167137, + "warning": false, + "error": false, + "exception": true, + "strict": false, + "info": false, + "private": false, + "stacktrace": [ + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 3, + "columnNumber": 5, + "functionName": "bar" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 6, + "columnNumber": 5, + "functionName": "foo" + }, + { + "filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-tempfile.js?key=Reference%20Error", + "lineNumber": 9, + "columnNumber": 3, + "functionName": null + } + ] + } +}); + + +module.exports = { + stubPreparedMessages, + stubPackets, +}
\ No newline at end of file |