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 |
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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 511 |
509 private: | 512 private: |
510 scoped_refptr<MediaStreamInterface> last_added_stream_; | 513 scoped_refptr<MediaStreamInterface> last_added_stream_; |
511 scoped_refptr<MediaStreamInterface> last_removed_stream_; | 514 scoped_refptr<MediaStreamInterface> last_removed_stream_; |
512 }; | 515 }; |
513 | 516 |
514 } // namespace | 517 } // namespace |
515 | 518 |
516 class PeerConnectionInterfaceTest : public testing::Test { | 519 class PeerConnectionInterfaceTest : public testing::Test { |
517 protected: | 520 protected: |
| 521 PeerConnectionInterfaceTest() { |
| 522 #ifdef WEBRTC_ANDROID |
| 523 webrtc::InitializeAndroidObjects(); |
| 524 #endif |
| 525 } |
| 526 |
518 virtual void SetUp() { | 527 virtual void SetUp() { |
519 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 528 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
520 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, | 529 rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL, |
521 NULL); | 530 NULL); |
522 ASSERT_TRUE(pc_factory_.get() != NULL); | 531 ASSERT_TRUE(pc_factory_.get() != NULL); |
523 } | 532 } |
524 | 533 |
525 void CreatePeerConnection() { | 534 void CreatePeerConnection() { |
526 CreatePeerConnection("", "", NULL); | 535 CreatePeerConnection("", "", NULL); |
527 } | 536 } |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2349 FakeConstraints updated_answer_c; | 2358 FakeConstraints updated_answer_c; |
2350 answer_c.SetMandatoryReceiveAudio(false); | 2359 answer_c.SetMandatoryReceiveAudio(false); |
2351 answer_c.SetMandatoryReceiveVideo(false); | 2360 answer_c.SetMandatoryReceiveVideo(false); |
2352 | 2361 |
2353 cricket::MediaSessionOptions updated_answer_options; | 2362 cricket::MediaSessionOptions updated_answer_options; |
2354 EXPECT_TRUE( | 2363 EXPECT_TRUE( |
2355 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2364 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2356 EXPECT_TRUE(updated_answer_options.has_audio()); | 2365 EXPECT_TRUE(updated_answer_options.has_audio()); |
2357 EXPECT_TRUE(updated_answer_options.has_video()); | 2366 EXPECT_TRUE(updated_answer_options.has_video()); |
2358 } | 2367 } |
OLD | NEW |