Index: net/url_request/url_request_http_job_unittest.cc |
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc |
index aa1599aa6cce1b56b906753b84491447423c7fff..83c85a07713fc94b8fcf40f9ef78807f7159b949 100644 |
--- a/net/url_request/url_request_http_job_unittest.cc |
+++ b/net/url_request/url_request_http_job_unittest.cc |
@@ -162,7 +162,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
ASSERT_TRUE(request->is_pending()); |
base::RunLoop().Run(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -191,7 +191,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
ASSERT_TRUE(request->is_pending()); |
base::RunLoop().Run(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -222,7 +222,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, TestContentLengthFailedRequest) { |
ASSERT_TRUE(request->is_pending()); |
base::RunLoop().Run(); |
- EXPECT_EQ(URLRequestStatus::FAILED, request->status().status()); |
+ EXPECT_EQ(ERR_FAILED, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -254,7 +254,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
request->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); |
+ EXPECT_EQ(ERR_ABORTED, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -302,7 +302,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
ASSERT_TRUE(request->is_pending()); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
// Should not include the redirect. |
EXPECT_EQ(CountWriteBytes(final_writes, arraysize(final_writes)), |
@@ -334,7 +334,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
request->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); |
+ EXPECT_EQ(ERR_ABORTED, delegate.request_status()); |
EXPECT_EQ(0, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -359,7 +359,7 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, |
request->Cancel(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); |
+ EXPECT_EQ(ERR_ABORTED, delegate.request_status()); |
EXPECT_EQ(0, request->received_response_content_length()); |
EXPECT_EQ(0, request->GetTotalSentBytes()); |
EXPECT_EQ(0, request->GetTotalReceivedBytes()); |
@@ -380,7 +380,7 @@ TEST_F(URLRequestHttpJobTest, TestCancelWhileReadingCookies) { |
request->Cancel(); |
base::RunLoop().Run(); |
- EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); |
+ EXPECT_EQ(ERR_ABORTED, delegate.request_status()); |
} |
// Make sure that SetPriority actually sets the URLRequestHttpJob's |
@@ -567,7 +567,7 @@ TEST_F(URLRequestHttpJobWithSdchSupportTest, GetDictionary) { |
request->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
// Second response should be from cache without notification of SdchObserver |
TestDelegate delegate2; |
@@ -576,7 +576,7 @@ TEST_F(URLRequestHttpJobWithSdchSupportTest, GetDictionary) { |
request2->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate2.request_status()); |
// Cleanup manager. |
sdch_manager.RemoveObserver(&sdch_observer); |
@@ -613,7 +613,7 @@ TEST_F(URLRequestHttpJobWithBrotliSupportTest, NoBrotliAdvertisementOverHttp) { |
request->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -648,7 +648,7 @@ TEST_F(URLRequestHttpJobWithBrotliSupportTest, BrotliAdvertisement) { |
request->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_TRUE(request->status().is_success()); |
+ EXPECT_EQ(OK, delegate.request_status()); |
EXPECT_EQ(12, request->received_response_content_length()); |
EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), |
request->GetTotalSentBytes()); |
@@ -798,8 +798,7 @@ class FakeWebSocketHandshakeStream : public WebSocketHandshakeStreamBase { |
TEST_F(URLRequestHttpJobWebSocketTest, RejectedWithoutCreateHelper) { |
req_->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(URLRequestStatus::FAILED, req_->status().status()); |
- EXPECT_THAT(req_->status().error(), IsError(ERR_DISALLOWED_URL_SCHEME)); |
+ EXPECT_EQ(ERR_DISALLOWED_URL_SCHEME, delegate_.request_status()); |
} |
TEST_F(URLRequestHttpJobWebSocketTest, CreateHelperPassedThrough) { |
@@ -816,7 +815,6 @@ TEST_F(URLRequestHttpJobWebSocketTest, CreateHelperPassedThrough) { |
req_->SetLoadFlags(LOAD_DISABLE_CACHE); |
req_->Start(); |
base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); |
EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); |
} |