Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: components/metrics/call_stack_profile_metrics_provider_unittest.cc

Issue 1325653003: Type change in StackSamplingProfiler from void* to uintptr_t. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@UMA2_refactor
Patch Set: Rebase and CL now only includes type changes. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/call_stack_profile_metrics_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/call_stack_profile_metrics_provider_unittest.cc
diff --git a/components/metrics/call_stack_profile_metrics_provider_unittest.cc b/components/metrics/call_stack_profile_metrics_provider_unittest.cc
index 395ef8f053a7fd46d4a7659c1a84038cc216c5bc..9ffaf573b486fa5e7b6fc7bc9245d519a488dd40 100644
--- a/components/metrics/call_stack_profile_metrics_provider_unittest.cc
+++ b/components/metrics/call_stack_profile_metrics_provider_unittest.cc
@@ -65,7 +65,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
const Module profile_modules[][2] = {
{
Module(
- reinterpret_cast<const void*>(module1_base_address),
+ module1_base_address,
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -74,7 +74,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
#endif
),
Module(
- reinterpret_cast<const void*>(module2_base_address),
+ module2_base_address,
"EFGH",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\third_party.dll")
@@ -85,7 +85,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
},
{
Module(
- reinterpret_cast<const void*>(module3_base_address),
+ module3_base_address,
"MNOP",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\third_party2.dll")
@@ -94,7 +94,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
#endif
),
Module( // Repeated from the first profile.
- reinterpret_cast<const void*>(module1_base_address),
+ module1_base_address,
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -147,26 +147,26 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
const Frame profile_sample_frames[][2][3] = {
{
{
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 0),
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x20), 1),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 0)
+ Frame(module1_base_address + 0x10, 0),
+ Frame(module2_base_address + 0x20, 1),
+ Frame(module1_base_address + 0x30, 0)
},
{
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x10), 1),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 0),
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x30), 1)
+ Frame(module2_base_address + 0x10, 1),
+ Frame(module1_base_address + 0x20, 0),
+ Frame(module2_base_address + 0x30, 1)
}
},
{
{
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x10), 0),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 1),
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x30), 0)
+ Frame(module3_base_address + 0x10, 0),
+ Frame(module1_base_address + 0x20, 1),
+ Frame(module3_base_address + 0x30, 0)
},
{
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 1),
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x20), 0),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 1)
+ Frame(module1_base_address + 0x10, 1),
+ Frame(module3_base_address + 0x20, 0),
+ Frame(module1_base_address + 0x30, 1)
}
}
};
@@ -277,7 +277,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) {
const Module modules[] = {
Module(
- reinterpret_cast<const void*>(module_base_address),
+ module_base_address,
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -289,10 +289,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) {
// Duplicate samples in slots 0, 2, and 3.
const Frame sample_frames[][1] = {
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) }
+ { Frame(module_base_address + 0x10, 0), },
+ { Frame(module_base_address + 0x20, 0), },
+ { Frame(module_base_address + 0x10, 0), },
+ { Frame(module_base_address + 0x10, 0) }
};
Profile profile;
@@ -356,7 +356,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
const Module modules[] = {
Module(
- reinterpret_cast<const void*>(module_base_address),
+ module_base_address,
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -368,10 +368,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
// Duplicate samples in slots 0, 2, and 3.
const Frame sample_frames[][1] = {
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) }
+ { Frame(module_base_address + 0x10, 0), },
+ { Frame(module_base_address + 0x20, 0), },
+ { Frame(module_base_address + 0x10, 0), },
+ { Frame(module_base_address + 0x10, 0) }
};
Profile profile;
@@ -390,9 +390,8 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
CallStackProfileMetricsProvider provider;
provider.OnRecordingEnabled();
- AppendProfiles(
- Params(CallStackProfileMetricsProvider::PROCESS_STARTUP, true),
- std::vector<Profile>(1, profile));
+ AppendProfiles(Params(CallStackProfileMetricsProvider::PROCESS_STARTUP, true),
+ std::vector<Profile>(1, profile));
ChromeUserMetricsExtension uma_proto;
provider.ProvideGeneralMetrics(&uma_proto);
@@ -430,8 +429,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
// Checks that unknown modules produce an empty Entry.
TEST_F(CallStackProfileMetricsProviderTest, UnknownModule) {
- const Frame frame(reinterpret_cast<const void*>(0x1000),
- Frame::kUnknownModuleIndex);
+ const Frame frame(0x1000, Frame::kUnknownModuleIndex);
Profile profile;
@@ -471,8 +469,8 @@ TEST_F(CallStackProfileMetricsProviderTest, ProfilesProvidedOnlyOnce) {
CallStackProfileMetricsProvider provider;
for (int i = 0; i < 2; ++i) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
// Use the sampling period to distinguish the two profiles.
@@ -500,8 +498,8 @@ TEST_F(CallStackProfileMetricsProviderTest, ProfilesProvidedOnlyOnce) {
TEST_F(CallStackProfileMetricsProviderTest,
ProfilesProvidedWhenCollectedBeforeInstantiation) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -522,8 +520,8 @@ TEST_F(CallStackProfileMetricsProviderTest,
// while recording is disabled.
TEST_F(CallStackProfileMetricsProviderTest, ProfilesNotProvidedWhileDisabled) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -544,8 +542,8 @@ TEST_F(CallStackProfileMetricsProviderTest, ProfilesNotProvidedWhileDisabled) {
TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeToDisabled) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -569,8 +567,8 @@ TEST_F(CallStackProfileMetricsProviderTest,
TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeToDisabledThenEnabled) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -595,8 +593,8 @@ TEST_F(CallStackProfileMetricsProviderTest,
TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeFromDisabled) {
Profile profile;
- profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ profile.samples.push_back(
+ Sample(1, Frame(0x1000, Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
« no previous file with comments | « components/metrics/call_stack_profile_metrics_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698