Index: talk/app/webrtc/fakemetricsobserver.h |
diff --git a/talk/app/webrtc/dtlsidentityservice.h b/talk/app/webrtc/fakemetricsobserver.h |
similarity index 58% |
copy from talk/app/webrtc/dtlsidentityservice.h |
copy to talk/app/webrtc/fakemetricsobserver.h |
index 760cab45651dd505731be490fbbc73fef1d4e07a..e9e49749bf104246b32dab0d3ebc124cc355cd2b 100644 |
--- a/talk/app/webrtc/dtlsidentityservice.h |
+++ b/talk/app/webrtc/fakemetricsobserver.h |
@@ -25,35 +25,44 @@ |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_ |
-#define TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_ |
+#ifndef TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_ |
+#define TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_ |
+#include <map> |
#include <string> |
#include "talk/app/webrtc/peerconnectioninterface.h" |
+#include "webrtc/base/thread_checker.h" |
namespace webrtc { |
-class DtlsIdentityStore; |
- |
-// This class forwards the request to DtlsIdentityStore to generate the |
-// identity. |
-class DtlsIdentityService : public webrtc::DTLSIdentityServiceInterface { |
+class FakeMetricsObserver : public MetricsObserverInterface { |
public: |
- explicit DtlsIdentityService(DtlsIdentityStore* store) : store_(store) {} |
+ FakeMetricsObserver(); |
+ void Reset(); |
+ |
+ void IncrementCounter(PeerConnectionMetricsCounter type) override; |
+ void AddHistogramSample(PeerConnectionMetricsName type, |
+ int value) override; |
+ void AddHistogramSample(PeerConnectionMetricsName type, |
+ const std::string& value) override; |
+ |
+ // Accessors to be used by the tests. |
+ int GetCounter(PeerConnectionMetricsCounter type) const; |
+ int GetIntHistogramSample(PeerConnectionMetricsName type) const; |
+ const std::string& GetStringHistogramSample( |
+ PeerConnectionMetricsName type) const; |
- // DTLSIdentityServiceInterface impl. |
- // |identity_name| and |common_name| must equal to |
- // DtlsIdentityStore::kIdentityName, otherwise the request will fail and false |
- // will be returned. |
- bool RequestIdentity(const std::string& identity_name, |
- const std::string& common_name, |
- webrtc::DTLSIdentityRequestObserver* observer) override; |
+ protected: |
+ ~FakeMetricsObserver() {} |
private: |
- DtlsIdentityStore* store_; |
+ rtc::ThreadChecker thread_checker_; |
+ int counters_[kPeerConnectionMetricsCounter_Max]; |
+ int int_histogram_samples_[kPeerConnectionMetricsCounter_Max]; |
+ std::string string_histogram_samples_[kPeerConnectionMetricsName_Max]; |
}; |
} // namespace webrtc |
-#endif // TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_ |
+#endif // TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_ |