chromium/components/browsing_data/content/browsing_data_model_unittest.cc

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

#include "components/browsing_data/content/browsing_data_model.h"

#include "base/barrier_closure.h"
#include "base/feature_list.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "components/browsing_data/content/browsing_data_model_test_util.h"
#include "components/browsing_data/content/test_browsing_data_model_delegate.h"
#include "content/public/browser/browser_context.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_storage_partition.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "net/base/schemeful_site.h"
#include "net/cookies/canonical_cookie.h"
#include "net/extras/shared_dictionary/shared_dictionary_usage_info.h"
#include "net/shared_dictionary/shared_dictionary_isolation_key.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/trust_tokens.mojom.h"
#include "services/network/test/test_network_context.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "url/origin.h"

BrowsingDataEntry;
ValidateBrowsingDataEntries;

namespace {

class MockNetworkContext : public network::TestNetworkContext {};

std::unique_ptr<net::CanonicalCookie> MakeCanonicalCookie(
    const std::string& name,
    const std::string& domain,
    std::optional<net::CookiePartitionKey> cookie_partition_key =
        std::nullopt) {}

}  // namespace

class BrowsingDataModelTest : public testing::Test {};

TEST_F(BrowsingDataModelTest, PrimaryHostMapping) {}

TEST_F(BrowsingDataModelTest, EntryCoalescense) {}

TEST_F(BrowsingDataModelTest, ConcurrentDeletions) {}

TEST_F(BrowsingDataModelTest, DelegateDataDeleted) {}

// A BrowsingDataModel::Delegate that marks all Origin-keyed data belonging
// to a given host as being owned by its origin rather than its host.
class OriginOwnershipDelegate final : public BrowsingDataModel::Delegate {};

TEST_F(BrowsingDataModelTest, DelegateDataCanBeOriginOwned) {}

// Tests that the BrowsingDataModel::Iterator can handle when the outer map
// contains an empty inner map.
//
// This is done by inserting an outer map element with an empty value
// for the inner map and then attempting to iterate over the entire model.
TEST_F(BrowsingDataModelTest, IteratorCanHandleEmptyDataKeyEntriesMaps) {}

TEST_F(BrowsingDataModelTest, RemoveBasedOnPartitioning) {}

TEST_F(BrowsingDataModelTest, ThirdPartyCookieTypes) {}

TEST_F(BrowsingDataModelTest, HasThirdPartyPartitioningSite_True) {}

TEST_F(BrowsingDataModelTest, HasThirdPartyPartitioningSite_False) {}

class BrowsingDataModelSharedDictionaryTest : public BrowsingDataModelTest {};

TEST_F(BrowsingDataModelSharedDictionaryTest, GetUsageInfo) {}

TEST_F(BrowsingDataModelSharedDictionaryTest, Delete) {}