OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 last_stun_buf_.reset(); | 195 last_stun_buf_.reset(); |
196 last_stun_msg_.reset(); | 196 last_stun_msg_.reset(); |
197 } | 197 } |
198 void set_type_preference(int type_preference) { | 198 void set_type_preference(int type_preference) { |
199 type_preference_ = type_preference; | 199 type_preference_ = type_preference; |
200 } | 200 } |
201 | 201 |
202 private: | 202 private: |
203 rtc::scoped_ptr<ByteBuffer> last_stun_buf_; | 203 rtc::scoped_ptr<ByteBuffer> last_stun_buf_; |
204 rtc::scoped_ptr<IceMessage> last_stun_msg_; | 204 rtc::scoped_ptr<IceMessage> last_stun_msg_; |
205 int type_preference_; | 205 int type_preference_ = 0; |
206 }; | 206 }; |
207 | 207 |
208 class TestChannel : public sigslot::has_slots<> { | 208 class TestChannel : public sigslot::has_slots<> { |
209 public: | 209 public: |
210 // Takes ownership of |p1| (but not |p2|). | 210 // Takes ownership of |p1| (but not |p2|). |
211 TestChannel(Port* p1) | 211 TestChannel(Port* p1) |
212 : ice_mode_(ICEMODE_FULL), | 212 : ice_mode_(ICEMODE_FULL), |
213 port_(p1), | 213 port_(p1), |
214 complete_count_(0), | 214 complete_count_(0), |
215 conn_(NULL), | 215 conn_(NULL), |
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2488 StartConnectAndStopChannels(&ch1, &ch2); | 2488 StartConnectAndStopChannels(&ch1, &ch2); |
2489 // Switch the role after all connections are destroyed. | 2489 // Switch the role after all connections are destroyed. |
2490 EXPECT_TRUE_WAIT(ch2.conn() == nullptr, kTimeout); | 2490 EXPECT_TRUE_WAIT(ch2.conn() == nullptr, kTimeout); |
2491 port1->SetIceRole(cricket::ICEROLE_CONTROLLED); | 2491 port1->SetIceRole(cricket::ICEROLE_CONTROLLED); |
2492 port2->SetIceRole(cricket::ICEROLE_CONTROLLING); | 2492 port2->SetIceRole(cricket::ICEROLE_CONTROLLING); |
2493 | 2493 |
2494 // After the connection is destroyed, the port should not be destroyed. | 2494 // After the connection is destroyed, the port should not be destroyed. |
2495 rtc::Thread::Current()->ProcessMessages(kTimeout); | 2495 rtc::Thread::Current()->ProcessMessages(kTimeout); |
2496 EXPECT_FALSE(destroyed()); | 2496 EXPECT_FALSE(destroyed()); |
2497 } | 2497 } |
OLD | NEW |