chromium/content/browser/loader/keep_alive_attribution_request_helper_unittest.cc

// Copyright 2024 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/loader/keep_alive_attribution_request_helper.h"

#include <memory>
#include <optional>
#include <utility>

#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/to_string.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "components/attribution_reporting/constants.h"
#include "components/attribution_reporting/registration_eligibility.mojom-shared.h"
#include "components/attribution_reporting/suitable_origin.h"
#include "content/browser/attribution_reporting/attribution_background_registrations_id.h"
#include "content/browser/attribution_reporting/attribution_data_host_manager.h"
#include "content/browser/attribution_reporting/attribution_data_host_manager_impl.h"
#include "content/browser/attribution_reporting/attribution_os_level_manager.h"
#include "content/browser/attribution_reporting/attribution_suitable_context.h"
#include "content/browser/attribution_reporting/attribution_test_utils.h"
#include "content/browser/attribution_reporting/test/mock_attribution_manager.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/test/test_renderer_host.h"
#include "content/test/test_web_contents.h"
#include "net/http/http_response_headers.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/attribution.mojom-shared.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "url/gurl.h"
#include "url/origin.h"

namespace content {

class KeepAliveAttributionRequestHelperTestPeer {};

namespace {

SuitableOrigin;
RegistrationEligibility;
AttributionReportingEligibility;
_;
AllOf;
Property;
Return;

constexpr char kRegisterSourceJson[] =;
constexpr char kRegisterTriggerJson[] =;

kAttributionReportingRegisterOsSourceHeader;
kAttributionReportingRegisterOsTriggerHeader;
kAttributionReportingRegisterSourceHeader;
kAttributionReportingRegisterTriggerHeader;

class KeepAliveAttributionRequestHelperTest : public RenderViewHostTestHarness {};

TEST_F(KeepAliveAttributionRequestHelperTest, SingleResponse) {}

TEST_F(KeepAliveAttributionRequestHelperTest, NavigationSource) {}

TEST_F(KeepAliveAttributionRequestHelperTest, ExtraResponsesAreIgnored) {}

TEST_F(KeepAliveAttributionRequestHelperTest,
       UnexpectedResponsesWillBeIgnored) {}

TEST_F(KeepAliveAttributionRequestHelperTest, NoAttributionHeader) {}

TEST_F(KeepAliveAttributionRequestHelperTest, Cleanup) {}

TEST_F(KeepAliveAttributionRequestHelperTest, RedirectChain) {}

TEST_F(KeepAliveAttributionRequestHelperTest, HelperNotNeeded) {}

TEST_F(KeepAliveAttributionRequestHelperTest, Eligibility) {}

}  // namespace
}  // namespace content