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

Unified Diff: components/browser_watcher/watcher_metrics_provider_win_unittest.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Address clang errors Created 4 years, 2 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/browser_watcher/watcher_metrics_provider_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « components/browser_watcher/watcher_metrics_provider_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698