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 "chromecast/base/metrics/cast_metrics_test_helper.h" | 5 #include "chromecast/base/metrics/cast_metrics_test_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chromecast/base/metrics/cast_metrics_helper.h" | 9 #include "chromecast/base/metrics/cast_metrics_helper.h" |
10 | 10 |
11 namespace chromecast { | 11 namespace chromecast { |
12 namespace metrics { | 12 namespace metrics { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 class CastMetricsHelperStub : public CastMetricsHelper { | 16 class CastMetricsHelperStub : public CastMetricsHelper { |
17 public: | 17 public: |
18 CastMetricsHelperStub(); | 18 CastMetricsHelperStub(); |
19 virtual ~CastMetricsHelperStub(); | 19 ~CastMetricsHelperStub() override; |
20 | 20 |
21 virtual void TagAppStart(const std::string& arg_app_name) override; | 21 void TagAppStart(const std::string& arg_app_name) override; |
22 virtual void LogMediaPlay() override; | 22 void LogMediaPlay() override; |
23 virtual void LogMediaPause() override; | 23 void LogMediaPause() override; |
24 virtual void LogTimeToDisplayVideo() override; | 24 void LogTimeToDisplayVideo() override; |
25 virtual void LogTimeToBufferAv(BufferingType buffering_type, | 25 void LogTimeToBufferAv(BufferingType buffering_type, |
26 base::TimeDelta time) override; | 26 base::TimeDelta time) override; |
27 virtual void ResetVideoFrameSampling() override; | 27 void ResetVideoFrameSampling() override; |
28 virtual void LogFramesPer5Seconds( | 28 void LogFramesPer5Seconds( |
29 int displayed_frames, int dropped_frames, | 29 int displayed_frames, int dropped_frames, |
30 int delayed_frames, int error_frames) override; | 30 int delayed_frames, int error_frames) override; |
31 virtual std::string GetMetricsNameWithAppName( | 31 std::string GetMetricsNameWithAppName( |
32 const std::string& prefix, const std::string& suffix) const override; | 32 const std::string& prefix, const std::string& suffix) const override; |
33 virtual void SetMetricsSink(MetricsSink* delegate) override; | 33 void SetMetricsSink(MetricsSink* delegate) override; |
34 | 34 |
35 private: | 35 private: |
36 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelperStub); | 36 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelperStub); |
37 }; | 37 }; |
38 | 38 |
39 bool stub_instance_exists = false; | 39 bool stub_instance_exists = false; |
40 | 40 |
41 CastMetricsHelperStub::CastMetricsHelperStub() | 41 CastMetricsHelperStub::CastMetricsHelperStub() |
42 : CastMetricsHelper() { | 42 : CastMetricsHelper() { |
43 DCHECK(!stub_instance_exists); | 43 DCHECK(!stub_instance_exists); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } // namespace | 86 } // namespace |
87 | 87 |
88 void InitializeMetricsHelperForTesting() { | 88 void InitializeMetricsHelperForTesting() { |
89 if (!stub_instance_exists) { | 89 if (!stub_instance_exists) { |
90 new CastMetricsHelperStub(); | 90 new CastMetricsHelperStub(); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 } // namespace metrics | 94 } // namespace metrics |
95 } // namespace chromecast | 95 } // namespace chromecast |
OLD | NEW |