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/file_util.h" | 8 #include "base/files/file_util.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" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "chrome/browser/chromeos/drive/drive.pb.h" | 13 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 14 #include "chrome/browser/chromeos/drive/drive_test_util.h" |
14 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" | 15 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" |
15 #include "chrome/browser/chromeos/drive/file_system_core_util.h" | 16 #include "chrome/browser/chromeos/drive/file_system_core_util.h" |
16 #include "chrome/browser/chromeos/drive/remove_stale_cache_files.h" | 17 #include "chrome/browser/chromeos/drive/remove_stale_cache_files.h" |
17 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 18 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
18 #include "chrome/browser/chromeos/drive/test_util.h" | |
19 #include "content/public/test/test_browser_thread_bundle.h" | 19 #include "content/public/test/test_browser_thread_bundle.h" |
20 #include "google_apis/drive/test_util.h" | 20 #include "google_apis/drive/test_util.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace drive { | 23 namespace drive { |
24 namespace internal { | 24 namespace internal { |
25 | 25 |
26 class RemoveStaleCacheFilesTest : public testing::Test { | 26 class RemoveStaleCacheFilesTest : public testing::Test { |
27 protected: | 27 protected: |
28 void SetUp() override { | 28 void SetUp() override { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); | 106 RemoveStaleCacheFiles(cache_.get(), resource_metadata_.get()); |
107 | 107 |
108 // Dirty cache should not be removed even though its MD5 doesn't match. | 108 // Dirty cache should not be removed even though its MD5 doesn't match. |
109 EXPECT_EQ(FILE_ERROR_OK, | 109 EXPECT_EQ(FILE_ERROR_OK, |
110 resource_metadata_->GetResourceEntryById(local_id, &entry)); | 110 resource_metadata_->GetResourceEntryById(local_id, &entry)); |
111 EXPECT_TRUE(entry.file_specific_info().cache_state().is_present()); | 111 EXPECT_TRUE(entry.file_specific_info().cache_state().is_present()); |
112 } | 112 } |
113 | 113 |
114 } // namespace internal | 114 } // namespace internal |
115 } // namespace drive | 115 } // namespace drive |
OLD | NEW |