| Index: net/url_request/url_request_file_dir_job_unittest.cc
|
| diff --git a/net/url_request/url_request_file_dir_job_unittest.cc b/net/url_request/url_request_file_dir_job_unittest.cc
|
| index e1b9b1e2015fb0c5bcbfb896fad41495ec73eedb..b23f55e26620005971a1f87140bcfff0773b2c07 100644
|
| --- a/net/url_request/url_request_file_dir_job_unittest.cc
|
| +++ b/net/url_request/url_request_file_dir_job_unittest.cc
|
| @@ -125,12 +125,13 @@
|
| base::RunLoop().RunUntilIdle();
|
| ASSERT_TRUE(delegate_.got_response_started());
|
|
|
| - int bytes_read = request->Read(buffer_.get(), kBufferSize);
|
| + int bytes_read = 0;
|
| + EXPECT_FALSE(request->Read(buffer_.get(), kBufferSize, &bytes_read));
|
|
|
| // The URLRequestFileDirJobShould return the cached read error synchronously.
|
| // If it's not returned synchronously, the code path this is intended to test
|
| // was not executed.
|
| - EXPECT_THAT(bytes_read, IsError(ERR_FILE_NOT_FOUND));
|
| + EXPECT_THAT(request->status().ToNetError(), IsError(ERR_FILE_NOT_FOUND));
|
| }
|
|
|
| // Test the case where reading the response completes synchronously.
|
| @@ -153,9 +154,12 @@
|
| // entire directory listing and cached it.
|
| base::RunLoop().RunUntilIdle();
|
|
|
| + int bytes_read = 0;
|
| // This will complete synchronously, since the URLRequetsFileDirJob had
|
| // directory listing cached in memory.
|
| - int bytes_read = request->Read(buffer_.get(), kBufferSize);
|
| + EXPECT_TRUE(request->Read(buffer_.get(), kBufferSize, &bytes_read));
|
| +
|
| + EXPECT_EQ(URLRequestStatus::SUCCESS, request->status().status());
|
|
|
| ASSERT_GT(bytes_read, 0);
|
| ASSERT_LE(bytes_read, kBufferSize);
|
|
|