OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h" | 5 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 } // namespace | 65 } // namespace |
66 | 66 |
67 class AntiVirusMetricsProviderTest : public ::testing::TestWithParam<bool> { | 67 class AntiVirusMetricsProviderTest : public ::testing::TestWithParam<bool> { |
68 public: | 68 public: |
69 AntiVirusMetricsProviderTest() | 69 AntiVirusMetricsProviderTest() |
70 : got_results_(false), | 70 : got_results_(false), |
71 expect_unhashed_value_(GetParam()), | 71 expect_unhashed_value_(GetParam()), |
72 provider_(new AntiVirusMetricsProvider( | 72 provider_(new AntiVirusMetricsProvider( |
73 content::BrowserThread::GetMessageLoopProxyForThread( | 73 content::BrowserThread::GetTaskRunnerForThread( |
74 content::BrowserThread::FILE))), | 74 content::BrowserThread::FILE))), |
75 thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD), | 75 thread_bundle_(content::TestBrowserThreadBundle::REAL_FILE_THREAD), |
76 weak_ptr_factory_(this) {} | 76 weak_ptr_factory_(this) {} |
77 | 77 |
78 void GetMetricsCallback() { | 78 void GetMetricsCallback() { |
79 // Check that the callback runs on the main loop. | 79 // Check that the callback runs on the main loop. |
80 ASSERT_TRUE(thread_checker_.CalledOnValidThread()); | 80 ASSERT_TRUE(thread_checker_.CalledOnValidThread()); |
81 ASSERT_TRUE(run_loop_.running()); | 81 ASSERT_TRUE(run_loop_.running()); |
82 | 82 |
83 run_loop_.QuitWhenIdle(); | 83 run_loop_.QuitWhenIdle(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 AntiVirusMetricsProvider::ResultCode expected_result = | 125 AntiVirusMetricsProvider::ResultCode expected_result = |
126 AntiVirusMetricsProvider::RESULT_SUCCESS; | 126 AntiVirusMetricsProvider::RESULT_SUCCESS; |
127 if (base::win::OSInfo::GetInstance()->version_type() == | 127 if (base::win::OSInfo::GetInstance()->version_type() == |
128 base::win::SUITE_SERVER) | 128 base::win::SUITE_SERVER) |
129 expected_result = AntiVirusMetricsProvider::RESULT_WSC_NOT_AVAILABLE; | 129 expected_result = AntiVirusMetricsProvider::RESULT_WSC_NOT_AVAILABLE; |
130 histograms.ExpectUniqueSample("UMA.AntiVirusMetricsProvider.Result", | 130 histograms.ExpectUniqueSample("UMA.AntiVirusMetricsProvider.Result", |
131 expected_result, 1); | 131 expected_result, 1); |
132 } | 132 } |
133 | 133 |
134 INSTANTIATE_TEST_CASE_P(, AntiVirusMetricsProviderTest, ::testing::Bool()); | 134 INSTANTIATE_TEST_CASE_P(, AntiVirusMetricsProviderTest, ::testing::Bool()); |
OLD | NEW |