| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/chromeos/gdata/drive_resource_metadata.h" | 9 #include "chrome/browser/chromeos/gdata/drive_resource_metadata.h" |
| 10 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 10 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Converts |cache_state| which is a bit mask of TestDriveCacheState, to a | 42 // Converts |cache_state| which is a bit mask of TestDriveCacheState, to a |
| 43 // DriveCacheEntry. | 43 // DriveCacheEntry. |
| 44 DriveCacheEntry ToCacheEntry(int cache_state); | 44 DriveCacheEntry ToCacheEntry(int cache_state); |
| 45 | 45 |
| 46 // Returns true if the cache state of the given two cache entries are equal. | 46 // Returns true if the cache state of the given two cache entries are equal. |
| 47 bool CacheStatesEqual(const DriveCacheEntry& a, const DriveCacheEntry& b); | 47 bool CacheStatesEqual(const DriveCacheEntry& a, const DriveCacheEntry& b); |
| 48 | 48 |
| 49 // Copies |error| to |output|. Used to run asynchronous functions that take | 49 // Copies |error| to |output|. Used to run asynchronous functions that take |
| 50 // FileOperationCallback from tests. | 50 // FileOperationCallback from tests. |
| 51 void CopyErrorCodeFromFileOperationCallback(GDataFileError* output, | 51 void CopyErrorCodeFromFileOperationCallback(DriveFileError* output, |
| 52 GDataFileError error); | 52 DriveFileError error); |
| 53 | 53 |
| 54 // Copies |error| and |moved_file_path| to |out_error| and |out_file_path|. | 54 // Copies |error| and |moved_file_path| to |out_error| and |out_file_path|. |
| 55 // Used to run asynchronous functions that take FileMoveCallback from tests. | 55 // Used to run asynchronous functions that take FileMoveCallback from tests. |
| 56 void CopyResultsFromFileMoveCallback(GDataFileError* out_error, | 56 void CopyResultsFromFileMoveCallback(DriveFileError* out_error, |
| 57 FilePath* out_file_path, | 57 FilePath* out_file_path, |
| 58 GDataFileError error, | 58 DriveFileError error, |
| 59 const FilePath& moved_file_path); | 59 const FilePath& moved_file_path); |
| 60 | 60 |
| 61 // Copies |error| and |entry_proto| to |out_error| and |out_entry_proto| | 61 // Copies |error| and |entry_proto| to |out_error| and |out_entry_proto| |
| 62 // respectively. Used to run asynchronous functions that take | 62 // respectively. Used to run asynchronous functions that take |
| 63 // GetEntryInfoCallback from tests. | 63 // GetEntryInfoCallback from tests. |
| 64 void CopyResultsFromGetEntryInfoCallback( | 64 void CopyResultsFromGetEntryInfoCallback( |
| 65 GDataFileError* out_error, | 65 DriveFileError* out_error, |
| 66 scoped_ptr<DriveEntryProto>* out_entry_proto, | 66 scoped_ptr<DriveEntryProto>* out_entry_proto, |
| 67 GDataFileError error, | 67 DriveFileError error, |
| 68 scoped_ptr<DriveEntryProto> entry_proto); | 68 scoped_ptr<DriveEntryProto> entry_proto); |
| 69 | 69 |
| 70 // Copies |error| and |entries| to |out_error| and |out_entries| | 70 // Copies |error| and |entries| to |out_error| and |out_entries| |
| 71 // respectively. Used to run asynchronous functions that take | 71 // respectively. Used to run asynchronous functions that take |
| 72 // GetEntryInfoCallback from tests. | 72 // GetEntryInfoCallback from tests. |
| 73 void CopyResultsFromReadDirectoryCallback( | 73 void CopyResultsFromReadDirectoryCallback( |
| 74 GDataFileError* out_error, | 74 DriveFileError* out_error, |
| 75 scoped_ptr<DriveEntryProtoVector>* out_entries, | 75 scoped_ptr<DriveEntryProtoVector>* out_entries, |
| 76 GDataFileError error, | 76 DriveFileError error, |
| 77 scoped_ptr<DriveEntryProtoVector> entries); | 77 scoped_ptr<DriveEntryProtoVector> entries); |
| 78 | 78 |
| 79 // Copies |error|, |drive_file_path|, and |entry_proto| to |out_error|, | 79 // Copies |error|, |drive_file_path|, and |entry_proto| to |out_error|, |
| 80 // |out_drive_file_path|, and |out_entry_proto| respectively. Used to run | 80 // |out_drive_file_path|, and |out_entry_proto| respectively. Used to run |
| 81 // asynchronous functions that take GetEntryInfoWithFilePathCallback from | 81 // asynchronous functions that take GetEntryInfoWithFilePathCallback from |
| 82 // tests. | 82 // tests. |
| 83 void CopyResultsFromGetEntryInfoWithFilePathCallback( | 83 void CopyResultsFromGetEntryInfoWithFilePathCallback( |
| 84 GDataFileError* out_error, | 84 DriveFileError* out_error, |
| 85 FilePath* out_drive_file_path, | 85 FilePath* out_drive_file_path, |
| 86 scoped_ptr<DriveEntryProto>* out_entry_proto, | 86 scoped_ptr<DriveEntryProto>* out_entry_proto, |
| 87 GDataFileError error, | 87 DriveFileError error, |
| 88 const FilePath& drive_file_path, | 88 const FilePath& drive_file_path, |
| 89 scoped_ptr<DriveEntryProto> entry_proto); | 89 scoped_ptr<DriveEntryProto> entry_proto); |
| 90 | 90 |
| 91 // Copies |result| to |out_result|. Used to run asynchronous functions | 91 // Copies |result| to |out_result|. Used to run asynchronous functions |
| 92 // that take GetEntryInfoPairCallback from tests. | 92 // that take GetEntryInfoPairCallback from tests. |
| 93 void CopyResultsFromGetEntryInfoPairCallback( | 93 void CopyResultsFromGetEntryInfoPairCallback( |
| 94 scoped_ptr<EntryInfoPairResult>* out_result, | 94 scoped_ptr<EntryInfoPairResult>* out_result, |
| 95 scoped_ptr<EntryInfoPairResult> result); | 95 scoped_ptr<EntryInfoPairResult> result); |
| 96 | 96 |
| 97 } // namespace test_util | 97 } // namespace test_util |
| 98 } // namespace gdata | 98 } // namespace gdata |
| 99 | 99 |
| 100 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ |
| OLD | NEW |