Bug 1581447 - Fix event breakpoints ignoring blackboxed files. r=davidwalsh
authorMiriam <bmiriam1230@gmail.com>
Fri, 27 Sep 2019 20:40:41 +0000
changeset 495436 195277db19c51031b4ba4b01bbd6e36fc1b18104
parent 495435 864c928edc5ba92cc0df45cd0482b0bd0956f913
child 495437 9364cff86a7e135ee2ffed3edcebc5c1c718ad20
push id36628
push useraciure@mozilla.com
push dateSat, 28 Sep 2019 09:46:05 +0000
treeherdermozilla-central@72a8d8c20180 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidwalsh
bugs1581447
milestone71.0a1
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
Bug 1581447 - Fix event breakpoints ignoring blackboxed files. r=davidwalsh Differential Revision: https://phabricator.services.mozilla.com/D47120
devtools/client/debugger/test/mochitest/browser_dbg-event-breakpoints.js
devtools/server/actors/thread.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg-event-breakpoints.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-event-breakpoints.js
@@ -46,9 +46,26 @@ add_task(async function() {
   invokeInTab("timerHandler");
   await waitForPaused(dbg);
   assertPauseLocation(dbg, 27);
   await resume(dbg);
 
   await waitForPaused(dbg);
   assertPauseLocation(dbg, 28);
   await resume(dbg);
+
+  // Test that we don't pause on event breakpoints when source is blackboxed.
+  await clickElement(dbg, "blackbox");
+  await waitForDispatch(dbg, "BLACKBOX");
+
+  invokeInTab("clickHandler");
+  is(isPaused(dbg), false);
+
+  invokeInTab("xhrHandler");
+  is(isPaused(dbg), false);
+
+  invokeInTab("timerHandler");
+  is(isPaused(dbg), false);
+
+  // Cleanup - unblackbox the source
+  await clickElement(dbg, "blackbox");
+  await waitForDispatch(dbg, "BLACKBOX");
 });
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -718,19 +718,21 @@ const ThreadActor = ActorClassWithSpec(t
 
         this._pauseAndRespondEventBreakpoint(frame, eventBreakpoint);
       }
     }
   },
 
   _makeEventBreakpointEnterFrame(eventBreakpoint) {
     return frame => {
-      const { sourceActor } = this.sources.getFrameLocation(frame);
+      const location = this.sources.getFrameLocation(frame);
+      const { sourceActor, line, column } = location;
       const url = sourceActor.url;
-      if (this.sources.isBlackBoxed(url)) {
+
+      if (this.sources.isBlackBoxed(url, line, column)) {
         return undefined;
       }
 
       this._restoreDebuggerHooks(this._activeEventPause);
       this._activeEventPause = null;
 
       return this._pauseAndRespondEventBreakpoint(frame, eventBreakpoint);
     };