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

Unified Diff: net/url_request/url_request_simple_job_unittest.cc

Issue 2265873002: Adjust callers and networking delegates in net/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: rebased Created 4 years, 4 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/url_request/url_request_simple_job_unittest.cc
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc
index 64678a1ee31d00b2044c77982400f9cd87dcc161..1fa96abc7228325064ddc440d95329aff9da0d55 100644
--- a/net/url_request/url_request_simple_job_unittest.cc
+++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -163,7 +163,7 @@ class URLRequestSimpleJobTest : public ::testing::Test {
TEST_F(URLRequestSimpleJobTest, SimpleRequest) {
StartRequest(NULL);
- ASSERT_TRUE(request_->status().is_success());
+ EXPECT_EQ(OK, delegate_.request_status());
EXPECT_EQ(kTestData, delegate_.data_received());
}
@@ -178,7 +178,7 @@ TEST_F(URLRequestSimpleJobTest, RangeRequest) {
StartRequest(&headers);
- ASSERT_TRUE(request_->status().is_success());
+ EXPECT_EQ(OK, delegate_.request_status());
EXPECT_EQ(kExpectedBody, delegate_.data_received());
}
@@ -195,8 +195,7 @@ TEST_F(URLRequestSimpleJobTest, MultipleRangeRequest) {
StartRequest(&headers);
EXPECT_TRUE(delegate_.request_failed());
- EXPECT_THAT(request_->status().error(),
- IsError(ERR_REQUEST_RANGE_NOT_SATISFIABLE));
+ EXPECT_EQ(ERR_REQUEST_RANGE_NOT_SATISFIABLE, delegate_.request_status());
}
TEST_F(URLRequestSimpleJobTest, InvalidRangeRequest) {
@@ -207,7 +206,7 @@ TEST_F(URLRequestSimpleJobTest, InvalidRangeRequest) {
StartRequest(&headers);
- ASSERT_TRUE(request_->status().is_success());
+ EXPECT_EQ(OK, delegate_.request_status());
EXPECT_EQ(kTestData, delegate_.data_received());
}
@@ -215,7 +214,7 @@ TEST_F(URLRequestSimpleJobTest, EmptyDataRequest) {
request_ =
context_.CreateRequest(GURL("data:empty"), DEFAULT_PRIORITY, &delegate_);
StartRequest(nullptr);
- ASSERT_TRUE(request_->status().is_success());
+ EXPECT_EQ(OK, delegate_.request_status());
EXPECT_EQ("", delegate_.data_received());
}
@@ -226,7 +225,7 @@ TEST_F(URLRequestSimpleJobTest, CancelBeforeResponseStarts) {
request_->Cancel();
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(URLRequestStatus::CANCELED, request_->status().status());
+ EXPECT_EQ(ERR_ABORTED, delegate_.request_status());
EXPECT_EQ(1, delegate_.response_started_count());
}
@@ -244,7 +243,6 @@ TEST_F(URLRequestSimpleJobTest, CancelAfterFirstReadStarted) {
FROM_HERE, base::Bind(&base::DoNothing), run_loop.QuitClosure()));
run_loop.Run();
- EXPECT_EQ(URLRequestStatus::CANCELED, request_->status().status());
EXPECT_EQ(1, cancel_delegate.response_started_count());
EXPECT_EQ("", cancel_delegate.data_received());
// Destroy the request so it doesn't outlive its delegate.

Powered by Google App Engine
This is Rietveld 408576698