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

Unified Diff: net/url_request/url_request_file_dir_job_unittest.cc

Issue 2330863002: Use modifed URLRequest API in net/url_request context builder, data job fuzzer and file dir test (Closed)
Patch Set: 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') | no next file » | 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 5d269f8f5fa8f678110836ea49a9940993af2ffe..922402a59f0ad40006c693f31ce83fc060609e98 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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698