| 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 "chrome/browser/chromeos/drive/file_cache.h" | 5 #include "chrome/browser/chromeos/drive/file_cache.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 ASSERT_TRUE(metadata_storage_->Initialize()); | 902 ASSERT_TRUE(metadata_storage_->Initialize()); |
| 903 | 903 |
| 904 cache_.reset(new FileCache( | 904 cache_.reset(new FileCache( |
| 905 metadata_storage_.get(), | 905 metadata_storage_.get(), |
| 906 temp_dir_.path().Append(util::kCacheFileDirectory), | 906 temp_dir_.path().Append(util::kCacheFileDirectory), |
| 907 base::MessageLoopProxy::current(), | 907 base::MessageLoopProxy::current(), |
| 908 fake_free_disk_space_getter_.get())); | 908 fake_free_disk_space_getter_.get())); |
| 909 ASSERT_TRUE(cache_->Initialize()); | 909 ASSERT_TRUE(cache_->Initialize()); |
| 910 } | 910 } |
| 911 | 911 |
| 912 virtual void TearDown() OVERRIDE { | |
| 913 cache_.reset(); | |
| 914 } | |
| 915 | |
| 916 static bool ImportOldDB(FileCache* cache, const base::FilePath& old_db_path) { | 912 static bool ImportOldDB(FileCache* cache, const base::FilePath& old_db_path) { |
| 917 return cache->ImportOldDB(old_db_path); | 913 return cache->ImportOldDB(old_db_path); |
| 918 } | 914 } |
| 919 | 915 |
| 920 content::TestBrowserThreadBundle thread_bundle_; | 916 content::TestBrowserThreadBundle thread_bundle_; |
| 921 base::ScopedTempDir temp_dir_; | 917 base::ScopedTempDir temp_dir_; |
| 922 | 918 |
| 923 scoped_ptr<ResourceMetadataStorage, test_util::DestroyHelperForTests> | 919 scoped_ptr<ResourceMetadataStorage, test_util::DestroyHelperForTests> |
| 924 metadata_storage_; | 920 metadata_storage_; |
| 925 scoped_ptr<FileCache, test_util::DestroyHelperForTests> cache_; | 921 scoped_ptr<FileCache, test_util::DestroyHelperForTests> cache_; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 // Data is imported correctly. | 1037 // Data is imported correctly. |
| 1042 FileCacheEntry entry; | 1038 FileCacheEntry entry; |
| 1043 EXPECT_TRUE(cache_->GetCacheEntry(key1, std::string(), &entry)); | 1039 EXPECT_TRUE(cache_->GetCacheEntry(key1, std::string(), &entry)); |
| 1044 EXPECT_EQ(md5_1, entry.md5()); | 1040 EXPECT_EQ(md5_1, entry.md5()); |
| 1045 EXPECT_TRUE(cache_->GetCacheEntry(key2, std::string(), &entry)); | 1041 EXPECT_TRUE(cache_->GetCacheEntry(key2, std::string(), &entry)); |
| 1046 EXPECT_EQ(md5_2, entry.md5()); | 1042 EXPECT_EQ(md5_2, entry.md5()); |
| 1047 } | 1043 } |
| 1048 | 1044 |
| 1049 } // namespace internal | 1045 } // namespace internal |
| 1050 } // namespace drive | 1046 } // namespace drive |
| OLD | NEW |