| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 cache_->RequestInitializeForTesting(); | 47 cache_->RequestInitializeForTesting(); |
| 48 message_loop_.RunUntilIdle(); | 48 message_loop_.RunUntilIdle(); |
| 49 | 49 |
| 50 FileError error = FILE_ERROR_FAILED; | 50 FileError error = FILE_ERROR_FAILED; |
| 51 resource_metadata_->Initialize( | 51 resource_metadata_->Initialize( |
| 52 google_apis::test_util::CreateCopyResultCallback(&error)); | 52 google_apis::test_util::CreateCopyResultCallback(&error)); |
| 53 message_loop_.RunUntilIdle(); | 53 message_loop_.RunUntilIdle(); |
| 54 ASSERT_EQ(FILE_ERROR_OK, error); | 54 ASSERT_EQ(FILE_ERROR_OK, error); |
| 55 } | 55 } |
| 56 | 56 |
| 57 MessageLoopForUI message_loop_; | 57 base::MessageLoopForUI message_loop_; |
| 58 content::TestBrowserThread ui_thread_; | 58 content::TestBrowserThread ui_thread_; |
| 59 base::ScopedTempDir temp_dir_; | 59 base::ScopedTempDir temp_dir_; |
| 60 | 60 |
| 61 scoped_ptr<FileCache, test_util::DestroyHelperForTests> cache_; | 61 scoped_ptr<FileCache, test_util::DestroyHelperForTests> cache_; |
| 62 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> | 62 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> |
| 63 resource_metadata_; | 63 resource_metadata_; |
| 64 scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_; | 64 scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 TEST_F(RemoveStaleCacheFilesTest, RemoveStaleCacheFiles) { | 67 TEST_F(RemoveStaleCacheFilesTest, RemoveStaleCacheFiles) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 88 | 88 |
| 89 // Remove stale cache files. | 89 // Remove stale cache files. |
| 90 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); | 90 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); |
| 91 | 91 |
| 92 // Verify that the cache entry is deleted. | 92 // Verify that the cache entry is deleted. |
| 93 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); | 93 EXPECT_FALSE(cache_->GetCacheEntry(resource_id, md5, &cache_entry)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace internal | 96 } // namespace internal |
| 97 } // namespace drive | 97 } // namespace drive |
| OLD | NEW |