| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "talk/app/webrtc/audiotrack.h" | 30 #include "talk/app/webrtc/audiotrack.h" |
| 31 #include "talk/app/webrtc/fakeportallocatorfactory.h" | 31 #include "talk/app/webrtc/fakeportallocatorfactory.h" |
| 32 #include "talk/app/webrtc/jsepsessiondescription.h" | 32 #include "talk/app/webrtc/jsepsessiondescription.h" |
| 33 #include "talk/app/webrtc/mediastream.h" | 33 #include "talk/app/webrtc/mediastream.h" |
| 34 #include "talk/app/webrtc/mediastreaminterface.h" | 34 #include "talk/app/webrtc/mediastreaminterface.h" |
| 35 #include "talk/app/webrtc/peerconnection.h" | 35 #include "talk/app/webrtc/peerconnection.h" |
| 36 #include "talk/app/webrtc/peerconnectioninterface.h" | 36 #include "talk/app/webrtc/peerconnectioninterface.h" |
| 37 #include "talk/app/webrtc/rtpreceiverinterface.h" | 37 #include "talk/app/webrtc/rtpreceiverinterface.h" |
| 38 #include "talk/app/webrtc/rtpsenderinterface.h" | 38 #include "talk/app/webrtc/rtpsenderinterface.h" |
| 39 #include "talk/app/webrtc/streamcollection.h" | 39 #include "talk/app/webrtc/streamcollection.h" |
| 40 #ifdef WEBRTC_ANDROID | |
| 41 #include "talk/app/webrtc/test/androidtestinitializer.h" | |
| 42 #endif | |
| 43 #include "talk/app/webrtc/test/fakeconstraints.h" | 40 #include "talk/app/webrtc/test/fakeconstraints.h" |
| 44 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" | 41 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
| 45 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" | 42 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" |
| 46 #include "talk/app/webrtc/test/testsdpstrings.h" | 43 #include "talk/app/webrtc/test/testsdpstrings.h" |
| 47 #include "talk/app/webrtc/videosource.h" | 44 #include "talk/app/webrtc/videosource.h" |
| 48 #include "talk/app/webrtc/videotrack.h" | 45 #include "talk/app/webrtc/videotrack.h" |
| 49 #include "talk/media/base/fakevideocapturer.h" | 46 #include "talk/media/base/fakevideocapturer.h" |
| 50 #include "talk/media/sctp/sctpdataengine.h" | 47 #include "talk/media/sctp/sctpdataengine.h" |
| 51 #include "talk/session/media/mediasession.h" | 48 #include "talk/session/media/mediasession.h" |
| 52 #include "webrtc/base/gunit.h" | 49 #include "webrtc/base/gunit.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 508 |
| 512 private: | 509 private: |
| 513 scoped_refptr<MediaStreamInterface> last_added_stream_; | 510 scoped_refptr<MediaStreamInterface> last_added_stream_; |
| 514 scoped_refptr<MediaStreamInterface> last_removed_stream_; | 511 scoped_refptr<MediaStreamInterface> last_removed_stream_; |
| 515 }; | 512 }; |
| 516 | 513 |
| 517 } // namespace | 514 } // namespace |
| 518 | 515 |
| 519 class PeerConnectionInterfaceTest : public testing::Test { | 516 class PeerConnectionInterfaceTest : public testing::Test { |
| 520 protected: | 517 protected: |
| 521 PeerConnectionInterfaceTest() { | |
| 522 #ifdef WEBRTC_ANDROID | |
| 523 webrtc::InitializeAndroidObjects(); | |
| 524 #endif | |
| 525 } | |
| 526 | |
| 527 virtual void SetUp() { | 518 virtual void SetUp() { |
| 528 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 519 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| 529 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, | 520 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, |
| 530 NULL); | 521 NULL); |
| 531 ASSERT_TRUE(pc_factory_.get() != NULL); | 522 ASSERT_TRUE(pc_factory_.get() != NULL); |
| 532 } | 523 } |
| 533 | 524 |
| 534 void CreatePeerConnection() { | 525 void CreatePeerConnection() { |
| 535 CreatePeerConnection("", "", NULL); | 526 CreatePeerConnection("", "", NULL); |
| 536 } | 527 } |
| (...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 FakeConstraints updated_answer_c; | 2349 FakeConstraints updated_answer_c; |
| 2359 answer_c.SetMandatoryReceiveAudio(false); | 2350 answer_c.SetMandatoryReceiveAudio(false); |
| 2360 answer_c.SetMandatoryReceiveVideo(false); | 2351 answer_c.SetMandatoryReceiveVideo(false); |
| 2361 | 2352 |
| 2362 cricket::MediaSessionOptions updated_answer_options; | 2353 cricket::MediaSessionOptions updated_answer_options; |
| 2363 EXPECT_TRUE( | 2354 EXPECT_TRUE( |
| 2364 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2355 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
| 2365 EXPECT_TRUE(updated_answer_options.has_audio()); | 2356 EXPECT_TRUE(updated_answer_options.has_audio()); |
| 2366 EXPECT_TRUE(updated_answer_options.has_video()); | 2357 EXPECT_TRUE(updated_answer_options.has_video()); |
| 2367 } | 2358 } |
| OLD | NEW |