From d3ae1f3a8d0245d4a08eb2955f9f2bd2db4e3ffd Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Thu, 7 Nov 2019 23:19:04 +0000 Subject: [PATCH] Bug 1593846 - Paused packet should return a frame front. r=bhackett Differential Revision: https://phabricator.services.mozilla.com/D52259 --HG-- extra : moz-landing-system : lando --- devtools/client/debugger/src/client/firefox/create.js | 8 +++----- devtools/client/debugger/src/client/firefox/types.js | 4 ++-- devtools/server/actors/thread.js | 2 +- devtools/server/tests/unit/test_frameactor-03.js | 2 +- devtools/server/tests/unit/test_watchpoint-01.js | 2 +- devtools/server/tests/unit/test_watchpoint-02.js | 2 +- devtools/shared/specs/thread.js | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/devtools/client/debugger/src/client/firefox/create.js b/devtools/client/debugger/src/client/firefox/create.js index b7729dda2d29..d3292c774462 100644 --- a/devtools/client/debugger/src/client/firefox/create.js +++ b/devtools/client/debugger/src/client/firefox/create.js @@ -32,7 +32,7 @@ export function prepareSourcePayload( export function createFrame( thread: ThreadId, - frame: FramePacket | FrameFront, + frame: FrameFront, index: number = 0 ): ?Frame { if (!frame) { @@ -45,10 +45,8 @@ export function createFrame( column: frame.where.column, }; - const id = frame.data ? frame.actorID : frame.actor; - return { - id, + id: frame.actorID, thread, displayName: frame.displayName, location, @@ -67,7 +65,7 @@ export function makeSourceId(source: SourcePayload) { export function createPause( thread: string, packet: PausedPacket, - frames: FramePacket[] + frames: FrameFront[] ): any { // NOTE: useful when the debugger is already paused const frame = packet.frame || frames[0]; diff --git a/devtools/client/debugger/src/client/firefox/types.js b/devtools/client/debugger/src/client/firefox/types.js index 84df49f5576d..92e1951b0d16 100644 --- a/devtools/client/debugger/src/client/firefox/types.js +++ b/devtools/client/debugger/src/client/firefox/types.js @@ -143,7 +143,7 @@ export type PausedPacket = { actor: ActorId, from: ActorId, type: string, - frame: FramePacket, + frame: FrameFront, why: { actors: ActorId[], type: string, @@ -367,7 +367,7 @@ export type ObjectFront = { * @static */ export type ThreadFront = { - getFrames: (number, number) => Promise<{| frames: FramePacket[] |}>, + getFrames: (number, number) => Promise<{| frames: FrameFront[] |}>, resume: Function => Promise<*>, stepIn: Function => Promise<*>, stepOver: Function => Promise<*>, diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index 33cf8a9db965..50ebd64c9e3e 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -1523,7 +1523,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { }; if (frame) { - packet.frame = this._createFrameActor(frame).form(); + packet.frame = this._createFrameActor(frame); } if (this.dbg.replaying) { diff --git a/devtools/server/tests/unit/test_frameactor-03.js b/devtools/server/tests/unit/test_frameactor-03.js index ccc28e657f8a..c366488f68e1 100644 --- a/devtools/server/tests/unit/test_frameactor-03.js +++ b/devtools/server/tests/unit/test_frameactor-03.js @@ -38,7 +38,7 @@ function test_pause_frame() { gThreadFront.once("paused", function(packet2) { const poppedFrames = packet2.poppedFrames; Assert.equal(typeof poppedFrames, typeof []); - Assert.ok(poppedFrames.includes(packet1.frame.actor)); + Assert.ok(poppedFrames.includes(packet1.frame.actorID)); gThreadFront.resume().then(function() { finishClient(gClient); }); diff --git a/devtools/server/tests/unit/test_watchpoint-01.js b/devtools/server/tests/unit/test_watchpoint-01.js index 41c6e82f04f7..640c5f3f3908 100644 --- a/devtools/server/tests/unit/test_watchpoint-01.js +++ b/devtools/server/tests/unit/test_watchpoint-01.js @@ -22,7 +22,7 @@ async function testSetWatchpoint({ threadFront, debuggee, targetFront }) { const consoleFront = await targetFront.getFront("console"); const { result } = await consoleFront.evaluateJSAsync(input, { thread: threadFront.actor, - frameActor: packet.frame.actor, + frameActor: packet.frame.actorID, }); return result; } diff --git a/devtools/server/tests/unit/test_watchpoint-02.js b/devtools/server/tests/unit/test_watchpoint-02.js index 74024e0ea4a8..f8a4f0a6b4b8 100644 --- a/devtools/server/tests/unit/test_watchpoint-02.js +++ b/devtools/server/tests/unit/test_watchpoint-02.js @@ -159,7 +159,7 @@ async function testLoops({ threadFront, debuggee, targetFront }) { const consoleFront = await targetFront.getFront("console"); const { result } = await consoleFront.evaluateJSAsync(input, { thread: threadFront.actor, - frameActor: packet.frame.actor, + frameActor: packet.frame.actorID, }); return result; } diff --git a/devtools/shared/specs/thread.js b/devtools/shared/specs/thread.js index 2a16f763c4ec..d71c71a70e95 100644 --- a/devtools/shared/specs/thread.js +++ b/devtools/shared/specs/thread.js @@ -53,7 +53,7 @@ const threadSpec = generateActorSpec({ events: { paused: { actor: Option(0, "nullable:string"), - frame: Option(0, "nullable:json"), + frame: Option(0, "frame"), why: Option(0, "paused-reason"), poppedFrames: Option(0, "nullable:json"), error: Option(0, "nullable:json"),