| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Create a stale cache file. | 75 // Create a stale cache file. |
| 76 EXPECT_EQ(FILE_ERROR_OK, | 76 EXPECT_EQ(FILE_ERROR_OK, |
| 77 cache_->Store(resource_id, md5, dummy_file, | 77 cache_->Store(resource_id, md5, dummy_file, |
| 78 FileCache::FILE_OPERATION_COPY)); | 78 FileCache::FILE_OPERATION_COPY)); |
| 79 | 79 |
| 80 // Verify that the cache entry exists. | 80 // Verify that the cache entry exists. |
| 81 FileCacheEntry cache_entry; | 81 FileCacheEntry cache_entry; |
| 82 EXPECT_TRUE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); | 82 EXPECT_TRUE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); |
| 83 | 83 |
| 84 ResourceEntry entry; | 84 ResourceEntry entry; |
| 85 EXPECT_EQ( | 85 EXPECT_EQ(FILE_ERROR_NOT_FOUND, |
| 86 FILE_ERROR_NOT_FOUND, | 86 resource_metadata_->GetResourceEntryById(resource_id, &entry)); |
| 87 resource_metadata_->GetResourceEntryById(resource_id, NULL, &entry)); | |
| 88 | 87 |
| 89 // Remove stale cache files. | 88 // Remove stale cache files. |
| 90 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); | 89 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); |
| 91 | 90 |
| 92 // Verify that the cache entry is deleted. | 91 // Verify that the cache entry is deleted. |
| 93 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); | 92 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); |
| 94 } | 93 } |
| 95 | 94 |
| 96 } // namespace internal | 95 } // namespace internal |
| 97 } // namespace drive | 96 } // namespace drive |
| OLD | NEW |