#ifndef CONTENT_SERVICES_AUCTION_WORKLET_WORKLET_TEST_UTIL_H_
#define CONTENT_SERVICES_AUCTION_WORKLET_WORKLET_TEST_UTIL_H_
#include <optional>
#include <string>
#include <vector>
#include "base/types/optional_ref.h"
#include "content/services/auction_worklet/public/mojom/auction_network_events_handler.mojom.h"
#include "content/services/auction_worklet/public/mojom/auction_shared_storage_host.mojom.h"
#include "net/http/http_status_code.h"
#include "services/network/test/test_url_loader_factory.h"
#include "url/gurl.h"
namespace base {
class WaitableEvent;
}
namespace auction_worklet {
class AuctionV8Helper;
extern const char kJavascriptMimeType[];
extern const char kJsonMimeType[];
extern const char kWasmMimeType[];
extern const char kAdAuctionTrustedSignalsMimeType[];
extern const char kAllowFledgeHeader[];
void AddResponse(network::TestURLLoaderFactory* url_loader_factory,
const GURL& url,
std::optional<std::string> mime_type,
std::optional<std::string> charset,
const std::string content,
std::optional<std::string> headers = kAllowFledgeHeader,
net::HttpStatusCode http_status = net::HTTP_OK,
network::TestURLLoaderFactory::Redirects redirects =
network::TestURLLoaderFactory::Redirects());
void AddJavascriptResponse(
network::TestURLLoaderFactory* url_loader_factory,
const GURL& url,
const std::string& content,
base::optional_ref<const std::string> extra_headers = std::nullopt);
void AddJsonResponse(network::TestURLLoaderFactory* url_loader_factory,
const GURL& url,
const std::string content);
void AddVersionedJsonResponse(network::TestURLLoaderFactory* url_loader_factory,
const GURL& url,
const std::string content,
uint32_t data_version);
void AddBidderJsonResponse(
network::TestURLLoaderFactory* url_loader_factory,
const GURL& url,
const std::string content,
std::optional<uint32_t> data_version = std::nullopt,
const std::optional<std::string>& format_version_string = "2");
base::WaitableEvent* WedgeV8Thread(AuctionV8Helper* v8_helper);
class TestAuctionSharedStorageHost : public mojom::AuctionSharedStorageHost { … };
class TestAuctionNetworkEventsHandler
: public mojom::AuctionNetworkEventsHandler { … };
}
#endif