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

Side by Side Diff: chromecast/base/metrics/cast_metrics_helper.h

Issue 1510973007: [Chromecast] Set dummy metrics session ID for browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: namespace fix Created 5 years 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 unified diff | Download patch
OLDNEW
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 #ifndef CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 5 #ifndef CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
6 #define CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 6 #define CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // events internally unless SetMetricsSink(NULL) is called. 96 // events internally unless SetMetricsSink(NULL) is called.
97 // CastMetricsHelper can only hold one MetricsSink instance. 97 // CastMetricsHelper can only hold one MetricsSink instance.
98 // Caller retains ownership of MetricsSink. 98 // Caller retains ownership of MetricsSink.
99 virtual void SetMetricsSink(MetricsSink* delegate); 99 virtual void SetMetricsSink(MetricsSink* delegate);
100 100
101 // Sets a default callback to record user action when MetricsSink is not set. 101 // Sets a default callback to record user action when MetricsSink is not set.
102 // This function could be called multiple times (in unittests), and 102 // This function could be called multiple times (in unittests), and
103 // CastMetricsHelper only honors the last one. 103 // CastMetricsHelper only honors the last one.
104 virtual void SetRecordActionCallback(const RecordActionCallback& callback); 104 virtual void SetRecordActionCallback(const RecordActionCallback& callback);
105 105
106 // Sets an all-0's session ID for running browser tests.
107 void SetDummySessionIdForTesting();
108
106 protected: 109 protected:
107 // Creates a CastMetricsHelper instance with no task runner. This should only 110 // Creates a CastMetricsHelper instance with no task runner. This should only
108 // be used by tests, since invoking any non-overridden methods on this 111 // be used by tests, since invoking any non-overridden methods on this
109 // instance will cause a failure. 112 // instance will cause a failure.
110 CastMetricsHelper(); 113 CastMetricsHelper();
111 114
112 private: 115 private:
113 static std::string EncodeAppInfoIntoMetricsName( 116 static std::string EncodeAppInfoIntoMetricsName(
114 const std::string& action_name, 117 const std::string& action_name,
115 const std::string& app_id, 118 const std::string& app_id,
(...skipping 27 matching lines...) Expand all
143 // Default RecordAction callback when metrics_sink_ is not set. 146 // Default RecordAction callback when metrics_sink_ is not set.
144 RecordActionCallback record_action_callback_; 147 RecordActionCallback record_action_callback_;
145 148
146 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelper); 149 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelper);
147 }; 150 };
148 151
149 } // namespace metrics 152 } // namespace metrics
150 } // namespace chromecast 153 } // namespace chromecast
151 154
152 #endif // CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 155 #endif // CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/base/metrics/cast_metrics_helper.cc » ('j') | chromecast/base/metrics/cast_metrics_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698