#include "components/history/core/browser/web_history_service.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Return;
namespace history {
namespace {
class TestingWebHistoryService : public WebHistoryService { … };
class TestRequest : public WebHistoryService::Request { … };
WebHistoryService::Request* TestingWebHistoryService::CreateRequest(
const GURL& url,
CompletionCallback callback,
const net::PartialNetworkTrafficAnnotationTag& partial_traffic_annotation) { … }
std::optional<base::Value::Dict> TestingWebHistoryService::ReadResponse(
Request* request) { … }
void TestingWebHistoryService::SetAudioHistoryCallback(
bool success, bool new_enabled_value) { … }
void TestingWebHistoryService::GetAudioHistoryCallback(
bool success, bool new_enabled_value) { … }
void TestingWebHistoryService::MultipleRequestsCallback(
bool success, bool new_enabled_value) { … }
const std::string& TestingWebHistoryService::GetExpectedPostData(
Request* request) { … }
std::string TestingWebHistoryService::GetExpectedAudioHistoryValue() { … }
}
class WebHistoryServiceTest : public testing::Test { … };
TEST_F(WebHistoryServiceTest, GetAudioHistoryEnabled) { … }
TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledTrue) { … }
TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledFalse) { … }
TEST_F(WebHistoryServiceTest, MultipleRequests) { … }
TEST_F(WebHistoryServiceTest, VerifyReadResponse) { … }
}