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

content / test / data / attribution_reporting / interop / event_report_window.json [blame]

{
  "description": "Event-level report not created if report window has passed",
  "input": {
    "registrations": [
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "123",
                // Clamped to one hour (3600 seconds). Trailing zero included
                // to demonstrate validity.
                "event_report_window": 3590.0,
                "aggregation_keys": {
                  "a": "0x1"
                }
              }
            }
          }
        ]
      },
      {
        "timestamp": "1000",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "event-source"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "456",
                // Not rounded.
                "event_report_window": "88400"
              }
            }
          }
        ]
      },
      {
        "timestamp": "2000",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "event-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination2.test",
                "source_event_id": "789",
                // Rounded to one day (86400 seconds).
                "expiry": "87400",
                // Default to expiry after rounding (86400 seconds).
                "event_report_window": "88400"
              }
            }
          }
        ]
      },
      // Should result in an event-level report and an aggregatable report
      // as the event report window was clamped to one hour.
      {
        // 3,599,000 ms = 1 hour - 1 second < clamped event_report_window value
        "timestamp": "3599000",
        "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"
                  }
                ],
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["a"],
                    "key_piece": "0x10"
                  }
                ],
                "aggregatable_values": {
                  "a": 123
                }
              }
            }
          }
        ]
      },
      // Should result in an aggregatable report, but not event-level report as
      // event report window has passed (event report window is an exclusive
      // bound).
      {
        // 3,600,000 ms = 1 hour = clamped event_report_window value
        "timestamp": "3600000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "debug_reporting": true,
                "event_trigger_data": [
                  {
                    "trigger_data": "2"
                  }
                ],
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["a"],
                    "key_piece": "0x20"
                  }
                ],
                "aggregatable_values": {
                  "a": 456
                }
              }
            }
          }
        ]
      },
      // Should result in an event-level report and report time was based on
      // event report window.
      {
        // We use a timestamp that is before the end of the clamped timestamp.
        // The report would be created even if the event_report_window would not
        // be clamped. However, we can assert that it was by ensuring that the
        // report's report_time is based on the clamped event_report_window.
        // clamped: 86,402 s = 2 s + 86,400 s
        // 86,401,000 ms = clamped - 1 s

        "timestamp": "86401000",
        "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 result in an event-level report as the event report window was
      // not rounded.
      {
        // 88,400,000 ms = 88,400 s (source 456 non-rounded event_report
        // window).
        "timestamp": "88400000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "3"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0001372,
          // 3600 s = 3600 s (clamped event_report_window) delay
          "scheduled_report_time": "3600",
          "source_event_id": "123",
          "source_type": "navigation",
          "trigger_data": "1"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "3600000"
      },
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination.test",
              "source_event_id": "123",
              "source_site": "https://source.test"
            },
            "type": "trigger-event-report-window-passed"
          }
        ],
        "report_time": "3600000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [
            {
              "id": "0",
              "key": "0x11",
              "value": 123
            }
          ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "7199",
            "version": "1.0"
          }
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
        "report_time": "7199000"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [
            {
              "id": "0",
              "key": "0x21",
              "value": 456
            }
          ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "7200",
            "version": "1.0"
          }
        },
        "report_time": "7200000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution"
      },
      {
        "payload": {
          "attribution_destination": "https://destination2.test",
          "randomized_trigger_rate": 0.0000025,
          // 86,r02 s = 2 s (source timestamp) + 86,400 s (clamped
          // event_report_window)
          "scheduled_report_time": "86402",
          "source_event_id": "789",
          "source_type": "event",
          "trigger_data": "0"
        },
        "report_time": "86402000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution"
      },
      {
        "payload": {
          "attribution_destination": "https://destination.test",
          "randomized_trigger_rate": 0.0000025,
          // 88,401 s = 1 s (source timestamp) + 88,400 s (event_report_window)
          "scheduled_report_time": "88401",
          "source_event_id": "456",
          "source_type": "event",
          "trigger_data": "1"
        },
        "report_time": "88401000",
        "report_url": "https://reporter2.test/.well-known/attribution-reporting/report-event-attribution"
      }
    ]
  }
}