| 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/mediastream.h" | 32 #include "talk/app/webrtc/mediastream.h" |
| 33 #include "talk/app/webrtc/mediastreamsignaling.h" | 33 #include "talk/app/webrtc/mediastreamsignaling.h" |
| 34 #include "talk/app/webrtc/sctputils.h" | 34 #include "talk/app/webrtc/sctputils.h" |
| 35 #include "talk/app/webrtc/streamcollection.h" | 35 #include "talk/app/webrtc/streamcollection.h" |
| 36 #include "talk/app/webrtc/test/fakeconstraints.h" | 36 #include "talk/app/webrtc/test/fakeconstraints.h" |
| 37 #include "talk/app/webrtc/test/fakedatachannelprovider.h" | 37 #include "talk/app/webrtc/test/fakedatachannelprovider.h" |
| 38 #include "talk/app/webrtc/videotrack.h" | 38 #include "talk/app/webrtc/videotrack.h" |
| 39 #include "talk/media/base/fakemediaengine.h" | 39 #include "talk/media/base/fakemediaengine.h" |
| 40 #include "talk/media/devices/fakedevicemanager.h" | |
| 41 #include "webrtc/p2p/base/constants.h" | 40 #include "webrtc/p2p/base/constants.h" |
| 42 #include "webrtc/p2p/base/sessiondescription.h" | 41 #include "webrtc/p2p/base/sessiondescription.h" |
| 43 #include "talk/session/media/channelmanager.h" | 42 #include "talk/session/media/channelmanager.h" |
| 44 #include "webrtc/base/gunit.h" | 43 #include "webrtc/base/gunit.h" |
| 45 #include "webrtc/base/scoped_ptr.h" | 44 #include "webrtc/base/scoped_ptr.h" |
| 46 #include "webrtc/base/stringutils.h" | 45 #include "webrtc/base/stringutils.h" |
| 47 #include "webrtc/base/thread.h" | 46 #include "webrtc/base/thread.h" |
| 48 | 47 |
| 49 static const char kStreams[][8] = {"stream1", "stream2"}; | 48 static const char kStreams[][8] = {"stream1", "stream2"}; |
| 50 static const char kAudioTracks[][32] = {"audiotrack0", "audiotrack1"}; | 49 static const char kAudioTracks[][32] = {"audiotrack0", "audiotrack1"}; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 using webrtc::MediaStreamSignaling::OnRemoteDescriptionChanged; | 474 using webrtc::MediaStreamSignaling::OnRemoteDescriptionChanged; |
| 476 using webrtc::MediaStreamSignaling::remote_streams; | 475 using webrtc::MediaStreamSignaling::remote_streams; |
| 477 }; | 476 }; |
| 478 | 477 |
| 479 class MediaStreamSignalingTest: public testing::Test { | 478 class MediaStreamSignalingTest: public testing::Test { |
| 480 protected: | 479 protected: |
| 481 virtual void SetUp() { | 480 virtual void SetUp() { |
| 482 observer_.reset(new MockSignalingObserver()); | 481 observer_.reset(new MockSignalingObserver()); |
| 483 channel_manager_.reset( | 482 channel_manager_.reset( |
| 484 new cricket::ChannelManager(new cricket::FakeMediaEngine(), | 483 new cricket::ChannelManager(new cricket::FakeMediaEngine(), |
| 485 new cricket::FakeDeviceManager(), | |
| 486 rtc::Thread::Current())); | 484 rtc::Thread::Current())); |
| 487 signaling_.reset(new MediaStreamSignalingForTest(observer_.get(), | 485 signaling_.reset(new MediaStreamSignalingForTest(observer_.get(), |
| 488 channel_manager_.get())); | 486 channel_manager_.get())); |
| 489 data_channel_provider_.reset(new FakeDataChannelProvider()); | 487 data_channel_provider_.reset(new FakeDataChannelProvider()); |
| 490 } | 488 } |
| 491 | 489 |
| 492 // Create a collection of streams. | 490 // Create a collection of streams. |
| 493 // CreateStreamCollection(1) creates a collection that | 491 // CreateStreamCollection(1) creates a collection that |
| 494 // correspond to kSdpString1. | 492 // correspond to kSdpString1. |
| 495 // CreateStreamCollection(2) correspond to kSdpString2. | 493 // CreateStreamCollection(2) correspond to kSdpString2. |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 webrtc::WriteDataChannelOpenMessage("a", config, &payload); | 1335 webrtc::WriteDataChannelOpenMessage("a", config, &payload); |
| 1338 cricket::ReceiveDataParams params; | 1336 cricket::ReceiveDataParams params; |
| 1339 params.ssrc = config.id; | 1337 params.ssrc = config.id; |
| 1340 EXPECT_TRUE(signaling_->AddDataChannelFromOpenMessage(params, payload)); | 1338 EXPECT_TRUE(signaling_->AddDataChannelFromOpenMessage(params, payload)); |
| 1341 EXPECT_TRUE(signaling_->HasDataChannels()); | 1339 EXPECT_TRUE(signaling_->HasDataChannels()); |
| 1342 | 1340 |
| 1343 // Removes the DataChannel and verifies that no DataChannel is left. | 1341 // Removes the DataChannel and verifies that no DataChannel is left. |
| 1344 signaling_->RemoveSctpDataChannel(config.id); | 1342 signaling_->RemoveSctpDataChannel(config.id); |
| 1345 EXPECT_FALSE(signaling_->HasDataChannels()); | 1343 EXPECT_FALSE(signaling_->HasDataChannels()); |
| 1346 } | 1344 } |
| OLD | NEW |