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

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler_unittest.cc

Issue 2790823002: Spec compliant video constraints for getUserMedia behind flag. (Closed)
Patch Set: fix tests Created 3 years, 8 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 (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/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 audio_tracks[0].initialize(blink_audio_source.id(), blink_audio_source); 322 audio_tracks[0].initialize(blink_audio_source.id(), blink_audio_source);
323 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), 323 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(),
324 Initialize(_, _, -1)); 324 Initialize(_, _, -1));
325 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), 325 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(),
326 SetAutomaticGainControl(true)); 326 SetAutomaticGainControl(true));
327 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Start()); 327 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Start());
328 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Stop()); 328 EXPECT_CALL(*mock_audio_device_factory_.mock_capturer_source(), Stop());
329 CHECK(audio_source->ConnectToTrack(audio_tracks[0])); 329 CHECK(audio_source->ConnectToTrack(audio_tracks[0]));
330 blink::WebVector<blink::WebMediaStreamTrack> video_tracks( 330 blink::WebVector<blink::WebMediaStreamTrack> video_tracks(
331 static_cast<size_t>(1)); 331 static_cast<size_t>(1));
332 blink::WebMediaConstraints video_constraints;
333 video_constraints.initialize();
334 video_tracks[0] = MediaStreamVideoTrack::CreateVideoTrack( 332 video_tracks[0] = MediaStreamVideoTrack::CreateVideoTrack(
335 native_video_source, video_constraints, 333 native_video_source, MediaStreamVideoSource::ConstraintsCallback(),
336 MediaStreamVideoSource::ConstraintsCallback(), true); 334 true);
337 335
338 blink::WebMediaStream local_stream; 336 blink::WebMediaStream local_stream;
339 local_stream.initialize(blink::WebString::fromUTF8(stream_label), 337 local_stream.initialize(blink::WebString::fromUTF8(stream_label),
340 audio_tracks, video_tracks); 338 audio_tracks, video_tracks);
341 local_stream.setExtraData(new MediaStream()); 339 local_stream.setExtraData(new MediaStream());
342 return local_stream; 340 return local_stream;
343 } 341 }
344 342
345 // Creates a remote MediaStream and adds it to the mocked native 343 // Creates a remote MediaStream and adds it to the mocked native
346 // peer connection. 344 // peer connection.
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 testing::Ref(tracks[0]))); 1306 testing::Ref(tracks[0])));
1309 1307
1310 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender( 1308 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender(
1311 pc_handler_->createDTMFSender(tracks[0])); 1309 pc_handler_->createDTMFSender(tracks[0]));
1312 EXPECT_TRUE(sender.get()); 1310 EXPECT_TRUE(sender.get());
1313 1311
1314 StopAllTracks(local_stream); 1312 StopAllTracks(local_stream);
1315 } 1313 }
1316 1314
1317 } // namespace content 1315 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698