Backed out changeset 4b1dc5e311b9 (bug 1448431) for xpcshell failures at devtools/server/tests/unit/test_pause_exceptions-01.js on a CLOSED TREE
authorCoroiu Cristina <ccoroiu@mozilla.com>
Tue, 03 Apr 2018 16:33:24 +0300
changeset 776633 d6bc182977b453cf4b1a5d4f94e34744c0c7db75
parent 776626 4b1dc5e311b92a54befa20bc4af71668fca6048f
child 776634 fe0e01b08506fe803fa12aa8b84fff9a5c59d1e8
push id104931
push userbmo:dharvey@mozilla.com
push dateTue, 03 Apr 2018 14:20:56 +0000
bugs1448431
milestone61.0a1
backs out4b1dc5e311b92a54befa20bc4af71668fca6048f
Backed out changeset 4b1dc5e311b9 (bug 1448431) for xpcshell failures at devtools/server/tests/unit/test_pause_exceptions-01.js on a CLOSED TREE
devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js
devtools/server/actors/thread.js
--- 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;
       }