#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "services/tracing/public/cpp/perfetto/traced_value_proto_writer.h"
#include <memory>
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/trace_event/traced_value.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/perfetto/include/perfetto/protozero/scattered_heap_buffer.h"
#include "third_party/perfetto/include/perfetto/protozero/scattered_stream_writer.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/debug_annotation.pb.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
#include "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.h"
TracedValue;
namespace tracing {
namespace {
DebugAnnotation;
NestedValue;
class ProtoInputStream : public google::protobuf::io::ZeroCopyInputStream { … };
class TracedValueProtoWriterTest : public testing::Test { … };
const NestedValue* FindDictEntry(const NestedValue* dict, const char* name) { … }
bool IsValue(const NestedValue* proto_value, bool value) { … }
bool IsValue(const NestedValue* proto_value, double value) { … }
bool IsValue(const NestedValue* proto_value, int value) { … }
bool IsValue(const NestedValue* proto_value, const char* value) { … }
NestedValue GetProtoFromTracedValue(TracedValue* traced_value) { … }
TEST_F(TracedValueProtoWriterTest, FlatDictionary) { … }
TEST_F(TracedValueProtoWriterTest, NoDotPathExpansion) { … }
TEST_F(TracedValueProtoWriterTest, Hierarchy) { … }
TEST_F(TracedValueProtoWriterTest, LongStrings) { … }
TEST_F(TracedValueProtoWriterTest, ProtoMessageBoundaries) { … }
TEST_F(TracedValueProtoWriterTest, PassTracedValue) { … }
}
}