Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/ipc/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  browser_subframesPreferUsed.js   Sprache: JAVA

 
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


ok(
  Services.appinfo.fissionAutostart,
  "this test requires fission to function!"
);

function documentURL(origin, html) {
  let params = new URLSearchParams();
  params.append("html", html.trim());
  return `${origin}/document-builder.sjs?${params.toString()}`;
}

async function singleTest(preferUsed) {
  info(`running test with preferUsed=${preferUsed}`);
  await SpecialPowers.pushPrefEnv({
    set: [
      ["dom.ipc.processCount.webIsolated", 4],
      ["browser.tabs.remote.subframesPreferUsed", preferUsed],
    ],
  });

  const TEST_URL = documentURL(
    "https://example.com",
    `<iframe src=${JSON.stringify(
      documentURL("https://example.org", `

iframe

`)

    )}></iframe>`
  );

  await BrowserTestUtils.withNewTab(TEST_URL, async browser1 => {
    is(browser1.browsingContext.children.length, 1);
    let topProc1 = browser1.browsingContext.currentWindowGlobal.domProcess;
    let frameProc1 =
      browser1.browsingContext.children[0].currentWindowGlobal.domProcess;
    isnot(
      topProc1.childID,
      frameProc1.childID,
      "the frame should be in a separate process"
    );

    await BrowserTestUtils.withNewTab(TEST_URL, async browser2 => {
      is(browser2.browsingContext.children.length, 1);
      let topProc2 = browser2.browsingContext.currentWindowGlobal.domProcess;
      let frameProc2 =
        browser2.browsingContext.children[0].currentWindowGlobal.domProcess;
      isnot(
        topProc2.childID,
        frameProc2.childID,
        "the frame should be in a separate process"
      );

      // Compare processes used for the two tabs.
      isnot(
        topProc1.childID,
        topProc2.childID,
        "the toplevel windows should be loaded in separate processes"
      );
      if (preferUsed) {
        is(
          frameProc1.childID,
          frameProc2.childID,
          "the iframes should load in the same process with subframesPreferUsed"
        );
      } else {
        isnot(
          frameProc1.childID,
          frameProc2.childID,
          "the iframes should load in different processes without subframesPreferUsed"
        );
      }
    });
  });
}

add_task(async function test_preferUsed() {
  await singleTest(true);
});

add_task(async function test_noPreferUsed() {
  await singleTest(false);
});

Messung V0.5
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.