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

Unified Diff: components/search_provider_logos/logo_cache_unittest.cc

Issue 2404823002: Fix error handling in POSIX version of the base::File::GetLength. (Closed)
Patch Set: Fix error handling in POSIX version of the base::File::GetLength. Created 4 years, 1 month 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: components/search_provider_logos/logo_cache_unittest.cc
diff --git a/components/search_provider_logos/logo_cache_unittest.cc b/components/search_provider_logos/logo_cache_unittest.cc
index 6a7dcbae646cab499c7794cc33658ff0b661e589..0de7e3897d329554f4f2a0ba0511346a10a761e7 100644
--- a/components/search_provider_logos/logo_cache_unittest.cc
+++ b/components/search_provider_logos/logo_cache_unittest.cc
@@ -94,7 +94,7 @@ void ExpectLogosEqual(const EncodedLogo& expected_logo,
void ShortenFile(base::FilePath path) {
base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_WRITE);
int64_t file_length = file.GetLength();
- ASSERT_NE(file_length, 0);
+ ASSERT_GT(file_length, 0);
file.SetLength(file_length - 1);
}

Powered by Google App Engine
This is Rietveld 408576698