summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fledge/tentative/auction-config.https.window.js
blob: 057b4d7f785cbe05f676b45ffc33551f51cf5e85 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
// META: script=/resources/testdriver.js
// META: script=/common/utils.js
// META: script=resources/fledge-util.sub.js
// META: script=/common/subset-tests.js
// META: timeout=long
// META: variant=?1-5
// META: variant=?6-10
// META: variant=?11-15
// META: variant=?16-20
// META: variant=?21-25
// META: variant=?26-30
// META: variant=?31-35
// META: variant=?36-40
// META: variant=?40-45
// META: variant=?46-50
// META: variant=?51-55
// META: variant=?56-60
// META: variant=?61-last

"use strict;"

// The tests in this file focus on calls to runAdAuction with various
// auctionConfigs.

// We handle promise rejections ourselves.
setup({ allow_uncaught_exception: true });

// Helper for when we expect it to happen.
const interceptUnhandledRejection = () => {
  let invokePromiseResolved;
  let eventHandler = event => {
    event.preventDefault();
    invokePromiseResolved(event.reason);
  }
  window.addEventListener("unhandledrejection", eventHandler, {once: true});
  return new Promise((resolved) => {
    invokePromiseResolved = resolved;
  });
}

// Helper for when we expect it to not happen. This relies on the event
// dispatching being sync.
const unexpectedUnhandledRejection = () => {
  let o = { sawError : false }
  window.addEventListener("unhandledrejection", event => {
    o.sawError = true;
  }, {once: true});
  return o;
}

const makeTest = ({
  // Test name
  name,
  // Expectation function (EXPECT_NULL, etc.)
  expect,
  // Overrides to the auction config.
  auctionConfigOverrides = {},
  // Expectation for a promise error.
  expectPromiseError,
}) => {
  subsetTest(promise_test, async test => {
    let waitPromiseError, dontExpectPromiseError;
    if (expectPromiseError) {
      waitPromiseError = interceptUnhandledRejection();
    } else {
      dontExpectPromiseError = unexpectedUnhandledRejection();
    }

    const uuid = generateUuid(test);
    // Join an interest group so the auction actually runs.
    await joinInterestGroup(test, uuid);
    let auctionResult;
    try {
      auctionResult = await runBasicFledgeAuction(test, uuid, auctionConfigOverrides);
    } catch (e) {
      auctionResult = e;
    }
    expect(auctionResult);

    if (expectPromiseError) {
      expectPromiseError(await waitPromiseError);
    } else {
      assert_false(dontExpectPromiseError.sawError,
                   "Should not see a promise error");
    }
  }, name);
};

// Expect an unsuccessful auction (yielding null).
const EXPECT_NO_WINNER = auctionResult => {
  assert_equals(auctionResult, null, 'Auction unexpected had a winner');
};

// Expect a winner (FencedFrameConfig).
const EXPECT_WINNER =
    auctionResult => {
      assert_true(
          auctionResult instanceof FencedFrameConfig,
          'Auction did not return expected FencedFrameConfig');
    }

// Expect an exception of the given type.
const EXPECT_EXCEPTION = exceptionType => auctionResult => {
  assert_not_equals(auctionResult, null, "got null instead of expected error");
  assert_true(auctionResult instanceof Error, "did not get expected error: " + auctionResult);
  assert_throws_js(exceptionType, () => { throw auctionResult; });
};

const EXPECT_PROMISE_ERROR = auctionResult => {
  assert_not_equals(auctionResult, null, "got null instead of expected error");
  assert_true(auctionResult instanceof TypeError,
              "did not get expected error type: " + auctionResult);
}

