Bug 1573890 - Simplify logpoint messages. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D41990

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jason Laster 2019-08-16 17:28:40 +00:00
parent f92163b353
commit c0a595d089
6 changed files with 29 additions and 48 deletions

View File

@ -31,6 +31,6 @@ add_task(async function() {
await hasConsoleMessage(dbg, "firstCall");
const { link, value } = await findConsoleMessage(dbg, "a b c");
is(link, "Logpoint @ script-switching-01.js:8:2", "logs should have the relevant link");
is(link, "script-switching-01.js:8:2", "logs should have the relevant link");
is(value, "a b c", "logs should have multiple values");
});

View File

@ -204,27 +204,6 @@ class Frame extends Component {
}
}
// If the message comes from a logPoint,
// prefix the source location accordingly
if (frame.options) {
let locationPrefix;
if (frame.options.logPoint) {
locationPrefix = "Logpoint @ ";
}
if (locationPrefix) {
sourceElements.push(
dom.span(
{
key: "locationPrefix",
className: "frame-link-prefix",
},
locationPrefix
)
);
}
}
let displaySource = showFullSourceUrl ? unicodeLong : unicodeShort;
if (isSourceMapped) {
displaySource = getSourceMappedFile(displaySource);

View File

@ -1,20 +1,24 @@
<!-- 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/. -->
<!DOCTYPE HTML>
<!DOCTYPE html>
<html>
<!--
<!--
Test the formatting of the file name, line and columns are correct in frame components,
with optional columns, unknown and non-URL sources.
-->
<head>
<meta charset="utf-8">
<title>Frame component test</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<pre id="test">
<head>
<meta charset="utf-8" />
<title>Frame component test</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link
rel="stylesheet"
type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css"
/>
</head>
<body>
<pre id="test">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
window.onload = async function () {
@ -339,7 +343,6 @@ window.onload = async function () {
options: { logPoint: true },
}
}, {
locationPrefix: "Logpoint @ ",
file: "mahscripts.js",
line: 55,
column: 10,
@ -364,5 +367,5 @@ window.onload = async function () {
};
</script>
</pre>
</body>
</body>
</html>

View File

@ -55,7 +55,7 @@ add_task(async function() {
await testOpenInDebugger(
hud,
toolbox,
"[Logpoint threw]: undefinedVariable is not defined",
"undefinedVariable is not defined",
true,
false,
false,
@ -90,7 +90,7 @@ add_task(async function() {
await testOpenInDebugger(
hud,
toolbox,
"[Logpoint threw]: undefinedVariable is not defined",
"undefinedVariable is not defined",
true,
9,
12

View File

@ -247,7 +247,7 @@ BreakpointActor.prototype = {
} else if ("return" in completion) {
value = completion.return;
} else {
value = ["[Logpoint threw]: " + this.getThrownMessage(completion)];
value = [this.getThrownMessage(completion)];
level = "logPointError";
}

View File

@ -56,20 +56,19 @@ function test_simple_breakpoint() {
// Execute the rest of the code.
await gThreadFront.resume();
Assert.equal(lastMessage.level, "logPointError");
Assert.equal(
lastMessage.arguments[0],
"[Logpoint threw]: c is not defined"
);
Assert.equal(lastMessage.arguments[0], "c is not defined");
finishClient(gClient);
});
/* eslint-disable */
Cu.evalInSandbox("debugger;\n" + // 1
"var a = 'three';\n" + // 2
"var b = 2;\n", // 3
gDebuggee,
"1.8",
"test.js",
1);
Cu.evalInSandbox(
"debugger;\n" + // 1
"var a = 'three';\n" + // 2
"var b = 2;\n", // 3
gDebuggee,
"1.8",
"test.js",
1
);
/* eslint-enable */
}