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

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

Issue 2097683003: Support legacy offerToReceiveAudio/offerToReceiveVideo fields in RTCOfferOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void MockWebRTCPeerConnectionHandler::PostRequestFailure( 93 void MockWebRTCPeerConnectionHandler::PostRequestFailure(
94 const WebRTCVoidRequest& request) { 94 const WebRTCVoidRequest& request) {
95 interfaces_->GetDelegate()->PostTask(new WebCallbackTask(base::Bind( 95 interfaces_->GetDelegate()->PostTask(new WebCallbackTask(base::Bind(
96 &WebRTCVoidRequest::requestFailed, 96 &WebRTCVoidRequest::requestFailed,
97 base::Owned(new WebRTCVoidRequest(request)), WebString("TEST_ERROR")))); 97 base::Owned(new WebRTCVoidRequest(request)), WebString("TEST_ERROR"))));
98 } 98 }
99 99
100 void MockWebRTCPeerConnectionHandler::createOffer( 100 void MockWebRTCPeerConnectionHandler::createOffer(
101 const WebRTCSessionDescriptionRequest& request, 101 const WebRTCSessionDescriptionRequest& request,
102 const blink::WebRTCOfferOptions& options) { 102 const blink::WebRTCOfferOptions& options) {
103 if (options.iceRestart() && options.voiceActivityDetection()) { 103 if (options.iceRestart() && options.voiceActivityDetection() &&
104 options.offerToReceiveAudio() > 0 && options.offerToReceiveVideo() > 0) {
104 WebRTCSessionDescription session_description; 105 WebRTCSessionDescription session_description;
105 session_description.initialize("offer", "local"); 106 session_description.initialize("offer", "local");
106 PostRequestResult(request, session_description); 107 PostRequestResult(request, session_description);
107 } else { 108 } else {
108 PostRequestFailure(request); 109 PostRequestFailure(request);
109 } 110 }
110 } 111 }
111 112
112 void MockWebRTCPeerConnectionHandler::createAnswer( 113 void MockWebRTCPeerConnectionHandler::createAnswer(
113 const WebRTCSessionDescriptionRequest& request, 114 const WebRTCSessionDescriptionRequest& request,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 const WebMediaStreamTrack& track) { 330 const WebMediaStreamTrack& track) {
330 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate()); 331 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate());
331 } 332 }
332 333
333 void MockWebRTCPeerConnectionHandler::stop() { 334 void MockWebRTCPeerConnectionHandler::stop() {
334 stopped_ = true; 335 stopped_ = true;
335 weak_factory_.InvalidateWeakPtrs(); 336 weak_factory_.InvalidateWeakPtrs();
336 } 337 }
337 338
338 } // namespace test_runner 339 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698