makeTest({
  name: 'deprecatedRenderURLReplacements without end bracket is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'${No_End_Bracket': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements without percents and brackets.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'No_Wrapper': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements without dollar sign.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'{No_Dollar_Sign}': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements without start bracket is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'$No_Start_Bracket}': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements mix and match is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'${Bracket_And_Percent%%': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements missing start percent is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'%Missing_Start_Percents%%': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements single percents is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'%Single_Percents%': 'SSP'}}
});

makeTest({
  name: 'deprecatedRenderURLReplacements without end percents is invalid.',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {deprecatedRenderURLReplacements: {'%%No_End_Percents': 'SSP'}}
});

makeTest({
  name: 'no buyers => no winners',
  expect: EXPECT_NO_WINNER,
  auctionConfigOverrides: {interestGroupBuyers: []},
});

makeTest({
  name: 'seller is not an https URL',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {seller: "ftp://not-https"},
});

makeTest({
  name: 'decisionLogicURL is invalid',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { decisionLogicURL: "https://foo:99999999999" },
});

makeTest({
  name: 'decisionLogicURL is cross-origin with seller',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { decisionLogicURL: "https://example.com" },
});

makeTest({
  name: 'trustedScoringSignalsURL is invalid',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { trustedScoringSignalsURL: "https://foo:99999999999" },
});

makeTest({
  name: 'valid trustedScoringSignalsURL',
  expect: EXPECT_WINNER,
  auctionConfigOverrides:
      {trustedScoringSignalsURL: window.location.origin + '/resource.json'}
});

makeTest({
  name: 'trustedScoringSignalsURL should not have a fragment',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides:
      {trustedScoringSignalsURL: window.location.origin + '/resource.json#foo'}
});

makeTest({
  name: 'trustedScoringSignalsURL with an empty fragment is not OK',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides:
      {trustedScoringSignalsURL: window.location.origin + '/resource.json#'}
});

makeTest({
  name: 'trustedScoringSignalsURL should not have a query',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides:
      {trustedScoringSignalsURL: window.location.origin + '/resource.json?foo'}
});

makeTest({
  name: 'trustedScoringSignalsURL with an empty query is not OK',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides:
      {trustedScoringSignalsURL: window.location.origin + '/resource.json?'}
});

makeTest({
  name: 'trustedScoringSignalsURL should not have embedded credentials',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    trustedScoringSignalsURL: (window.location.origin + '/resource.json')
                                  .replace('https://', 'https://user:pass@')
  }
});

makeTest({
  name: 'trustedScoringSignalsURL is cross-origin with seller',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { trustedScoringSignalsURL: "https://example.com" },
});

makeTest({
  name: 'interestGroupBuyer is invalid',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { interestGroupBuyers: ["https://foo:99999999999"] },
});

makeTest({
  name: 'interestGroupBuyer is not https',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { interestGroupBuyers: ["http://example.com"] },
});

makeTest({
  name: 'only one interestGroupBuyer is invalid',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    interestGroupBuyers: ["https://example.com", "https://foo:99999999999"],
  },
});

makeTest({
  name: 'only one interestGroupBuyer is not https',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    interestGroupBuyers: ["https://example.com", "http://example.com"],
  },
});

makeTest({
  name: 'auctionSignals is invalid as JSON',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { auctionSignals: { sig: BigInt(13) } },
});

makeTest({
  name: 'sellerSignals is invalid as JSON',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { sellerSignals: { sig: BigInt(13) } },
});

makeTest({
  name: 'directFromSellerSignals is invalid',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { directFromSellerSignals: "https://foo:99999999999" },
});

makeTest({
  name: 'directFromSellerSignals is cross-origin with seller',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { directFromSellerSignals: "https://example.com" },
});

makeTest({
  name: 'directFromSellerSignals has nonempty query',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { directFromSellerSignals: window.location.origin + "?foo=bar" },
});

makeTest({
  name: 'perBuyerSignals has invalid URL in a key',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { perBuyerSignals: { "https://foo:99999999999" : {} }},
});

makeTest({
  name: 'perBuyerSignals value is invalid as JSON',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    perBuyerSignals: { "https://example.com" : { sig: BigInt(1) },
  }},
});

makeTest({
  name: 'perBuyerGroupLimits has invalid URL in a key',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { perBuyerGroupLimits: { "https://foo:99999999999" : 5 }},
});

makeTest({
  name: 'perBuyerExperimentGroupIds has invalid URL in a key',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: { perBuyerExperimentGroupIds: { "https://foo:99999999999" : 11 }},
});

makeTest({
  name: 'perBuyerPrioritySignals has invalid URL in a key',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    perBuyerPrioritySignals: { "https://foo:99999999999" : { sig: 2.5} },
  },
});

makeTest({
  name: 'perBuyerPrioritySignals has a value with a key with prefix "browserSignals"',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    perBuyerPrioritySignals: { "https://example.com" : { "browserSignals.foo" : true } },
  },
});

