%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<!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>