multiple-component-ads.https.html (1004B)
1 <!DOCTYPE html> 2 <title>Test loading multiple component ads</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(t) => { 12 const fencedframe = await attachFencedFrameContext({ 13 generator_api: 'fledge', 14 num_components: 2, 15 }); 16 17 await fencedframe.execute(async () => { 18 const ad_component_1 = await attachComponentFencedFrameContext(0); 19 const ad_component_2 = await attachComponentFencedFrameContext(1); 20 21 await ad_component_1.execute(() => { 22 window.component_1_var = 4; 23 }); 24 25 // Check that ad_component_2 is its own separate frame. 26 await ad_component_2.execute(() => { 27 assert_equals(window.component_1_var, undefined); 28 }); 29 }); 30 }, 'Test creating and using multiple component ads in a FLEDGE auction'); 31 </script> 32 </body>