OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/metrics/metrics_state_manager.h" | 5 #include "components/metrics/metrics_state_manager.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 scoped_ptr<MetricsStateManager> state_manager(CreateStateManager()); | 166 scoped_ptr<MetricsStateManager> state_manager(CreateStateManager()); |
167 state_manager->GetLowEntropySource(); | 167 state_manager->GetLowEntropySource(); |
168 | 168 |
169 EXPECT_EQ("test", prefs_.GetString(kCachePrefName)); | 169 EXPECT_EQ("test", prefs_.GetString(kCachePrefName)); |
170 EXPECT_EQ(low_entropy_value, | 170 EXPECT_EQ(low_entropy_value, |
171 prefs_.GetInteger(prefs::kMetricsLowEntropySource)); | 171 prefs_.GetInteger(prefs::kMetricsLowEntropySource)); |
172 } | 172 } |
173 | 173 |
174 // Verify that the cache does get reset if --reset-variations-state is passed. | 174 // Verify that the cache does get reset if --reset-variations-state is passed. |
175 { | 175 { |
176 CommandLine::ForCurrentProcess()->AppendSwitch( | 176 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
177 switches::kResetVariationState); | 177 switches::kResetVariationState); |
178 | 178 |
179 scoped_ptr<MetricsStateManager> state_manager(CreateStateManager()); | 179 scoped_ptr<MetricsStateManager> state_manager(CreateStateManager()); |
180 state_manager->GetLowEntropySource(); | 180 state_manager->GetLowEntropySource(); |
181 | 181 |
182 EXPECT_TRUE(prefs_.GetString(kCachePrefName).empty()); | 182 EXPECT_TRUE(prefs_.GetString(kCachePrefName).empty()); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 // Check that setting the kMetricsResetIds pref to true causes the client id to | 186 // Check that setting the kMetricsResetIds pref to true causes the client id to |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 // The metrics-reporting-enabled date will be reset to Now(). | 373 // The metrics-reporting-enabled date will be reset to Now(). |
374 EXPECT_GE(prefs_.GetInt64(prefs::kMetricsReportingEnabledTimestamp), | 374 EXPECT_GE(prefs_.GetInt64(prefs::kMetricsReportingEnabledTimestamp), |
375 previous_client_info->reporting_enabled_date); | 375 previous_client_info->reporting_enabled_date); |
376 | 376 |
377 stored_client_info_backup_.reset(); | 377 stored_client_info_backup_.reset(); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 } // namespace metrics | 381 } // namespace metrics |
OLD | NEW |