makeTest({
  name: 'component auctions are not allowed within component auctions',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    interestGroupBuyers: undefined,
    componentAuctions: [
      {
        seller: window.location.origin,
        decisionLogicURL: window.location.origin,
        interestGroupBuyers: undefined,
        componentAuctions: [
          {
            seller: window.location.origin,
            decisionLogicURL: window.location.origin,
          }
        ],
      },
    ],
  },
});

makeTest({
  name: 'component auctions are not allowed with interestGroupBuyers',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {
    interestGroupBuyers: ["https://example.com"],
    componentAuctions: [
      {
        seller: window.location.origin,
        decisionLogicURL: window.location.origin,
        interestGroupBuyers: [],
      },
    ],
  },
});

makeTest({
  name: 'perBuyerCurrencies with invalid currency',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerCurrencies: {'*': 'Dollars'}}
});

makeTest({
  name: 'perBuyerCurrencies with invalid currency map key',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerCurrencies: {'example': 'USD'}}
});

makeTest({
  name: 'perBuyerCurrencies with non-https currency map key',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerCurrencies: {'http://example.org/': 'USD'}}
});

makeTest({
  name: 'perBuyerCurrencies not convertible to dictionary',
  expect: EXPECT_PROMISE_ERROR,
  expectPromiseError: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerCurrencies: 123}
});

makeTest({
  name: 'requestedSize has no width',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {height: '100'}}
});

makeTest({
  name: 'requestedSize has no height',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '100'}}
});

makeTest({
  name: 'requestedSize width not a number',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '10 0', height: '100'}}
});

makeTest({
  name: 'requestedSize height not a number',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '100', height: '10 0'}}
});

makeTest({
  name: 'requestedSize 0',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '0', height: '100'}}
});

makeTest({
  name: 'requestedSize space before units',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '100 px', height: '100'}}
});

makeTest({
  name: 'requestedSize leading 0',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '0100', height: '100'}}
});

makeTest({
  name: 'requestedSize invalid unit type',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '100furlongs', height: '100'}}
});

makeTest({
  name: 'requestedSize hexideximal',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize: {width: '0x100', height: '100'}}
});

makeTest({
  name: 'Empty allSlotsRequestedSizes',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {allSlotsRequestedSizes: []}
});

makeTest({
  name: 'allSlotsRequestedSizes without matching value in requestedSize',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {requestedSize:
                             {width: '100', height: '100'},
                           allSlotsRequestedSizes:
                            [{width: '100', height: '101'}]}
});

makeTest({
  name: 'allSlotsRequestedSizes has duplicate values',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {allSlotsRequestedSizes:
                            [{width: '100', height: '100'},
                             {width: '100', height: '100'}]}
});

makeTest({
  name: 'allSlotsRequestedSizes has invalid value',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {allSlotsRequestedSizes:
                            [{width: '100', height: '100'},
                             {width: '200furlongs', height: '200'}]}
});

makeTest({
  name: 'sellerRealTimeReportingConfig has default local reporting type',
  expect:  EXPECT_WINNER,
  auctionConfigOverrides: {sellerRealTimeReportingConfig:
                            {type: 'default-local-reporting'}}
});

makeTest({
  name: 'sellerRealTimeReportingConfig has no type',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {sellerRealTimeReportingConfig:
                            {notType: 'default-local-reporting'}}
});

makeTest({
  name: 'sellerRealTimeReportingConfig has unknown type',
  expect:  EXPECT_WINNER,
  auctionConfigOverrides: {sellerRealTimeReportingConfig: {type: 'unknown type'}}
});

makeTest({
  name: 'perBuyerRealTimeReportingConfig',
  expect: EXPECT_WINNER,
  auctionConfigOverrides: {perBuyerRealTimeReportingConfig:
                            {"https://example.com": {type: 'default-local-reporting'}}}
});

makeTest({
  name: 'perBuyerRealTimeReportingConfig has no entry',
  expect: EXPECT_WINNER,
  auctionConfigOverrides: {perBuyerRealTimeReportingConfig: {}}
});

makeTest({
  name: 'perBuyerRealTimeReportingConfig has invalid buyer',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerRealTimeReportingConfig:
                            {"http://example.com": {type: 'default-local-reporting'}}}
});

makeTest({
  name: 'perBuyerRealTimeReportingConfig has no type',
  expect: EXPECT_EXCEPTION(TypeError),
  auctionConfigOverrides: {perBuyerRealTimeReportingConfig:
                            {"https://example.com": {notType: 'default-local-reporting'}}}
});

