Backed out changeset 4b1dc5e311b9 (
bug 1448431) for xpcshell failures at devtools/server/tests/unit/test_pause_exceptions-01.js on a CLOSED TREE
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js
@@ -17,45 +17,65 @@ function getLabel(dbg, index) {
return findElement(dbg, "expressionNode", index).innerText;
}
function getValue(dbg, index) {
return findElement(dbg, "expressionValue", index).innerText;
}
async function addExpression(dbg, input) {
- const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION");
+ info("Adding an expression");
findElementWithSelector(dbg, expressionSelectors.input).focus();
type(dbg, input);
pressKey(dbg, "Enter");
- await evaluation;
+ await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
}
async function editExpression(dbg, input) {
info("updating the expression");
dblClickElement(dbg, "expressionNode", 1);
// Position cursor reliably at the end of the text.
const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION");
pressKey(dbg, "End");
type(dbg, input);
pressKey(dbg, "Enter");
await evaluation;
}
+/*
+ * When we add a bad expression, we'll pause,
+ * resume, and wait for the expression to finish being evaluated.
+ */
+async function addBadExpression(dbg, input) {
+ const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION");
+
+ findElementWithSelector(dbg, expressionSelectors.input).focus();
+ type(dbg, input);
+ pressKey(dbg, "Enter");
+
+ await waitForPaused(dbg);
+
+ ok(dbg.selectors.isEvaluatingExpression(dbg.getState()));
+ await resume(dbg);
+ await evaluation;
+}
+
add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html");
- await togglePauseOnExceptions(dbg, true, false);
+ const onPausedOnException = togglePauseOnExceptions(dbg, true, false);
// add a good expression, 2 bad expressions, and another good one
await addExpression(dbg, "location");
- await addExpression(dbg, "foo.bar");
- await addExpression(dbg, "foo.batt");
+ await addBadExpression(dbg, "foo.bar");
+ await addBadExpression(dbg, "foo.batt");
await addExpression(dbg, "2");
+ await onPausedOnException;
+
// check the value of
is(getValue(dbg, 2), "(unavailable)");
is(getValue(dbg, 3), "(unavailable)");
is(getValue(dbg, 4), 2);
await toggleExpressionNode(dbg, 1);
is(findAllElements(dbg, "expressionNodes").length, 20);
});
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -1531,19 +1531,17 @@ const ThreadActor = ActorClassWithSpec(t
return undefined;
}
const generatedLocation = this.sources.getFrameLocation(youngestFrame);
const { originalSourceActor } = this.unsafeSynchronize(
this.sources.getOriginalLocation(generatedLocation));
const url = originalSourceActor ? originalSourceActor.url : null;
- // We ignore sources without a url because we do not
- // want to pause at console evaluations or watch expressions.
- if (!url || this.sources.isBlackBoxed(url)) {
+ if (this.sources.isBlackBoxed(url)) {
return undefined;
}
try {
let packet = this._paused(youngestFrame);
if (!packet) {
return undefined;
}