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 /* |
278 webrtc::StatsReport::kStatsValueNameFingerprint, | 278 webrtc::StatsReport::Value value = { |
279 "trackvalue" | 279 webrtc::StatsReport::kStatsValueNameFingerprint, |
280 }; | 280 "trackvalue" |
281 report.values.push_back(value); | 281 }; |
| 282 report.values.push_back(value); |
| 283 */ |
282 // If selector is given, we pass back one report. | 284 // If selector is given, we pass back one report. |
283 // If selector is not given, we pass back two. | 285 // If selector is not given, we pass back two. |
284 if (!track) { | 286 if (!track) { |
285 webrtc::StatsReport& report2 = reports[1]; | 287 webrtc::StatsReport& report2 = reports[1]; |
286 report2.id = "nontrack"; | 288 report2.id = "nontrack"; |
287 report2.type = "generic"; | 289 report2.type = "generic"; |
288 report2.timestamp = 44; | 290 report2.timestamp = 44; |
289 report2.values.push_back(value); | 291 /* |
290 webrtc::StatsReport::Value value2 = { | 292 report2.values.push_back(value); |
291 webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm, | 293 webrtc::StatsReport::Value value2 = { |
292 "somevalue" | 294 webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm, |
293 }; | 295 "somevalue" |
294 report2.values.push_back(value2); | 296 }; |
| 297 report2.values.push_back(value2); |
| 298 */ |
295 } | 299 } |
296 // Note that the callback is synchronous, not asynchronous; it will | 300 // Note that the callback is synchronous, not asynchronous; it will |
297 // happen before the request call completes. | 301 // happen before the request call completes. |
298 observer->OnComplete(reports); | 302 observer->OnComplete(reports); |
299 return true; | 303 return true; |
300 } | 304 } |
301 | 305 |
302 const webrtc::SessionDescriptionInterface* | 306 const webrtc::SessionDescriptionInterface* |
303 MockPeerConnectionImpl::local_description() const { | 307 MockPeerConnectionImpl::local_description() const { |
304 return local_desc_.get(); | 308 return local_desc_.get(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 sdp_mline_index_ = candidate->sdp_mline_index(); | 361 sdp_mline_index_ = candidate->sdp_mline_index(); |
358 return candidate->ToString(&ice_sdp_); | 362 return candidate->ToString(&ice_sdp_); |
359 } | 363 } |
360 | 364 |
361 void MockPeerConnectionImpl::RegisterUMAObserver( | 365 void MockPeerConnectionImpl::RegisterUMAObserver( |
362 webrtc::UMAObserver* observer) { | 366 webrtc::UMAObserver* observer) { |
363 NOTIMPLEMENTED(); | 367 NOTIMPLEMENTED(); |
364 } | 368 } |
365 | 369 |
366 } // namespace content | 370 } // namespace content |
OLD | NEW |