| Index: components/browser_watcher/watcher_metrics_provider_win_unittest.cc
|
| diff --git a/components/browser_watcher/watcher_metrics_provider_win_unittest.cc b/components/browser_watcher/watcher_metrics_provider_win_unittest.cc
|
| index 020b73855041152f9e7fa9af8b81a9f876c39ab3..5f2554679c688edddefff7b7b9a7e35840a00030 100644
|
| --- a/components/browser_watcher/watcher_metrics_provider_win_unittest.cc
|
| +++ b/components/browser_watcher/watcher_metrics_provider_win_unittest.cc
|
| @@ -23,6 +23,9 @@ namespace browser_watcher {
|
|
|
| namespace {
|
|
|
| +using GetExecutableDetailsCallback =
|
| + WatcherMetricsProviderWin::GetExecutableDetailsCallback;
|
| +
|
| const wchar_t kRegistryPath[] = L"Software\\WatcherMetricsProviderWinTest";
|
|
|
| class WatcherMetricsProviderWinTest : public testing::Test {
|
| @@ -87,8 +90,9 @@ TEST_F(WatcherMetricsProviderWinTest, RecordsStabilityHistogram) {
|
| // Record a single failure.
|
| AddProcessExitCode(false, 100);
|
|
|
| - WatcherMetricsProviderWin provider(kRegistryPath, base::FilePath(),
|
| - base::FilePath(), test_task_runner_.get());
|
| + WatcherMetricsProviderWin provider(
|
| + kRegistryPath, base::FilePath(), base::FilePath(),
|
| + GetExecutableDetailsCallback(), test_task_runner_.get());
|
|
|
| provider.ProvideStabilityMetrics(NULL);
|
| histogram_tester_.ExpectBucketCount(
|
| @@ -110,8 +114,9 @@ TEST_F(WatcherMetricsProviderWinTest, DoesNotReportOwnProcessId) {
|
| // Record own process as STILL_ACTIVE.
|
| AddProcessExitCode(true, STILL_ACTIVE);
|
|
|
| - WatcherMetricsProviderWin provider(kRegistryPath, base::FilePath(),
|
| - base::FilePath(), test_task_runner_.get());
|
| + WatcherMetricsProviderWin provider(
|
| + kRegistryPath, base::FilePath(), base::FilePath(),
|
| + GetExecutableDetailsCallback(), test_task_runner_.get());
|
|
|
| provider.ProvideStabilityMetrics(NULL);
|
| histogram_tester_.ExpectUniqueSample(
|
| @@ -131,8 +136,9 @@ TEST_F(WatcherMetricsProviderWinTest, DeletesRecordedExitFunnelEvents) {
|
| base::win::RegistryKeyIterator it(HKEY_CURRENT_USER, kRegistryPath);
|
| EXPECT_EQ(3u, it.SubkeyCount());
|
|
|
| - WatcherMetricsProviderWin provider(kRegistryPath, base::FilePath(),
|
| - base::FilePath(), test_task_runner_.get());
|
| + WatcherMetricsProviderWin provider(
|
| + kRegistryPath, base::FilePath(), base::FilePath(),
|
| + GetExecutableDetailsCallback(), test_task_runner_.get());
|
|
|
| provider.ProvideStabilityMetrics(NULL);
|
| // Make sure the exit funnel events are no longer recorded in histograms.
|
| @@ -166,8 +172,9 @@ TEST_F(WatcherMetricsProviderWinTest, DeletesExitcodeKeyWhenNotReporting) {
|
| AddExitFunnelEvent(102, L"Three", 990 * 1000);
|
|
|
| // Make like the user is opted out of reporting.
|
| - WatcherMetricsProviderWin provider(kRegistryPath, base::FilePath(),
|
| - base::FilePath(), test_task_runner_.get());
|
| + WatcherMetricsProviderWin provider(
|
| + kRegistryPath, base::FilePath(), base::FilePath(),
|
| + GetExecutableDetailsCallback(), test_task_runner_.get());
|
| provider.OnRecordingDisabled();
|
|
|
| base::win::RegKey key;
|
| @@ -198,9 +205,9 @@ TEST_F(WatcherMetricsProviderWinTest, DeletesOnly100FunnelsAtATime) {
|
|
|
| {
|
| // Make like the user is opted out of reporting.
|
| - WatcherMetricsProviderWin provider(kRegistryPath, base::FilePath(),
|
| - base::FilePath(),
|
| - test_task_runner_.get());
|
| + WatcherMetricsProviderWin provider(
|
| + kRegistryPath, base::FilePath(), base::FilePath(),
|
| + GetExecutableDetailsCallback(), test_task_runner_.get());
|
| provider.OnRecordingDisabled();
|
| // Flush the task(s).
|
| test_task_runner_->RunPendingTasks();
|
|
|