tor-browser

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

get-mode-in-nested-frame.https.html (1345B)


      1 <!DOCTYPE html>
      2 <title>Test GetFencedFrameMode() on a nested nested iframe.</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/utils.js"></script>
      6 <script src="/common/dispatcher/dispatcher.js"></script>
      7 <script src="resources/utils.js"></script>
      8 
      9 <body>
     10 <script>
     11 promise_test(async () => {
     12  // This test has the following setup:
     13  // root -> (fencedframe) -> (first_iframe) -> (second_iframe)
     14  // (second_iframe) will attempt an _unfencedTop navigation, which will result
     15  // in GetFencedframeMode() being called. For this test to pass, it shouldn't
     16  // timeout.
     17  const fencedframe = await attachFencedFrameContext(
     18      {generator_api: 'fledge'});
     19  await fencedframe.execute(async () => {
     20    const first_iframe = attachIFrameContext();
     21    await first_iframe.execute(async () => {
     22      const second_iframe = attachIFrameContext();
     23      await second_iframe.execute(async () => {
     24        // This call will cause FrameTreeNode::GetFencedFrameMode() to be called
     25        // for second_iframe. If the browser process doesn't hang (and timeout
     26        // the test), then the test passes.
     27        window.open("https://www.google.com", "_unfencedTop");
     28      });
     29    });
     30  });
     31 }, 'Trigger GetFencedFrameMode() in a nested nested iframe');
     32 </script>
     33 </body>