mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Merge inbound to mozilla-central. a=merge
This commit is contained in:
commit
6e2787f9c5
@ -928,14 +928,20 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't find any matching entrypoints, then
|
||||
// we should check to see if the breakpoint is to the left of the first offset.
|
||||
// If we don't find any matching entrypoints,
|
||||
// then we should see if the breakpoint comes before or after the column offsets.
|
||||
if (entryPoints.length === 0) {
|
||||
for (let [script, columnToOffsetMap] of columnToOffsetMaps) {
|
||||
if (columnToOffsetMap.length > 0) {
|
||||
let { columnNumber: column, offset } = columnToOffsetMap[0];
|
||||
if (generatedColumn < column) {
|
||||
entryPoints.push({ script, offsets: [offset] });
|
||||
const firstColumnOffset = columnToOffsetMap[0];
|
||||
const lastColumnOffset = columnToOffsetMap[columnToOffsetMap.length - 1];
|
||||
|
||||
if (generatedColumn < firstColumnOffset.columnNumber) {
|
||||
entryPoints.push({ script, offsets: [firstColumnOffset.offset] });
|
||||
}
|
||||
|
||||
if (generatedColumn > lastColumnOffset.columnNumber) {
|
||||
entryPoints.push({ script, offsets: [lastColumnOffset.offset] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
function f() {
|
||||
var a = 1; var b = 2;
|
||||
var c = 3;
|
||||
}
|
@ -2,63 +2,58 @@
|
||||
|
||||
var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js");
|
||||
|
||||
function run_test() {
|
||||
return async function () {
|
||||
do_test_pending();
|
||||
async function run_test() {
|
||||
do_test_pending();
|
||||
DebuggerServer.registerModule("xpcshell-test/testactors");
|
||||
DebuggerServer.init(() => true);
|
||||
let global = createTestGlobal("test");
|
||||
DebuggerServer.addTestGlobal(global);
|
||||
|
||||
DebuggerServer.registerModule("xpcshell-test/testactors");
|
||||
DebuggerServer.init(() => true);
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
await connect(client);
|
||||
|
||||
let global = createTestGlobal("test");
|
||||
DebuggerServer.addTestGlobal(global);
|
||||
let { tabs } = await listTabs(client);
|
||||
let tab = findTab(tabs, "test");
|
||||
let [, tabClient] = await attachTab(client, tab);
|
||||
let [, threadClient] = await attachThread(tabClient);
|
||||
await resume(threadClient);
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
await connect(client);
|
||||
let promise = waitForNewSource(threadClient, SOURCE_URL);
|
||||
loadSubScript(SOURCE_URL, global);
|
||||
let { source } = await promise;
|
||||
let sourceClient = threadClient.source(source);
|
||||
|
||||
let { tabs } = await listTabs(client);
|
||||
let tab = findTab(tabs, "test");
|
||||
let [, tabClient] = await attachTab(client, tab);
|
||||
let [, threadClient] = await attachThread(tabClient);
|
||||
await resume(threadClient);
|
||||
let location = { line: 4, column: 2 };
|
||||
let [packet, breakpointClient] = await setBreakpoint(
|
||||
sourceClient,
|
||||
location
|
||||
);
|
||||
|
||||
let promise = waitForNewSource(threadClient, SOURCE_URL);
|
||||
loadSubScript(SOURCE_URL, global);
|
||||
let { source } = await promise;
|
||||
let sourceClient = threadClient.source(source);
|
||||
Assert.ok(!packet.isPending);
|
||||
Assert.equal(false, "actualLocation" in packet);
|
||||
|
||||
let location = { line: 4, column: 2 };
|
||||
let [packet, breakpointClient] = await setBreakpoint(
|
||||
sourceClient,
|
||||
location
|
||||
);
|
||||
packet = await executeOnNextTickAndWaitForPause(function () {
|
||||
Cu.evalInSandbox("f()", global);
|
||||
}, client);
|
||||
|
||||
Assert.ok(!packet.isPending);
|
||||
Assert.equal(false, "actualLocation" in packet);
|
||||
Assert.equal(packet.type, "paused");
|
||||
let why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
Assert.equal(why.actors[0], breakpointClient.actor);
|
||||
|
||||
packet = await executeOnNextTickAndWaitForPause(function () {
|
||||
Cu.evalInSandbox("f()", global);
|
||||
}, client);
|
||||
let frame = packet.frame;
|
||||
let where = frame.where;
|
||||
Assert.equal(where.source.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, 6);
|
||||
|
||||
Assert.equal(packet.type, "paused");
|
||||
let why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
Assert.equal(why.actors[0], breakpointClient.actor);
|
||||
let variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value.type, "undefined");
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
||||
let frame = packet.frame;
|
||||
let where = frame.where;
|
||||
Assert.equal(where.source.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, 6);
|
||||
|
||||
let variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value.type, "undefined");
|
||||
Assert.equal(variables.b.value.type, "undefined");
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
||||
await resume(threadClient);
|
||||
await close(client);
|
||||
|
||||
do_test_finished();
|
||||
};
|
||||
await resume(threadClient);
|
||||
await close(client);
|
||||
do_test_finished();
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js");
|
||||
|
||||
async function run_test() {
|
||||
do_test_pending();
|
||||
|
||||
DebuggerServer.registerModule("xpcshell-test/testactors");
|
||||
DebuggerServer.init(() => true);
|
||||
|
||||
let global = createTestGlobal("test");
|
||||
DebuggerServer.addTestGlobal(global);
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
await connect(client);
|
||||
|
||||
let { tabs } = await listTabs(client);
|
||||
let tab = findTab(tabs, "test");
|
||||
let [, tabClient] = await attachTab(client, tab);
|
||||
let [, threadClient] = await attachThread(tabClient);
|
||||
await resume(threadClient);
|
||||
|
||||
let promise = waitForNewSource(threadClient, SOURCE_URL);
|
||||
loadSubScript(SOURCE_URL, global);
|
||||
let { source } = await promise;
|
||||
let sourceClient = threadClient.source(source);
|
||||
|
||||
let location = { line: 4, column: 42 };
|
||||
let [packet, breakpointClient] = await setBreakpoint(
|
||||
sourceClient,
|
||||
location
|
||||
);
|
||||
|
||||
Assert.ok(!packet.isPending);
|
||||
Assert.equal(false, "actualLocation" in packet);
|
||||
|
||||
packet = await executeOnNextTickAndWaitForPause(function () {
|
||||
Cu.evalInSandbox("f()", global);
|
||||
}, client);
|
||||
|
||||
Assert.equal(packet.type, "paused");
|
||||
let why = packet.why;
|
||||
Assert.equal(why.type, "breakpoint");
|
||||
Assert.equal(why.actors.length, 1);
|
||||
Assert.equal(why.actors[0], breakpointClient.actor);
|
||||
|
||||
let frame = packet.frame;
|
||||
let where = frame.where;
|
||||
Assert.equal(where.source.actor, source.actor);
|
||||
Assert.equal(where.line, location.line);
|
||||
Assert.equal(where.column, 28);
|
||||
|
||||
let variables = frame.environment.bindings.variables;
|
||||
Assert.equal(variables.a.value, 1);
|
||||
Assert.equal(variables.b.value, 2);
|
||||
Assert.equal(variables.c.value.type, "undefined");
|
||||
|
||||
await resume(threadClient);
|
||||
await close(client);
|
||||
|
||||
do_test_finished();
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var SOURCE_URL = getFileUrl("setBreakpoint-on-column-with-no-offsets-at-end-of-line.js");
|
||||
|
||||
function run_test() {
|
||||
return (async function () {
|
||||
do_test_pending();
|
||||
|
||||
DebuggerServer.registerModule("xpcshell-test/testactors");
|
||||
DebuggerServer.init(() => true);
|
||||
|
||||
let global = createTestGlobal("test");
|
||||
DebuggerServer.addTestGlobal(global);
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
await connect(client);
|
||||
|
||||
let { tabs } = await listTabs(client);
|
||||
let tab = findTab(tabs, "test");
|
||||
let [, tabClient] = await attachTab(client, tab);
|
||||
let [, threadClient] = await attachThread(tabClient);
|
||||
await resume(threadClient);
|
||||
|
||||
let promise = waitForNewSource(threadClient, SOURCE_URL);
|
||||
loadSubScript(SOURCE_URL, global);
|
||||
let { source } = await promise;
|
||||
let sourceClient = threadClient.source(source);
|
||||
|
||||
let location = { line: 4, column: 23 };
|
||||
let [packet, ] = await setBreakpoint(sourceClient, location);
|
||||
Assert.ok(packet.isPending);
|
||||
Assert.equal(false, "actualLocation" in packet);
|
||||
|
||||
Cu.evalInSandbox("f()", global);
|
||||
await close(client);
|
||||
|
||||
do_test_finished();
|
||||
})();
|
||||
}
|
@ -10,75 +10,72 @@
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
var gCallback;
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
run_test_with_server(DebuggerServer, function () {
|
||||
run_test_with_server(WorkerDebuggerServer, do_test_finished);
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function run_test_with_server(server, callback) {
|
||||
gCallback = callback;
|
||||
initTestDebuggerServer(server);
|
||||
gDebuggee = addTestGlobal("test-stack", server);
|
||||
gDebuggee = addTestGlobal("test-stepping", server);
|
||||
gClient = new DebuggerClient(server.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_simple_stepping();
|
||||
});
|
||||
});
|
||||
gClient.connect(test_simple_stepping);
|
||||
}
|
||||
|
||||
function test_simple_stepping() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, undefined);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
async function test_simple_stepping() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
|
||||
"test-stepping");
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
const dbgStmt = await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
equal(dbgStmt.frame.where.line, 2, "Should be at debugger statement on line 2");
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
// When leaving a stack frame the line number doesn't change.
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, 2);
|
||||
dumpn("Step Over to line 3");
|
||||
const step1 = await stepOver(gClient, threadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
equal(step1.frame.where.line, 3);
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
gThreadClient.stepOver();
|
||||
});
|
||||
gThreadClient.stepOver();
|
||||
});
|
||||
gThreadClient.stepOver();
|
||||
});
|
||||
dumpn("Step Over to line 4");
|
||||
const step3 = await stepOver(gClient, threadClient);
|
||||
equal(step3.type, "paused");
|
||||
equal(step3.why.type, "resumeLimit");
|
||||
equal(step3.frame.where.line, 4);
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
dumpn("Step Over to line 4 to leave the frame");
|
||||
const step4 = await stepOver(gClient, threadClient);
|
||||
equal(step4.type, "paused");
|
||||
equal(step4.why.type, "resumeLimit");
|
||||
equal(step4.frame.where.line, 4);
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, 2);
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"debugger;\n" + // line0 + 1
|
||||
"var a = 1;\n" + // line0 + 2
|
||||
"var b = 2;"); // line0 + 3
|
||||
/* eslint-enable */
|
||||
}
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
debugger; // 2
|
||||
var a = 1; // 3
|
||||
var b = 2;`, // 4
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-01-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-disable */
|
||||
}
|
@ -10,75 +10,72 @@
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
var gCallback;
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
run_test_with_server(DebuggerServer, function () {
|
||||
run_test_with_server(WorkerDebuggerServer, do_test_finished);
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function run_test_with_server(server, callback) {
|
||||
gCallback = callback;
|
||||
initTestDebuggerServer(server);
|
||||
gDebuggee = addTestGlobal("test-stack", server);
|
||||
gDebuggee = addTestGlobal("test-stepping", server);
|
||||
gClient = new DebuggerClient(server.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_simple_stepping();
|
||||
});
|
||||
});
|
||||
gClient.connect(test_simple_stepping);
|
||||
}
|
||||
|
||||
function test_simple_stepping() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, undefined);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
async function test_simple_stepping() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(
|
||||
gClient,
|
||||
"test-stepping"
|
||||
);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
// When leaving a stack frame the line number doesn't change.
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, 2);
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
const dbgStmt = await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
equal(dbgStmt.frame.where.line, 2, "Should be at debugger statement on line 2");
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
const step1 = await stepIn(gClient, threadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
equal(step1.frame.where.line, 3);
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
const step3 = await stepIn(gClient, threadClient);
|
||||
equal(step3.type, "paused");
|
||||
equal(step3.why.type, "resumeLimit");
|
||||
equal(step3.frame.where.line, 4);
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
const step4 = await stepIn(gClient, threadClient);
|
||||
equal(step4.type, "paused");
|
||||
equal(step4.why.type, "resumeLimit");
|
||||
equal(step4.frame.where.line, 4);
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, 2);
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
debugger; // 2
|
||||
var a = 1; // 3
|
||||
var b = 2;`, // 4
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-01-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"debugger;\n" + // line0 + 1
|
||||
"var a = 1;\n" + // line0 + 2
|
||||
"var b = 2;"); // line0 + 3
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
var gCallback;
|
||||
|
||||
function run_test() {
|
||||
@ -23,42 +22,45 @@ function run_test() {
|
||||
function run_test_with_server(server, callback) {
|
||||
gCallback = callback;
|
||||
initTestDebuggerServer(server);
|
||||
gDebuggee = addTestGlobal("test-stack", server);
|
||||
gDebuggee = addTestGlobal("test-stepping", server);
|
||||
gClient = new DebuggerClient(server.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_simple_stepping();
|
||||
});
|
||||
});
|
||||
gClient.connect(test_simple_stepping);
|
||||
}
|
||||
|
||||
function test_simple_stepping() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, 2);
|
||||
async function test_simple_stepping() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
|
||||
"test-stepping");
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
gThreadClient.stepOut();
|
||||
});
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
|
||||
const step1 = await stepOut(gClient, threadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.frame.where.line, 6);
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, 2);
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"function f() {\n" + // line0 + 1
|
||||
" debugger;\n" + // line0 + 2
|
||||
" this.a = 1;\n" + // line0 + 3
|
||||
" this.b = 2;\n" + // line0 + 4
|
||||
"}\n" + // line0 + 5
|
||||
"f();\n"); // line0 + 6
|
||||
/* eslint-enable */
|
||||
}
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
function f() { // 2
|
||||
debugger; // 3
|
||||
this.a = 1; // 4
|
||||
this.b = 2; // 5
|
||||
} // 6
|
||||
f(); // 7
|
||||
`, // 8
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-01-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-disable */
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
var gCallback;
|
||||
|
||||
function run_test() {
|
||||
@ -23,53 +22,56 @@ function run_test() {
|
||||
function run_test_with_server(server, callback) {
|
||||
gCallback = callback;
|
||||
initTestDebuggerServer(server);
|
||||
gDebuggee = addTestGlobal("test-stack", server);
|
||||
gDebuggee = addTestGlobal("test-stepping", server);
|
||||
gClient = new DebuggerClient(server.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_simple_stepping();
|
||||
});
|
||||
});
|
||||
gClient.connect(test_simple_stepping);
|
||||
}
|
||||
|
||||
function test_simple_stepping() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, undefined);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
async function test_simple_stepping() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(
|
||||
gClient,
|
||||
"test-stepping"
|
||||
);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 6);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
gThreadClient.stepOver();
|
||||
});
|
||||
gThreadClient.stepOver();
|
||||
});
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
|
||||
dumpn("Step Over to f()");
|
||||
const step1 = await stepOver(gClient, threadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
equal(step1.frame.where.line, 6);
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
dumpn("Step Over f()");
|
||||
const step2 = await stepOver(gClient, threadClient);
|
||||
equal(step2.type, "paused");
|
||||
equal(step2.frame.where.line, 7);
|
||||
equal(step2.why.type, "resumeLimit");
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
function f() { // 2
|
||||
this.a = 1; // 3
|
||||
} // 4
|
||||
debugger; // 5
|
||||
f(); // 6
|
||||
let b = 2; // 7
|
||||
`, // 8
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-01-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"function f() {\n" + // line0 + 1
|
||||
" this.a = 1;\n" + // line0 + 2
|
||||
"}\n" + // line0 + 3
|
||||
"debugger;\n" + // line0 + 4
|
||||
"f();\n" + // line0 + 5
|
||||
"let b = 2;\n"); // line0 + 6
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
var gCallback;
|
||||
|
||||
function run_test() {
|
||||
@ -21,81 +20,68 @@ function run_test() {
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function run_test_with_server(server, callback) {
|
||||
gCallback = callback;
|
||||
initTestDebuggerServer(server);
|
||||
gDebuggee = addTestGlobal("test-stack", server);
|
||||
gDebuggee = addTestGlobal("test-stepping", server);
|
||||
gClient = new DebuggerClient(server.connectPipe());
|
||||
gClient.connect().then(function () {
|
||||
attachTestTabAndResume(gClient, "test-stack",
|
||||
function (response, tabClient, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_stepping_last();
|
||||
});
|
||||
gClient.connect(test_simple_stepping);
|
||||
}
|
||||
|
||||
async function test_simple_stepping() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(
|
||||
gClient,
|
||||
"test-stepping"
|
||||
);
|
||||
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
|
||||
const step1 = await stepIn(gClient, threadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.frame.where.line, 3);
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
equal(gDebuggee.a, undefined);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
const step2 = await stepIn(gClient, threadClient);
|
||||
equal(step2.type, "paused");
|
||||
equal(step2.frame.where.line, 4);
|
||||
equal(step2.why.type, "resumeLimit");
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, undefined);
|
||||
|
||||
const step3 = await stepIn(gClient, threadClient);
|
||||
equal(step3.type, "paused");
|
||||
equal(step3.frame.where.line, 4);
|
||||
equal(step3.why.type, "resumeLimit");
|
||||
equal(gDebuggee.a, 1);
|
||||
equal(gDebuggee.b, 2);
|
||||
|
||||
threadClient.stepIn(() => {
|
||||
threadClient.addOneTimeListener("paused", (event, packet) => {
|
||||
equal(packet.type, "paused");
|
||||
// Before fixing bug 785689, the type was resumeLimit.
|
||||
equal(packet.why.type, "debuggerStatement");
|
||||
finishClient(gClient, gCallback);
|
||||
});
|
||||
gDebuggee.eval("debugger;");
|
||||
});
|
||||
}
|
||||
|
||||
function test_stepping_last() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 2);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, undefined);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, undefined);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
// When leaving a stack frame the line number doesn't change.
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 3);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
// Check that stepping worked.
|
||||
Assert.equal(gDebuggee.a, 1);
|
||||
Assert.equal(gDebuggee.b, 2);
|
||||
|
||||
gThreadClient.stepIn(function () {
|
||||
test_next_pause();
|
||||
});
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
gThreadClient.stepIn();
|
||||
});
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
debugger; // 2
|
||||
var a = 1; // 3
|
||||
var b = 2;`, // 4
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-05-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"debugger;\n" + // line0 + 1
|
||||
"var a = 1;\n" + // line0 + 2
|
||||
"var b = 2;"); // line0 + 3
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
function test_next_pause() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check the return value.
|
||||
Assert.equal(packet.type, "paused");
|
||||
// Before fixing bug 785689, the type was resumeLimit.
|
||||
Assert.equal(packet.why.type, "debuggerStatement");
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
|
||||
gDebuggee.eval("debugger;");
|
||||
}
|
||||
|
@ -40,63 +40,71 @@ function run_test_with_server(server, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function test_simple_stepping() {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check that the return value is 10.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 5);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
Assert.equal(packet.why.frameFinished.return, 10);
|
||||
async function test_simple_stepping() {
|
||||
await executeOnNextTickAndWaitForPause(evaluateTestCode, gClient);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check that the return value is undefined.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 8);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
Assert.equal(packet.why.frameFinished.return.type, "undefined");
|
||||
const step1 = await stepOut(gClient, gThreadClient);
|
||||
equal(step1.type, "paused");
|
||||
equal(step1.frame.where.line, 6);
|
||||
equal(step1.why.type, "resumeLimit");
|
||||
equal(step1.why.frameFinished.return, 10);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
gThreadClient.addOneTimeListener("paused", function (event, packet) {
|
||||
// Check that the exception was thrown.
|
||||
Assert.equal(packet.type, "paused");
|
||||
Assert.equal(packet.frame.where.line, gDebuggee.line0 + 11);
|
||||
Assert.equal(packet.why.type, "resumeLimit");
|
||||
Assert.equal(packet.why.frameFinished.throw, "ah");
|
||||
gThreadClient.resume();
|
||||
const step2 = await waitForPause(gThreadClient);
|
||||
equal(step2.type, "paused");
|
||||
equal(step2.frame.where.line, 8);
|
||||
equal(step2.why.type, "debuggerStatement");
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
gThreadClient.stepOut();
|
||||
});
|
||||
gThreadClient.resume();
|
||||
});
|
||||
gThreadClient.stepOut();
|
||||
});
|
||||
gThreadClient.resume();
|
||||
});
|
||||
gThreadClient.stepOut();
|
||||
});
|
||||
gThreadClient.stepOut();
|
||||
const step3 = await waitForPause(gThreadClient);
|
||||
equal(step3.type, "paused");
|
||||
equal(step3.frame.where.line, 9);
|
||||
equal(step3.why.type, "resumeLimit");
|
||||
equal(step3.why.frameFinished.return.type, "undefined");
|
||||
|
||||
/* eslint-disable */
|
||||
gDebuggee.eval("var line0 = Error().lineNumber;\n" +
|
||||
"function f() {\n" + // line0 + 1
|
||||
" debugger;\n" + // line0 + 2
|
||||
" var a = 10;\n" + // line0 + 3
|
||||
" return a;\n" + // line0 + 4
|
||||
"}\n" + // line0 + 5
|
||||
"function g() {\n" + // line0 + 6
|
||||
" debugger;\n" + // line0 + 7
|
||||
"}\n" + // line0 + 8
|
||||
"function h() {\n" + // line0 + 9
|
||||
" debugger;\n" + // line0 + 10
|
||||
" throw 'ah';\n" + // line0 + 11
|
||||
" return 2;\n" + // line0 + 12
|
||||
"}\n" + // line0 + 13
|
||||
"f();\n" + // line0 + 14
|
||||
"g();\n" + // line0 + 15
|
||||
"try { h() } catch (ex) { };\n"); // line0 + 16
|
||||
/* eslint-enable */
|
||||
gThreadClient.resume();
|
||||
const step4 = await waitForPause(gThreadClient);
|
||||
|
||||
equal(step4.type, "paused");
|
||||
equal(step4.frame.where.line, 11);
|
||||
|
||||
gThreadClient.stepOut();
|
||||
const step5 = await waitForPause(gThreadClient);
|
||||
equal(step5.type, "paused");
|
||||
equal(step5.frame.where.line, 12);
|
||||
equal(step5.why.type, "resumeLimit");
|
||||
equal(step5.why.frameFinished.throw, "ah");
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
` // 1
|
||||
function f() { // 2
|
||||
debugger; // 3
|
||||
var a = 10; // 4
|
||||
return a; // 5
|
||||
} // 6
|
||||
function g() { // 7
|
||||
debugger; // 8
|
||||
} // 9
|
||||
function h() { // 10
|
||||
debugger; // 11
|
||||
throw 'ah'; // 12
|
||||
return 2; // 13
|
||||
} // 14
|
||||
f() // 15
|
||||
g() // 16
|
||||
try { // 17
|
||||
h(); // 18
|
||||
} catch (ex) { }; // 19
|
||||
`, // 20
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
"test_stepping-07-test-code.js",
|
||||
1
|
||||
);
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
@ -26,9 +26,12 @@ function run_test_with_server(server, callback) {
|
||||
gClient.connect(testSteppingAndReturns);
|
||||
}
|
||||
|
||||
const testSteppingAndReturns = async function () {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(gClient,
|
||||
"test-stepping");
|
||||
async function testSteppingAndReturns() {
|
||||
const [attachResponse,, threadClient] = await attachTestTabAndResume(
|
||||
gClient,
|
||||
"test-stepping"
|
||||
);
|
||||
|
||||
ok(!attachResponse.error, "Should not get an error attaching");
|
||||
|
||||
dumpn("Evaluating test code and waiting for first debugger statement");
|
||||
@ -64,7 +67,7 @@ const testSteppingAndReturns = async function () {
|
||||
ok(step5.why.frameFinished, "This should be the explicit function return");
|
||||
|
||||
finishClient(gClient, gCallback);
|
||||
};
|
||||
}
|
||||
|
||||
function evaluateTestCode() {
|
||||
/* eslint-disable */
|
||||
|
@ -21,7 +21,6 @@ support-files =
|
||||
setBreakpoint-on-column.js
|
||||
setBreakpoint-on-column-in-gcd-script.js
|
||||
setBreakpoint-on-column-with-no-offsets.js
|
||||
setBreakpoint-on-column-with-no-offsets-at-end-of-line.js
|
||||
setBreakpoint-on-column-with-no-offsets-in-gcd-script.js
|
||||
setBreakpoint-on-line.js
|
||||
setBreakpoint-on-line-in-gcd-script.js
|
||||
@ -223,9 +222,9 @@ reason = bug 937197
|
||||
[test_xpcshell_debugging.js]
|
||||
support-files = xpcshell_debugging_script.js
|
||||
[test_setBreakpoint-at-the-beginning-of-a-line.js]
|
||||
[test_setBreakpoint-at-the-end-of-a-line.js]
|
||||
[test_setBreakpoint-on-column.js]
|
||||
[test_setBreakpoint-on-column-in-gcd-script.js]
|
||||
[test_setBreakpoint-on-column-with-no-offsets-at-end-of-line.js]
|
||||
[test_setBreakpoint-on-line.js]
|
||||
[test_setBreakpoint-on-line-in-gcd-script.js]
|
||||
[test_setBreakpoint-on-line-with-multiple-offsets.js]
|
||||
|
@ -1,7 +1,7 @@
|
||||
fails-if(Android) == textbox-multiline-noresize.xul textbox-multiline-ref.xul # reference is blank on Android (due to no native theme support?)
|
||||
!= textbox-multiline-resize.xul textbox-multiline-ref.xul
|
||||
== popup-explicit-size.xul popup-explicit-size-ref.xul
|
||||
random-if(Android||winWidget) fuzzy-if(webrender,128-128,168-168) == image-size.xul image-size-ref.xul # Bug 1426797
|
||||
random-if(Android) fuzzy-if(webrender,128-128,168-168) == image-size.xul image-size-ref.xul
|
||||
== image-scaling-min-height-1.xul image-scaling-min-height-1-ref.xul
|
||||
== textbox-text-transform.xul textbox-text-transform-ref.xul
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
load 307298-1.xul
|
||||
load 309732-1.xul
|
||||
load 309732-2.xul
|
||||
asserts-if(winWidget,0-1) load 366583-1.xul # Bug 1428087
|
||||
load 366583-1.xul
|
||||
load 380217-1.xul
|
||||
load 382444-1.html
|
||||
load 391178-1.xhtml
|
||||
|
Loading…
Reference in New Issue
Block a user