chromium/content/test/data/attribution_reporting/interop/attribution_scopes_smaller_scope_limit.json

{
  "description": "Test that sources with a smaller attribution scope limit are deleted.",
  "api_config": {
    "needs_attribution_scopes": true
  },
  "input": {
    "registrations": [
      // S1: attribution scope limit -> 3 destinations -> [D1].
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "1",
                "attribution_scopes": {
                  "limit": 3,
                  "values": [
                    "1",
                    "2"
                  ]
                }
              }
            }
          }
        ]
      },
      // S2: attribution_scope_limit -> 4.
      // S1 will be deleted due to smaller attribution_scope_limit.
      {
        "timestamp": "1000",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "234",
                "attribution_scopes": {
                  "limit": 4,
                  "values": [
                    "2",
                    "3"
                  ]
                }
              }
            }
          }
        ]
      },
      // S3: attribution_scope_limit -> 3
      // S2 will be NOT be deleted as it has higher attribution_scope_limit.
      {
        "timestamp": "2000",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "345",
                "attribution_scopes": {
                  "limit": 3,
                  "values": [
                    "3",
                    "4"
                  ]
                }
              }
            }
          }
        ]
      },
      // T1: attribution scope -> "1", destination -> D1
      // This shouldn't match as S1 was deleted.
      {
        "timestamp": "3000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "attribution_scopes": [
                  "1"
                ],
                "debug_reporting": true,
                "event_trigger_data": [
                  {
                  }
                ]
              }
            }
          }
        ]
      },
      // T2: attribution scope -> "2", destination -> D1.
      // This should match to S2 as S1 was deleted.
      {
        "timestamp": "4000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "attribution_scopes": [
                  "2"
                ],
                "debug_reporting": true,
                "event_trigger_data": [
                  {
                    "trigger_data": "2"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination.test"
            },
            "type": "trigger-no-matching-source"
          }
        ],
        "report_time": "3000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172801",
          "source_event_id": "234",
          "source_type": "navigation",
          "trigger_data": "2"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172801000"
      }
    ]
  }
}