Backed out changeset 0e538f767312 (bug 1607923) for XPCShell in devtools/server/tests/unit/test_logpoint-01.js. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Thu, 16 Jan 2020 06:13:16 +0200
changeset 510429 e69960479b2ad9c896146229645a62da5bf3586f
parent 510428 051d6f3a237c14a883a3712360dafddeaf23b6c2
child 510430 b5aac83f7f4fbb8b3f6eb6eeaeafda286515fe67
push id37021
push userrmaries@mozilla.com
push dateThu, 16 Jan 2020 09:46:51 +0000
treeherdermozilla-central@7541d616ff87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1607923
milestone74.0a1
backs out0e538f767312b0fff2dfed404e998cf06bbcf755
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 0e538f767312 (bug 1607923) for XPCShell in devtools/server/tests/unit/test_logpoint-01.js. CLOSED TREE
devtools/client/debugger/test/mochitest/browser.ini
devtools/client/debugger/test/mochitest/browser_dbg-log-points-workers.js
devtools/client/debugger/test/mochitest/examples/simple-worker.js
devtools/server/actors/utils/logEvent.js
devtools/server/actors/webconsole.js
devtools/server/actors/webconsole/eval-with-debugger.js
devtools/server/startup/worker.js
--- a/devtools/client/debugger/test/mochitest/browser.ini
+++ b/devtools/client/debugger/test/mochitest/browser.ini
@@ -82,17 +82,16 @@ skip-if = ccov && os == 'win' # Bug 1443
 [browser_dbg-inline-preview.js]
 [browser_dbg-inspector-integration.js]
 [browser_dbg-keyboard-navigation.js]
 [browser_dbg-keyboard-shortcuts.js]
 skip-if = os == "linux" # bug 1351952
 [browser_dbg-layout-changes.js]
 [browser_dbg-log-events.js]
 [browser_dbg-log-points.js]
-[browser_dbg-log-points-workers.js]
 [browser_dbg-outline.js]
 [browser_dbg-outline-focus.js]
 skip-if = verify
 [browser_dbg-outline-pretty.js]
 [browser_dbg-outline-filter.js]
 [browser_dbg-pause-exceptions.js]
 skip-if = !debug && (os == "win" && os_version == "6.1") # Bug 1456441
 [browser_dbg-pause-on-next.js]
