| 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_service.h" | 5 #include "components/metrics/metrics_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 return scoped_ptr<ClientInfo>(); | 31 return scoped_ptr<ClientInfo>(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 class TestMetricsProvider : public metrics::MetricsProvider { | 34 class TestMetricsProvider : public metrics::MetricsProvider { |
| 35 public: | 35 public: |
| 36 explicit TestMetricsProvider(bool has_stability_metrics) : | 36 explicit TestMetricsProvider(bool has_stability_metrics) : |
| 37 has_stability_metrics_(has_stability_metrics), | 37 has_stability_metrics_(has_stability_metrics), |
| 38 provide_stability_metrics_called_(false) { | 38 provide_stability_metrics_called_(false) { |
| 39 } | 39 } |
| 40 | 40 |
| 41 virtual bool HasStabilityMetrics() OVERRIDE { return has_stability_metrics_; } | 41 virtual bool HasStabilityMetrics() override { return has_stability_metrics_; } |
| 42 virtual void ProvideStabilityMetrics( | 42 virtual void ProvideStabilityMetrics( |
| 43 SystemProfileProto* system_profile_proto) OVERRIDE { | 43 SystemProfileProto* system_profile_proto) override { |
| 44 provide_stability_metrics_called_ = true; | 44 provide_stability_metrics_called_ = true; |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool provide_stability_metrics_called() const { | 47 bool provide_stability_metrics_called() const { |
| 48 return provide_stability_metrics_called_; | 48 return provide_stability_metrics_called_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 bool has_stability_metrics_; | 52 bool has_stability_metrics_; |
| 53 bool provide_stability_metrics_called_; | 53 bool provide_stability_metrics_called_; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 "clientID", 1, MetricsLog::ONGOING_LOG, &client, GetLocalState()))); | 357 "clientID", 1, MetricsLog::ONGOING_LOG, &client, GetLocalState()))); |
| 358 service.GetCurrentSyntheticFieldTrials(&synthetic_trials); | 358 service.GetCurrentSyntheticFieldTrials(&synthetic_trials); |
| 359 EXPECT_EQ(3U, synthetic_trials.size()); | 359 EXPECT_EQ(3U, synthetic_trials.size()); |
| 360 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial1", "Group2")); | 360 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial1", "Group2")); |
| 361 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial2", "Group2")); | 361 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial2", "Group2")); |
| 362 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial3", "Group3")); | 362 EXPECT_TRUE(HasSyntheticTrial(synthetic_trials, "TestTrial3", "Group3")); |
| 363 service.log_manager_.FinishCurrentLog(); | 363 service.log_manager_.FinishCurrentLog(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace metrics | 366 } // namespace metrics |
| OLD | NEW |