| 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/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace internal { | 26 namespace internal { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 const char kCacheFileDirectory[] = "files"; | 29 const char kCacheFileDirectory[] = "files"; |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 // Tests FileCache methods working with the blocking task runner. | 33 // Tests FileCache methods working with the blocking task runner. |
| 34 class FileCacheTest : public testing::Test { | 34 class FileCacheTest : public testing::Test { |
| 35 protected: | 35 protected: |
| 36 virtual void SetUp() OVERRIDE { | 36 virtual void SetUp() override { |
| 37 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 37 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 38 const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta"); | 38 const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta"); |
| 39 cache_files_dir_ = temp_dir_.path().AppendASCII(kCacheFileDirectory); | 39 cache_files_dir_ = temp_dir_.path().AppendASCII(kCacheFileDirectory); |
| 40 | 40 |
| 41 ASSERT_TRUE(base::CreateDirectory(metadata_dir)); | 41 ASSERT_TRUE(base::CreateDirectory(metadata_dir)); |
| 42 ASSERT_TRUE(base::CreateDirectory(cache_files_dir_)); | 42 ASSERT_TRUE(base::CreateDirectory(cache_files_dir_)); |
| 43 | 43 |
| 44 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); | 44 fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter); |
| 45 | 45 |
| 46 metadata_storage_.reset(new ResourceMetadataStorage( | 46 metadata_storage_.reset(new ResourceMetadataStorage( |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 551 |
| 552 // Clear cache. | 552 // Clear cache. |
| 553 EXPECT_TRUE(cache_->ClearAll()); | 553 EXPECT_TRUE(cache_->ClearAll()); |
| 554 | 554 |
| 555 // Verify that the cache is removed. | 555 // Verify that the cache is removed. |
| 556 EXPECT_TRUE(base::IsDirectoryEmpty(cache_files_dir_)); | 556 EXPECT_TRUE(base::IsDirectoryEmpty(cache_files_dir_)); |
| 557 } | 557 } |
| 558 | 558 |
| 559 } // namespace internal | 559 } // namespace internal |
| 560 } // namespace drive | 560 } // namespace drive |
| OLD | NEW |