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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 StatsOutputLevel level) { | 267 StatsOutputLevel level) { |
268 if (!getstats_result_) | 268 if (!getstats_result_) |
269 return false; | 269 return false; |
270 | 270 |
271 DCHECK_EQ(kStatsOutputLevelStandard, level); | 271 DCHECK_EQ(kStatsOutputLevelStandard, level); |
272 std::vector<webrtc::StatsReport> reports(track ? 1 : 2); | 272 std::vector<webrtc::StatsReport> reports(track ? 1 : 2); |
273 webrtc::StatsReport& report = reports[0]; | 273 webrtc::StatsReport& report = reports[0]; |
274 report.id = "1234"; | 274 report.id = "1234"; |
275 report.type = "ssrc"; | 275 report.type = "ssrc"; |
276 report.timestamp = 42; | 276 report.timestamp = 42; |
277 webrtc::StatsReport::Value value; | 277 webrtc::StatsReport::Value value = { |
278 value.name = "trackname"; | 278 webrtc::StatsReport::kStatsValueNameFingerprint, |
279 value.value = "trackvalue"; | 279 "trackvalue" |
| 280 }; |
280 report.values.push_back(value); | 281 report.values.push_back(value); |
281 // If selector is given, we pass back one report. | 282 // If selector is given, we pass back one report. |
282 // If selector is not given, we pass back two. | 283 // If selector is not given, we pass back two. |
283 if (!track) { | 284 if (!track) { |
284 webrtc::StatsReport& report2 = reports[1]; | 285 webrtc::StatsReport& report2 = reports[1]; |
285 report2.id = "nontrack"; | 286 report2.id = "nontrack"; |
286 report2.type = "generic"; | 287 report2.type = "generic"; |
287 report2.timestamp = 44; | 288 report2.timestamp = 44; |
288 report2.values.push_back(value); | 289 report2.values.push_back(value); |
289 value.name = "somename"; | 290 webrtc::StatsReport::Value value2 = { |
290 value.value = "somevalue"; | 291 webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm, |
291 report2.values.push_back(value); | 292 "somevalue" |
| 293 }; |
| 294 report2.values.push_back(value2); |
292 } | 295 } |
293 // Note that the callback is synchronous, not asynchronous; it will | 296 // Note that the callback is synchronous, not asynchronous; it will |
294 // happen before the request call completes. | 297 // happen before the request call completes. |
295 observer->OnComplete(reports); | 298 observer->OnComplete(reports); |
296 return true; | 299 return true; |
297 } | 300 } |
298 | 301 |
299 const webrtc::SessionDescriptionInterface* | 302 const webrtc::SessionDescriptionInterface* |
300 MockPeerConnectionImpl::local_description() const { | 303 MockPeerConnectionImpl::local_description() const { |
301 return local_desc_.get(); | 304 return local_desc_.get(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 sdp_mline_index_ = candidate->sdp_mline_index(); | 357 sdp_mline_index_ = candidate->sdp_mline_index(); |
355 return candidate->ToString(&ice_sdp_); | 358 return candidate->ToString(&ice_sdp_); |
356 } | 359 } |
357 | 360 |
358 void MockPeerConnectionImpl::RegisterUMAObserver( | 361 void MockPeerConnectionImpl::RegisterUMAObserver( |
359 webrtc::UMAObserver* observer) { | 362 webrtc::UMAObserver* observer) { |
360 NOTIMPLEMENTED(); | 363 NOTIMPLEMENTED(); |
361 } | 364 } |
362 | 365 |
363 } // namespace content | 366 } // namespace content |
OLD | NEW |