deleted file mode 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg-log-points-workers.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* 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/>. */
-
-/*
- * Tests that log points in a worker are correctly logged to the console
- */
-
-add_task(async function() {
-  Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
-
-  const dbg = await initDebugger("doc-windowless-workers.html");
-
-  await waitForSource(dbg, "simple-worker.js");
-  await selectSource(dbg, "simple-worker.js");
-
-  await altClickElement(dbg, "gutter", 4);
-  await waitForBreakpoint(dbg, "simple-worker.js", 4);
-
-  await getDebuggerSplitConsole(dbg);
-  await hasConsoleMessage(dbg, "timer");
-  const { link } = await await findConsoleMessage(dbg, "timer");
-  is(
-    link,
-    "simple-worker.js:4:9",
-    "message should include the url and linenumber"
-  );
-});
--- a/devtools/client/debugger/test/mochitest/examples/simple-worker.js
+++ b/devtools/client/debugger/test/mochitest/examples/simple-worker.js
@@ -2,10 +2,10 @@ var count = 0;
 function timer() {
   var n = ++count;
   console.log("WORKER SAYS HELLO! " + n);
 }
 
 setInterval(timer, 1000);
 
 self.onmessage = () => {
-  console.log("hi");
-};
+  console.log('hi')
+}
--- a/devtools/server/actors/utils/logEvent.js
+++ b/devtools/server/actors/utils/logEvent.js
@@ -21,29 +21,16 @@ function getThrownMessage(completion) {
 }
 module.exports.getThrownMessage = getThrownMessage;
 
 function logEvent({ threadActor, frame, level, expression, bindings }) {
   const { sourceActor, line, column } = threadActor.sources.getFrameLocation(
     frame
   );
   const displayName = formatDisplayName(frame);
-
-  // TODO remove this branch when (#1592584) lands (#1609540)
-  if (isWorker) {
-    threadActor._parent._consoleActor.evaluateJS({
-      text: `console.log(...${expression})`,
-      bindings: { displayName, ...bindings },
-      url: sourceActor.url,
-      lineNumber: line,
-    });
-
-    return undefined;
-  }
-
   const completion = frame.evalWithBindings(expression, {
     displayName,
     ...bindings,
   });
 
   let value;
   if (!completion) {
     // The evaluation was killed (possibly by the slow script dialog).
@@ -63,12 +50,11 @@ function logEvent({ threadActor, frame, 
     filename: sourceActor.url,
     lineNumber: line,
     columnNumber: column,
     arguments: value,
     level,
   };
 
   threadActor._parent._consoleActor.onConsoleAPICall(message);
-  return undefined;
 }
 
 module.exports.logEvent = logEvent;
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -1142,18 +1142,16 @@ const WebConsoleActor = ActorClassWithSp
     const timestamp = Date.now();
 
     const evalOptions = {
       frameActor: request.frameActor,
       url: request.url,
       selectedNodeActor: request.selectedNodeActor,
       selectedObjectActor: request.selectedObjectActor,
       eager: request.eager,
-      bindings: request.bindings,
-      lineNumber: request.lineNumber,
     };
     const { mapped } = request;
 
     // Set a flag on the thread actor which indicates an evaluation is being
     // done for the client. This can affect how debugger handlers behave.
     this.parentActor.threadActor.insideClientEvaluation = true;
 
     const evalInfo = evalWithDebugger(input, evalOptions, this);
--- a/devtools/server/actors/webconsole/eval-with-debugger.js
+++ b/devtools/server/actors/webconsole/eval-with-debugger.js
@@ -112,39 +112,28 @@ exports.evalWithDebugger = function(stri
     if (options.eager) {
       throw new Error("Eager evaluations are not supported while replaying");
     }
     return evalReplay(frame, dbg, evalString);
   }
 
   const { dbgWindow, bindSelf } = getDbgWindow(options, dbg, webConsole);
   const helpers = getHelpers(dbgWindow, options, webConsole);
-  let { bindings, helperCache } = bindCommands(
+  const { bindings, helperCache } = bindCommands(
     isCommand(string),
     dbgWindow,
     bindSelf,
     frame,
     helpers
   );
 
-  if (options.bindings) {
-    bindings = { ...(bindings || {}), ...options.bindings };
-  }
-
   // Ready to evaluate the string.
   helpers.evalInput = string;
-  const evalOptions = {};
-
-  if (typeof options.url === "string") {
-    evalOptions.url = options.url;
-  }
-
-  if (typeof options.lineNumber === "number") {
-    evalOptions.lineNumber = options.lineNumber;
-  }
+  const evalOptions =
+    typeof options.url === "string" ? { url: options.url } : null;
 
   updateConsoleInputEvaluation(dbg, dbgWindow, webConsole);
 
   let sideEffectData = null;
   if (options.eager) {
     sideEffectData = preventSideEffects(dbg);
   }
 
--- a/devtools/server/startup/worker.js
+++ b/devtools/server/startup/worker.js
@@ -112,20 +112,16 @@ this.addEventListener("message", functio
       pool.addActor(threadActor);
 
       // parentActor.threadActor is needed from the webconsole for grip previewing
       parent.threadActor = threadActor;
 
       const consoleActor = new WebConsoleActor(connection, parent);
       pool.addActor(consoleActor);
 
-      // needed so the thread actor can communicate with the console
-      // when evaluating logpoints.
-      parent._consoleActor = consoleActor;
-
       // Step 5: Send a response packet to the parent to notify
       // it that a connection has been established.
       postMessage(
         JSON.stringify({
           type: "connected",
           id: packet.id,
           threadActor: threadActor.actorID,
           consoleActor: consoleActor.actorID,