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

Quelle  test_current_inner_window.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/base/test/test_current_inner_window.html


<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Test that current inner window checks are correct after navigations/discards</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>

<iframe id="frame"></iframe>

<script type="application/javascript">
"use strict";

const TEST_FILE = "file_current_inner_window.html";
const BASE_PATH = location.pathname.replace(/[^\/]+$/, "");

let frame = document.getElementById("frame");

function loadInFrame(url) {
  return new Promise(resolve => {
    frame.addEventListener("load", resolve, { once: true });
    frame.contentWindow.location = url;
  });
}

add_task(async function() {
  await loadInFrame(TEST_FILE);

  // Store the check function from the window before we navigate. After that,
  // its bare word property accesses will continue referring to the same inner
  // window no matter how many times the frame navigates.
  let check1 = frame.contentWindow.isCurrentWinnerWindow;
  ok(check1(),
     "Initial inner window should be current before we navigate away");

  await loadInFrame(`http://example.com/${BASE_PATH}/${TEST_FILE}`);
  ok(!check1(),
     "Initial inner window should no longer be current after we navigate away");
  await SpecialPowers.spawn(frame, [], () => {
    Assert.ok(this.content.wrappedJSObject.isCurrentWinnerWindow(),
              "Remote inner window should be current after before we navigate away");
  });

  await loadInFrame(TEST_FILE);
  ok(!check1(),
     "Initial inner window should still not be current after we back to current process");
  let check2 = frame.contentWindow.isCurrentWinnerWindow;
  ok(check2(),
     "Second in-process inner window should be current before we remove the frame");

  frame.remove();
  ok(!check1(),
     "Initial inner window should still not be current after we remove the frame");
  ok(check2(),
     "Second in-process inner window should still be current after we remove the frame");
});
</script>
</body>
</html>

Messung V0.5
C=99 H=99 G=98

¤ Dauer der Verarbeitung: 0.23 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.