frame-navigation-inner-create-nested.https.html (1821B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/common/get-host-info.sub.js"></script> 4 <script src="utils.js"></script> 5 <title>Test nested fenced frame navigation (by a parent frame setting its src).</title> 6 7 <body> 8 <script> 9 async function init() { // Needed in order to use top-level await. 10 // This file is meant to run in a <fencedframe>. It communicates with 11 // the embedder to confirm that nested fenced frames can be navigated. 12 13 const [navigation_key, navigation_ack_key] = parseKeylist(); 14 15 // Create URL prefixes to simulate different origins. 16 // (www1 and www2 are different origins) 17 const simple_url = generateURL("frame-navigation-inner-simple.https.html", 18 [navigation_key, navigation_ack_key]); 19 20 const origin1_simple_url = getRemoteOriginURL(simple_url); 21 const origin2_simple_url = getRemoteOriginURL(simple_url) 22 .toString().replace("www1", "www2"); 23 24 const url_prefix = location.href + "/../"; 25 26 // Tell the embedder that this frame has loaded. 27 writeValueToServer(navigation_key, "create-nested"); 28 await nextValueFromServer(navigation_ack_key); 29 30 // Create an inner frame. 31 inner_frame = attachFencedFrame(origin1_simple_url); 32 // Wait for our parent to tell us they're done communicating. 33 await nextValueFromServer(navigation_ack_key); 34 35 // Navigate (cross-origin) and wait. 36 inner_frame.config = new FencedFrameConfig( 37 generateURL(origin2_simple_url, [])); 38 await nextValueFromServer(navigation_ack_key); 39 40 // Navigate (same-origin) and wait. 41 inner_frame.config = new FencedFrameConfig( 42 generateURL(origin2_simple_url, [])); 43 await nextValueFromServer(navigation_ack_key); 44 } 45 46 init(); 47 </script> 48 </body>