author | Oriol Brufau <oriol-bugzilla@hotmail.com> |
Wed, 31 Jul 2019 17:25:15 +0300 | |
changeset 485832 | 09384c51f12729d8daecc67af15453f70d3acce1 |
parent 485831 | 2cc2e0210a28dba5566fe5e57c51a195f66bf71b |
child 485833 | 7acf0e8d6a667761882ea445e22cf6e3b4abbb72 |
push id | 36374 |
push user | rmaries@mozilla.com |
push date | Fri, 02 Aug 2019 03:53:17 +0000 |
treeherder | mozilla-central@4748c006ae7b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ochameau |
bugs | 1570279 |
milestone | 70.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
devtools/server/tests/unit/head_dbg.js | file | annotate | diff | comparison | revisions | |
devtools/server/tests/unit/test_objectgrips-17.js | file | annotate | diff | comparison | revisions |
--- a/devtools/server/tests/unit/head_dbg.js +++ b/devtools/server/tests/unit/head_dbg.js @@ -920,34 +920,38 @@ async function setupTestFromUrl(url) { * principals by default. * - ThreadFront threadFront * A reference to a ThreadFront instance that is attached to the debuggee. * - DebuggerClient client * A reference to the DebuggerClient used to communicated with the RDP server. * @param Object options * Optional arguments to tweak test environment * - JSPrincipal principal - * Principal to use for the debuggee. + * Principal to use for the debuggee. Defaults to systemPrincipal. * - boolean doNotRunWorker - * If true, do not run this tests in worker debugger context. + * If true, do not run this tests in worker debugger context. Defaults to false. + * - bool wantXrays + * Whether the debuggee wants Xray vision with respect to same-origin objects + * outside the sandbox. Defaults to true. */ function threadFrontTest(test, options = {}) { - let { principal, doNotRunWorker } = options; - if (!principal) { - principal = systemPrincipal; - } + const { + principal = systemPrincipal, + doNotRunWorker = false, + wantXrays = true, + } = options; async function runThreadFrontTestWithServer(server, test) { // Setup a server and connect a client to it. initTestDebuggerServer(server); // Create a custom debuggee and register it to the server. // We are using a custom Sandbox as debuggee. Create a new zone because // debugger and debuggee must be in different compartments. - const debuggee = Cu.Sandbox(principal, { freshZone: true }); + const debuggee = Cu.Sandbox(principal, { freshZone: true, wantXrays }); const scriptName = "debuggee.js"; debuggee.__name = scriptName; server.addTestGlobal(debuggee); const client = new DebuggerClient(server.connectPipe()); await client.connect(); // Attach to the fake tab target and retrieve the ThreadFront instance.
--- a/devtools/server/tests/unit/test_objectgrips-17.js +++ b/devtools/server/tests/unit/test_objectgrips-17.js @@ -294,17 +294,17 @@ async function run_tests_in_principal( await testPrincipal(options, undefined, debuggeeHasXrays); // Test objects created in a system principal new global. await testPrincipal(options, systemPrincipal, debuggeeHasXrays); // Test objects created in a cross-origin null principal new global. await testPrincipal(options, null, debuggeeHasXrays); - if (debuggeePrincipal === null) { + if (debuggeePrincipal.isNullPrincipal) { // Test objects created in a same-origin null principal new global. await testPrincipal( options, Cu.getObjectPrincipal(debuggee), debuggeeHasXrays ); } }