Chromium Code Reviews| 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 3834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3845 | 3845 |
| 3846 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( | 3846 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( |
| 3847 rtc::Socket::Option::OPT_SNDBUF, &option_val)); | 3847 rtc::Socket::Option::OPT_SNDBUF, &option_val)); |
| 3848 EXPECT_EQ(4000, option_val); | 3848 EXPECT_EQ(4000, option_val); |
| 3849 | 3849 |
| 3850 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( | 3850 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( |
| 3851 rtc::Socket::Option::OPT_RCVBUF, &option_val)); | 3851 rtc::Socket::Option::OPT_RCVBUF, &option_val)); |
| 3852 EXPECT_EQ(8000, option_val); | 3852 EXPECT_EQ(8000, option_val); |
| 3853 } | 3853 } |
| 3854 | 3854 |
| 3855 // Test creating a session, request multiple offers, destroy the session | |
| 3856 // and make sure we got success/failure callbacks for all of the requests. | |
| 3857 // Background: crbug.com/507307 | |
| 3858 TEST_F(WebRtcSessionTest, CreateOffersAndShutdown) { | |
| 3859 Init(); | |
| 3860 | |
| 3861 rtc::scoped_refptr<WebRtcSessionCreateSDPObserverForTest> observers[100]; | |
| 3862 PeerConnectionInterface::RTCOfferAnswerOptions options; | |
| 3863 options.offer_to_receive_audio = | |
| 3864 RTCOfferAnswerOptions::kOfferToReceiveMediaTrue; | |
| 3865 | |
| 3866 for (auto& o : observers) { | |
| 3867 o = new WebRtcSessionCreateSDPObserverForTest(); | |
| 3868 session_->CreateOffer(o, options); | |
| 3869 } | |
| 3870 | |
| 3871 session_.reset(); | |
| 3872 // Make sure we process pending messages on the current (signaling) thread | |
| 3873 // before checking we we got our callbacks. | |
| 3874 rtc::Thread::Current()->ProcessMessages(10); | |
|
pbos-webrtc
2015/07/09 09:09:22
Is this long enough to not be flaky? Is it just to
tommi
2015/07/09 09:18:15
All messages will have been posted to the message
| |
| 3875 | |
| 3876 for (auto& o : observers) { | |
| 3877 // We expect to have received a notification now even if the session was | |
| 3878 // terminated. The offer creation may or may not have succeeded, but we | |
| 3879 // must have received a notification which, so the only invalid state | |
| 3880 // is kInit. | |
| 3881 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); | |
| 3882 } | |
| 3883 } | |
| 3884 | |
| 3855 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 3885 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 3856 // currently fails because upon disconnection and reconnection OnIceComplete is | 3886 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 3857 // called more than once without returning to IceGatheringGathering. | 3887 // called more than once without returning to IceGatheringGathering. |
| OLD | NEW |