chromium/services/tracing/perfetto/test_utils.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SERVICES_TRACING_PERFETTO_TEST_UTILS_H_
#define SERVICES_TRACING_PERFETTO_TEST_UTILS_H_

#include <memory>
#include <string>
#include <vector>

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "base/test/trace_test_utils.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/tracing/perfetto/perfetto_service.h"
#include "services/tracing/perfetto/producer_host.h"
#include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h"
#include "services/tracing/public/cpp/perfetto/producer_client.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/perfetto/include/perfetto/ext/tracing/core/consumer.h"
#include "third_party/perfetto/include/perfetto/tracing/core/trace_config.h"
#include "third_party/perfetto/protos/perfetto/common/observable_events.pb.h"

namespace base {
class RunLoop;
}

namespace tracing {

const char kPerfettoTestString[] =;
const size_t kLargeMessageSize =;

class TestDataSource : public PerfettoTracedProcess::DataSourceBase {};

// This class is owned by PerfettoTracedProcess, and its lifetime is indirectly
// controlled by the handle returned from Create().
class MockProducerClient : public ProducerClient {};

class MockConsumer : public perfetto::Consumer {};

class MockProducerHost : public ProducerHost {};

class MockProducer {};

// Base class for various tracing unit tests, ensuring cleanup of
// PerfettoTracedProcess. Tracing tasks are run on the test thread.
class TracingUnitTest : public testing::Test {};

}  // namespace tracing

#endif  // SERVICES_TRACING_PERFETTO_TEST_UTILS_H_