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

Unified Diff: net/url_request/url_request_file_dir_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 on top of URLRequest::Read CL 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
« no previous file with comments | « net/url_request/url_request_data_job_fuzzer.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b23f55e26620005971a1f87140bcfff0773b2c07..e1b9b1e2015fb0c5bcbfb896fad41495ec73eedb 100644
--- a/net/url_request/url_request_file_dir_job_unittest.cc
+++ b/net/url_request/url_request_file_dir_job_unittest.cc
@@ -125,13 +125,12 @@ TEST_F(URLRequestFileDirTest, ListCompletionOnNoPending) {
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(delegate_.got_response_started());
- int bytes_read = 0;
- EXPECT_FALSE(request->Read(buffer_.get(), kBufferSize, &bytes_read));
+ int bytes_read = request->Read(buffer_.get(), kBufferSize);
// 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(request->status().ToNetError(), IsError(ERR_FILE_NOT_FOUND));
+ EXPECT_THAT(bytes_read, IsError(ERR_FILE_NOT_FOUND));
}
// Test the case where reading the response completes synchronously.
@@ -154,12 +153,9 @@ TEST_F(URLRequestFileDirTest, DirectoryWithASingleFileSync) {
// 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.
- EXPECT_TRUE(request->Read(buffer_.get(), kBufferSize, &bytes_read));
-
- EXPECT_EQ(URLRequestStatus::SUCCESS, request->status().status());
+ int bytes_read = request->Read(buffer_.get(), kBufferSize);
ASSERT_GT(bytes_read, 0);
ASSERT_LE(bytes_read, kBufferSize);
« no previous file with comments | « net/url_request/url_request_data_job_fuzzer.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698