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

Unified Diff: talk/app/webrtc/test/mockpeerconnectionobservers.h

Issue 1204493002: Set / verify stats report timestamps. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 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 | « talk/app/webrtc/statscollector_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/test/mockpeerconnectionobservers.h
diff --git a/talk/app/webrtc/test/mockpeerconnectionobservers.h b/talk/app/webrtc/test/mockpeerconnectionobservers.h
index f31b16c744303d40160884e944d2399aa05c92b8..580a0fbb85bfd25b257d01c5e9a8bb16a9ace63c 100644
--- a/talk/app/webrtc/test/mockpeerconnectionobservers.h
+++ b/talk/app/webrtc/test/mockpeerconnectionobservers.h
@@ -127,6 +127,7 @@ class MockStatsObserver : public webrtc::StatsObserver {
stats_.number_of_reports = reports.size();
for (const auto* r : reports) {
if (r->type() == StatsReport::kStatsReportTypeSsrc) {
+ stats_.timestamp = r->timestamp();
GetIntValue(r, StatsReport::kStatsValueNameAudioOutputLevel,
&stats_.audio_output_level);
GetIntValue(r, StatsReport::kStatsValueNameAudioInputLevel,
@@ -136,9 +137,11 @@ class MockStatsObserver : public webrtc::StatsObserver {
GetIntValue(r, StatsReport::kStatsValueNameBytesSent,
&stats_.bytes_sent);
} else if (r->type() == StatsReport::kStatsReportTypeBwe) {
+ stats_.timestamp = r->timestamp();
GetIntValue(r, StatsReport::kStatsValueNameAvailableReceiveBandwidth,
&stats_.available_receive_bandwidth);
} else if (r->type() == StatsReport::kStatsReportTypeComponent) {
+ stats_.timestamp = r->timestamp();
GetStringValue(r, StatsReport::kStatsValueNameDtlsCipher,
&stats_.dtls_cipher);
GetStringValue(r, StatsReport::kStatsValueNameSrtpCipher,
@@ -149,6 +152,7 @@ class MockStatsObserver : public webrtc::StatsObserver {
bool called() const { return called_; }
size_t number_of_reports() const { return stats_.number_of_reports; }
+ double timestamp() const { return stats_.timestamp; }
int AudioOutputLevel() const {
ASSERT(called_);
@@ -210,6 +214,7 @@ class MockStatsObserver : public webrtc::StatsObserver {
struct {
void Clear() {
number_of_reports = 0;
+ timestamp = 0;
audio_output_level = 0;
audio_input_level = 0;
bytes_received = 0;
@@ -220,6 +225,7 @@ class MockStatsObserver : public webrtc::StatsObserver {
}
size_t number_of_reports;
+ double timestamp;
int audio_output_level;
int audio_input_level;
int bytes_received;
« no previous file with comments | « talk/app/webrtc/statscollector_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698