Index: webrtc/pc/test/mockpeerconnectionobservers.h |
diff --git a/webrtc/pc/test/mockpeerconnectionobservers.h b/webrtc/pc/test/mockpeerconnectionobservers.h |
index 94996d004f1d8e8fc5c0d5fc26371e1b3a70a8f5..fb4c00419aa3ac043261dd07bc37dfeb8f32865f 100644 |
--- a/webrtc/pc/test/mockpeerconnectionobservers.h |
+++ b/webrtc/pc/test/mockpeerconnectionobservers.h |
@@ -225,6 +225,25 @@ class MockStatsObserver : public webrtc::StatsObserver { |
} stats_; |
}; |
+// Helper class that just stores the report from the callback. |
+class MockRTCStatsCollectorCallback : public webrtc::RTCStatsCollectorCallback { |
+ public: |
+ rtc::scoped_refptr<const RTCStatsReport> report() { return report_; } |
+ |
+ bool called() const { return called_; } |
+ |
+ protected: |
+ void OnStatsDelivered( |
+ const rtc::scoped_refptr<const RTCStatsReport>& report) override { |
+ report_ = report; |
+ called_ = true; |
+ } |
+ |
+ private: |
+ bool called_ = false; |
+ rtc::scoped_refptr<const RTCStatsReport> report_; |
+}; |
+ |
} // namespace webrtc |
#endif // WEBRTC_PC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_ |