mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 10:27:32 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
28
js/xpconnect/tests/unit/test_sandbox_name.js
Normal file
28
js/xpconnect/tests/unit/test_sandbox_name.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
|
||||
const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
|
||||
|
||||
/**
|
||||
* Test that the name of a sandbox contains the name of all principals.
|
||||
*/
|
||||
function test_sandbox_name() {
|
||||
let names = [
|
||||
"http://example.com/?" + Math.random(),
|
||||
"http://example.org/?" + Math.random()
|
||||
];
|
||||
let sandbox = Cu.Sandbox(names);
|
||||
let fileName = Cu.evalInSandbox(
|
||||
"(new Error()).fileName",
|
||||
sandbox,
|
||||
"latest" /*js version*/,
|
||||
""/*file name*/
|
||||
);
|
||||
|
||||
for (let name of names) {
|
||||
Assert.ok(fileName.indexOf(name) != -1, `Name ${name} appears in ${fileName}`);
|
||||
}
|
||||
};
|
||||
|
||||
function run_test() {
|
||||
test_sandbox_name();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue