#include "src/tracing/test/mock_producer.h"
#include "perfetto/ext/tracing/core/client_identity.h"
#include "perfetto/ext/tracing/core/trace_writer.h"
#include "perfetto/ext/tracing/core/tracing_service.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
#include "perfetto/tracing/core/data_source_config.h"
#include "perfetto/tracing/core/data_source_descriptor.h"
#include "protos/perfetto/common/track_event_descriptor.pbzero.h"
#include "src/base/test/test_task_runner.h"
_;
Eq;
Invoke;
InvokeWithoutArgs;
Property;
namespace perfetto {
namespace {
static DataSourceDescriptor CreateDataSourceDescriptor(
const std::initializer_list<std::string>& categories,
uint32_t id) { … }
}
MockProducer::MockProducer(base::TestTaskRunner* task_runner)
: … { … }
MockProducer::~MockProducer() { … }
void MockProducer::Connect(TracingService* svc,
const std::string& producer_name,
uid_t uid,
pid_t pid,
size_t shared_memory_size_hint_bytes,
size_t shared_memory_page_size_hint_bytes,
std::unique_ptr<SharedMemory> shm) { … }
void MockProducer::RegisterDataSource(const std::string& name,
bool ack_stop,
bool ack_start,
bool handle_incremental_state_clear,
bool no_flush) { … }
void MockProducer::UnregisterDataSource(const std::string& name) { … }
void MockProducer::RegisterTrackEventDataSource(
const std::initializer_list<std::string>& categories,
uint32_t id) { … }
void MockProducer::UpdateTrackEventDataSource(
const std::initializer_list<std::string>& categories,
uint32_t id) { … }
void MockProducer::RegisterTraceWriter(uint32_t writer_id,
uint32_t target_buffer) { … }
void MockProducer::UnregisterTraceWriter(uint32_t writer_id) { … }
void MockProducer::WaitForTracingSetup() { … }
void MockProducer::WaitForDataSourceSetup(const std::string& name) { … }
void MockProducer::WaitForDataSourceStart(const std::string& name) { … }
void MockProducer::WaitForDataSourceStop(const std::string& name) { … }
std::unique_ptr<TraceWriter> MockProducer::CreateTraceWriter(
const std::string& data_source_name) { … }
void MockProducer::ExpectFlush(TraceWriter* writer_to_flush,
bool reply,
FlushFlags expected_flags) { … }
void MockProducer::ExpectFlush(std::vector<TraceWriter*> writers_to_flush,
bool reply,
FlushFlags expected_flags) { … }
DataSourceInstanceID MockProducer::GetDataSourceInstanceId(
const std::string& name) { … }
const MockProducer::EnabledDataSource* MockProducer::GetDataSourceInstance(
const std::string& name) { … }
}