Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2870)

Unified Diff: chromecast/base/metrics/cast_metrics_test_helper.cc

Issue 652353003: Chromecast: adds class to help record complex histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resets initial buffering state on flush Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/base/metrics/cast_metrics_test_helper.h ('k') | chromecast/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/base/metrics/cast_metrics_test_helper.cc
diff --git a/chromecast/base/metrics/cast_metrics_test_helper.cc b/chromecast/base/metrics/cast_metrics_test_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6aa2a86a6c84c9180b80321ba2040a3ebabc10c6
--- /dev/null
+++ b/chromecast/base/metrics/cast_metrics_test_helper.cc
@@ -0,0 +1,95 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/base/metrics/cast_metrics_test_helper.h"
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "chromecast/base/metrics/cast_metrics_helper.h"
+
+namespace chromecast {
+namespace metrics {
+
+namespace {
+
+class CastMetricsHelperStub : public CastMetricsHelper {
+ public:
+ CastMetricsHelperStub();
+ virtual ~CastMetricsHelperStub();
+
+ virtual void TagAppStart(const std::string& arg_app_name) override;
+ virtual void LogMediaPlay() override;
+ virtual void LogMediaPause() override;
+ virtual void LogTimeToDisplayVideo() override;
+ virtual void LogTimeToBufferAv(BufferingType buffering_type,
+ base::TimeDelta time) override;
+ virtual void ResetVideoFrameSampling() override;
+ virtual void LogFramesPer5Seconds(
+ int displayed_frames, int dropped_frames,
+ int delayed_frames, int error_frames) override;
+ virtual std::string GetMetricsNameWithAppName(
+ const std::string& prefix, const std::string& suffix) const override;
+ virtual void SetMetricsSink(MetricsSink* delegate) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CastMetricsHelperStub);
+};
+
+bool stub_instance_exists = false;
+
+CastMetricsHelperStub::CastMetricsHelperStub()
+ : CastMetricsHelper() {
+ DCHECK(!stub_instance_exists);
+ stub_instance_exists = true;
+}
+
+CastMetricsHelperStub::~CastMetricsHelperStub() {
+ DCHECK(stub_instance_exists);
+ stub_instance_exists = false;
+}
+
+void CastMetricsHelperStub::TagAppStart(const std::string& arg_app_name) {
+}
+
+void CastMetricsHelperStub::LogMediaPlay() {
+}
+
+void CastMetricsHelperStub::LogMediaPause() {
+}
+
+void CastMetricsHelperStub::LogTimeToDisplayVideo() {
+}
+
+void CastMetricsHelperStub::LogTimeToBufferAv(BufferingType buffering_type,
+ base::TimeDelta time) {
+}
+
+void CastMetricsHelperStub::ResetVideoFrameSampling() {
+}
+
+void CastMetricsHelperStub::LogFramesPer5Seconds(int displayed_frames,
+ int dropped_frames,
+ int delayed_frames,
+ int error_frames) {
+}
+
+std::string CastMetricsHelperStub::GetMetricsNameWithAppName(
+ const std::string& prefix,
+ const std::string& suffix) const {
+ return "";
+}
+
+void CastMetricsHelperStub::SetMetricsSink(MetricsSink* delegate) {
+}
+
+} // namespace
+
+void InitializeMetricsHelperForTesting() {
+ if (!stub_instance_exists) {
+ new CastMetricsHelperStub();
+ }
+}
+
+} // namespace metrics
+} // namespace chromecast
« no previous file with comments | « chromecast/base/metrics/cast_metrics_test_helper.h ('k') | chromecast/browser/cast_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698