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

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: Matt's comments 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
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..e0d68bbd9931015224d1766472c4c53a3d446a0c 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, ERR_FILE_NOT_FOUND);
mmenke 2016/09/01 16:57:25 This should be "EXPECT_THAT(bytes_read, IsError(ER
maksims (do not use this acc) 2016/09/02 12:31:53 Done.
}
// 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);

Powered by Google App Engine
This is Rietveld 408576698