| 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" |
| 11 #include "base/files/file_enumerator.h" | 11 #include "base/files/file_enumerator.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/md5.h" | 13 #include "base/md5.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "chrome/browser/chromeos/drive/drive.pb.h" | 17 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 18 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" | 18 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" |
| 19 #include "chrome/browser/chromeos/drive/file_system_util.h" | 19 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 20 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" | 20 #include "chrome/browser/chromeos/drive/resource_metadata_storage.h" |
| 21 #include "chrome/browser/chromeos/drive/test_util.h" | 21 #include "chrome/browser/chromeos/drive/test_util.h" |
| 22 #include "chrome/browser/google_apis/test_util.h" | |
| 23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/test/test_browser_thread_bundle.h" | 23 #include "content/public/test/test_browser_thread_bundle.h" |
| 24 #include "google_apis/drive/test_util.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 namespace drive { | 27 namespace drive { |
| 28 namespace internal { | 28 namespace internal { |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 const char kCacheFileDirectory[] = "files"; | 31 const char kCacheFileDirectory[] = "files"; |
| 32 | 32 |
| 33 // Bitmask of cache states in FileCacheEntry. | 33 // Bitmask of cache states in FileCacheEntry. |
| 34 enum TestFileCacheState { | 34 enum TestFileCacheState { |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 // Clear cache. | 970 // Clear cache. |
| 971 EXPECT_TRUE(cache_->ClearAll()); | 971 EXPECT_TRUE(cache_->ClearAll()); |
| 972 | 972 |
| 973 // Verify that the cache is removed. | 973 // Verify that the cache is removed. |
| 974 EXPECT_FALSE(cache_->GetCacheEntry(id, &cache_entry)); | 974 EXPECT_FALSE(cache_->GetCacheEntry(id, &cache_entry)); |
| 975 EXPECT_TRUE(base::IsDirectoryEmpty(cache_files_dir_)); | 975 EXPECT_TRUE(base::IsDirectoryEmpty(cache_files_dir_)); |
| 976 } | 976 } |
| 977 | 977 |
| 978 } // namespace internal | 978 } // namespace internal |
| 979 } // namespace drive | 979 } // namespace drive |
| OLD | NEW |