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

Unified Diff: components/safe_browsing_db/v4_store_unittest.cc

Issue 2598733002: Fix handling of store-write failures in Pver4 (Closed)
Patch Set: Change the way I generate a non-writable file, for Windows Created 4 years 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 | « components/safe_browsing_db/v4_store.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_store_unittest.cc
diff --git a/components/safe_browsing_db/v4_store_unittest.cc b/components/safe_browsing_db/v4_store_unittest.cc
index 61af219164af9fb8a516901a482e5c9c1f76eedf..12d2845a88a86eac23f5509353bf3e399b581454 100644
--- a/components/safe_browsing_db/v4_store_unittest.cc
+++ b/components/safe_browsing_db/v4_store_unittest.cc
@@ -825,6 +825,14 @@ TEST_F(V4StoreTest, WriteToDiskFails) {
// the temp store file to |store_path_| it fails.
EXPECT_EQ(UNABLE_TO_RENAME_FAILURE,
V4Store(task_runner_, temp_dir_.GetPath()).WriteToDisk(Checksum()));
+
+ // Give a location that isn't writable, even for the tmp file.
+ base::FilePath non_writable_dir =
+ temp_dir_.GetPath()
+ .Append(FILE_PATH_LITERAL("nonexistent_dir"))
+ .Append(FILE_PATH_LITERAL("some.store"));
+ EXPECT_EQ(UNEXPECTED_BYTES_WRITTEN_FAILURE,
+ V4Store(task_runner_, non_writable_dir).WriteToDisk(Checksum()));
}
TEST_F(V4StoreTest, FullUpdateFailsChecksumSynchronously) {
« no previous file with comments | « components/safe_browsing_db/v4_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698