drive: FileCache::Store marks the entry as dirty if empty MD5 is given

Store() and MarkAsDirty() should be performed together, atomically.
Otherwise, it may cause troubles when something goes wrong. (e.g. sudden shutdown of the device)

Provide a way to perform Store() and MarkAsDirty() at the same time by specially handling empty MD5.

BUG=260539
TEST=unit_tests

Review URL: https://codereview.chromium.org/146833015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247559 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chromeos/drive/sync_client_unittest.cc b/chrome/browser/chromeos/drive/sync_client_unittest.cc
index 784e247..77da5459 100644
--- a/chrome/browser/chromeos/drive/sync_client_unittest.cc
+++ b/chrome/browser/chromeos/drive/sync_client_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "chrome/browser/chromeos/drive/sync_client.h"
 
-#include "base/callback_helpers.h"
 #include "base/file_util.h"
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
@@ -208,14 +207,10 @@
     EXPECT_EQ(FILE_ERROR_OK, cache_->Pin(GetLocalId("fetched")));
 
     // Prepare a pinned-and-fetched-and-dirty file.
-    const std::string md5_dirty = "";  // Don't care.
     EXPECT_EQ(FILE_ERROR_OK,
-              cache_->Store(GetLocalId("dirty"), md5_dirty,
+              cache_->Store(GetLocalId("dirty"), std::string(),
                             temp_file, FileCache::FILE_OPERATION_COPY));
     EXPECT_EQ(FILE_ERROR_OK, cache_->Pin(GetLocalId("dirty")));
-    scoped_ptr<base::ScopedClosureRunner> file_closer;
-    EXPECT_EQ(FILE_ERROR_OK,
-              cache_->OpenForWrite(GetLocalId("dirty"), &file_closer));
 
     // Prepare a removed file.
     file_system::RemoveOperation remove_operation(