Chromium Code Reviews| 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 |