summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/multiple-component-ads.https.html
blob: 81d506842efd41c6defbcb4ba12ba5d2ccfa9216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<title>Test loading multiple component ads</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="resources/utils.js"></script>

<body>
<script>
promise_test(async(t) => {
  const fencedframe = await attachFencedFrameContext({
    generator_api: 'fledge',
    num_components: 2,
  });

  await fencedframe.execute(async () => {
    const ad_component_1 = await attachComponentFencedFrameContext(0);
    const ad_component_2 = await attachComponentFencedFrameContext(1);

    await ad_component_1.execute(() => {
      window.component_1_var = 4;
    });

    // Check that ad_component_2 is its own separate frame.
    await ad_component_2.execute(() => {
      assert_equals(window.component_1_var, undefined);
    });
  });
}, 'Test creating and using multiple component ads in a FLEDGE auction');
</script>
</body>