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

Unified Diff: components/browser_watcher/watcher_metrics_provider_win_unittest.cc

Issue 811483006: Don't report exit funnels for live processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 955ad06903d38882755eef1c45f4d11daba95633..838b12deca2331f18f3f0c2d80eeb2d1f88928da 100644
--- a/components/browser_watcher/watcher_metrics_provider_win_unittest.cc
+++ b/components/browser_watcher/watcher_metrics_provider_win_unittest.cc
@@ -138,7 +138,13 @@ TEST_F(WatcherMetricsProviderWinTest, ReadsExitFunnelWrites) {
// Test that the metrics provider picks up the writes from
ExitFunnel funnel;
+ // Events against our own process should not get reported.
ASSERT_TRUE(funnel.Init(kRegistryPath, base::GetCurrentProcessHandle()));
+ ASSERT_TRUE(funnel.RecordEvent(L"Forgetaboutit"));
+
+ // Reset the funnel to a pseudo process. The PID 4 is the system process,
+ // which tests can hopefully never open.
+ ASSERT_TRUE(funnel.InitImpl(kRegistryPath, 4, base::Time::Now()));
erikwright (departed) 2014/12/19 20:03:38 I don't understand the purpose of this. Is it to t
// Each named event can only exist in a single copy.
ASSERT_TRUE(funnel.RecordEvent(L"One"));
@@ -154,9 +160,9 @@ TEST_F(WatcherMetricsProviderWinTest, ReadsExitFunnelWrites) {
histogram_tester_.ExpectTotalCount("Stability.ExitFunnel.Two", 1);
histogram_tester_.ExpectTotalCount("Stability.ExitFunnel.Three", 1);
- // Make sure the subkey has been deleted on reporting.
+ // Make sure the subkey for the pseudo process has been deleted on reporting.
base::win::RegistryKeyIterator it(HKEY_CURRENT_USER, kRegistryPath);
- ASSERT_EQ(it.SubkeyCount(), 0);
+ ASSERT_EQ(it.SubkeyCount(), 1);
}
} // namespace browser_watcher
« 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