makeTest({
  name: 'perBuyerRealTimeReportingConfig has unknown type',
  expect: EXPECT_WINNER,
  auctionConfigOverrides: {perBuyerRealTimeReportingConfig:
                            {"https://example.com": {type: 'unknown type'}}}
});

subsetTest(promise_test, async test => {
  const uuid = generateUuid(test);

  // The renderURL / report URLs for the first/second iterations of the auction.
  let renderURL = createRenderURL(uuid);
  let bidderReportURL1 = createBidderReportURL(uuid, /*id=*/ 1);
  let bidderReportURL2 = createBidderReportURL(uuid, /*id=*/ 2);
  let bidderDebugReportURL =
      createBidderReportURL(uuid, /*id=*/ 'forDebuggingOnly');
  let sellerReportURL1 = createSellerReportURL(uuid, /*id=*/ 1);
  let sellerReportURL2 = createSellerReportURL(uuid, /*id=*/ 2);
  let sellerDebugReportURL =
      createSellerReportURL(uuid, /*id=*/ 'forDebuggingOnly');

  // reportWin() sends "bidderReportURL1" if
  // browserSignals.forDebuggingOnlyInCooldownOrLockout is true,
  // "bidderReportURL2" otherwise.
  await joinInterestGroup(test, uuid, {
    ads: [{renderURL: renderURL}],
    biddingLogicURL: createBiddingScriptURL({
      generateBid: `
        forDebuggingOnly.reportAdAuctionWin('${bidderDebugReportURL}');
        if (!browserSignals.hasOwnProperty(
          'forDebuggingOnlyInCooldownOrLockout')) {
          throw "Missing forDebuggingOnlyInCooldownOrLockout in browserSignals";
        }
        let bid = browserSignals.forDebuggingOnlyInCooldownOrLockout ? 1 : 2;
        return {bid: bid, render: '${renderURL}'};`,
      reportWin: `
        if (browserSignals.bid === 1)
          sendReportTo('${bidderReportURL1}');
        if (browserSignals.bid === 2)
          sendReportTo('${bidderReportURL2}');`

    })
  });

  // reportResult() sends "sellerReportURL1" if
  // browserSignals.forDebuggingOnlyInCooldownOrLockout in scoreAd() is true,
  // "sellerReportURL2" otherwise.
  const auctionConfigOverrides = {
    decisionLogicURL: createDecisionScriptURL(uuid, {
      scoreAd: `
        forDebuggingOnly.reportAdAuctionWin('${sellerDebugReportURL}');
        if (!browserSignals.hasOwnProperty(
          'forDebuggingOnlyInCooldownOrLockout')) {
          throw "Missing forDebuggingOnlyInCooldownOrLockout in browserSignals";
        }
        let desirability =
            browserSignals.forDebuggingOnlyInCooldownOrLockout ? 1 : 2;
        return {desirability: desirability};`,
      reportResult: `
        if (browserSignals.desirability === 1)
          sendReportTo('${sellerReportURL1}');
        if (browserSignals.desirability === 2)
          sendReportTo('${sellerReportURL2}');`
    })
  };

  // In the first auction, browserSignals.forDebuggingOnlyInCooldownOrLockout in
  // generateBid() and scoreAd() should both be false. After the auction,
  // lockout and cooldowns should be updated.
  await runBasicFledgeAuctionAndNavigate(test, uuid, auctionConfigOverrides);
  await waitForObservedRequestsIgnoreDebugOnlyReports(
      uuid, [bidderReportURL2, sellerReportURL2]);

  // In the second auction, browserSignals.forDebuggingOnlyInCooldownOrLockout
  // in generateBid() and scoreAd() should both be true, since both the buyer
  // and seller called forDebuggingOnly API in the first auction, so they are in
  // cooldowns at least (and also in lockout if a debug report is allowed to be
  // sent).
  await runBasicFledgeAuctionAndNavigate(test, uuid, auctionConfigOverrides);
  await waitForObservedRequestsIgnoreDebugOnlyReports(
    uuid,
    [bidderReportURL2, sellerReportURL2, bidderReportURL1, sellerReportURL1]);
}, `forDebuggingOnly lockout and cooldowns updating in one auction, read in another's.`);