automatic-beacon-cross-origin-no-opt-in.https.html (1649B)
1 <!DOCTYPE html> 2 <title>Test cross-origin automatic beacons without opt-in</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 <script src="/resources/testdriver.js"></script> 9 <script src="/resources/testdriver-actions.js"></script> 10 <script src="/resources/testdriver-vendor.js"></script> 11 <script src="/common/get-host-info.sub.js"></script> 12 <script src="resources/automatic-beacon-helper.js"></script> 13 14 <body> 15 <script> 16 promise_test(async(t) => { 17 const actions = new test_driver.Actions(); 18 const fencedframe = await attachFencedFrameContext({ 19 generator_api: 'fledge', 20 register_beacon: true 21 }); 22 23 let beacon_event = { 24 eventType: "reserved.top_navigation_start", 25 eventData: "this is the beacon data", 26 destination: ["buyer"], 27 crossOriginExposed: true, 28 } 29 // Add a cross-origin iframe that will perform the top-level navigation. 30 // Do not set the 'Allow-Fenced-Frame-Automatic-Beacons' header to true. 31 await setupAutomaticBeacon(fencedframe, [beacon_event], 32 "resources/close.html", NavigationTrigger.CrossOriginClickNoOptIn, 33 "_blank"); 34 35 await actions.pointerMove(0, 0, {origin: fencedframe.element}) 36 .pointerDown() 37 .pointerUp() 38 .send(); 39 40 await verifyBeaconData(beacon_event.eventType, beacon_event.eventData, 41 get_host_info().HTTPS_REMOTE_ORIGIN, false, t); 42 }, 'Automatic beacon in a cross-origin subframe with no opt-in header should ' + 43 'not send.'); 44 </script> 45 </body>