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

Quelle  test_bug593174.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/bugs/test_bug593174.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=593174
-->

<head>
  <title>Test for Bug 593174</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=593174">Mozilla Bug 593174</a>

<script>

SimpleTest.waitForExplicitFinish();

var loadCount = 0;
var popup = null;

const kOriginalLocation = location.href;

function iframeLoaded(identifier) {
  loadCount++;
  dump("iframeLoaded. loadCount=" + loadCount +
                    " identifier='" + identifier + "'\n");

  var iframe = document.getElementById('iframe');
  var iframeCw = iframe.contentWindow;

  if (loadCount == 1) {
    // Test 1: Navigate iframe1.  This page should be the referer.
    // We'll get a callback from the inner page when its iframe finishes
    // loading, so get rid of the onload listener on our iframe.

    // Change this page's URI using replaceState; the referrer should be this
    // new value, not our original location.
    history.replaceState('''', Math.random());

    iframe.onload = null;
    iframeCw.location = 'file_bug593174_2.html';
  }
  else if (loadCount == 2) {
    // Test 1: Check that this page is the referer.
    is(iframeCw.document.referrer, String(document.location), 'outer iframe referrer');

    // Test 2: file_bug593174_2.html itself contains an iframe, whose src is a
    // data: uri.  Call into that inner iframe and have it set its
    // document.location.  The new document's referrer should be
    // file_bug593174_2.html.

    // We'll get a call to iframeLoaded when this finishes.
    iframeCw.navigateInnerIframe();
  }
  else if (loadCount == 3) {
    is(iframeCw.getInnerIframeReferrer(), String(iframeCw.location), 'inner iframe referrer');

    // Now do the test again, this time with a popup.
    popup = window.open('file_bug593174_1.html');
    popup.onload = iframeLoaded('popup/outer');
  }
  else if (loadCount == 4) {
    history.replaceState('''', Math.random());

    popup.onload = null;
    popup.location = 'file_bug593174_2.html';
  }
  else if (loadCount == 5) {
    is(popup.document.referrer, String(document.location), 'popup referrer after replaceState');
    popup.navigateInnerIframe();
  }
  else if (loadCount == 6) {
    is(popup.getInnerIframeReferrer(), String(popup.location), 'popup/inner iframe referrer');
    popup.close();
    history.replaceState('''', kOriginalLocation);
    SimpleTest.finish();
  }
}

</script>

<iframe onload='iframeLoaded("outer")' id='iframe' src='file_bug593174_1.html'></iframe>

</body>
</html>

Messung V0.5
C=95 H=95 G=94

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.