chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc

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

#include <string>

#include "base/location.h"
#include "base/strings/strcat.h"
#include "base/test/bind.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/schemeful_site.h"
#include "net/network_error_logging/mock_persistent_nel_store.h"
#include "net/network_error_logging/network_error_logging_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"

namespace net {

namespace {

NetworkErrorLoggingService::NelPolicy MakePolicy(
    const url::Origin& origin,
    const net::NetworkAnonymizationKey& network_anonymization_key) {}

void RunClosureOnNelPoliciesLoaded(
    base::OnceClosure closure,
    std::vector<NetworkErrorLoggingService::NelPolicy>* policies_out,
    std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies) {}

// Makes a NelPoliciesLoadedCallback that will fail if it's never run before
// destruction.
MockPersistentNelStore::NelPoliciesLoadedCallback
MakeExpectedRunNelPoliciesLoadedCallback(
    std::vector<NetworkErrorLoggingService::NelPolicy>* policies_out) {}

class MockPersistentNelStoreTest : public testing::Test {};

// Test that FinishLoading() runs the callback.
TEST_F(MockPersistentNelStoreTest, FinishLoading) {}

TEST_F(MockPersistentNelStoreTest, PreStoredPolicies) {}

// Failed load should yield empty vector of policies.
TEST_F(MockPersistentNelStoreTest, FailedLoad) {}

TEST_F(MockPersistentNelStoreTest, Add) {}

TEST_F(MockPersistentNelStoreTest, AddThenDelete) {}

TEST_F(MockPersistentNelStoreTest, AddFlushThenDelete) {}

TEST_F(MockPersistentNelStoreTest, AddThenUpdate) {}

}  // namespace

}  // namespace net