tree: 9f8f5ad52d5b3c2e3de60222499949a2cfaab623 [path history] [tgz]
  1. aggregatable_budget.json
  2. aggregatable_contributions_creation.json
  3. aggregatable_contributions_with_filtering_ids.json
  4. aggregatable_debug_reports.json
  5. aggregatable_debug_reports_limits.json
  6. aggregatable_debug_reports_trigger.json
  7. aggregatable_debug_reports_with_filtering_ids.json
  8. aggregatable_dedup_key.json
  9. aggregatable_large_key.json
  10. aggregatable_named_budgets.json
  11. aggregatable_named_budgets_parsing_failures.json
  12. aggregatable_report_source_registration_time.json
  13. aggregatable_report_trigger_context_id.json
  14. aggregatable_report_window.json
  15. aggregatable_reports_fake_source.json
  16. aggregatable_storage_limit.json
  17. aggregatable_values_filtering.json
  18. aggregatable_with_event_disabled.json
  19. aggregation_coordinator_origin.json
  20. aggregation_key_identifier_length.json
  21. attribution_destination_sorting.json
  22. attribution_scopes_basic.json
  23. attribution_scopes_different_max_event_states.json
  24. attribution_scopes_max_event_states_limit.json
  25. attribution_scopes_multiple_trigger_scopes.json
  26. attribution_scopes_navigation_limit_no_scopes.json
  27. attribution_scopes_navigation_limit_with_scopes.json
  28. attribution_scopes_null_scopes_incoming_data_interaction.json
  29. attribution_scopes_null_scopes_removes_data.json
  30. attribution_scopes_older_scopes_removed.json
  31. attribution_scopes_older_scopes_removed_2.json
  32. attribution_scopes_parsing_failures.json
  33. attribution_scopes_smaller_scope_limit.json
  34. basic.json
  35. basic_aggregatable.json
  36. basic_disconnected.json
  37. basic_retry.json
  38. channel_capacity.json
  39. clamp_aggregatable_report_window.json
  40. clamp_event_report_window.json
  41. clamp_expiry.json
  42. custom_trigger_data.json
  43. dedup_key.json
  44. dedup_key_report_window_ordering.json
  45. deduplication_sequence.json
  46. default_config.json
  47. destination_limit.json
  48. destination_public_suffix.json
  49. destination_rate_limit.json
  50. destination_validation.json
  51. event_level_attribution_rate_limit_replacement.json
  52. event_level_epsilon.json
  53. event_level_report_time.json
  54. event_level_storage_limit.json
  55. event_level_storage_limit_replacement.json
  56. event_level_trigger_filter_data.json
  57. event_level_trigger_priority.json
  58. event_report_window.json
  59. event_report_windows.json
  60. event_report_windows_int_max.json
  61. event_source.json
  62. event_source_event_report_windows.json
  63. event_source_rounds_expiry.json
  64. event_source_trigger_priority.json
  65. expired_source.json
  66. fenced.json
  67. filter_data_validation.json
  68. header_presence.json
  69. lookback_window_int_max.json
  70. lookback_window_precision.json
  71. max_aggregatable_reports_per_source.json
  72. max_event_level_reports_per_source.json
  73. max_trigger_state_cardinality.json
  74. most_recent_source.json
  75. multiple_destinations.json
  76. navigation_retry_first_attempt.json
  77. navigation_retry_second_attempt.json
  78. navigation_retry_third_attempt.json
  79. null_aggregatable_report.json
  80. os_debug_reports.json
  81. parse_failures.json
  82. preferred_platform.json
  83. prio_dup.json
  84. randomized_response_0_reports.json
  85. randomized_response_1_report.json
  86. rate_limit_max_attribution_reporting_endpoints.json
  87. rate_limit_max_attributions.json
  88. rate_limit_max_distinct_reporting_origins_per_source_reporting_site.json
  89. rate_limit_max_reporting_origins_per_source_reporting_site.json
  90. rate_limit_max_source_registration_reporting_origin_endpoints.json
  91. rate_limit_max_source_reporting_origin_ignores_expiry.json
  92. README.md
  93. redirect_source_trigger.json
  94. same_destination_site.json
  95. same_reporting_origin.json
  96. source_deactivation.json
  97. source_destination_limit_aggregatable_debug.json
  98. source_destination_limit_fifo.json
  99. source_destination_limit_fifo_and_destination_rate_limit.json
  100. source_destination_limit_fifo_rate_limits.json
  101. source_destination_limit_priority_fifo.json
  102. source_destination_limits.json
  103. source_header_error_debug_report.json
  104. source_priority.json
  105. source_registration_limits.json
  106. source_storage_limit.json
  107. source_storage_limit_and_destination_rate_limit.json
  108. source_storage_limit_expiry.json
  109. success_debug_aggregatable.json
  110. success_debug_event_level.json
  111. top_level_filter_data.json
  112. trigger_data_matching.json
  113. trigger_data_sanitization.json
  114. trigger_header_error_debug_report.json
  115. trigger_verbose_debug_report_source_debug_permission.json
  116. unsuitable_response_url.json
  117. verbose_debug_report_multiple_data.json
