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

{
  "description": "Losing sources deactivated if trigger attributed",
  "input": {
    "registrations": [
      {
        "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": "111",
                "expiry": "86400",
                "priority": "3"
              }
            }
          }
        ]
      },
      {
        "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": "222",
                "expiry": "86400",
                "priority": "2"
              }
            }
          }
        ]
      },
      {
        "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",
                  "https://destination2.test"
                ],
                "source_event_id": "333",
                "priority": "1"
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as top level filter data
      // doesn't match and therefore should not deactivate the second and third
      // sources.
      {
        "timestamp": "3000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1"
                  }
                ],
                "filters": {
                  "source_type": ["event"]
                }
              }
            }
          }
        ]
      },
      // Should result in an event-level report and deactivate the third source.
      {
        "timestamp": "86400000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "2"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as the third source was
      // deactivated.
      {
        "timestamp": "86400100",
        "registration_request": {
          "context_origin": "https://destination2.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "4"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as the third source was
      // deactivated.
      {
        "timestamp": "86401000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "3"
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "timestamp": "100000000",
        "registration_request": {
          "context_origin": "https://source2.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": [
                  "https://destination3.test"
                ],
                "source_event_id": "444",
                "expiry": "86400",
                "priority": "2"
              }
            }
          }
        ]
      },
      {
        "timestamp": "100001000",
        "registration_request": {
          "context_origin": "https://source2.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": [
                  "https://destination3.test"
                ],
                "source_event_id": "555",
                "priority": "1"
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as filter data doesn't match.
      // Top level filters match, so the second corresponding source should
      // deactivate.
      {
        "timestamp": "100002000",
        "registration_request": {
          "context_origin": "https://destination3.test"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1",
                    "filters": {
                      "source_type": ["event"]
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      // Should not result in an event-level report as the second source was
      // deactivated.
      {
        "timestamp": "186400000",
        "registration_request": {
          "context_origin": "https://destination3.test"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "2"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0001372,
          "scheduled_report_time": "86401",
          "source_event_id": "222",
          "source_type": "navigation",
          "trigger_data": "2"
        },
        "report_time": "86401000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution"
      }
    ]
  }
}