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

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/net_watcher/net_watcher.cc ('k') | net/tools/quic/quic_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 26caccff3503c164e705a732a9fbaaf7742ea25d..eb593e19d2a7f0b373f3709adbf215093a818b68 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -7,7 +7,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h"
@@ -304,8 +303,8 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
}
void set_smaller_flow_control_receive_window() {
- const uint32 kClientIFCW = 64 * 1024;
- const uint32 kServerIFCW = 1024 * 1024;
+ const uint32_t kClientIFCW = 64 * 1024;
+ const uint32_t kServerIFCW = 1024 * 1024;
set_client_initial_stream_flow_control_receive_window(kClientIFCW);
set_client_initial_session_flow_control_receive_window(
kSessionToStreamRatio * kClientIFCW);
@@ -314,26 +313,26 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
kSessionToStreamRatio * kServerIFCW);
}
- void set_client_initial_stream_flow_control_receive_window(uint32 window) {
+ void set_client_initial_stream_flow_control_receive_window(uint32_t window) {
CHECK(client_.get() == nullptr);
DVLOG(1) << "Setting client initial stream flow control window: " << window;
client_config_.SetInitialStreamFlowControlWindowToSend(window);
}
- void set_client_initial_session_flow_control_receive_window(uint32 window) {
+ void set_client_initial_session_flow_control_receive_window(uint32_t window) {
CHECK(client_.get() == nullptr);
DVLOG(1) << "Setting client initial session flow control window: "
<< window;
client_config_.SetInitialSessionFlowControlWindowToSend(window);
}
- void set_server_initial_stream_flow_control_receive_window(uint32 window) {
+ void set_server_initial_stream_flow_control_receive_window(uint32_t window) {
CHECK(server_thread_.get() == nullptr);
DVLOG(1) << "Setting server initial stream flow control window: " << window;
server_config_.SetInitialStreamFlowControlWindowToSend(window);
}
- void set_server_initial_session_flow_control_receive_window(uint32 window) {
+ void set_server_initial_session_flow_control_receive_window(uint32_t window) {
CHECK(server_thread_.get() == nullptr);
DVLOG(1) << "Setting server initial session flow control window: "
<< window;
@@ -447,7 +446,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
response_code, body);
}
- void SetPacketLossPercentage(int32 loss) {
+ void SetPacketLossPercentage(int32_t loss) {
// TODO(rtenneti): enable when we can do random packet loss tests in
// chrome's tree.
if (loss != 0 && loss != 100)
@@ -463,7 +462,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
// server_writer_->set_fake_packet_delay(delay);
}
- void SetReorderPercentage(int32 reorder) {
+ void SetReorderPercentage(int32_t reorder) {
// TODO(rtenneti): enable when we can do random packet reorder tests in
// chrome's tree.
// client_writer_->set_fake_reorder_percentage(reorder);
@@ -1040,7 +1039,7 @@ TEST_P(EndToEndTest, DoNotSetResumeWriteAlarmIfConnectionFlowControlBlocked) {
// Ensure both stream and connection level are flow control blocked by setting
// the send window offset to 0.
- const uint64 flow_control_window =
+ const uint64_t flow_control_window =
server_config_.GetInitialStreamFlowControlWindowToSend();
QuicSpdyClientStream* stream = client_->GetOrCreateStream();
QuicSession* session = client_->client()->session();
@@ -1221,7 +1220,7 @@ TEST_P(EndToEndTest, LimitMaxOpenStreams) {
TEST_P(EndToEndTest, ClientSuggestsRTT) {
// Client suggests initial RTT, verify it is used.
- const uint32 kInitialRTT = 20000;
+ const uint32_t kInitialRTT = 20000;
client_config_.SetInitialRoundTripTimeUsToSend(kInitialRTT);
ASSERT_TRUE(Initialize());
@@ -1270,9 +1269,9 @@ TEST_P(EndToEndTest, MaxInitialRTT) {
client_sent_packet_manager.GetRttStats()->smoothed_rtt().IsInfinite());
const RttStats& server_rtt_stats =
*session->connection()->sent_packet_manager().GetRttStats();
- EXPECT_EQ(static_cast<int64>(kMaxInitialRoundTripTimeUs),
+ EXPECT_EQ(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
server_rtt_stats.initial_rtt_us());
- EXPECT_GE(static_cast<int64>(kMaxInitialRoundTripTimeUs),
+ EXPECT_GE(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
server_rtt_stats.smoothed_rtt().ToMicroseconds());
server_thread_->Resume();
}
@@ -1301,7 +1300,7 @@ TEST_P(EndToEndTest, MinInitialRTT) {
EXPECT_FALSE(
client_sent_packet_manager.GetRttStats()->smoothed_rtt().IsInfinite());
// Expect the default rtt of 100ms.
- EXPECT_EQ(static_cast<int64>(100 * kNumMicrosPerMilli),
+ EXPECT_EQ(static_cast<int64_t>(100 * kNumMicrosPerMilli),
server_sent_packet_manager.GetRttStats()->initial_rtt_us());
// Ensure the bandwidth is valid.
client_sent_packet_manager.BandwidthEstimate();
@@ -1535,14 +1534,14 @@ TEST_P(EndToEndTest, DifferentFlowControlWindows) {
// Client and server can set different initial flow control receive windows.
// These are sent in CHLO/SHLO. Tests that these values are exchanged properly
// in the crypto handshake.
- const uint32 kClientStreamIFCW = 123456;
- const uint32 kClientSessionIFCW = 234567;
+ const uint32_t kClientStreamIFCW = 123456;
+ const uint32_t kClientSessionIFCW = 234567;
set_client_initial_stream_flow_control_receive_window(kClientStreamIFCW);
set_client_initial_session_flow_control_receive_window(kClientSessionIFCW);
- uint32 kServerStreamIFCW =
+ uint32_t kServerStreamIFCW =
GetParam().auto_tune_flow_control_window ? 32 * 1024 : 654321;
- uint32 kServerSessionIFCW =
+ uint32_t kServerSessionIFCW =
GetParam().auto_tune_flow_control_window ? 48 * 1024 : 765432;
set_server_initial_stream_flow_control_receive_window(kServerStreamIFCW);
set_server_initial_session_flow_control_receive_window(kServerSessionIFCW);
@@ -1591,9 +1590,9 @@ TEST_P(EndToEndTest, DifferentFlowControlWindows) {
TEST_P(EndToEndTest, HeadersAndCryptoStreamsNoConnectionFlowControl) {
// The special headers and crypto streams should be subject to per-stream flow
// control limits, but should not be subject to connection level flow control.
- const uint32 kStreamIFCW =
+ const uint32_t kStreamIFCW =
GetParam().auto_tune_flow_control_window ? 32 * 1024 : 123456;
- const uint32 kSessionIFCW =
+ const uint32_t kSessionIFCW =
GetParam().auto_tune_flow_control_window ? 48 * 1024 : 234567;
set_client_initial_stream_flow_control_receive_window(kStreamIFCW);
set_client_initial_session_flow_control_receive_window(kSessionIFCW);
@@ -2020,7 +2019,7 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
// The response body must be larger than the flow control window so the server
// must receive a window update from the client before it can finish sending
// it.
- uint32 response_body_size =
+ uint32_t response_body_size =
2 * client_config_.GetInitialStreamFlowControlWindowToSend();
GenerateBody(&response_body, response_body_size);
@@ -2039,7 +2038,7 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
// update. This allows headers processing to trigger the error response
// before the request FIN is processed but receive the request FIN before the
// response is sent completely.
- const uint32 kRequestBodySize = kMaxPacketSize + 10;
+ const uint32_t kRequestBodySize = kMaxPacketSize + 10;
string request_body;
GenerateBody(&request_body, kRequestBodySize);
request.AddBody(request_body, false);
@@ -2073,7 +2072,7 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
}
TEST_P(EndToEndTest, LargePostEarlyResponse) {
- const uint32 kWindowSize = 65536;
+ const uint32_t kWindowSize = 65536;
set_client_initial_stream_flow_control_receive_window(kWindowSize);
set_client_initial_session_flow_control_receive_window(kWindowSize);
set_server_initial_stream_flow_control_receive_window(kWindowSize);
@@ -2086,7 +2085,7 @@ TEST_P(EndToEndTest, LargePostEarlyResponse) {
// POST to a URL that gets an early error response, after the headers are
// received and before the body is received.
HTTPMessage request(HttpConstants::HTTP_1_1, HttpConstants::POST, "/garbage");
- const uint32 kBodySize = 2 * kWindowSize;
+ const uint32_t kBodySize = 2 * kWindowSize;
// Invalid content-length so the request will receive an early 500 response.
request.AddHeader("content-length", "-1");
request.set_skip_message_validation(true);
« no previous file with comments | « net/tools/net_watcher/net_watcher.cc ('k') | net/tools/quic/quic_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698