Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/xpconnect/tests/unit/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  test_sandbox_builtins.js

  Sprache: JAVA
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


function isSandboxFrozen(sandbox) {
  return Cu.evalInSandbox("Object.isFrozen(Object)", sandbox);
}

add_task(function test_invalid_option() {
  Assert.throws(
    () => Cu.Sandbox(null, { freezeBuiltins: 1 }),
    /Expected a boolean value for property freezeBuiltins/,
    "freezeBuiltins must be a boolean"
  );
});

add_task(function test_null_principal_sandbox() {
  let sand1 = Cu.Sandbox(null);
  ok(!isSandboxFrozen(sand1), "Null sandbox not frozen by default");

  let sand2 = Cu.Sandbox(null, { freezeBuiltins: true });
  ok(isSandboxFrozen(sand2), "Null sandbox can be frozen");
});

add_task(function test_system_sandbox() {
  let sand1 = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal());
  ok(isSandboxFrozen(sand1), "System sandbox frozen by default");

  let sand2 = Cu.Sandbox(
    Services.scriptSecurityManager.getSystemPrincipal(),
    { freezeBuiltins: false }
  );
  ok(!isSandboxFrozen(sand2), "System sandbox can opt out of being frozen");
});

Messung V0.5 in Prozent
C=88 H=95 G=91

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.