#include "components/metrics/call_stacks/call_stack_profile_metadata.h"
#include <tuple>
#include <utility>
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/sampled_profile.pb.h"
namespace metrics {
namespace {
void ExpectMetadataApplied(
const base::MetadataRecorder::Item& expected_item,
const google::protobuf::RepeatedPtrField<CallStackProfile::StackSample>&
samples,
int sample_index,
int metadata_index,
const google::protobuf::RepeatedField<uint64_t>& name_hashes) { … }
void ExpectMetadataUnapplied(
const base::MetadataRecorder::Item& expected_item,
const google::protobuf::RepeatedPtrField<CallStackProfile::StackSample>&
samples,
int sample_index,
int metadata_index,
const google::protobuf::RepeatedField<uint64_t>& name_hashes) { … }
}
TEST(CallStackProfileMetadataTest, MetadataRecorder_NoItems) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_SetItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_SetKeyedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_SetThreadItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_RepeatItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_RepeatKeyedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_ModifiedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_ModifiedKeyedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_NewItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_NewKeyedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_RemovedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_RemovedKeyedItem) { … }
TEST(CallStackProfileMetadataTest, MetadataRecorder_RemovedThreadItem) { … }
TEST(CallStackProfileMetadataTest,
MetadataRecorder_SetMixedUnkeyedAndKeyedItems) { … }
TEST(CallStackProfileMetadataTest,
MetadataRecorder_RemoveMixedUnkeyedAndKeyedItems) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_Basic) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_DifferentNameHashes) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_DifferentKeys) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_EmptyRange) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_ThroughEnd) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_WithRecordMetadata) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_WithActiveMetadata) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_IndependentRanges) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_BackToBackRanges) { … }
TEST(CallStackProfileMetadataTest,
ApplyMetadata_BackToBackRangesWithDifferentValues) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_UpdateWithinExistingRange) { … }
TEST(CallStackProfileMetadataTest,
ApplyMetadata_UpdateWithinExistingRangeWithDifferentValues) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_UpdateEnclosesExistingRange) { … }
TEST(CallStackProfileMetadataTest,
ApplyMetadata_UpdateEnclosesExistingRangeWithDifferentValues) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_UpdateOverlapsBegin) { … }
TEST(CallStackProfileMetadataTest,
ApplyMetadata_UpdateOverlapsBeginWithDifferentValues) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_UpdateOverlapsEnd) { … }
TEST(CallStackProfileMetadataTest,
ApplyMetadata_UpdateOverlapsEndWithDifferentValues) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_Update) { … }
TEST(CallStackProfileMetadataTest, ApplyMetadata_UpdateWithDifferentValues) { … }
}