chromium/content/browser/attribution_reporting/rate_limit_table_unittest.cc

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

#include "content/browser/attribution_reporting/rate_limit_table.h"

#include <stdint.h>

#include <limits>
#include <optional>
#include <ostream>
#include <string>
#include <utility>
#include <vector>

#include "base/check_op.h"
#include "base/containers/flat_map.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/attribution_reporting/source_type.mojom.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "content/browser/attribution_reporting/attribution_info.h"
#include "content/browser/attribution_reporting/attribution_test_utils.h"
#include "content/browser/attribution_reporting/rate_limit_result.h"
#include "content/browser/attribution_reporting/stored_source.h"
#include "content/browser/attribution_reporting/test/configurable_storage_delegate.h"
#include "content/public/browser/attribution_data_model.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/schemeful_site.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"

namespace content {

namespace {

RateLimitScope;

SuitableOrigin;

_;
ElementsAre;
Field;
IsEmpty;
Pair;
SizeIs;

constexpr base::TimeDelta kExpiry =;
constexpr AttributionReport::Id kReportId(1);

struct RateLimitInput {};

struct RateLimitRow {};

std::ostream& operator<<(std::ostream& out, const RateLimitScope scope) {}

std::ostream& operator<<(std::ostream& out, const RateLimitInput& i) {}

std::ostream& operator<<(std::ostream& out, const RateLimitRow& row) {}

class RateLimitTableTest : public testing::Test {};

}  // namespace

// Tests that attribution counts are scoped to <source site, destination site,
// reporting origin> in the correct time window.
TEST_F(RateLimitTableTest,
       AttributionAllowedForAttributionCountLimit_ScopedCorrectly) {}

TEST_F(RateLimitTableTest,
       AttributionAllowedForAttributionCountLimit_SourceTypesCombined) {}

TEST_F(RateLimitTableTest,
       AttributionAllowedForAttributionRateLimit_SeparateReportTypes) {}

namespace {

// The following loop iterations are *not* independent: Each one depends on
// the correct handling of the previous one.
const struct {} kReportingOriginRateLimitsToAdd[] =;

}  // namespace

TEST_F(RateLimitTableTest, SourceAllowedForReportingOriginLimit) {}

TEST_F(RateLimitTableTest,
       SourceAllowedForReportingOriginPerSourceReportingSiteLimit) {}

TEST_F(RateLimitTableTest, AttributionAllowedForReportingOriginLimit) {}

TEST_F(RateLimitTableTest,
       ReportingOriginLimits_IndependentForSourcesAndAttributions) {}

TEST_F(RateLimitTableTest, DeleteAttributionRateLimit) {}

TEST_F(RateLimitTableTest, ClearAllDataAllTime) {}

TEST_F(RateLimitTableTest, ClearDataForOriginsInRange) {}

TEST_F(RateLimitTableTest, AddRateLimit_DeletesExpiredRows) {}

TEST_F(RateLimitTableTest, AddRateLimitSource_OneRowPerDestination) {}

TEST_F(RateLimitTableTest, AddFakeSourceForAttribution_OneRowPerDestination) {}

TEST_F(RateLimitTableTest, AddRateLimitSource_DeletesExpiredRows) {}

TEST_F(RateLimitTableTest, ClearDataForSourceIds) {}

TEST_F(RateLimitTableTest, DestinationRateLimitSourceLimits) {}

TEST_F(RateLimitTableTest, DestinationRateLimitReportingSitesLimits) {}

TEST_F(RateLimitTableTest, DestinationRateLimitMultipleOverLimit) {}

TEST_F(RateLimitTableTest, DestinationRateLimitRollingWindow) {}

TEST_F(RateLimitTableTest, DestinationRateLimitSourceExpiry) {}

TEST_F(RateLimitTableTest, DestinationRateLimitHitBothLimits) {}

TEST_F(RateLimitTableTest, SourceDestinationLimit) {}

TEST_F(RateLimitTableTest, SourceDestinationLimitPriority) {}

TEST_F(RateLimitTableTest, DeactivateSourcesForDestinationLimit) {}

TEST_F(RateLimitTableTest, DestinationPerDayRateLimit) {}

TEST_F(RateLimitTableTest, DestinationPerDayRateLimitSourceExpiry) {}

TEST_F(RateLimitTableTest, GetAttributionDataKeyList) {}

}  // namespace content