Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  browser_bug1685807.js

  Sprache: JAVA
 

/**
 * Bug 1685807 - Testing that the window.name won't be reset when loading an
 *               about:blank page to a window which had loaded non-about:blank
 *               page. And other case that window.name should be reset if
 *               the document.domain has changed.
 */


"use strict";

const EMPTY_URI =
  "https://test1.example.com/browser/dom/tests/browser/file_empty.html";
const TEST_URI =
  "https://test1.example.com/browser/dom/tests/browser/file_bug1685807.html";

add_setup(async function () {
  await SpecialPowers.pushPrefEnv({
    set: [["privacy.window.name.update.enabled"true]],
  });
});

add_task(async function doTests() {
  for (let testDocDomain of [falsetrue]) {
    // Open an empty tab.
    let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, EMPTY_URI);
    let browser = tab.linkedBrowser;

    // Create a promise in order to wait loading of the about:blank page.
    let loadedPromise = BrowserTestUtils.browserLoaded(
      browser,
      false,
      "about:blank"
    );

    // Set the window.name and document.domain.
    SpecialPowers.spawn(
      browser,
      [TEST_URI, testDocDomain],
      (aTestURI, aTestDocDomain) => {
        // Mark the first entry as having been interacted with.
        content.document.notifyUserGestureActivation();

        content.name = "Test";

        if (aTestDocDomain) {
          content.document.domain = "example.com";
        }

        // Open the page which will trigger the loading of the about:blank page.
        content.open(aTestURI);
      }
    );

    // Wait until the about:blank page is loaded.
    await loadedPromise;

    // Check the window.name.
    await SpecialPowers.spawn(browser, [testDocDomain], aTestDocDomain => {
      if (aTestDocDomain) {
        // The window.name should be reset if the document.domain was set to a
        // cross-origin.
        is(content.name, """The window.name should be reset.");
      } else {
        is(content.name, "Test""The window.name shouldn't be reset.");
      }
    });

    let awaitPageShow = BrowserTestUtils.waitForContentEvent(
      browser,
      "pageshow"
    );
    browser.goBack(false);
    await awaitPageShow;

    // Check the window.name.
    await SpecialPowers.spawn(browser, [], () => {
      is(content.name, "Test""The window.name is correct.");
    });

    BrowserTestUtils.removeTab(tab);
  }
});

Messung V0.5 in Prozent
C=85 H=85 G=84

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet am  2026-06-06) ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik