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

Unified Diff: net/spdy/spdy_http_stream_unittest.cc

Issue 2351513002: net: rename BoundNetLog to NetLogWithSource (Closed)
Patch Set: one more fix, content bound_net_log_ Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/spdy_http_stream_unittest.cc
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc
index 96149e8050ef7c90cc046a1848a3388e6d2e50ab..d2b478a28ab8de631a5a495cf906ad869f2f1598 100644
--- a/net/spdy/spdy_http_stream_unittest.cc
+++ b/net/spdy/spdy_http_stream_unittest.cc
@@ -76,7 +76,7 @@ class ReadErrorUploadDataStream : public UploadDataStream {
void CompleteRead() { UploadDataStream::OnReadCompleted(ERR_FAILED); }
// UploadDataStream implementation:
- int InitInternal(const BoundNetLog& net_log) override { return OK; }
+ int InitInternal(const NetLogWithSource& net_log) override { return OK; }
int ReadInternal(IOBuffer* buf, int buf_len) override {
if (async_ == FailureMode::ASYNC) {
@@ -146,8 +146,8 @@ class SpdyHttpStreamTest : public testing::Test {
new SequencedSocketData(reads, reads_count, writes, writes_count));
session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get());
http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
- session_ =
- CreateInsecureSpdySession(http_session_.get(), key_, BoundNetLog());
+ session_ = CreateInsecureSpdySession(http_session_.get(), key_,
+ NetLogWithSource());
}
void TestSendCredentials(
@@ -187,7 +187,7 @@ TEST_F(SpdyHttpStreamTest, SendRequest) {
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
// Make sure getting load timing information the stream early does not crash.
@@ -264,10 +264,9 @@ TEST_F(SpdyHttpStreamTest, LoadTimingTwoRequests) {
new SpdyHttpStream(session_, true));
// First write.
- ASSERT_EQ(OK,
- http_stream1->InitializeStream(&request1, DEFAULT_PRIORITY,
- BoundNetLog(),
- CompletionCallback()));
+ ASSERT_EQ(OK, http_stream1->InitializeStream(&request1, DEFAULT_PRIORITY,
+ NetLogWithSource(),
+ CompletionCallback()));
EXPECT_EQ(ERR_IO_PENDING, http_stream1->SendRequest(headers1, &response1,
callback1.callback()));
EXPECT_TRUE(HasSpdySession(http_session_->spdy_session_pool(), key_));
@@ -281,10 +280,9 @@ TEST_F(SpdyHttpStreamTest, LoadTimingTwoRequests) {
EXPECT_FALSE(http_stream2->GetLoadTimingInfo(&load_timing_info2));
// Second write.
- ASSERT_EQ(OK,
- http_stream2->InitializeStream(&request2, DEFAULT_PRIORITY,
- BoundNetLog(),
- CompletionCallback()));
+ ASSERT_EQ(OK, http_stream2->InitializeStream(&request2, DEFAULT_PRIORITY,
+ NetLogWithSource(),
+ CompletionCallback()));
EXPECT_EQ(ERR_IO_PENDING, http_stream2->SendRequest(headers2, &response2,
callback2.callback()));
EXPECT_TRUE(HasSpdySession(http_session_->spdy_session_pool(), key_));
@@ -346,14 +344,14 @@ TEST_F(SpdyHttpStreamTest, SendChunkedPost) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_EQ(
OK,
@@ -402,14 +400,14 @@ TEST_F(SpdyHttpStreamTest, SendChunkedPostLastEmpty) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_EQ(OK, http_stream.InitializeStream(&request, DEFAULT_PRIORITY,
net_log, CompletionCallback()));
@@ -455,14 +453,14 @@ TEST_F(SpdyHttpStreamTest, ConnectionClosedDuringChunkedPost) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_EQ(OK, http_stream.InitializeStream(&request, DEFAULT_PRIORITY,
net_log, CompletionCallback()));
@@ -524,12 +522,12 @@ TEST_F(SpdyHttpStreamTest, DelayedSendChunkedPost) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
upload_stream.AppendData(kUploadData, kUploadDataSize, false);
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
ASSERT_EQ(OK, http_stream->InitializeStream(&request, DEFAULT_PRIORITY,
@@ -618,12 +616,12 @@ TEST_F(SpdyHttpStreamTest, DelayedSendChunkedPostWithEmptyFinalDataFrame) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
upload_stream.AppendData(kUploadData, kUploadDataSize, false);
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
ASSERT_EQ(OK, http_stream->InitializeStream(&request, DEFAULT_PRIORITY,
@@ -701,12 +699,12 @@ TEST_F(SpdyHttpStreamTest, ChunkedPostWithEmptyPayload) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
upload_stream.AppendData("", 0, true);
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
ASSERT_EQ(OK, http_stream->InitializeStream(&request, DEFAULT_PRIORITY,
@@ -765,7 +763,7 @@ TEST_F(SpdyHttpStreamTest, SpdyURLTest) {
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
ASSERT_EQ(OK,
@@ -814,11 +812,11 @@ TEST_F(SpdyHttpStreamTest, DelayedSendChunkedPostWithWindowUpdate) {
request.url = GURL("http://www.example.org/");
request.upload_data_stream = &upload_stream;
- ASSERT_THAT(
- upload_stream.Init(TestCompletionCallback().callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(upload_stream.Init(TestCompletionCallback().callback(),
+ NetLogWithSource()),
+ IsOk());
- BoundNetLog net_log;
+ NetLogWithSource net_log;
std::unique_ptr<SpdyHttpStream> http_stream(
new SpdyHttpStream(session_, true));
ASSERT_EQ(OK, http_stream->InitializeStream(&request, DEFAULT_PRIORITY,
@@ -911,7 +909,7 @@ TEST_F(SpdyHttpStreamTest, DataReadErrorSynchronous) {
ReadErrorUploadDataStream upload_data_stream(
ReadErrorUploadDataStream::FailureMode::SYNC);
ASSERT_THAT(upload_data_stream.Init(TestCompletionCallback().callback(),
- BoundNetLog()),
+ NetLogWithSource()),
IsOk());
HttpRequestInfo request;
@@ -922,7 +920,7 @@ TEST_F(SpdyHttpStreamTest, DataReadErrorSynchronous) {
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_EQ(OK, http_stream.InitializeStream(&request, DEFAULT_PRIORITY,
net_log, CompletionCallback()));
@@ -960,7 +958,7 @@ TEST_F(SpdyHttpStreamTest, DataReadErrorAsynchronous) {
ReadErrorUploadDataStream upload_data_stream(
ReadErrorUploadDataStream::FailureMode::ASYNC);
ASSERT_THAT(upload_data_stream.Init(TestCompletionCallback().callback(),
- BoundNetLog()),
+ NetLogWithSource()),
IsOk());
HttpRequestInfo request;
@@ -971,7 +969,7 @@ TEST_F(SpdyHttpStreamTest, DataReadErrorAsynchronous) {
TestCompletionCallback callback;
HttpResponseInfo response;
HttpRequestHeaders headers;
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_EQ(OK, http_stream.InitializeStream(&request, DEFAULT_PRIORITY,
net_log, CompletionCallback()));
@@ -1004,11 +1002,12 @@ TEST_F(SpdyHttpStreamTest, RequestCallbackCancelsStream) {
request.upload_data_stream = &upload_stream;
TestCompletionCallback upload_callback;
- ASSERT_THAT(upload_stream.Init(upload_callback.callback(), BoundNetLog()),
- IsOk());
+ ASSERT_THAT(
+ upload_stream.Init(upload_callback.callback(), NetLogWithSource()),
+ IsOk());
upload_stream.AppendData("", 0, true);
- BoundNetLog net_log;
+ NetLogWithSource net_log;
SpdyHttpStream http_stream(session_, true);
ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log,
CompletionCallback()),

Powered by Google App Engine
This is Rietveld 408576698