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

Side by Side Diff: components/test_runner/mock_webrtc_peer_connection_handler.cc

Issue 2317063002: WebRTCPeerConnectionHandler::getStats for the new stats collector API (Closed)
Patch Set: TODO to impl MockWebRTCPeerConnectionHandler::getStats in a follow-up instead Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/test_runner/mock_webrtc_peer_connection_handler.h" 5 #include "components/test_runner/mock_webrtc_peer_connection_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 MockWebRTCLegacyStats video_stats("Mock video", "ssrc", current_date); 385 MockWebRTCLegacyStats video_stats("Mock video", "ssrc", current_date);
386 video_stats.addStatistic("type", "video"); 386 video_stats.addStatistic("type", "video");
387 response.addStats(video_stats); 387 response.addStats(video_stats);
388 } 388 }
389 } 389 }
390 interfaces_->GetDelegate()->PostTask(new WebCallbackTask( 390 interfaces_->GetDelegate()->PostTask(new WebCallbackTask(
391 base::Bind(&blink::WebRTCStatsRequest::requestSucceeded, 391 base::Bind(&blink::WebRTCStatsRequest::requestSucceeded,
392 base::Owned(new WebRTCStatsRequest(request)), response))); 392 base::Owned(new WebRTCStatsRequest(request)), response)));
393 } 393 }
394 394
395 void MockWebRTCPeerConnectionHandler::getStats(
396 std::unique_ptr<blink::WebRTCStatsReportCallback> callback) {
397 // TODO(hbos): When blink::RTCPeerConnection starts using the new |getStats|
398 // this needs to be implemented. crbug.com/627816.
399 NOTREACHED();
400 }
401
395 void MockWebRTCPeerConnectionHandler::ReportCreationOfDataChannel() { 402 void MockWebRTCPeerConnectionHandler::ReportCreationOfDataChannel() {
396 WebRTCDataChannelInit init; 403 WebRTCDataChannelInit init;
397 WebRTCDataChannelHandler* remote_data_channel = 404 WebRTCDataChannelHandler* remote_data_channel =
398 new MockWebRTCDataChannelHandler("MockRemoteDataChannel", init, 405 new MockWebRTCDataChannelHandler("MockRemoteDataChannel", init,
399 interfaces_->GetDelegate()); 406 interfaces_->GetDelegate());
400 client_->didAddRemoteDataChannel(remote_data_channel); 407 client_->didAddRemoteDataChannel(remote_data_channel);
401 } 408 }
402 409
403 WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::createDataChannel( 410 WebRTCDataChannelHandler* MockWebRTCPeerConnectionHandler::createDataChannel(
404 const WebString& label, 411 const WebString& label,
(...skipping 12 matching lines...) Expand all
417 const WebMediaStreamTrack& track) { 424 const WebMediaStreamTrack& track) {
418 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate()); 425 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate());
419 } 426 }
420 427
421 void MockWebRTCPeerConnectionHandler::stop() { 428 void MockWebRTCPeerConnectionHandler::stop() {
422 stopped_ = true; 429 stopped_ = true;
423 weak_factory_.InvalidateWeakPtrs(); 430 weak_factory_.InvalidateWeakPtrs();
424 } 431 }
425 432
426 } // namespace test_runner 433 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698