mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Backed out changeset b9eb6110ecfc (bug 1511422) for dt failures on /browser_browser_toolbox_debugger.js
This commit is contained in:
parent
fabf13656d
commit
a032920c1d
@ -650,7 +650,6 @@ support-files =
|
||||
examples/times2.js
|
||||
examples/doc_rr_basic.html
|
||||
examples/doc_rr_continuous.html
|
||||
examples/doc_rr_logs.html
|
||||
examples/doc_rr_recovery.html
|
||||
examples/doc_rr_error.html
|
||||
|
||||
@ -784,6 +783,3 @@ skip-if = os != "mac" || debug || !nightly_build
|
||||
skip-if = os != "mac" || debug || !nightly_build
|
||||
[browser_dbg_rr_console_warp-01.js]
|
||||
skip-if = os != "mac" || debug || !nightly_build
|
||||
[browser_dbg_rr_console_warp-02.js]
|
||||
skip-if = os != "mac" || debug || !nightly_build
|
||||
|
||||
|
@ -1,3 +1,26 @@
|
||||
// Return a promise with a reference to jsterm, opening the split
|
||||
// console if necessary. This cleans up the split console pref so
|
||||
// it won't pollute other tests.
|
||||
function getSplitConsole(dbg) {
|
||||
const { toolbox, win } = dbg;
|
||||
|
||||
if (!win) {
|
||||
win = toolbox.win;
|
||||
}
|
||||
|
||||
if (!toolbox.splitConsole) {
|
||||
pressKey(dbg, "Escape");
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
toolbox.getPanelWhenReady("webconsole").then(() => {
|
||||
ok(toolbox.splitConsole, "Split console is shown.");
|
||||
let jsterm = toolbox.getPanel("webconsole").hud.jsterm;
|
||||
resolve(jsterm);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
add_task(async function() {
|
||||
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
|
||||
const dbg = await initDebugger("doc-script-switching.html", "switching-01");
|
||||
|
@ -7,34 +7,35 @@
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger(
|
||||
"doc_rr_basic.html",
|
||||
{ waitForRecording: true }
|
||||
);
|
||||
const {threadClient, tab, toolbox} = dbg;
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
|
||||
await once(Services.ppmm, "RecordingFinished");
|
||||
|
||||
await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
await setBreakpoint(client, "doc_rr_basic.html", 21);
|
||||
|
||||
// Visit a lot of breakpoints so that we are sure we have crossed major
|
||||
// checkpoint boundaries.
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 10);
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 9);
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 8);
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 7);
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 6);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 7);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 8);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 9);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 10);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 10);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 9);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 8);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 7);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 6);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 7);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 8);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 9);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 10);
|
||||
|
||||
await toolbox.closeToolbox();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -7,17 +7,21 @@
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger("doc_rr_basic.html", { waitForRecording: true });
|
||||
const {threadClient, tab, toolbox} = dbg;
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
|
||||
await once(Services.ppmm, "RecordingFinished");
|
||||
|
||||
await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
|
||||
await rewindToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 10);
|
||||
await checkEvaluateInTopFrameThrows(threadClient, "window.alert(3)");
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 10);
|
||||
await checkEvaluateInTopFrameThrows(threadClient, "window.alert(3)");
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 10);
|
||||
await checkEvaluateInTopFrame(threadClient, "testStepping2()", undefined);
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
await setBreakpoint(client, "doc_rr_basic.html", 21);
|
||||
await rewindToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 10);
|
||||
await checkEvaluateInTopFrameThrows(client, "window.alert(3)");
|
||||
await checkEvaluateInTopFrame(client, "number", 10);
|
||||
await checkEvaluateInTopFrameThrows(client, "window.alert(3)");
|
||||
await checkEvaluateInTopFrame(client, "number", 10);
|
||||
await checkEvaluateInTopFrame(client, "testStepping2()", undefined);
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -7,19 +7,21 @@
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger("doc_rr_continuous.html");
|
||||
const {threadClient, tab, toolbox} = dbg;
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_continuous.html", "current");
|
||||
|
||||
await threadClient.interrupt();
|
||||
await setBreakpoint(threadClient, "doc_rr_continuous.html", 19);
|
||||
await resumeToLine(threadClient, 19);
|
||||
await reverseStepOverToLine(threadClient, 18);
|
||||
await checkEvaluateInTopFrame(threadClient, "SpecialPowers.Cu.recordReplayDirective(/* AlwaysTakeTemporarySnapshots */ 3)", undefined);
|
||||
await stepInToLine(threadClient, 22);
|
||||
await setBreakpoint(threadClient, "doc_rr_continuous.html", 24);
|
||||
await resumeToLine(threadClient, 24);
|
||||
await setBreakpoint(threadClient, "doc_rr_continuous.html", 22);
|
||||
await rewindToLine(threadClient, 22);
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
await setBreakpoint(client, "doc_rr_continuous.html", 19);
|
||||
await resumeToLine(client, 19);
|
||||
await reverseStepOverToLine(client, 18);
|
||||
await checkEvaluateInTopFrame(client, "SpecialPowers.Cu.recordReplayDirective(/* AlwaysTakeTemporarySnapshots */ 3)", undefined);
|
||||
await stepInToLine(client, 22);
|
||||
await setBreakpoint(client, "doc_rr_continuous.html", 24);
|
||||
await resumeToLine(client, 24);
|
||||
await setBreakpoint(client, "doc_rr_continuous.html", 22);
|
||||
await rewindToLine(client, 22);
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -8,24 +8,27 @@
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger("doc_rr_continuous.html");
|
||||
const {threadClient, tab, toolbox} = dbg;
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_continuous.html", "current");
|
||||
|
||||
await setBreakpoint(threadClient, "doc_rr_continuous.html", 14);
|
||||
await resumeToLine(threadClient, 14);
|
||||
let value = await evaluateInTopFrame(threadClient, "number");
|
||||
await resumeToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value + 1);
|
||||
await rewindToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value);
|
||||
await resumeToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value + 1);
|
||||
await resumeToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value + 2);
|
||||
await resumeToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value + 3);
|
||||
await rewindToLine(threadClient, 14);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", value + 2);
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
await setBreakpoint(client, "doc_rr_continuous.html", 14);
|
||||
await resumeToLine(client, 14);
|
||||
let value = await evaluateInTopFrame(client, "number");
|
||||
await resumeToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value + 1);
|
||||
await rewindToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value);
|
||||
await resumeToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value + 1);
|
||||
await resumeToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value + 2);
|
||||
await resumeToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value + 3);
|
||||
await rewindToLine(client, 14);
|
||||
await checkEvaluateInTopFrame(client, "number", value + 2);
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -8,21 +8,22 @@
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger(
|
||||
"doc_rr_basic.html",
|
||||
{ waitForRecording: true }
|
||||
);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_basic.html", "current");
|
||||
await once(Services.ppmm, "RecordingFinished");
|
||||
|
||||
const {threadClient, tab, toolbox} = dbg;
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
|
||||
// Rewind to the beginning of the recording.
|
||||
await rewindToLine(threadClient, undefined);
|
||||
await rewindToLine(client, undefined);
|
||||
|
||||
await setBreakpoint(threadClient, "doc_rr_basic.html", 21);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 1);
|
||||
await resumeToLine(threadClient, 21);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 2);
|
||||
await setBreakpoint(client, "doc_rr_basic.html", 21);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 1);
|
||||
await resumeToLine(client, 21);
|
||||
await checkEvaluateInTopFrame(client, "number", 2);
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -3,49 +3,96 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var { HUDService } = require("devtools/client/webconsole/hudservice");
|
||||
|
||||
// This functionality was copied from devtools/client/webconsole/test/mochitest/head.js,
|
||||
// since this test straddles both the web console and the debugger. I couldn't
|
||||
// figure out how to load that script directly here.
|
||||
function waitForThreadEvents(threadClient, eventName) {
|
||||
|
||||
function findMessages(hud, text, selector = ".message") {
|
||||
const messages = hud.ui.outputNode.querySelectorAll(selector);
|
||||
const elements = Array.prototype.filter.call(
|
||||
messages,
|
||||
(el) => el.textContent.includes(text)
|
||||
);
|
||||
return elements;
|
||||
}
|
||||
|
||||
function waitForThreadEvents(console, eventName) {
|
||||
info(`Waiting for thread event '${eventName}' to fire.`);
|
||||
const thread = console.threadClient;
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
threadClient.addListener(eventName, function onEvent(eventName, ...args) {
|
||||
thread.addListener(eventName, function onEvent(eventName, ...args) {
|
||||
info(`Thread event '${eventName}' fired.`);
|
||||
threadClient.removeListener(eventName, onEvent);
|
||||
thread.removeListener(eventName, onEvent);
|
||||
resolve.apply(resolve, args);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function openContextMenu(hud, element) {
|
||||
const onConsoleMenuOpened = hud.ui.consoleOutput.once("menu-open");
|
||||
synthesizeContextMenuEvent(element);
|
||||
await onConsoleMenuOpened;
|
||||
const doc = hud.ui.consoleOutput.owner.chromeWindow.document;
|
||||
return doc.getElementById("webconsole-menu");
|
||||
}
|
||||
|
||||
function hideContextMenu(hud) {
|
||||
const doc = hud.ui.consoleOutput.owner.chromeWindow.document;
|
||||
const popup = doc.getElementById("webconsole-menu");
|
||||
if (!popup) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const onPopupHidden = once(popup, "popuphidden");
|
||||
popup.hidePopup();
|
||||
return onPopupHidden;
|
||||
}
|
||||
|
||||
// Test basic console time warping functionality in web replay.
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger(
|
||||
"doc_rr_error.html",
|
||||
{ waitForRecording: true }
|
||||
);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + "doc_rr_error.html", "current");
|
||||
await once(Services.ppmm, "RecordingFinished");
|
||||
|
||||
const {tab, toolbox, threadClient} = dbg;
|
||||
const console = await getSplitConsole(dbg);
|
||||
const hud = console.hud;
|
||||
let console = await openToolboxForTab(tab, "webconsole");
|
||||
let hud = console.getCurrentPanel().hud;
|
||||
let messages = findMessages(hud, "Number 5");
|
||||
ok(messages.length == 1, "Found one message");
|
||||
let message = messages.pop();
|
||||
|
||||
await warpToMessage(hud, threadClient, "Number 5");
|
||||
await threadClient.interrupt();
|
||||
let menuPopup = await openContextMenu(hud, message);
|
||||
let timeWarpItem = menuPopup.querySelector("#console-menu-time-warp");
|
||||
ok(timeWarpItem, "Time warp menu item is available");
|
||||
timeWarpItem.click();
|
||||
await hideContextMenu(hud);
|
||||
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 5);
|
||||
await once(Services.ppmm, "TimeWarpFinished");
|
||||
|
||||
await waitForThreadEvents(console, 'paused')
|
||||
messages = findMessages(hud, "", ".paused");
|
||||
ok(messages.length == 1, "Found one paused message");
|
||||
|
||||
let toolbox = await attachDebugger(tab), client = toolbox.threadClient;
|
||||
await client.interrupt();
|
||||
|
||||
await checkEvaluateInTopFrame(client, "number", 5);
|
||||
|
||||
// Initially we are paused inside the 'new Error()' call on line 19. The
|
||||
// first reverse step takes us to the start of that line.
|
||||
await reverseStepOverToLine(threadClient, 19);
|
||||
await reverseStepOverToLine(threadClient, 18);
|
||||
await setBreakpoint(threadClient, "doc_rr_error.html", 12);
|
||||
await rewindToLine(threadClient, 12);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 4);
|
||||
await resumeToLine(threadClient, 12);
|
||||
await checkEvaluateInTopFrame(threadClient, "number", 5);
|
||||
await reverseStepOverToLine(client, 19);
|
||||
|
||||
await reverseStepOverToLine(client, 18);
|
||||
await setBreakpoint(client, "doc_rr_error.html", 12);
|
||||
await rewindToLine(client, 12);
|
||||
await checkEvaluateInTopFrame(client, "number", 4);
|
||||
await resumeToLine(client, 12);
|
||||
await checkEvaluateInTopFrame(client, "number", 5);
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
|
@ -1,48 +0,0 @@
|
||||
/* -*- 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/ */
|
||||
|
||||
|
||||
// This functionality was copied from devtools/client/webconsole/test/mochitest/head.js,
|
||||
// since this test straddles both the web console and the debugger. I couldn't
|
||||
// figure out how to load that script directly here.
|
||||
function waitForThreadEvents(threadClient, eventName) {
|
||||
info(`Waiting for thread event '${eventName}' to fire.`);
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
threadClient.addListener(eventName, function onEvent(eventName, ...args) {
|
||||
info(`Thread event '${eventName}' fired.`);
|
||||
threadClient.removeListener(eventName, onEvent);
|
||||
resolve.apply(resolve, args);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Test basic console time warping functionality in web replay.
|
||||
async function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
const dbg = await attatchRecordingDebugger(
|
||||
"doc_rr_logs.html",
|
||||
{ waitForRecording: true }
|
||||
);
|
||||
|
||||
const {tab, toolbox, threadClient} = dbg;
|
||||
const console = await getSplitConsole(dbg);
|
||||
const hud = console.hud;
|
||||
|
||||
let message = await warpToMessage(hud, threadClient, "number: 1");
|
||||
ok(!message.classList.contains("paused-before"), "paused before message is not shown");
|
||||
|
||||
await stepOverToLine(threadClient, 18);
|
||||
await reverseStepOverToLine(threadClient, 17);
|
||||
|
||||
message = findMessage(hud, "number: 1")
|
||||
ok(message.classList.contains("paused-before"), "paused before message is shown");
|
||||
|
||||
await toolbox.destroy();
|
||||
await gBrowser.removeTab(tab);
|
||||
finish();
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="maindiv" style="padding-top:50px">Hello World!</div>
|
||||
</body>
|
||||
<script>
|
||||
const cpmm = SpecialPowers.Services.cpmm;
|
||||
function recordingFinished() {
|
||||
cpmm.sendAsyncMessage("RecordingFinished");
|
||||
}
|
||||
var number = 0;
|
||||
function f() {
|
||||
number++;
|
||||
console.log({ number });
|
||||
number++;
|
||||
console.log({ number });
|
||||
number++;
|
||||
console.log({ number });
|
||||
window.setTimeout(recordingFinished);
|
||||
}
|
||||
window.setTimeout(f, 1);
|
||||
// Simulate a longer recording by marking major checkpoints whenever possible.
|
||||
SpecialPowers.Cu.recordReplayDirective(/* AlwaysMarkMajorCheckpoints */ 4);
|
||||
</script>
|
||||
</html>
|
@ -46,17 +46,6 @@ Services.scriptloader.loadSubScript(
|
||||
const EXAMPLE_URL =
|
||||
"http://example.com/browser/devtools/client/debugger/new/test/mochitest/examples/";
|
||||
|
||||
|
||||
async function waitFor(predicate) {
|
||||
let result;
|
||||
await waitUntil(() => {
|
||||
result = predicate();
|
||||
return result;
|
||||
})
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// NOTE: still experimental, the screenshots might not be exactly correct
|
||||
async function takeScreenshot(dbg) {
|
||||
let canvas = dbg.win.document.createElementNS(
|
||||
@ -79,42 +68,6 @@ async function attachDebugger(tab) {
|
||||
return toolbox;
|
||||
}
|
||||
|
||||
async function attatchRecordingDebugger(url, { waitForRecording } = { waitForRecording: false }) {
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, null, { recordExecution: "*" });
|
||||
gBrowser.selectedTab = tab;
|
||||
openTrustedLinkIn(EXAMPLE_URL + url, "current");
|
||||
|
||||
if (waitForRecording) {
|
||||
await once(Services.ppmm, "RecordingFinished");
|
||||
}
|
||||
const toolbox = await attachDebugger(tab);
|
||||
const dbg = createDebuggerContext(toolbox)
|
||||
const threadClient = dbg.toolbox.threadClient;
|
||||
|
||||
await threadClient.interrupt();
|
||||
return {...dbg, tab, threadClient};
|
||||
}
|
||||
|
||||
|
||||
// Return a promise with a reference to jsterm, opening the split
|
||||
// console if necessary. This cleans up the split console pref so
|
||||
// it won't pollute other tests.
|
||||
async function getSplitConsole(dbg) {
|
||||
const { toolbox, win } = dbg;
|
||||
|
||||
if (!win) {
|
||||
win = toolbox.win;
|
||||
}
|
||||
|
||||
if (!toolbox.splitConsole) {
|
||||
pressKey(dbg, "Escape");
|
||||
}
|
||||
|
||||
await toolbox.openSplitConsole();
|
||||
return toolbox.getPanel("webconsole");
|
||||
}
|
||||
|
||||
|
||||
// Return a promise that resolves when a breakpoint has been set.
|
||||
async function setBreakpoint(threadClient, expectedFile, lineno) {
|
||||
let {sources} = await threadClient.getSources();
|
||||
@ -190,73 +143,3 @@ function newRecordingFile() {
|
||||
return OS.Path.join(OS.Constants.Path.tmpDir,
|
||||
"MochitestRecording" + Math.round(Math.random() * 1000000000));
|
||||
}
|
||||
|
||||
|
||||
async function warpToMessage(hud, threadClient, text) {
|
||||
let messages = await waitForMessages(hud, text);
|
||||
ok(messages.length == 1, "Found one message");
|
||||
let message = messages.pop();
|
||||
|
||||
let menuPopup = await openConsoleContextMenu(hud, message);
|
||||
console.log(`.>> menu`, menuPopup);
|
||||
|
||||
|
||||
let timeWarpItem = menuPopup.querySelector("#console-menu-time-warp");
|
||||
ok(timeWarpItem, "Time warp menu item is available");
|
||||
|
||||
timeWarpItem.click();
|
||||
|
||||
await Promise.all([
|
||||
hideConsoleContextMenu(hud),
|
||||
once(Services.ppmm, "TimeWarpFinished"),
|
||||
waitForThreadEvents(threadClient, 'paused')
|
||||
]);
|
||||
|
||||
messages = findMessages(hud, "", ".paused");
|
||||
ok(messages.length == 1, "Found one paused message");
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
function findMessage(hud, text, selector = ".message") {
|
||||
return findMessages(hud, text, selector)[0]
|
||||
}
|
||||
|
||||
function findMessages(hud, text, selector = ".message") {
|
||||
const messages = hud.ui.outputNode.querySelectorAll(selector);
|
||||
const elements = Array.prototype.filter.call(
|
||||
messages,
|
||||
(el) => el.textContent.includes(text)
|
||||
);
|
||||
|
||||
if (elements.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
function waitForMessages(hud, text, selector = ".message") {
|
||||
return waitFor(() => findMessages(hud, text, selector))
|
||||
}
|
||||
|
||||
async function openConsoleContextMenu(hud, element) {
|
||||
const onConsoleMenuOpened = hud.ui.consoleOutput.once("menu-open");
|
||||
synthesizeContextMenuEvent(element);
|
||||
await onConsoleMenuOpened;
|
||||
const doc = hud.ui.consoleOutput.owner.chromeWindow.document;
|
||||
return doc.getElementById("webconsole-menu");
|
||||
}
|
||||
|
||||
function hideConsoleContextMenu(hud) {
|
||||
const doc = hud.ui.consoleOutput.owner.chromeWindow.document;
|
||||
const popup = doc.getElementById("webconsole-menu");
|
||||
if (!popup) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const onPopupHidden = once(popup, "popuphidden");
|
||||
popup.hidePopup();
|
||||
return onPopupHidden;
|
||||
}
|
||||
|
@ -488,8 +488,6 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--progress-playing-background);
|
||||
transition-duration: 200ms;
|
||||
|
||||
}
|
||||
|
||||
.webreplay-player #overlay:not(.recording) .progress::after {
|
||||
@ -505,7 +503,6 @@
|
||||
|
||||
.webreplay-player .recording .progress {
|
||||
background: var(--progress-recording-background);
|
||||
transition-duration: 200ms;
|
||||
}
|
||||
|
||||
.webreplay-player .message {
|
||||
@ -516,7 +513,6 @@
|
||||
border-radius: 4.5px;
|
||||
top: calc(50% - 3.5px);
|
||||
background: var(--blue-40);
|
||||
transition-duration: 100ms;
|
||||
}
|
||||
|
||||
.webreplay-player .message.overlayed {
|
||||
@ -617,7 +613,6 @@
|
||||
left: 0;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transition-duration: 200ms;
|
||||
}
|
||||
|
||||
.webreplay-player .progress-line.end {
|
||||
|
@ -122,13 +122,7 @@ a {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.message.paused.paused-before::before {
|
||||
top: 0px;
|
||||
bottom: inherit;
|
||||
}
|
||||
|
||||
.message.paused ~ .message:not(.command):not(.result) .message-body-wrapper,
|
||||
.message.paused.paused-before .message-body-wrapper {
|
||||
.message.paused ~ .message:not(.command):not(.result) .message-body-wrapper {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,6 @@ class Message extends Component {
|
||||
executionPoint: PropTypes.shape({
|
||||
progress: PropTypes.number,
|
||||
}),
|
||||
pausedExecutionPoint: PropTypes.shape({
|
||||
progress: PropTypes.number,
|
||||
}),
|
||||
scrollToMessage: PropTypes.bool,
|
||||
exceptionDocURL: PropTypes.string,
|
||||
request: PropTypes.object,
|
||||
@ -165,7 +162,6 @@ class Message extends Component {
|
||||
timeStamp = Date.now(),
|
||||
timestampsVisible,
|
||||
executionPoint,
|
||||
pausedExecutionPoint,
|
||||
notes,
|
||||
} = this.props;
|
||||
|
||||
@ -176,12 +172,6 @@ class Message extends Component {
|
||||
|
||||
if (isPaused) {
|
||||
topLevelClasses.push("paused");
|
||||
|
||||
if (pausedExecutionPoint
|
||||
&& executionPoint
|
||||
&& pausedExecutionPoint.progress < executionPoint.progress) {
|
||||
topLevelClasses.push("paused-before");
|
||||
}
|
||||
}
|
||||
|
||||
let timestampEl;
|
||||
|
@ -36,7 +36,6 @@ class MessageContainer extends Component {
|
||||
networkMessageUpdate: PropTypes.object,
|
||||
getMessage: PropTypes.func.isRequired,
|
||||
isPaused: PropTypes.bool.isRequired,
|
||||
pausedExecutionPoint: PropTypes.any,
|
||||
};
|
||||
}
|
||||
|
||||
@ -55,16 +54,13 @@ class MessageContainer extends Component {
|
||||
const networkMessageUpdateChanged =
|
||||
this.props.networkMessageUpdate !== nextProps.networkMessageUpdate;
|
||||
const pausedChanged = this.props.isPaused !== nextProps.isPaused;
|
||||
const executionPointChanged =
|
||||
this.props.pausedExecutionPoint !== nextProps.pausedExecutionPoint;
|
||||
|
||||
return repeatChanged
|
||||
|| openChanged
|
||||
|| tableDataChanged
|
||||
|| timestampVisibleChanged
|
||||
|| networkMessageUpdateChanged
|
||||
|| pausedChanged
|
||||
|| executionPointChanged;
|
||||
|| pausedChanged;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -39,7 +39,6 @@ function ConsoleApiCall(props) {
|
||||
serviceContainer,
|
||||
timestampsVisible,
|
||||
repeat,
|
||||
pausedExecutionPoint,
|
||||
isPaused,
|
||||
} = props;
|
||||
const {
|
||||
@ -117,7 +116,6 @@ function ConsoleApiCall(props) {
|
||||
return Message({
|
||||
messageId,
|
||||
executionPoint,
|
||||
pausedExecutionPoint,
|
||||
isPaused,
|
||||
open,
|
||||
collapsible,
|
||||
|
@ -79,6 +79,7 @@ WebConsoleFrame.prototype = {
|
||||
this._initUI();
|
||||
await this._initConnection();
|
||||
await this.consoleOutput.init();
|
||||
|
||||
// Toggle the timestamp on preference change
|
||||
Services.prefs.addObserver(PREF_MESSAGE_TIMESTAMP, this._onToolboxPrefChanged);
|
||||
this._onToolboxPrefChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user