chromium/components/metrics/call_stacks/call_stack_profile_builder_unittest.cc

// 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.

#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) {}

}  // namespace

TEST(CallStackProfileBuilderTest, ProfilingCompleted) {}

TEST(CallStackProfileBuilderTest, CustomWeightsAndCounts) {}

TEST(CallStackProfileBuilderTest, StacksDeduped) {}

TEST(CallStackProfileBuilderTest, StacksNotDeduped) {}

TEST(CallStackProfileBuilderTest, Modules) {}

TEST(CallStackProfileBuilderTest, DedupModules) {}

TEST(CallStackProfileBuilderTest, WorkIds) {}

TEST(CallStackProfileBuilderTest, ProfileStartTime) {}

// A basic test of RecordMetadata at the level of the
// CallStackProfileBuilder. The underlying implementation in
// CallStackProfileMetadata is tested independently.
TEST(CallStackProfileBuilderTest, RecordMetadata) {}

// A basic test of ApplyMetadataRetrospectively at the level of the
// CallStackProfileBuilder. The underlying implementation in
// CallStackProfileMetadata is tested independently.
TEST(CallStackProfileBuilderTest, ApplyMetadataRetrospectively_Basic) {}

// Checks that ApplyMetadataRetrospectively doesn't apply metadata if the
// requested start time is before the profile start time.
TEST(CallStackProfileBuilderTest,
     ApplyMetadataRetrospectively_BeforeStartTime) {}

}  // namespace metrics