OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 pcf_->Initialize(); | 2357 pcf_->Initialize(); |
2358 } | 2358 } |
2359 const cricket::MediaConfig& TestCreatePeerConnection( | 2359 const cricket::MediaConfig& TestCreatePeerConnection( |
2360 const PeerConnectionInterface::RTCConfiguration& config, | 2360 const PeerConnectionInterface::RTCConfiguration& config, |
2361 const MediaConstraintsInterface *constraints) { | 2361 const MediaConstraintsInterface *constraints) { |
2362 pcf_->create_media_controller_called_ = false; | 2362 pcf_->create_media_controller_called_ = false; |
2363 | 2363 |
2364 scoped_refptr<PeerConnectionInterface> pc( | 2364 scoped_refptr<PeerConnectionInterface> pc( |
2365 pcf_->CreatePeerConnection(config, constraints, nullptr, nullptr, | 2365 pcf_->CreatePeerConnection(config, constraints, nullptr, nullptr, |
2366 &observer_)); | 2366 &observer_)); |
| 2367 { |
| 2368 // The MediaController is lazy initialized so in order for the below |
| 2369 // expectations not to fail, we need to trigger creation. |
| 2370 rtc::scoped_refptr<RtpSenderInterface> sender( |
| 2371 pc->CreateSender(MediaStreamTrackInterface::kAudioKind, "foo_id")); |
| 2372 } |
2367 EXPECT_TRUE(pc.get()); | 2373 EXPECT_TRUE(pc.get()); |
2368 EXPECT_TRUE(pcf_->create_media_controller_called_); | 2374 EXPECT_TRUE(pcf_->create_media_controller_called_); |
2369 return pcf_->create_media_controller_config_; | 2375 return pcf_->create_media_controller_config_; |
2370 } | 2376 } |
2371 | 2377 |
2372 scoped_refptr<PeerConnectionFactoryForTest> pcf_; | 2378 scoped_refptr<PeerConnectionFactoryForTest> pcf_; |
2373 MockPeerConnectionObserver observer_; | 2379 MockPeerConnectionObserver observer_; |
2374 }; | 2380 }; |
2375 | 2381 |
2376 // This test verifies the default behaviour with no constraints and a | 2382 // This test verifies the default behaviour with no constraints and a |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 FakeConstraints updated_answer_c; | 2594 FakeConstraints updated_answer_c; |
2589 answer_c.SetMandatoryReceiveAudio(false); | 2595 answer_c.SetMandatoryReceiveAudio(false); |
2590 answer_c.SetMandatoryReceiveVideo(false); | 2596 answer_c.SetMandatoryReceiveVideo(false); |
2591 | 2597 |
2592 cricket::MediaSessionOptions updated_answer_options; | 2598 cricket::MediaSessionOptions updated_answer_options; |
2593 EXPECT_TRUE( | 2599 EXPECT_TRUE( |
2594 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2600 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2595 EXPECT_TRUE(updated_answer_options.has_audio()); | 2601 EXPECT_TRUE(updated_answer_options.has_audio()); |
2596 EXPECT_TRUE(updated_answer_options.has_video()); | 2602 EXPECT_TRUE(updated_answer_options.has_video()); |
2597 } | 2603 } |
OLD | NEW |