| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/media/mock_peer_connection_impl.h" | 5 #include "content/renderer/media/mock_peer_connection_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" | 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool MockPeerConnectionImpl::GetStats( | 235 bool MockPeerConnectionImpl::GetStats( |
| 236 webrtc::StatsObserver* observer, | 236 webrtc::StatsObserver* observer, |
| 237 webrtc::MediaStreamTrackInterface* track, | 237 webrtc::MediaStreamTrackInterface* track, |
| 238 StatsOutputLevel level) { | 238 StatsOutputLevel level) { |
| 239 if (!getstats_result_) | 239 if (!getstats_result_) |
| 240 return false; | 240 return false; |
| 241 | 241 |
| 242 DCHECK_EQ(kStatsOutputLevelStandard, level); | 242 DCHECK_EQ(kStatsOutputLevelStandard, level); |
| 243 webrtc::StatsReport report1, report2; | 243 webrtc::StatsReport report1("1234"), report2("nontrack"); |
| 244 report1.id = "1234"; | 244 report1.type = webrtc::StatsReport::kStatsReportTypeSsrc; |
| 245 report1.type = "ssrc"; | |
| 246 report1.timestamp = 42; | 245 report1.timestamp = 42; |
| 247 report1.values.push_back( | 246 report1.values.push_back( |
| 248 webrtc::StatsReport::Value( | 247 webrtc::StatsReport::Value( |
| 249 webrtc::StatsReport::kStatsValueNameFingerprint, | 248 webrtc::StatsReport::kStatsValueNameFingerprint, |
| 250 "trackvalue")); | 249 "trackvalue")); |
| 251 | 250 |
| 252 webrtc::StatsReports reports; | 251 webrtc::StatsReports reports; |
| 253 reports.push_back(&report1); | 252 reports.push_back(&report1); |
| 254 | 253 |
| 255 // If selector is given, we pass back one report. | 254 // If selector is given, we pass back one report. |
| 256 // If selector is not given, we pass back two. | 255 // If selector is not given, we pass back two. |
| 257 if (!track) { | 256 if (!track) { |
| 258 report2.id = "nontrack"; | 257 report2.type = webrtc::StatsReport::kStatsReportTypeSession; |
| 259 report2.type = "generic"; | |
| 260 report2.timestamp = 44; | 258 report2.timestamp = 44; |
| 261 report2.values.push_back( | 259 report2.values.push_back( |
| 262 webrtc::StatsReport::Value( | 260 webrtc::StatsReport::Value( |
| 263 webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm, | 261 webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm, |
| 264 "somevalue")); | 262 "somevalue")); |
| 265 reports.push_back(&report2); | 263 reports.push_back(&report2); |
| 266 } | 264 } |
| 267 | 265 |
| 268 // Note that the callback is synchronous, not asynchronous; it will | 266 // Note that the callback is synchronous, not asynchronous; it will |
| 269 // happen before the request call completes. | 267 // happen before the request call completes. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 sdp_mline_index_ = candidate->sdp_mline_index(); | 328 sdp_mline_index_ = candidate->sdp_mline_index(); |
| 331 return candidate->ToString(&ice_sdp_); | 329 return candidate->ToString(&ice_sdp_); |
| 332 } | 330 } |
| 333 | 331 |
| 334 void MockPeerConnectionImpl::RegisterUMAObserver( | 332 void MockPeerConnectionImpl::RegisterUMAObserver( |
| 335 webrtc::UMAObserver* observer) { | 333 webrtc::UMAObserver* observer) { |
| 336 NOTIMPLEMENTED(); | 334 NOTIMPLEMENTED(); |
| 337 } | 335 } |
| 338 | 336 |
| 339 } // namespace content | 337 } // namespace content |
| OLD | NEW |