#include "net/log/trace_net_log_observer.h"
#include <memory>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/task_environment.h"
#include "base/trace_event/trace_buffer.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_impl.h"
#include "base/values.h"
#include "net/log/net_log.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source_type.h"
#include "net/log/net_log_with_source.h"
#include "net/log/test_net_log.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
TraceLog;
namespace net {
namespace {
const char kNetLogTracingCategory[] = …;
struct TraceEntryInfo { … };
TraceEntryInfo GetTraceEntryInfoFromValue(const base::Value::Dict& value) { … }
void EnableTraceLog(std::string_view category) { … }
void DisableTraceLog() { … }
void EnableTraceLogWithNetLog() { … }
void EnableTraceLogWithoutNetLog() { … }
class TraceNetLogObserverTest : public TestWithTaskEnvironment { … };
TEST_F(TraceNetLogObserverTest, TracingNotEnabled) { … }
TEST_F(TraceNetLogObserverTest, TraceEventCaptured) { … }
TEST_F(TraceNetLogObserverTest, EnableAndDisableTracing) { … }
TEST_F(TraceNetLogObserverTest, DestroyObserverWhileTracing) { … }
TEST_F(TraceNetLogObserverTest, DestroyObserverWhileNotTracing) { … }
TEST_F(TraceNetLogObserverTest, CreateObserverAfterTracingStarts) { … }
TEST_F(TraceNetLogObserverTest,
CreateObserverAfterTracingStartsDisabledCategory) { … }
TEST_F(TraceNetLogObserverTest, EventsWithAndWithoutParameters) { … }
TEST(TraceNetLogObserverCategoryTest, DisabledCategory) { … }
TEST(TraceNetLogObserverCategoryTest, EnabledCategory) { … }
}
}