Bug 1581999 - Fix event logging while replaying, r=jlast.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-09-18 03:22:33 +00:00
parent a5a84ae3df
commit a0762fda35
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ add_task(async function() {
const hud = console.hud;
await dbg.actions.addEventListenerBreakpoints(["event.mouse.mousedown"]);
await dbg.actions.toggleEventLogging();
const msg = await waitForMessage(hud, "mousedown");

View File

@ -408,6 +408,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
toggleEventLogging(logEventBreakpoints) {
this._options.logEventBreakpoints = logEventBreakpoints;
this._updateEventLogging();
return this._options.logEventBreakpoints;
},
@ -544,8 +545,13 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
);
}
this._updateEventLogging();
},
_updateEventLogging() {
if (isReplaying && this._options.logEventBreakpoints) {
const logpointId = `logGroup-${Math.random()}`;
const ids = [...this._activeEventBreakpoints];
this.dbg.replaySetActiveEventBreakpoints(ids, (executionPoint, rv) => {
const { script, offset } = this.dbg.replayGetExecutionPointPosition(
executionPoint