tor-browser

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

config-with-empty-url-installation-unloads-navigated-fenced-frame.https.html (1640B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="/common/get-host-info.sub.js"></script>
      6 <script src="resources/utils.js"></script>
      7 <title>Test installing a config with empty url to a navigated fenced frame
      8  unloads the original document</title>
      9 
     10 <body>
     11 
     12 <script>
     13 promise_test(async () => {
     14  const fenced_frame_loaded_key = token();
     15 
     16  // Create a fenced frame and install a config constructed with an empty url.
     17  const fenced_frame = document.createElement('fencedframe');
     18  document.body.append(fenced_frame);
     19 
     20  // Specify the fenced frame's src attribute to an url.
     21  const url = generateURL('resources/fenced-frame-loaded.html',
     22                          [fenced_frame_loaded_key]);
     23  fenced_frame.config = new FencedFrameConfig(url);
     24 
     25  // The fenced frame should navigate to the src url.
     26  const load_expected = "fenced frame loaded";
     27  const load_actual = await nextValueFromServer(fenced_frame_loaded_key);
     28  assert_equals(load_actual, load_expected,
     29    "Fenced frame successfully loaded by specifying its src attribute.");
     30 
     31  // Create a config with an empty url.
     32  const empty_url_config = new FencedFrameConfig('');
     33  fenced_frame.config = empty_url_config;
     34 
     35  // Installing a config with an empty url to the fenced frame should unload the
     36  // original document.
     37  const server_value = await readValueFromServer(fenced_frame_loaded_key);
     38  assert_false(server_value.status);
     39 
     40 }, 'Installing a config with empty url to a navigated fenced unloads ',
     41  'the original document.');
     42 </script>
     43 
     44 </body>