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 | 30 |
31 #include "talk/app/webrtc/audiotrack.h" | 31 #include "talk/app/webrtc/audiotrack.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 |
40 #include "talk/app/webrtc/test/fakeconstraints.h" | 43 #include "talk/app/webrtc/test/fakeconstraints.h" |
41 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" | 44 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
42 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" | 45 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" |
43 #include "talk/app/webrtc/test/testsdpstrings.h" | 46 #include "talk/app/webrtc/test/testsdpstrings.h" |
44 #include "talk/app/webrtc/videosource.h" | 47 #include "talk/app/webrtc/videosource.h" |
45 #include "talk/app/webrtc/videotrack.h" | 48 #include "talk/app/webrtc/videotrack.h" |
46 #include "talk/media/base/fakevideocapturer.h" | 49 #include "talk/media/base/fakevideocapturer.h" |
47 #include "talk/media/sctp/sctpdataengine.h" | 50 #include "talk/media/sctp/sctpdataengine.h" |
48 #include "talk/session/media/mediasession.h" | 51 #include "talk/session/media/mediasession.h" |
49 #include "webrtc/base/gunit.h" | 52 #include "webrtc/base/gunit.h" |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 510 |
508 private: | 511 private: |
509 scoped_refptr<MediaStreamInterface> last_added_stream_; | 512 scoped_refptr<MediaStreamInterface> last_added_stream_; |
510 scoped_refptr<MediaStreamInterface> last_removed_stream_; | 513 scoped_refptr<MediaStreamInterface> last_removed_stream_; |
511 }; | 514 }; |
512 | 515 |
513 } // namespace | 516 } // namespace |
514 | 517 |
515 class PeerConnectionInterfaceTest : public testing::Test { | 518 class PeerConnectionInterfaceTest : public testing::Test { |
516 protected: | 519 protected: |
| 520 PeerConnectionInterfaceTest() { |
| 521 #ifdef WEBRTC_ANDROID |
| 522 webrtc::InitializeAndroidObjects(); |
| 523 #endif |
| 524 } |
| 525 |
517 virtual void SetUp() { | 526 virtual void SetUp() { |
518 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 527 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
519 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, | 528 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, |
520 NULL); | 529 NULL); |
521 ASSERT_TRUE(pc_factory_.get() != NULL); | 530 ASSERT_TRUE(pc_factory_.get() != NULL); |
522 } | 531 } |
523 | 532 |
524 void CreatePeerConnection() { | 533 void CreatePeerConnection() { |
525 CreatePeerConnection("", "", NULL); | 534 CreatePeerConnection("", "", NULL); |
526 } | 535 } |
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2402 FakeConstraints updated_answer_c; | 2411 FakeConstraints updated_answer_c; |
2403 answer_c.SetMandatoryReceiveAudio(false); | 2412 answer_c.SetMandatoryReceiveAudio(false); |
2404 answer_c.SetMandatoryReceiveVideo(false); | 2413 answer_c.SetMandatoryReceiveVideo(false); |
2405 | 2414 |
2406 cricket::MediaSessionOptions updated_answer_options; | 2415 cricket::MediaSessionOptions updated_answer_options; |
2407 EXPECT_TRUE( | 2416 EXPECT_TRUE( |
2408 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2417 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2409 EXPECT_TRUE(updated_answer_options.has_audio()); | 2418 EXPECT_TRUE(updated_answer_options.has_audio()); |
2410 EXPECT_TRUE(updated_answer_options.has_video()); | 2419 EXPECT_TRUE(updated_answer_options.has_video()); |
2411 } | 2420 } |
OLD | NEW |