| 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace internal { | 22 namespace internal { |
| 23 | 23 |
| 24 class RemoveStaleCacheFilesTest : public testing::Test { | 24 class RemoveStaleCacheFilesTest : public testing::Test { |
| 25 protected: | 25 protected: |
| 26 virtual void SetUp() OVERRIDE { | 26 virtual void SetUp() OVERRIDE { |
| 27 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 27 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 28 | 28 |
| 29 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); | 29 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); |
| 30 | 30 |
| 31 metadata_storage_.reset(new ResourceMetadataStorage( | 31 metadata_storage_.reset(new ResourceMetadataStorage( |
| 32 temp_dir_.path(), base::MessageLoopProxy::current())); | 32 temp_dir_.path(), base::MessageLoopProxy::current().get())); |
| 33 | 33 |
| 34 cache_.reset(new FileCache(metadata_storage_.get(), | 34 cache_.reset(new FileCache(metadata_storage_.get(), |
| 35 temp_dir_.path(), | 35 temp_dir_.path(), |
| 36 base::MessageLoopProxy::current(), | 36 base::MessageLoopProxy::current().get(), |
| 37 fake_free_disk_space_getter_.get())); | 37 fake_free_disk_space_getter_.get())); |
| 38 | 38 |
| 39 resource_metadata_.reset(new ResourceMetadata( | 39 resource_metadata_.reset(new ResourceMetadata( |
| 40 metadata_storage_.get(), base::MessageLoopProxy::current())); | 40 metadata_storage_.get(), base::MessageLoopProxy::current())); |
| 41 | 41 |
| 42 ASSERT_TRUE(metadata_storage_->Initialize()); | 42 ASSERT_TRUE(metadata_storage_->Initialize()); |
| 43 ASSERT_TRUE(cache_->Initialize()); | 43 ASSERT_TRUE(cache_->Initialize()); |
| 44 ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize()); | 44 ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize()); |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 77 | 77 |
| 78 // Remove stale cache files. | 78 // Remove stale cache files. |
| 79 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); | 79 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); |
| 80 | 80 |
| 81 // Verify that the cache entry is deleted. | 81 // Verify that the cache entry is deleted. |
| 82 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); | 82 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace internal | 85 } // namespace internal |
| 86 } // namespace drive | 86 } // namespace drive |
| OLD | NEW |