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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1502503004: Remove kuint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint8
Patch Set: rebase 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
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index bd538f54b9a9a483b37e7ca64dfb62cb72e95998..09a7e505a764e7a998a1c2528094d9bb3565098f 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -8,6 +8,7 @@
#include <stdarg.h>
#include <stdint.h>
+#include <limits>
#include <string>
#include <vector>
@@ -546,10 +547,9 @@ void FillLargeHeadersString(std::string* str, int size) {
#if defined(NTLM_PORTABLE)
// Alternative functions that eliminate randomness and dependency on the local
// host name so that the generated NTLM messages are reproducible.
-void MockGenerateRandom1(uint8* output, size_t n) {
- static const uint8 bytes[] = {
- 0x55, 0x29, 0x66, 0x26, 0x6b, 0x9c, 0x73, 0x54
- };
+void MockGenerateRandom1(uint8_t* output, size_t n) {
+ static const uint8_t bytes[] = {0x55, 0x29, 0x66, 0x26,
+ 0x6b, 0x9c, 0x73, 0x54};
static size_t current_byte = 0;
for (size_t i = 0; i < n; ++i) {
output[i] = bytes[current_byte++];
@@ -557,11 +557,10 @@ void MockGenerateRandom1(uint8* output, size_t n) {
}
}
-void MockGenerateRandom2(uint8* output, size_t n) {
- static const uint8 bytes[] = {
- 0x96, 0x79, 0x85, 0xe7, 0x49, 0x93, 0x70, 0xa1,
- 0x4e, 0xe7, 0x87, 0x45, 0x31, 0x5b, 0xd3, 0x1f
- };
+void MockGenerateRandom2(uint8_t* output, size_t n) {
+ static const uint8_t bytes[] = {0x96, 0x79, 0x85, 0xe7, 0x49, 0x93,
+ 0x70, 0xa1, 0x4e, 0xe7, 0x87, 0x45,
+ 0x31, 0x5b, 0xd3, 0x1f};
static size_t current_byte = 0;
for (size_t i = 0; i < n; ++i) {
output[i] = bytes[current_byte++];
@@ -1376,7 +1375,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest(
"hello", "world"
};
- uint32 first_socket_log_id = NetLog::Source::kInvalidId;
+ uint32_t first_socket_log_id = NetLog::Source::kInvalidId;
for (int i = 0; i < 2; ++i) {
TestCompletionCallback callback;
@@ -1904,7 +1903,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) {
const int kNumUnreadBodies = arraysize(data_writes) - 1;
std::string response_lines[kNumUnreadBodies];
- uint32 first_socket_log_id = NetLog::Source::kInvalidId;
+ uint32_t first_socket_log_id = NetLog::Source::kInvalidId;
for (size_t i = 0; i < kNumUnreadBodies; ++i) {
TestCompletionCallback callback;
@@ -9127,14 +9126,14 @@ TEST_P(HttpNetworkTransactionTest, LargeContentLengthThenClose) {
TEST_P(HttpNetworkTransactionTest, UploadFileSmallerThanLength) {
base::FilePath temp_file_path;
ASSERT_TRUE(base::CreateTemporaryFile(&temp_file_path));
- const uint64 kFakeSize = 100000; // file is actually blank
+ const uint64_t kFakeSize = 100000; // file is actually blank
UploadFileElementReader::ScopedOverridingContentLengthForTests
overriding_content_length(kFakeSize);
std::vector<scoped_ptr<UploadElementReader>> element_readers;
element_readers.push_back(make_scoped_ptr(new UploadFileElementReader(
- base::ThreadTaskRunnerHandle::Get().get(), temp_file_path, 0, kuint64max,
- base::Time())));
+ base::ThreadTaskRunnerHandle::Get().get(), temp_file_path, 0,
+ std::numeric_limits<uint64_t>::max(), base::Time())));
ElementsUploadDataStream upload_data_stream(std::move(element_readers), 0);
HttpRequestInfo request;
@@ -9186,9 +9185,9 @@ TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) {
ASSERT_TRUE(base::MakeFileUnreadable(temp_file));
std::vector<scoped_ptr<UploadElementReader>> element_readers;
- element_readers.push_back(make_scoped_ptr(
- new UploadFileElementReader(base::ThreadTaskRunnerHandle::Get().get(),
- temp_file, 0, kuint64max, base::Time())));
+ element_readers.push_back(make_scoped_ptr(new UploadFileElementReader(
+ base::ThreadTaskRunnerHandle::Get().get(), temp_file, 0,
+ std::numeric_limits<uint64_t>::max(), base::Time())));
ElementsUploadDataStream upload_data_stream(std::move(element_readers), 0);
HttpRequestInfo request;
@@ -9229,8 +9228,8 @@ TEST_P(HttpNetworkTransactionTest, CancelDuringInitRequestBody) {
callback_ = callback;
return ERR_IO_PENDING;
}
- uint64 GetContentLength() const override { return 0; }
- uint64 BytesRemaining() const override { return 0; }
+ uint64_t GetContentLength() const override { return 0; }
+ uint64_t BytesRemaining() const override { return 0; }
int Read(IOBuffer* buf,
int buf_length,
const CompletionCallback& callback) override {
« no previous file with comments | « net/base/upload_file_element_reader_unittest.cc ('k') | net/quic/congestion_control/send_algorithm_simulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698