held.tentative.https.html (1787B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <meta name="timeout" content="long"> 4 <title>Web Locks API: bfcache</title> 5 <link rel=help href="https://w3c.github.io/web-locks/"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/common/utils.js"></script> 9 <script src="/common/dispatcher/dispatcher.js"></script> 10 <script src="/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js"></script> 11 <script type="module"> 12 import { runWebLocksBfcacheTest } from "./helpers.js"; 13 14 runWebLocksBfcacheTest({ 15 funcBeforeNavigation: () => { 16 navigator.locks.request(uniqueNameByQuery(), () => new Promise(() => { })); 17 }, 18 shouldBeCached: false 19 }, "A held lock on the main thread must prevent bfcache"); 20 21 runWebLocksBfcacheTest({ 22 funcBeforeNavigation: async () => { 23 window.worker = new Worker("/web-locks/resources/worker.js"); 24 await postToWorkerAndWait(worker, { op: "request", name: uniqueNameByQuery() }); 25 }, 26 shouldBeCached: false 27 }, "A held lock on a worker must prevent bfcache"); 28 29 runWebLocksBfcacheTest({ 30 funcBeforeNavigation: async () => { 31 window.worker = new Worker("/web-locks/resources/parentworker.js"); 32 await postToWorkerAndWait(worker, { op: "request", name: uniqueNameByQuery() }); 33 }, 34 shouldBeCached: false 35 }, "A held lock on a nested worker must prevent bfcache"); 36 37 runWebLocksBfcacheTest({ 38 funcBeforeNavigation: async () => { 39 window.worker = new SharedWorker("/web-locks/resources/worker.js"); 40 worker.port.start(); 41 await postToWorkerAndWait(worker.port, { op: "request", name: uniqueNameByQuery() }); 42 }, 43 shouldBeCached: false 44 }, "A held lock on a shared worker must prevent bfcache"); 45 </script>