chromium/third_party/blink/web_tests/http/tests/inspector-protocol/attribution-reporting/source-ignored.js

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

(async function(/** @type {import('test_runner').TestRunner} */ testRunner) {
  const {dp} = await testRunner.startBlank(
      'Test that an attributionsrc request that is only eligible for triggers triggers an issue when it tries to register a source.');

  await dp.Audits.enable();

  const issue = dp.Audits.onceIssueAdded();

  await dp.Runtime.evaluate({expression: `
    fetch('/inspector-protocol/attribution-reporting/resources/register-source-and-trigger.php',
        {keepalive: true,
         attributionReporting: {
          eventSourceEligible: false,
          triggerEligible: true,
        }});
  `});

  testRunner.log((await issue).params.issue, 'Issue reported: ', ['request']);
  testRunner.completeTest();
})