tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

about-blank-iframes.https.html (922B)


      1 <!DOCTYPE html>
      2 <title>Test about:blank iframes prerendering state</title>
      3 <meta name="timeout" content="long">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/utils.js"></script>
      7 <script src="../resources/utils.js"></script>
      8 <script src="resources/utils.js"></script>
      9 
     10 <body>
     11 <script>
     12 setup(() => assertSpeculationRulesIsSupported());
     13 
     14 promise_test(async t => {
     15  const uid = token();
     16  const channel = new PrerenderChannel('test-channel', uid);
     17 
     18  const gotMessage = new Promise(resolve => {
     19    channel.addEventListener('message', e => {
     20      resolve(e.data);
     21    }, {once: true});
     22  });
     23 
     24  // Make the window to start the prerender.
     25  const url = `resources/about-blank-iframes.html?uid=${uid}`;
     26  window.open(url, '_blank', 'noopener');
     27 
     28  const msg = await gotMessage;
     29  assert_equals(msg, 'PASS');
     30 }, 'about:blank iframes');
     31 </script>