1
0
Fork 0
firefox/devtools/server/tests/xpcshell/test_pauselifetime-04.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

42 lines
991 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Test that requesting a pause actor for the same value multiple
* times returns the same actor.
*/
add_task(
threadFrontTest(async ({ threadFront, debuggee }) => {
const packet = await executeOnNextTickAndWaitForPause(
() => evaluateTestCode(debuggee),
threadFront
);
const args = packet.frame.arguments;
const objActor1 = args[0].actor;
const response = await threadFront.getFrames(0, 1);
const frame = response.frames[0];
Assert.equal(objActor1, frame.arguments[0].actor);
await threadFront.resume();
})
);
function evaluateTestCode(debuggee) {
debuggee.eval(
"(" +
function () {
// These arguments are tested.
// eslint-disable-next-line no-unused-vars
function stopMe(obj) {
debugger;
}
stopMe({ foo: "bar" });
} +
")()"
);
}