Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_loadEventFired.js

  Sprache: JAVA
 

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


"use strict";

add_task(async function noEventWhenPageDomainDisabled({ client }) {
  await runLoadEventFiredTest(client, 0, async () => {
    info("Navigate to a page with nested iframes");
    await loadURL(FRAMESET_NESTED_URL);
  });
});

add_task(async function noEventAfterPageDomainDisabled({ client }) {
  const { Page } = client;

  await Page.enable();
  await Page.disable();

  await runLoadEventFiredTest(client, 0, async () => {
    info("Navigate to a page with nested iframes");
    await loadURL(FRAMESET_NESTED_URL);
  });
});

add_task(async function eventWhenNavigatingWithNoFrames({ client }) {
  const { Page } = client;

  await Page.enable();

  await runLoadEventFiredTest(client, 1, async () => {
    info("Navigate to a page with no iframes");
    await loadURL(PAGE_URL);
  });
});

add_task(async function eventWhenNavigatingWithFrames({ client }) {
  const { Page } = client;

  await Page.enable();

  await runLoadEventFiredTest(client, 1, async () => {
    info("Navigate to a page with iframes");
    await loadURL(FRAMESET_MULTI_URL);
  });
});

add_task(async function eventWhenNavigatingWithNestedFrames({ client }) {
  const { Page } = client;

  await Page.enable();

  await runLoadEventFiredTest(client, 1, async () => {
    info("Navigate to a page with nested iframes");
    await loadURL(FRAMESET_NESTED_URL);
  });
});

async function runLoadEventFiredTest(client, expectedEventCount, callback) {
  const { Page } = client;

  if (![01].includes(expectedEventCount)) {
    throw new Error(`Invalid value for expectedEventCount`);
  }

  const LOAD_EVENT_FIRED = "Page.loadEventFired";

  const history = new RecordEvents(expectedEventCount);
  history.addRecorder({
    event: Page.loadEventFired,
    eventName: LOAD_EVENT_FIRED,
    messageFn: payload => {
      return `Received ${LOAD_EVENT_FIRED} at time ${payload.timestamp}`;
    },
  });

  const timeBefore = Date.now() / 1000;
  await callback();
  const loadEventFiredEvents = await history.record();
  const timeAfter = Date.now() / 1000;

  is(
    loadEventFiredEvents.length,
    expectedEventCount,
    "Got expected amount of loadEventFired events"
  );
  if (expectedEventCount == 0) {
    return;
  }

  const timestamp = loadEventFiredEvents[0].payload.timestamp;
  ok(
    timestamp >= timeBefore && timestamp <= timeAfter,
    `Timestamp ${timestamp} in expected range [${timeBefore} - ${timeAfter}]`
  );
}

Messung V0.5 in Prozent
C=90 H=80 G=85

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

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