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

Quelle  unload-manual.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/hr-time/unload-manual.html


<!DOCTYPE html>
<html>
<head>
  <title>time origin value manual test</title>
  <link rel="help" href="https://w3c.github.io/hr-time/#time-origin-1">
  <link rel="prefetch" href="./resources/unload-a.html">
  <link rel="prefetch" href="./resources/unload-b.html">
  <link rel="prefetch" href="./resources/unload-c.html">
</head>
<body>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script>
    setup({ explicit_timeout: true });

    const ACCEPTABLE_VARIANCE = 400; // ms

    const isRoughlyEqual = (a, b) => Math.abs(a - b) < ACCEPTABLE_VARIANCE;

    const timings = { a: {}, b: {}, c: {} };
    const t = async_test("hr-time time origin");

    window.mark = msg => {
      timings[msg.docName][msg.lifecycleEventName] = {
        performanceNow: msg.performanceNow,
        dateNow: msg.dateNow
      };

      if (msg.docName === "c" && msg.lifecycleEventName === "unload") {
        setTimeout(makeAssertions, 0);
      }
    };

    function makeAssertions () {
      t.step(() => {
        const loadTimeBetweenAandB = timings.b.load.dateNow - timings.a.unload.dateNow;
        const loadTimeBetweenBandC = timings.c.load.dateNow - timings.b.unload.dateNow;

        assert_true(
          isRoughlyEqual(loadTimeBetweenAandB, timings.b.load.performanceNow),
          "Document in reused window's time origin should be time of close of pop-up box."
        );
        assert_true(
          isRoughlyEqual(loadTimeBetweenBandC, timings.c.load.performanceNow),
          "Document in reused window's time origin should be time of close of pop-up box."
        );
        assert_true(
          !isRoughlyEqual(timings.a.unload.performanceNow, 0),
          "Time origin during unload event should match that of rest of document."
        );
        assert_true(
          !isRoughlyEqual(timings.b.unload.performanceNow, 0),
          "Time origin during unload event should match that of rest of document."
        );
        assert_true(
          !isRoughlyEqual(timings.c.unload.performanceNow, 0),
          "Time origin during unload event should match that of rest of document."
        );
      });
      t.done();
    }
  </script>

  <h2>Description</h2>
  <p>This test validates the behavior of <code>performance.now()</code> with respect to its time origin.</p>
  <div id="log">
   <h2>Manual Test Steps</h2>
   <ol>
    <li><a href="resources/unload-a.html" target="_blank">Click here</a>
   </ol>
  </div>
</body>
<html>

Messung V0.5
C=91 H=95 G=92

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