#include "services/tracing/perfetto/system_test_utils.h"
#include <cstdio>
#include "base/files/scoped_temp_dir.h"
#include "base/task/sequenced_task_runner.h"
#include "services/tracing/perfetto/test_utils.h"
#include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h"
#include "third_party/perfetto/include/perfetto/ext/tracing/core/commit_data_request.h"
#include "third_party/perfetto/include/perfetto/ext/tracing/ipc/service_ipc_host.h"
#include "third_party/perfetto/protos/perfetto/common/commit_data_request.pb.h"
namespace tracing {
MockSystemService::MockSystemService(const std::string& consumer_socket,
const std::string& producer_socket)
: … { … }
MockSystemService::MockSystemService(const base::ScopedTempDir& tmp_dir)
: … { … }
MockSystemService::MockSystemService(
const base::ScopedTempDir& tmp_dir,
std::unique_ptr<perfetto::base::TaskRunner> task_runner)
: … { … }
MockSystemService::~MockSystemService() { … }
void MockSystemService::StartService() { … }
const std::string& MockSystemService::consumer() const { … }
const std::string& MockSystemService::producer() const { … }
perfetto::TracingService* MockSystemService::GetService() { … }
MockPosixSystemProducer::MockPosixSystemProducer(
const std::string& socket,
bool check_sdk_level,
uint32_t num_data_sources,
base::OnceClosure data_source_enabled_callback,
base::OnceClosure data_source_disabled_callback,
bool sandbox_forbids_socket_connection)
: … { … }
MockPosixSystemProducer::~MockPosixSystemProducer() { … }
void MockPosixSystemProducer::StartDataSource(
perfetto::DataSourceInstanceID id,
const perfetto::DataSourceConfig& data_source_config) { … }
void MockPosixSystemProducer::StopDataSource(
perfetto::DataSourceInstanceID id) { … }
void MockPosixSystemProducer::SetDataSourceEnabledCallback(
base::OnceClosure data_source_enabled_callback) { … }
void MockPosixSystemProducer::SetDataSourceDisabledCallback(
base::OnceClosure data_source_disabled_callback) { … }
bool MockPosixSystemProducer::SandboxForbidsSocketConnection() { … }
}