#include "components/metrics/call_stacks/call_stack_profile_builder.h"
#include <memory>
#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/profiler/call_stack_profile_params.h"
#include "base/profiler/module_cache.h"
#include "base/profiler/process_type.h"
#include "base/profiler/stack_sampling_profiler_test_util.h"
#include "base/test/bind.h"
#include "base/test/mock_callback.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/sampled_profile.pb.h"
namespace metrics {
namespace {
constexpr base::CallStackProfileParams kProfileParams = …;
class TestingCallStackProfileBuilder : public CallStackProfileBuilder { … };
TestingCallStackProfileBuilder::TestingCallStackProfileBuilder(
const base::CallStackProfileParams& profile_params,
const WorkIdRecorder* work_id_recorder,
base::OnceClosure completed_callback)
: … { … }
TestingCallStackProfileBuilder::~TestingCallStackProfileBuilder() = default;
void TestingCallStackProfileBuilder::PassProfilesToMetricsProvider(
base::TimeTicks profile_start_time,
SampledProfile sampled_profile) { … }
}
TEST(CallStackProfileBuilderTest, ProfilingCompleted) { … }
TEST(CallStackProfileBuilderTest, CustomWeightsAndCounts) { … }
TEST(CallStackProfileBuilderTest, StacksDeduped) { … }
TEST(CallStackProfileBuilderTest, StacksNotDeduped) { … }
TEST(CallStackProfileBuilderTest, Modules) { … }
TEST(CallStackProfileBuilderTest, DedupModules) { … }
TEST(CallStackProfileBuilderTest, WorkIds) { … }
TEST(CallStackProfileBuilderTest, ProfileStartTime) { … }
TEST(CallStackProfileBuilderTest, RecordMetadata) { … }
TEST(CallStackProfileBuilderTest, ApplyMetadataRetrospectively_Basic) { … }
TEST(CallStackProfileBuilderTest,
ApplyMetadataRetrospectively_BeforeStartTime) { … }
}