#ifndef NET_LOG_TEST_NET_LOG_UTIL_H_
#define NET_LOG_TEST_NET_LOG_UTIL_H_
#include <stddef.h>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "net/log/net_log_event_type.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
struct NetLogEntry;
::testing::AssertionResult LogContainsEvent(
const std::vector<NetLogEntry>& entries,
int offset,
NetLogEventType expected_event,
NetLogEventPhase expected_phase);
::testing::AssertionResult LogContainsBeginEvent(
const std::vector<NetLogEntry>& entries,
int offset,
NetLogEventType expected_event);
::testing::AssertionResult LogContainsEndEvent(
const std::vector<NetLogEntry>& entries,
int offset,
NetLogEventType expected_event);
::testing::AssertionResult LogContainsEntryWithType(
const std::vector<NetLogEntry>& entries,
int offset,
NetLogEventType type);
::testing::AssertionResult LogContainsEntryWithTypeAfter(
const std::vector<NetLogEntry>& entries,
int start_offset,
NetLogEventType type);
size_t ExpectLogContainsSomewhere(const std::vector<NetLogEntry>& entries,
size_t min_offset,
NetLogEventType expected_event,
NetLogEventPhase expected_phase);
size_t ExpectLogContainsSomewhereAfter(const std::vector<NetLogEntry>& entries,
size_t start_offset,
NetLogEventType expected_event,
NetLogEventPhase expected_phase);
std::optional<std::string> GetOptionalStringValueFromParams(
const NetLogEntry& entry,
std::string_view path);
std::optional<bool> GetOptionalBooleanValueFromParams(const NetLogEntry& entry,
std::string_view path);
std::optional<int> GetOptionalIntegerValueFromParams(const NetLogEntry& entry,
std::string_view path);
std::optional<int> GetOptionalNetErrorCodeFromParams(const NetLogEntry& entry);
std::string GetStringValueFromParams(const NetLogEntry& entry,
std::string_view path);
int GetIntegerValueFromParams(const NetLogEntry& entry, std::string_view path);
bool GetBooleanValueFromParams(const NetLogEntry& entry, std::string_view path);
int GetNetErrorCodeFromParams(const NetLogEntry& entry);
}
#endif