| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Disk space size used by FakeFreeDiskSpaceGetter. | 25 // Disk space size used by FakeFreeDiskSpaceGetter. |
| 26 const int64 kLotsOfSpace = internal::kMinFreeSpace * 10; | 26 const int64 kLotsOfSpace = internal::kMinFreeSpace * 10; |
| 27 | 27 |
| 28 // This is a bitmask of cache states in FileCacheEntry. Used only in tests. | 28 // This is a bitmask of cache states in FileCacheEntry. Used only in tests. |
| 29 enum TestFileCacheState { | 29 enum TestFileCacheState { |
| 30 TEST_CACHE_STATE_NONE = 0, | 30 TEST_CACHE_STATE_NONE = 0, |
| 31 TEST_CACHE_STATE_PINNED = 1 << 0, | 31 TEST_CACHE_STATE_PINNED = 1 << 0, |
| 32 TEST_CACHE_STATE_PRESENT = 1 << 1, | 32 TEST_CACHE_STATE_PRESENT = 1 << 1, |
| 33 TEST_CACHE_STATE_DIRTY = 1 << 2, | 33 TEST_CACHE_STATE_DIRTY = 1 << 2, |
| 34 TEST_CACHE_STATE_MOUNTED = 1 << 3, | 34 TEST_CACHE_STATE_MOUNTED = 1 << 3, |
| 35 TEST_CACHE_STATE_PERSISTENT = 1 << 4, | |
| 36 }; | 35 }; |
| 37 | 36 |
| 38 // Test data type of file cache | 37 // Test data type of file cache |
| 39 struct TestCacheResource { | 38 struct TestCacheResource { |
| 40 TestCacheResource(const std::string& source_file, | 39 TestCacheResource(const std::string& source_file, |
| 41 const std::string& resource_id, | 40 const std::string& resource_id, |
| 42 const std::string& md5, | 41 const std::string& md5, |
| 43 bool is_pinned, | 42 bool is_pinned, |
| 44 bool is_dirty); | 43 bool is_dirty); |
| 45 ~TestCacheResource(){} | 44 ~TestCacheResource(){} |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Adds test cache |resources| to |cache|. Returns whether the operation | 94 // Adds test cache |resources| to |cache|. Returns whether the operation |
| 96 // succeeded or not. | 95 // succeeded or not. |
| 97 bool PrepareTestCacheResources( | 96 bool PrepareTestCacheResources( |
| 98 internal::FileCache* cache, | 97 internal::FileCache* cache, |
| 99 const std::vector<TestCacheResource>& resources); | 98 const std::vector<TestCacheResource>& resources); |
| 100 | 99 |
| 101 } // namespace test_util | 100 } // namespace test_util |
| 102 } // namespace drive | 101 } // namespace drive |
| 103 | 102 |
| 104 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ | 103 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_ |
| OLD | NEW |