Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: webrtc/p2p/base/stunrequest_unittest.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/stunrequest.cc ('k') | webrtc/p2p/base/tcpport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 EXPECT_FALSE(failure_); 139 EXPECT_FALSE(failure_);
140 EXPECT_FALSE(timeout_); 140 EXPECT_FALSE(timeout_);
141 delete res; 141 delete res;
142 } 142 }
143 143
144 // Test that requests are sent at the right times, and that the 9th request 144 // Test that requests are sent at the right times, and that the 9th request
145 // (sent at 7900 ms) can be properly replied to. 145 // (sent at 7900 ms) can be properly replied to.
146 TEST_F(StunRequestTest, TestBackoff) { 146 TEST_F(StunRequestTest, TestBackoff) {
147 StunMessage* req = CreateStunMessage(STUN_BINDING_REQUEST, NULL); 147 StunMessage* req = CreateStunMessage(STUN_BINDING_REQUEST, NULL);
148 148
149 uint32 start = rtc::Time(); 149 uint32_t start = rtc::Time();
150 manager_.Send(new StunRequestThunker(req, this)); 150 manager_.Send(new StunRequestThunker(req, this));
151 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, req); 151 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, req);
152 for (int i = 0; i < 9; ++i) { 152 for (int i = 0; i < 9; ++i) {
153 while (request_count_ == i) 153 while (request_count_ == i)
154 rtc::Thread::Current()->ProcessMessages(1); 154 rtc::Thread::Current()->ProcessMessages(1);
155 int32 elapsed = rtc::TimeSince(start); 155 int32_t elapsed = rtc::TimeSince(start);
156 LOG(LS_INFO) << "STUN request #" << (i + 1) 156 LOG(LS_INFO) << "STUN request #" << (i + 1)
157 << " sent at " << elapsed << " ms"; 157 << " sent at " << elapsed << " ms";
158 EXPECT_GE(TotalDelay(i + 1), elapsed); 158 EXPECT_GE(TotalDelay(i + 1), elapsed);
159 } 159 }
160 EXPECT_TRUE(manager_.CheckResponse(res)); 160 EXPECT_TRUE(manager_.CheckResponse(res));
161 161
162 EXPECT_TRUE(response_ == res); 162 EXPECT_TRUE(response_ == res);
163 EXPECT_TRUE(success_); 163 EXPECT_TRUE(success_);
164 EXPECT_FALSE(failure_); 164 EXPECT_FALSE(failure_);
165 EXPECT_FALSE(timeout_); 165 EXPECT_FALSE(timeout_);
(...skipping 28 matching lines...) Expand all
194 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, &dummy_req); 194 StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, &dummy_req);
195 195
196 EXPECT_TRUE(manager_.CheckResponse(res)); 196 EXPECT_TRUE(manager_.CheckResponse(res));
197 197
198 EXPECT_TRUE(response_ == res); 198 EXPECT_TRUE(response_ == res);
199 EXPECT_TRUE(success_); 199 EXPECT_TRUE(success_);
200 EXPECT_FALSE(failure_); 200 EXPECT_FALSE(failure_);
201 EXPECT_FALSE(timeout_); 201 EXPECT_FALSE(timeout_);
202 delete res; 202 delete res;
203 } 203 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/stunrequest.cc ('k') | webrtc/p2p/base/tcpport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698