content/test/data/attribution_reporting/interop/README.md

Interop Tests

This directory contains a set of tests which ensure the attribution logic as implemented matches the intended behavior of the Attribution Reporting API.

See https://wicg.github.io/attribution-reporting-api/ for the draft specification.

See //content/browser/attribution_reporting/interop/interop_unittest.cc for the tests.

These tests are purposefully not implemented as web platform tests, so that they can be shared by non-web-based platforms.

The tests here cover how the browser will handle various series of sources and triggers with different configurations, but does not rely on any blink APIs.

The vendor-specific parameters can be configured for testing. The default configuration is specified in default_config.json that is contained in this directory. Each test file can optionally specify the parameters in the “api_config” field.

Configuration format

The JSON schema is as follows. All the fields are required in “default_config.json” and optional in “api_config” field. See the schema in “default_config.json”.

Test case format

The JSON schema is as follows. Timestamps must be distinct across all sources and triggers.

{
  "description": "description",

  // Optional configuration.
  "api_config": {},

  // Required input.
  "input": {
    // List of zero or more registrations.
    "registrations": [
      {
        // Required time at which to register in milliseconds since
        // the UNIX epoch formatted as a base-10 string.
        "timestamp": "123",

        "registration_request": {
          // Required origin on which to register.
          "context_origin": "https://context.example",

          // A structured dictionary indicating which registrations the
          // responses are eligible for.
          // https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#registration-requests
          "Attribution-Reporting-Eligible": "navigation-source",

          // Whether the request originated from a fenced frame.
          // Defaults to false.
          // https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#verbose-debugging-reports
          "fenced": false
        },

        // List of URLs and the corresponding responses.
        "responses": [
          {
            // Required URL from which the response was sent.
            "url": "https://reporting.example",

            // Whether the registration will be processed with debug permission
            // enabled. Defaults to false.
            "debug_permission": true,

            // Optional for the first response in the list, but required for all
            // subsequent ones. If absent, defaults to the registration's
            // timestamp.
            "timestamp": "456",

            // If present and non-null, the source's randomized response,
            // consisting of zero of more fake reports. Defaults to null. Length
            // must be <= the source's max_event_level_reports. Ignored for
            // triggers.
            "randomized_response": [
              {
                // The fake report's trigger data. Must be a uint32 exactly
                // matching a value in the source's trigger specs.
                "trigger_data": 1,

                // The fake report's report window index. Must be a non-negative
                // integer less than the source's number of report windows.
                "report_window_index": 0
              }
            ],

            // If present and non-null, the lookback days that would create null
            // aggregatable reports. Defaults to null. Ignored for sources.
            "null_aggregatable_reports_days": [1, 5]

            // Exactly one of the registration fields must be present. See
            // https://github.com/WICG/attribution-reporting-api for the
            // complete schema.
            "response": {
              "Attribution-Reporting-Register-Source": { ... },

              "Attribution-Reporting-Register-Trigger": { ... },

              "Attribution-Reporting-Info": "..."
            }
          }
        ]
      }
    ]
  },

  // Expected output.
  "output": {
    "reports": [
      {
        // URL to which the report would have been sent.
        "report_url": "https://reporting.example/.well-known/attribution-reporting/report-event-attribution",

        // Time at which the report would have been sent in milliseconds since
        // the UNIX epoch.
        "report_time": "123",

        "payload": ...
      }
    ]
  }
}