#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/services/auction_worklet/worklet_devtools_debug_test_util.h"
#include <string>
#include <utility>
#include <vector>
#include "base/json/json_reader.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/inspector_protocol/crdtp/cbor.h"
#include "third_party/inspector_protocol/crdtp/json.h"
#include "third_party/inspector_protocol/crdtp/span.h"
namespace auction_worklet {
namespace {
crdtp::span<uint8_t> ToSpan(const mojo_base::BigBuffer& buffer) { … }
crdtp::span<uint8_t> ToSpan(const std::string& string) { … }
std::string ToString(const std::vector<uint8_t>& vector) { … }
std::string ToString(crdtp::span<uint8_t> span) { … }
}
TestDevToolsAgentClient::TestDevToolsAgentClient(
mojo::AssociatedRemote<blink::mojom::DevToolsAgent> agent,
std::string session_id,
bool use_binary_protocol)
: … { … }
TestDevToolsAgentClient::~TestDevToolsAgentClient() = default;
void TestDevToolsAgentClient::RunCommand(Channel channel,
int call_id,
std::string method,
std::string payload) { … }
TestDevToolsAgentClient::Event
TestDevToolsAgentClient::RunCommandAndWaitForResult(Channel channel,
int call_id,
std::string method,
std::string payload) { … }
TestDevToolsAgentClient::Event TestDevToolsAgentClient::WaitForEvent(
const EventPredicate& predicate) { … }
TestDevToolsAgentClient::Event
TestDevToolsAgentClient::WaitForMethodNotification(std::string method) { … }
void TestDevToolsAgentClient::DispatchProtocolResponse(
blink::mojom::DevToolsMessagePtr message,
int32_t call_id,
blink::mojom::DevToolsSessionStatePtr updates) { … }
void TestDevToolsAgentClient::DispatchProtocolNotification(
blink::mojom::DevToolsMessagePtr message,
blink::mojom::DevToolsSessionStatePtr updates) { … }
void TestDevToolsAgentClient::LogEvent(
Event::Type type,
int call_id,
blink::mojom::DevToolsMessagePtr message) { … }
std::string MakeInstrumentationBreakpointCommand(int seq_number,
const char* verb,
const char* event_name) { … }
}