| 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_GDATA_GDATA_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
| 9 |
| 8 namespace gdata { | 10 namespace gdata { |
| 9 | 11 |
| 10 class GDataCacheEntry; | 12 class GDataCacheEntry; |
| 11 | 13 |
| 12 namespace test_util { | 14 namespace test_util { |
| 13 | 15 |
| 14 // Runs a task posted to the blocking pool, including subquent tasks posted | 16 // Runs a task posted to the blocking pool, including subquent tasks posted |
| 15 // to the UI message loop and the blocking pool. | 17 // to the UI message loop and the blocking pool. |
| 16 // | 18 // |
| 17 // A task is often posted to the blocking pool with PostTaskAndReply(). In | 19 // A task is often posted to the blocking pool with PostTaskAndReply(). In |
| (...skipping 12 matching lines...) Expand all Loading... |
| 30 TEST_CACHE_STATE_PERSISTENT = 1 << 4, | 32 TEST_CACHE_STATE_PERSISTENT = 1 << 4, |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 // Converts |cache_state| which is a bit mask of TestGDataCacheState, to a | 35 // Converts |cache_state| which is a bit mask of TestGDataCacheState, to a |
| 34 // GDataCacheEntry. | 36 // GDataCacheEntry. |
| 35 GDataCacheEntry ToCacheEntry(int cache_state); | 37 GDataCacheEntry ToCacheEntry(int cache_state); |
| 36 | 38 |
| 37 // Returns true if the cache state of the given two cache entries are equal. | 39 // Returns true if the cache state of the given two cache entries are equal. |
| 38 bool CacheStatesEqual(const GDataCacheEntry& a, const GDataCacheEntry& b); | 40 bool CacheStatesEqual(const GDataCacheEntry& a, const GDataCacheEntry& b); |
| 39 | 41 |
| 42 // Copies |error| to |output|. Used to run asynchronous functions that take |
| 43 // FileOperationCallback from tests. |
| 44 void CopyErrorCodeFromFileOperationCallback( |
| 45 GDataFileError* output, GDataFileError error); |
| 46 |
| 47 |
| 40 } // namespace test_util | 48 } // namespace test_util |
| 41 } // namespace gdata | 49 } // namespace gdata |
| 42 | 50 |
| 43 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ | 51 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ |
| OLD | NEW |