зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1512152 - Use threadFrontTest instead of initTestDebuggerServer when possible, r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D52205 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
41df86cc53
Коммит
6c92f8d784
|
@ -901,12 +901,16 @@ async function setupTestFromUrl(url) {
|
|||
* - bool wantXrays
|
||||
* Whether the debuggee wants Xray vision with respect to same-origin objects
|
||||
* outside the sandbox. Defaults to true.
|
||||
* - bool waitForFinish
|
||||
* Whether to wait for a call to threadFrontTestFinished after the test
|
||||
* function finishes.
|
||||
*/
|
||||
function threadFrontTest(test, options = {}) {
|
||||
const {
|
||||
principal = systemPrincipal,
|
||||
doNotRunWorker = false,
|
||||
wantXrays = true,
|
||||
waitForFinish = false,
|
||||
} = options;
|
||||
|
||||
async function runThreadFrontTestWithServer(server, test) {
|
||||
|
@ -932,7 +936,18 @@ function threadFrontTest(test, options = {}) {
|
|||
);
|
||||
|
||||
// Run the test function
|
||||
await test({ threadFront, debuggee, client, server, targetFront });
|
||||
const args = { threadFront, debuggee, client, server, targetFront };
|
||||
if (waitForFinish) {
|
||||
// Use dispatchToMainThread so that the test function does not have to
|
||||
// finish executing before the test itself finishes.
|
||||
const promise = new Promise(
|
||||
resolve => (threadFrontTestFinished = resolve)
|
||||
);
|
||||
Services.tm.dispatchToMainThread(() => test(args));
|
||||
await promise;
|
||||
} else {
|
||||
await test(args);
|
||||
}
|
||||
|
||||
// Cleanup the client after the test ran
|
||||
await client.close();
|
||||
|
@ -954,3 +969,10 @@ function threadFrontTest(test, options = {}) {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
// This callback is used in tandem with the waitForFinish option of
|
||||
// threadFrontTest to support thread front tests that use promises to
|
||||
// asynchronously finish the tests, instead of using async/await.
|
||||
// Newly written tests should avoid using this. See bug 1596114 for migrating
|
||||
// existing tests to async/await and removing this functionality.
|
||||
let threadFrontTestFinished;
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
gThreadFront = threadFront;
|
||||
testBlackBox();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
await testBlackBox();
|
||||
})
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -104,8 +94,6 @@ const testBlackBox = async function() {
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
||||
function evalCode() {
|
||||
|
|
|
@ -12,25 +12,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_black_box();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -107,7 +100,7 @@ async function test_unblack_box_breakpoint(sourceFront) {
|
|||
// nastiness to skip over it.
|
||||
gThreadFront.once("paused", async () => {
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
await gThreadFront.resume();
|
||||
});
|
||||
|
|
|
@ -9,25 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_black_box();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -102,7 +95,7 @@ async function test_unblack_box_dbg_statement(sourceFront) {
|
|||
"We should stop at the debugger statement again"
|
||||
);
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
gDebuggee.runTest();
|
||||
}
|
||||
|
|
|
@ -9,25 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_black_box();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -86,6 +79,6 @@ function test_black_box_paused() {
|
|||
"We should be notified that we are currently paused in this source"
|
||||
);
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,30 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
// XXX: We have to do an executeSoon so that the error isn't caught and
|
||||
// reported by DebuggerClient.requester (because we are using the local
|
||||
// transport and share a stack) which causes the test to fail.
|
||||
Services.tm.dispatchToMainThread({
|
||||
run: test_black_box,
|
||||
});
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
gDebuggee = debuggee;
|
||||
test_black_box();
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/blackboxme.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -95,7 +83,7 @@ function test_black_box_exception() {
|
|||
"We shouldn't pause while in the black boxed source."
|
||||
);
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gThreadFront.resume();
|
||||
|
|
|
@ -9,25 +9,15 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-black-box");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-black-box", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
gThreadFront = threadFront;
|
||||
testBlackBox();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
await testBlackBox();
|
||||
})
|
||||
);
|
||||
|
||||
const BLACK_BOXED_URL = "http://example.com/black-boxed.min.js";
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
@ -45,7 +35,6 @@ const testBlackBox = async function() {
|
|||
equal(regularSource.isBlackBoxed, false);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
||||
function evalCode() {
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Check that adding a breakpoint in the same place returns the same actor.
|
||||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
gThreadFront = threadFront;
|
||||
testSameBreakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
const SOURCE_URL = "http://example.com/source.js";
|
||||
|
||||
const testSameBreakpoint = async function() {
|
||||
const packet = await executeOnNextTickAndWaitForPause(evalCode, gThreadFront);
|
||||
const source = await getSourceById(gThreadFront, packet.frame.where.actor);
|
||||
|
||||
// Whole line
|
||||
const wholeLineLocation = {
|
||||
line: 2,
|
||||
};
|
||||
|
||||
let [, firstBpClient] = await setBreakpoint(source, wholeLineLocation);
|
||||
let [, secondBpClient] = await setBreakpoint(source, wholeLineLocation);
|
||||
|
||||
Assert.equal(
|
||||
firstBpClient.actor,
|
||||
secondBpClient.actor,
|
||||
"Should get the same actor w/ whole line breakpoints"
|
||||
);
|
||||
|
||||
// Specific column
|
||||
|
||||
const columnLocation = {
|
||||
line: 2,
|
||||
column: 6,
|
||||
};
|
||||
|
||||
[, firstBpClient] = await setBreakpoint(source, columnLocation);
|
||||
[, secondBpClient] = await setBreakpoint(source, columnLocation);
|
||||
|
||||
Assert.equal(
|
||||
secondBpClient.actor,
|
||||
secondBpClient.actor,
|
||||
"Should get the same actor column breakpoints"
|
||||
);
|
||||
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
||||
function evalCode() {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
"" + function doStuff(k) { // line 1
|
||||
let arg = 15; // line 2 - Step in here
|
||||
k(arg); // line 3
|
||||
} + "\n" // line 4
|
||||
+ "debugger;", // line 5
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
SOURCE_URL,
|
||||
1
|
||||
);
|
||||
/* eslint-enable */
|
||||
}
|
|
@ -9,24 +9,15 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-breakpoints");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestThread(gClient, "test-breakpoints", testBreakpoint);
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
gDebuggee = debuggee;
|
||||
await testBreakpoint(threadFront);
|
||||
})
|
||||
);
|
||||
|
||||
const testBreakpoint = async function(
|
||||
threadResponse,
|
||||
targetFront,
|
||||
threadFront,
|
||||
tabResponse
|
||||
) {
|
||||
const testBreakpoint = async function(threadFront) {
|
||||
evalSetupCode();
|
||||
|
||||
// Load the test source once.
|
||||
|
@ -43,8 +34,6 @@ const testBreakpoint = async function(
|
|||
const source = await getSource(threadFront, "test.js");
|
||||
setBreakpoint(threadFront, { sourceUrl: source.url, line: 3 });
|
||||
|
||||
await resume(threadFront);
|
||||
|
||||
// Load the test source again.
|
||||
|
||||
evalTestCode();
|
||||
|
@ -98,8 +87,6 @@ const testBreakpoint = async function(
|
|||
"debuggerStatement",
|
||||
"And we should hit the debugger statement after the pause."
|
||||
);
|
||||
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
||||
function evalSetupCode() {
|
||||
|
|
|
@ -9,25 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-conditional-breakpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-conditional-breakpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
let hitBreakpoint = false;
|
||||
|
@ -48,7 +41,7 @@ function test_simple_breakpoint() {
|
|||
gThreadFront.removeBreakpoint(location);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -9,25 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-conditional-breakpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-conditional-breakpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -45,7 +38,7 @@ function test_simple_breakpoint() {
|
|||
gThreadFront.removeBreakpoint(location2);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -10,25 +10,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-conditional-breakpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-conditional-breakpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -54,7 +47,7 @@ function test_simple_breakpoint() {
|
|||
gThreadFront.removeBreakpoint(location);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -11,25 +11,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-conditional-breakpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-conditional-breakpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
async function test_simple_breakpoint() {
|
||||
await gThreadFront.setBreakpoint(
|
||||
|
@ -52,7 +45,7 @@ async function test_simple_breakpoint() {
|
|||
line: 3,
|
||||
});
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -8,29 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -38,7 +27,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!packet.frame.actor);
|
||||
Assert.equal(packet.frame.displayName, "stopMe");
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -9,36 +9,25 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet1) {
|
||||
gThreadFront.once("paused", function(packet2) {
|
||||
Assert.equal(packet1.frame.actor, packet2.frame.actor);
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
gThreadFront.resume();
|
||||
|
|
|
@ -9,29 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet1) {
|
||||
|
@ -40,7 +29,7 @@ function test_pause_frame() {
|
|||
Assert.equal(typeof poppedFrames, typeof []);
|
||||
Assert.ok(poppedFrames.includes(packet1.frame.actorID));
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
gThreadFront.resume();
|
||||
|
|
|
@ -8,29 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
var frameFixtures = [
|
||||
// Function calls...
|
||||
|
@ -56,7 +45,7 @@ async function test_frame_packet() {
|
|||
}
|
||||
|
||||
await gThreadFront.resume();
|
||||
await finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
}
|
||||
|
||||
function test_pause_frame() {
|
||||
|
|
|
@ -10,29 +10,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -52,7 +41,7 @@ function test_pause_frame() {
|
|||
Assert.equal(expectPopped[i], popped[i]);
|
||||
}
|
||||
|
||||
gThreadFront.resume().then(() => finishClient(gClient));
|
||||
gThreadFront.resume().then(() => threadFrontTestFinished());
|
||||
});
|
||||
gThreadFront.resume();
|
||||
});
|
||||
|
|
|
@ -9,38 +9,22 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
if (typeof WebAssembly == "undefined") {
|
||||
// wasm is not enabled for this platform
|
||||
return;
|
||||
}
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", async function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
await gThreadFront.reconfigure({
|
||||
observeAsmJS: true,
|
||||
wasmBinarySource: true,
|
||||
});
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -57,7 +41,7 @@ function test_pause_frame() {
|
|||
Assert.equal(location.column > 0, true);
|
||||
Assert.equal(/^wasm:(?:[^:]*:)*?[0-9a-f]{16}$/.test(source.url), true);
|
||||
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -8,29 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -46,7 +35,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!args[5].actor);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -8,31 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -70,7 +57,7 @@ function test_pause_frame() {
|
|||
Assert.equal(false, "class" in response.ownProperties.b.value);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -8,31 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -56,7 +43,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!response.ownProperties.Object.value.actor);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -9,31 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -61,7 +48,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!response.ownProperties.cos.value.actor);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -10,31 +10,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -72,7 +59,7 @@ function test_pause_frame() {
|
|||
Assert.equal(vars.foo.value, 2 * Math.PI);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -9,31 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -60,7 +47,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!response.ownProperties.Object.value.actor);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
|
|
|
@ -4,32 +4,18 @@
|
|||
"use strict";
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_banana_environment();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_banana_environment() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -50,7 +36,7 @@ function test_banana_environment() {
|
|||
equal(parent.function.name, "banana");
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
|
|
|
@ -9,30 +9,17 @@ var gClient;
|
|||
var gThreadFront;
|
||||
const { EnvironmentFront } = require("devtools/shared/fronts/environment");
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
// Test that the EnvironmentFront's getBindings() method works as expected.
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-bindings");
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-bindings", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_banana_environment();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_banana_environment() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -57,7 +44,7 @@ function test_banana_environment() {
|
|||
response = await grandpaClient.getBindings();
|
||||
Assert.equal(response.arguments[0].y.value, "y");
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
|
|
|
@ -4,35 +4,18 @@
|
|||
"use strict";
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_named_function();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_named_function() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -51,6 +34,11 @@ function test_named_function() {
|
|||
test_inferred_name_function();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
gDebuggee.eval("stopMe(stopMe)");
|
||||
}
|
||||
|
||||
|
@ -94,7 +82,7 @@ function test_anonymous_function() {
|
|||
Assert.equal(response.parameterNames[2], "baz");
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gDebuggee.eval("stopMe(function(foo, bar, baz) { })");
|
||||
|
|
|
@ -6,37 +6,29 @@
|
|||
/**
|
||||
* Check basic getSources functionality.
|
||||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
var gNumTimesSourcesSent = 0;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.request = (function(origRequest) {
|
||||
return function(request, onResponse) {
|
||||
if (request.type === "sources") {
|
||||
++gNumTimesSourcesSent;
|
||||
}
|
||||
return origRequest.call(this, request, onResponse);
|
||||
};
|
||||
})(gClient.request);
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
client.request = (function(origRequest) {
|
||||
return function(request, onResponse) {
|
||||
if (request.type === "sources") {
|
||||
++gNumTimesSourcesSent;
|
||||
}
|
||||
return origRequest.call(this, request, onResponse);
|
||||
};
|
||||
})(client.request);
|
||||
test_simple_listsources();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_listsources() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -54,7 +46,7 @@ function test_simple_listsources() {
|
|||
);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -7,35 +7,27 @@
|
|||
* Check getting sources before there are any.
|
||||
*/
|
||||
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
var gNumTimesSourcesSent = 0;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.request = (function(origRequest) {
|
||||
return function(request, onResponse) {
|
||||
if (request.type === "sources") {
|
||||
++gNumTimesSourcesSent;
|
||||
}
|
||||
return origRequest.call(this, request, onResponse);
|
||||
};
|
||||
})(gClient.request);
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
client.request = (function(origRequest) {
|
||||
return function(request, onResponse) {
|
||||
if (request.type === "sources") {
|
||||
++gNumTimesSourcesSent;
|
||||
}
|
||||
return origRequest.call(this, request, onResponse);
|
||||
};
|
||||
})(client.request);
|
||||
test_listing_zero_sources();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_listing_zero_sources() {
|
||||
gThreadFront.getSources().then(function(packet) {
|
||||
|
@ -49,6 +41,6 @@ function test_listing_zero_sources() {
|
|||
" might have had to send one to determine feature support."
|
||||
);
|
||||
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -8,29 +8,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-sources");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-sources", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_listsources();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_listsources() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -47,7 +36,7 @@ function test_simple_listsources() {
|
|||
);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,22 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-logpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-logpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
const rootActor = gClient.transport._serverConnection.rootActor;
|
||||
|
@ -58,7 +53,7 @@ function test_simple_breakpoint() {
|
|||
await gThreadFront.resume();
|
||||
Assert.equal(lastMessage.level, "logPoint");
|
||||
Assert.equal(lastMessage.arguments[0], "three");
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -12,22 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-logpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-logpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
const rootActor = gClient.transport._serverConnection.rootActor;
|
||||
|
@ -57,7 +52,7 @@ function test_simple_breakpoint() {
|
|||
// Execute the rest of the code.
|
||||
await gThreadFront.resume();
|
||||
Assert.equal(lastMessage.arguments[0], 5);
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -12,22 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-logpoint");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-logpoint", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_simple_breakpoint();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_breakpoint() {
|
||||
const rootActor = gClient.transport._serverConnection.rootActor;
|
||||
|
@ -57,7 +52,7 @@ function test_simple_breakpoint() {
|
|||
await gThreadFront.resume();
|
||||
Assert.equal(lastMessage.level, "logPointError");
|
||||
Assert.equal(lastMessage.arguments[0], "c is not defined");
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -7,34 +7,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_longstring_grip();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_longstring_grip() {
|
||||
const longString =
|
||||
|
@ -82,5 +65,11 @@ function test_longstring_grip() {
|
|||
}
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gDebuggee.eval('stopMe("' + longString + '")');
|
||||
}
|
||||
|
|
|
@ -6,33 +6,19 @@
|
|||
// Test that we can nest event loops when needed in
|
||||
// ThreadActor.prototype.unsafeSynchronize.
|
||||
|
||||
var gClient;
|
||||
var gThreadActor;
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, client }) => {
|
||||
// Reach over the protocol connection and get a reference to the thread actor.
|
||||
// TODO: rewrite the test so we don't do this..
|
||||
const thread = client._transport._serverConnection.getActor(
|
||||
threadFront.actorID
|
||||
);
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
addTestGlobal("test-nesting");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-nesting", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
// Reach over the protocol connection and get a reference to the thread actor.
|
||||
// TODO: rewrite the test so we don't do this..
|
||||
gThreadActor = gClient._transport._serverConnection.getActor(
|
||||
threadFront.actorID
|
||||
);
|
||||
test_nesting(thread);
|
||||
})
|
||||
);
|
||||
|
||||
test_nesting();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function test_nesting() {
|
||||
const thread = gThreadActor;
|
||||
function test_nesting(thread) {
|
||||
const { resolve, promise: p } = defer();
|
||||
|
||||
let currentStep = 0;
|
||||
|
@ -51,6 +37,4 @@ function test_nesting() {
|
|||
Assert.equal(++currentStep, 2);
|
||||
// There shouldn't be any nested event loops anymore
|
||||
Assert.equal(thread._nestedEventLoops.size, 0);
|
||||
|
||||
finishClient(gClient);
|
||||
}
|
||||
|
|
|
@ -6,34 +6,19 @@
|
|||
// Test that we can nest event loops and then automatically exit nested event
|
||||
// loops when requested.
|
||||
|
||||
var gClient;
|
||||
var gThreadActor;
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, client }) => {
|
||||
// Reach over the protocol connection and get a reference to the thread actor.
|
||||
// TODO: rewrite the test so we don't do this..
|
||||
const thread = client._transport._serverConnection.getActor(
|
||||
threadFront.actorID
|
||||
);
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
addTestGlobal("test-nesting");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-nesting", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
// Reach over the protocol connection and get a reference to the thread
|
||||
// actor.
|
||||
// TODO: rewrite tests so we don't do this kind of reaching anymore..
|
||||
gThreadActor = gClient._transport._serverConnection.getActor(
|
||||
threadFront.actorID
|
||||
);
|
||||
test_nesting(thread);
|
||||
})
|
||||
);
|
||||
|
||||
test_nesting();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function test_nesting() {
|
||||
const thread = gThreadActor;
|
||||
function test_nesting(thread) {
|
||||
const { resolve, promise: p } = defer();
|
||||
|
||||
// The following things should happen (in order):
|
||||
|
@ -82,6 +67,4 @@ function test_nesting() {
|
|||
Assert.equal(++currentStep, 4);
|
||||
// There shouldn't be any nested event loops anymore
|
||||
Assert.equal(thread._nestedEventLoops.size, 0);
|
||||
|
||||
finishClient(gClient);
|
||||
}
|
||||
|
|
|
@ -8,32 +8,25 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_new_source();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_new_source() {
|
||||
gThreadFront.once("newSource", function(packet) {
|
||||
Assert.ok(!!packet.source);
|
||||
Assert.ok(!!packet.source.url.match(/test_new_source-01.js$/));
|
||||
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
Cu.evalInSandbox(
|
||||
|
|
|
@ -8,31 +8,20 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gTargetFront;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, targetFront }) => {
|
||||
gThreadFront = threadFront;
|
||||
gTargetFront = targetFront;
|
||||
gDebuggee = debuggee;
|
||||
test_simple_new_source();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_simple_new_source() {
|
||||
gThreadFront.once("paused", function() {
|
||||
|
@ -46,7 +35,7 @@ function test_simple_new_source() {
|
|||
Assert.ok(!!packet.source);
|
||||
Assert.ok(!!packet.source.url.match(/example\.com/));
|
||||
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
const consoleFront = await gTargetFront.getFront("console");
|
||||
|
|
|
@ -5,34 +5,20 @@
|
|||
"use strict";
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
// Test that closures can be inspected.
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-closures");
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-closures", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_object_grip();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_object_grip() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -71,7 +57,7 @@ function test_object_grip() {
|
|||
Assert.equal(bindings.variables.foo.value, 10);
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -6,37 +6,18 @@
|
|||
// Test that we get the magic properties on Error objects.
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_object_grip();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_object_grip() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -53,8 +34,14 @@ function test_object_grip() {
|
|||
Assert.equal(opn[3], "message");
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gDebuggee.eval("stopMe(new TypeError('error message text'))");
|
||||
}
|
||||
|
|
|
@ -11,37 +11,18 @@ const { PromiseTestUtils } = ChromeUtils.import(
|
|||
);
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_display_string();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_display_string() {
|
||||
const testCases = [
|
||||
|
@ -171,11 +152,17 @@ function test_display_string() {
|
|||
loop();
|
||||
} else {
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
||||
gDebuggee.eval(
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
}.toString()
|
||||
);
|
||||
|
||||
const inputs = testCases.map(({ input }) => input).join(",");
|
||||
gDebuggee.eval("stopMe(" + inputs + ")");
|
||||
}
|
||||
|
|
|
@ -7,32 +7,18 @@
|
|||
// request work properly.
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
Cu.evalInSandbox(
|
||||
function stopMe() {
|
||||
debugger;
|
||||
}.toString(),
|
||||
gDebuggee
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
add_pause_listener();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function add_pause_listener() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -46,6 +32,13 @@ function add_pause_listener() {
|
|||
}
|
||||
|
||||
function eval_code() {
|
||||
Cu.evalInSandbox(
|
||||
function stopMe() {
|
||||
debugger;
|
||||
}.toString(),
|
||||
gDebuggee
|
||||
);
|
||||
|
||||
Cu.evalInSandbox(
|
||||
[
|
||||
"this.line0 = Error().lineNumber;",
|
||||
|
@ -70,6 +63,6 @@ function test_bad_definition_site(obj) {
|
|||
try {
|
||||
obj._client.request("definitionSite", () => Assert.ok(false));
|
||||
} catch (e) {
|
||||
gThreadFront.resume().then(() => finishClient(gClient));
|
||||
gThreadFront.resume().then(() => threadFrontTestFinished());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-object-grip");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-object-grip", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
gThreadFront = threadFront;
|
||||
testObjectGroup();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
await testObjectGroup();
|
||||
})
|
||||
);
|
||||
|
||||
function evalCode() {
|
||||
evalCallback(gDebuggee, function runTest() {
|
||||
|
@ -60,5 +50,4 @@ const testObjectGroup = async function() {
|
|||
Assert.equal(packet.ownProperties.length.value, 1);
|
||||
|
||||
await resume(gThreadFront);
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-object-grip");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-object-grip", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
gThreadFront = threadFront;
|
||||
testObjectGroup();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
await testObjectGroup();
|
||||
})
|
||||
);
|
||||
|
||||
function evalCode() {
|
||||
evalCallback(gDebuggee, function runTest() {
|
||||
|
@ -60,5 +50,4 @@ const testObjectGroup = async function() {
|
|||
Assert.equal(packet.ownProperties.length.value, 2);
|
||||
|
||||
await resume(gThreadFront);
|
||||
finishClient(gClient);
|
||||
};
|
||||
|
|
|
@ -10,38 +10,25 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
Assert.equal(packet.why.type, "exception");
|
||||
Assert.equal(packet.why.exception, 42);
|
||||
gThreadFront.resume().then(() => finishClient(gClient));
|
||||
gThreadFront.resume().then(() => threadFrontTestFinished());
|
||||
});
|
||||
|
||||
gThreadFront.pauseOnExceptions(true, false);
|
||||
|
|
|
@ -9,38 +9,25 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.pauseOnExceptions(true, false).then(function() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
Assert.equal(packet.why.type, "exception");
|
||||
Assert.equal(packet.why.exception, 42);
|
||||
gThreadFront.resume().then(() => finishClient(gClient));
|
||||
gThreadFront.resume().then(() => threadFrontTestFinished());
|
||||
});
|
||||
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -12,26 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -57,7 +48,7 @@ function test_pause_frame() {
|
|||
ok(true, "bogusRequest thrown");
|
||||
Assert.equal(e.error, "noSuchActor");
|
||||
}
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -12,26 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -60,7 +51,7 @@ function test_pause_frame() {
|
|||
ok(true, "bogusRequest thrown");
|
||||
Assert.equal(e.error, "noSuchActor");
|
||||
}
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -12,26 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
gClient = client;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -67,7 +58,7 @@ function test_pause_frame() {
|
|||
Assert.ok(!!e.match(/noSuchActor/));
|
||||
}
|
||||
Assert.ok(!objClient.valid);
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -9,29 +9,18 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-stack");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-stack", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_pause_frame();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_pause_frame() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -42,7 +31,7 @@ function test_pause_frame() {
|
|||
const frame = response.frames[0];
|
||||
Assert.equal(objActor1, frame.arguments[0].actor);
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,33 +9,19 @@
|
|||
* pending.
|
||||
*/
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
const debuggee = addTestGlobal("test-promise-state");
|
||||
const client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect().then(function() {
|
||||
attachTestTabAndResume(client, "test-promise-state", function(
|
||||
response,
|
||||
targetFront,
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
) {
|
||||
(async function() {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
);
|
||||
);
|
||||
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "pending");
|
||||
|
||||
finishClient(client);
|
||||
})();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "pending");
|
||||
})
|
||||
);
|
||||
|
||||
function evalCode(debuggee) {
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -9,39 +9,25 @@
|
|||
* fulfilled.
|
||||
*/
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
const debuggee = addTestGlobal("test-promise-state");
|
||||
const client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect().then(function() {
|
||||
attachTestTabAndResume(client, "test-promise-state", function(
|
||||
response,
|
||||
targetFront,
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
) {
|
||||
(async function() {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
);
|
||||
);
|
||||
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "fulfilled");
|
||||
equal(
|
||||
grip.value.promiseState.value.actorID,
|
||||
packet.frame.arguments[0].actorID,
|
||||
"The promise's fulfilled state value should be the same value passed " +
|
||||
"to the then function"
|
||||
);
|
||||
|
||||
finishClient(client);
|
||||
})();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "fulfilled");
|
||||
equal(
|
||||
grip.value.promiseState.value.actorID,
|
||||
packet.frame.arguments[0].actorID,
|
||||
"The promise's fulfilled state value should be the same value passed " +
|
||||
"to the then function"
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
function evalCode(debuggee) {
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -9,39 +9,25 @@
|
|||
* rejected.
|
||||
*/
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
const debuggee = addTestGlobal("test-promise-state");
|
||||
const client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect().then(function() {
|
||||
attachTestTabAndResume(client, "test-promise-state", function(
|
||||
response,
|
||||
targetFront,
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
) {
|
||||
(async function() {
|
||||
const packet = await executeOnNextTickAndWaitForPause(
|
||||
() => evalCode(debuggee),
|
||||
threadFront
|
||||
);
|
||||
);
|
||||
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "rejected");
|
||||
equal(
|
||||
grip.value.promiseState.reason.actorID,
|
||||
packet.frame.arguments[0].actorID,
|
||||
"The promise's rejected state reason should be the same value passed " +
|
||||
"to the then function"
|
||||
);
|
||||
|
||||
finishClient(client);
|
||||
})();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
const grip = packet.frame.environment.bindings.variables.p;
|
||||
ok(grip.value.preview);
|
||||
equal(grip.value.class, "Promise");
|
||||
equal(grip.value.promiseState.state, "rejected");
|
||||
equal(
|
||||
grip.value.promiseState.reason.actorID,
|
||||
packet.frame.arguments[0].actorID,
|
||||
"The promise's rejected state reason should be the same value passed " +
|
||||
"to the then function"
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
function evalCode(debuggee) {
|
||||
/* eslint-disable */
|
||||
|
|
|
@ -5,39 +5,22 @@
|
|||
"use strict";
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
// This test ensures that we can create SourceActors and SourceFronts properly,
|
||||
// and that they can communicate over the protocol to fetch the source text for
|
||||
// a given script.
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
Cu.evalInSandbox(
|
||||
"" +
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
},
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
getFileUrl("test_source-01.js")
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_source();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const SOURCE_URL = "http://example.com/foobar.js";
|
||||
const SOURCE_CONTENT = "stopMe()";
|
||||
|
@ -66,11 +49,21 @@ function test_source() {
|
|||
Assert.equal(SOURCE_CONTENT, response.source);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Cu.evalInSandbox(
|
||||
"" +
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
},
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
getFileUrl("test_source-01.js")
|
||||
);
|
||||
|
||||
Cu.evalInSandbox(SOURCE_CONTENT, gDebuggee, "1.8", SOURCE_URL);
|
||||
}
|
||||
|
|
|
@ -5,39 +5,22 @@
|
|||
"use strict";
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
// This test ensures that we can create SourceActors and SourceFronts properly,
|
||||
// and that they can communicate over the protocol to fetch the source text for
|
||||
// a given script.
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
Cu.evalInSandbox(
|
||||
"" +
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
},
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
getFileUrl("test_source-02.js")
|
||||
);
|
||||
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee }) => {
|
||||
gThreadFront = threadFront;
|
||||
gDebuggee = debuggee;
|
||||
test_source();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
const SOURCE_URL = "http://example.com/foobar.js";
|
||||
const SOURCE_CONTENT = `
|
||||
|
@ -102,9 +85,19 @@ function test_source() {
|
|||
});
|
||||
|
||||
await gThreadFront.resume();
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
|
||||
Cu.evalInSandbox(
|
||||
"" +
|
||||
function stopMe(arg1) {
|
||||
debugger;
|
||||
},
|
||||
gDebuggee,
|
||||
"1.8",
|
||||
getFileUrl("test_source-02.js")
|
||||
);
|
||||
|
||||
Cu.evalInSandbox(SOURCE_CONTENT, gDebuggee, "1.8", SOURCE_URL);
|
||||
}
|
||||
|
|
|
@ -9,26 +9,13 @@
|
|||
|
||||
const URL = "foo.js";
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
const debuggee = addTestGlobal("test-symbols");
|
||||
const client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
await testSymbols(threadFront, debuggee);
|
||||
})
|
||||
);
|
||||
|
||||
client.connect().then(function() {
|
||||
attachTestTabAndResume(client, "test-symbols", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(testSymbols.bind(null, threadFront, client, debuggee));
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
async function testSymbols(threadFront, client, debuggee) {
|
||||
async function testSymbols(threadFront, debuggee) {
|
||||
const evalCode = () => {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
|
@ -61,6 +48,4 @@ async function testSymbols(threadFront, client, debuggee) {
|
|||
|
||||
equal(iteratorSymbol.value.type, "symbol");
|
||||
equal(iteratorSymbol.value.name, "Symbol.iterator");
|
||||
|
||||
finishClient(client);
|
||||
}
|
||||
|
|
|
@ -9,26 +9,13 @@
|
|||
|
||||
const URL = "foo.js";
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
const debuggee = addTestGlobal("test-symbols");
|
||||
const client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
add_task(
|
||||
threadFrontTest(async ({ threadFront, debuggee }) => {
|
||||
await testSymbols(threadFront, debuggee);
|
||||
})
|
||||
);
|
||||
|
||||
client.connect().then(function() {
|
||||
attachTestTabAndResume(client, "test-symbols", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(testSymbols.bind(null, client, threadFront, debuggee));
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
async function testSymbols(client, threadFront, debuggee) {
|
||||
async function testSymbols(threadFront, debuggee) {
|
||||
const evalCode = () => {
|
||||
/* eslint-disable */
|
||||
Cu.evalInSandbox(
|
||||
|
@ -52,6 +39,4 @@ async function testSymbols(client, threadFront, debuggee) {
|
|||
|
||||
equal(sym.value.type, "symbol");
|
||||
equal(sym.value.name, "le troll");
|
||||
|
||||
finishClient(client);
|
||||
}
|
||||
|
|
|
@ -12,26 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gClient = client;
|
||||
gDebuggee = debuggee;
|
||||
test_thread_lifetime();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_thread_lifetime() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -57,7 +48,7 @@ function test_thread_lifetime() {
|
|||
ok(true, "bogusRequest thrown");
|
||||
}
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
gThreadFront.resume();
|
||||
|
|
|
@ -12,26 +12,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gClient = client;
|
||||
gDebuggee = debuggee;
|
||||
test_thread_lifetime();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_thread_lifetime() {
|
||||
gThreadFront.once("paused", async function(packet) {
|
||||
|
@ -58,7 +49,7 @@ function test_thread_lifetime() {
|
|||
.catch(function(response) {
|
||||
Assert.ok(!!response.match(/noSuchActor/));
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
throw new Error();
|
||||
});
|
||||
|
|
|
@ -13,26 +13,17 @@ var gDebuggee;
|
|||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
function run_test() {
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-grips");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
attachTestTabAndResume(gClient, "test-grips", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gClient = client;
|
||||
gDebuggee = debuggee;
|
||||
test_thread_lifetime();
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
},
|
||||
{ waitForFinish: true }
|
||||
)
|
||||
);
|
||||
|
||||
function test_thread_lifetime() {
|
||||
gThreadFront.once("paused", function(packet) {
|
||||
|
@ -51,7 +42,7 @@ function test_thread_lifetime() {
|
|||
) {
|
||||
Assert.equal(threadGrip1, response.from);
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,45 +9,24 @@
|
|||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadFront;
|
||||
|
||||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
if (typeof WebAssembly == "undefined") {
|
||||
// wasm is not enabled for this platform
|
||||
return;
|
||||
}
|
||||
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-wasm-source");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function() {
|
||||
Assert.ok(gClient.mainRoot.traits.wasmBinarySource);
|
||||
|
||||
attachTestTabAndResume(gClient, "test-wasm-source", function(
|
||||
response,
|
||||
targetFront,
|
||||
threadFront
|
||||
) {
|
||||
add_task(
|
||||
threadFrontTest(
|
||||
async ({ threadFront, debuggee, client }) => {
|
||||
gThreadFront = threadFront;
|
||||
gThreadFront
|
||||
.reconfigure({
|
||||
observeAsmJS: true,
|
||||
wasmBinarySource: true,
|
||||
})
|
||||
.then(function() {
|
||||
test_source();
|
||||
});
|
||||
});
|
||||
});
|
||||
do_test_pending();
|
||||
}
|
||||
gDebuggee = debuggee;
|
||||
|
||||
await gThreadFront.reconfigure({
|
||||
observeAsmJS: true,
|
||||
wasmBinarySource: true,
|
||||
});
|
||||
|
||||
test_source();
|
||||
},
|
||||
{ waitForFinish: true, doNotRunWorker: true }
|
||||
)
|
||||
);
|
||||
|
||||
const EXPECTED_CONTENT = String.fromCharCode(
|
||||
0,
|
||||
|
@ -135,7 +114,7 @@ function test_source() {
|
|||
Assert.equal(EXPECTED_CONTENT, sourceContent.binary);
|
||||
|
||||
gThreadFront.resume().then(function() {
|
||||
finishClient(gClient);
|
||||
threadFrontTestFinished();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -111,8 +111,6 @@ skip-if = true # breakpoint sliding is not supported bug 1525685
|
|||
skip-if = true # breakpoint sliding is not supported bug 1525685
|
||||
[test_breakpoint-13.js]
|
||||
[test_breakpoint-14.js]
|
||||
[test_breakpoint-15.js]
|
||||
skip-if = true # tests for breakpoint actors are obsolete bug 1524374
|
||||
[test_breakpoint-16.js]
|
||||
[test_breakpoint-17.js]
|
||||
skip-if = true # tests for breakpoint actors are obsolete bug 1524374
|
||||
|
|
Загрузка…
Ссылка в новой задаче