mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-27 13:40:37 -10:00
Backed out changeset 8b850fd66bf5 (bug 1582512) Backed out changeset 07d3631e609a (bug 1582512) Backed out changeset fa91b085eb59 (bug 1582512) Backed out changeset 232d5735d404 (bug 1582512) Backed out changeset 47045fa2ffd2 (bug 1582512) Backed out changeset 40a0f6c6cd61 (bug 1582512) Backed out changeset 5fb3e489c31f (bug 1582512) Backed out changeset 379318a35b20 (bug 1582512) Backed out changeset bf81985c33b7 (bug 1582512) Backed out changeset 1e0dd57b8041 (bug 1582512) Backed out changeset 2787043f1fab (bug 1582512)
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
// Check that Dead Objects do not break the Web/Browser Consoles.
|
|
//
|
|
// This test:
|
|
// - Opens the Browser Console.
|
|
// - Creates a sandbox.
|
|
// - Stores a reference to the sandbox on the chrome window object.
|
|
// - Nukes the sandbox
|
|
// - Tries to use the sandbox. This is the dead object.
|
|
|
|
"use strict";
|
|
|
|
add_task(async function() {
|
|
const hud = await BrowserConsoleManager.toggleBrowserConsole();
|
|
ok(hud, "browser console opened");
|
|
|
|
// Add the reference to the nuked sandbox.
|
|
execute(
|
|
hud,
|
|
"window.nukedSandbox = Cu.Sandbox(null); Cu.nukeSandbox(nukedSandbox);"
|
|
);
|
|
|
|
await executeAndWaitForMessage(hud, "nukedSandbox", "DeadObject");
|
|
const msg = await executeAndWaitForMessage(
|
|
hud,
|
|
"nukedSandbox.hello",
|
|
"can't access dead object"
|
|
);
|
|
|
|
// Check that the link contains an anchor. We can't click on the link because
|
|
// clicking links from tests attempts to access an external URL and crashes Firefox.
|
|
const anchor = msg.node.querySelector("a");
|
|
is(anchor.textContent, "[Learn More]", "Link text is correct");
|
|
|
|
await executeAndWaitForMessage(hud, "delete window.nukedSandbox; 1 + 1", "2");
|
|
});
|