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 |
11 #include "webrtc/p2p/base/stunrequest.h" | 11 #include "webrtc/p2p/base/stunrequest.h" |
12 #include "webrtc/base/fakeclock.h" | 12 #include "webrtc/rtc_base/fakeclock.h" |
13 #include "webrtc/base/gunit.h" | 13 #include "webrtc/rtc_base/gunit.h" |
14 #include "webrtc/base/helpers.h" | 14 #include "webrtc/rtc_base/helpers.h" |
15 #include "webrtc/base/logging.h" | 15 #include "webrtc/rtc_base/logging.h" |
16 #include "webrtc/base/ssladapter.h" | 16 #include "webrtc/rtc_base/ssladapter.h" |
17 #include "webrtc/base/timeutils.h" | 17 #include "webrtc/rtc_base/timeutils.h" |
18 | 18 |
19 using namespace cricket; | 19 using namespace cricket; |
20 | 20 |
21 class StunRequestTest : public testing::Test, | 21 class StunRequestTest : public testing::Test, |
22 public sigslot::has_slots<> { | 22 public sigslot::has_slots<> { |
23 public: | 23 public: |
24 StunRequestTest() | 24 StunRequestTest() |
25 : manager_(rtc::Thread::Current()), | 25 : manager_(rtc::Thread::Current()), |
26 request_count_(0), response_(NULL), | 26 request_count_(0), response_(NULL), |
27 success_(false), failure_(false), timeout_(false) { | 27 success_(false), failure_(false), timeout_(false) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, &dummy_req); | 191 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, &dummy_req); |
192 | 192 |
193 EXPECT_TRUE(manager_.CheckResponse(res)); | 193 EXPECT_TRUE(manager_.CheckResponse(res)); |
194 | 194 |
195 EXPECT_TRUE(response_ == res); | 195 EXPECT_TRUE(response_ == res); |
196 EXPECT_TRUE(success_); | 196 EXPECT_TRUE(success_); |
197 EXPECT_FALSE(failure_); | 197 EXPECT_FALSE(failure_); |
198 EXPECT_FALSE(timeout_); | 198 EXPECT_FALSE(timeout_); |
199 delete res; | 199 delete res; |
200 } | 200 } |
OLD | NEW |