#include "src/tracing/core/trace_writer_impl.h"
#include <vector>
#include "perfetto/ext/base/utils.h"
#include "perfetto/ext/tracing/core/commit_data_request.h"
#include "perfetto/ext/tracing/core/shared_memory_abi.h"
#include "perfetto/ext/tracing/core/trace_writer.h"
#include "perfetto/ext/tracing/core/tracing_service.h"
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/proto_utils.h"
#include "perfetto/protozero/scattered_stream_writer.h"
#include "src/base/test/gtest_test_suite.h"
#include "src/base/test/test_task_runner.h"
#include "src/tracing/core/shared_memory_arbiter_impl.h"
#include "src/tracing/test/aligned_buffer_test.h"
#include "src/tracing/test/mock_producer_endpoint.h"
#include "test/gtest_and_gmock.h"
#include "protos/perfetto/trace/test_event.gen.h"
#include "protos/perfetto/trace/test_event.pbzero.h"
#include "protos/perfetto/trace/trace_packet.gen.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"
namespace perfetto {
namespace {
ChunkHeader;
ShmemMode;
ScatteredStreamWriter;
AllOf;
ElementsAre;
IsEmpty;
IsNull;
MockFunction;
Ne;
NiceMock;
Not;
NotNull;
Optional;
SizeIs;
ValuesIn;
class TraceWriterImplTest : public AlignedBufferTest { … };
size_t const kPageSizes[] = …;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(TraceWriterImplTest, NewTracePacket) { … }
TEST_P(TraceWriterImplTest, NewTracePacketLargePackets) { … }
constexpr char kFirstPacketOnSequenceFlagPrefix[] = …;
TEST_P(TraceWriterImplTest, NewTracePacketTakeWriter) { … }
#if defined(GTEST_HAS_DEATH_TEST)
TraceWriterImplDeathTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(TraceWriterImplDeathTest, NewTracePacketTakeWriterNoFinish) { … }
#endif
TEST_P(TraceWriterImplTest, AnnotatePatch) { … }
TEST_P(TraceWriterImplTest, MixManualTakeAndMessage) { … }
TEST_P(TraceWriterImplTest, MessageHandleDestroyedPacketScrapable) { … }
TEST_P(TraceWriterImplTest, FinishTracePacketScrapable) { … }
TEST_P(TraceWriterImplTest,
MessageHandleDestroyedAndFinishTracePacketScrapable) { … }
TEST_P(TraceWriterImplTest, MessageHandleDestroyedPacketFullChunk) { … }
TEST_P(TraceWriterImplTest, FinishTracePacketFullChunk) { … }
TEST_P(TraceWriterImplTest, FragmentingPacketWithProducerAndServicePatching) { … }
TEST_P(TraceWriterImplTest, FragmentingPacketWithoutEnablingProducerPatching) { … }
TEST_P(TraceWriterImplTest, FragmentingPacketWhileBufferExhausted) { … }
TEST_P(TraceWriterImplTest, FlushBeforeBufferExhausted) { … }
TEST_P(TraceWriterImplTest, FlushAfterFragmentingPacketWhileBufferExhausted) { … }
TEST_P(TraceWriterImplTest, GarbageChunkWrap) { … }
TEST_P(TraceWriterImplTest, AnnotatePatchWhileBufferExhausted) { … }
TEST_P(TraceWriterImplTest, Flush) { … }
TEST_P(TraceWriterImplTest, NestedMsgsPatches) { … }
}
}