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" |
11 | 11 |
12 class FilePath; | 12 class FilePath; |
13 | 13 |
| 14 namespace base { |
| 15 class Value; |
| 16 } |
| 17 |
14 namespace gdata { | 18 namespace gdata { |
15 | 19 |
16 class DriveCacheEntry; | 20 class DriveCacheEntry; |
17 class DriveEntryProto; | 21 class DriveEntryProto; |
| 22 class DriveFileSystem; |
18 | 23 |
19 typedef std::vector<DriveEntryProto> DriveEntryProtoVector; | 24 typedef std::vector<DriveEntryProto> DriveEntryProtoVector; |
20 | 25 |
21 namespace test_util { | 26 namespace test_util { |
22 | 27 |
23 // Runs a task posted to the blocking pool, including subquent tasks posted | 28 // Runs a task posted to the blocking pool, including subquent tasks posted |
24 // to the UI message loop and the blocking pool. | 29 // to the UI message loop and the blocking pool. |
25 // | 30 // |
26 // A task is often posted to the blocking pool with PostTaskAndReply(). In | 31 // A task is often posted to the blocking pool with PostTaskAndReply(). In |
27 // that case, a task is posted back to the UI message loop, which can again | 32 // that case, a task is posted back to the UI message loop, which can again |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 DriveFileError error, | 92 DriveFileError error, |
88 const FilePath& drive_file_path, | 93 const FilePath& drive_file_path, |
89 scoped_ptr<DriveEntryProto> entry_proto); | 94 scoped_ptr<DriveEntryProto> entry_proto); |
90 | 95 |
91 // Copies |result| to |out_result|. Used to run asynchronous functions | 96 // Copies |result| to |out_result|. Used to run asynchronous functions |
92 // that take GetEntryInfoPairCallback from tests. | 97 // that take GetEntryInfoPairCallback from tests. |
93 void CopyResultsFromGetEntryInfoPairCallback( | 98 void CopyResultsFromGetEntryInfoPairCallback( |
94 scoped_ptr<EntryInfoPairResult>* out_result, | 99 scoped_ptr<EntryInfoPairResult>* out_result, |
95 scoped_ptr<EntryInfoPairResult> result); | 100 scoped_ptr<EntryInfoPairResult> result); |
96 | 101 |
| 102 // Returns the absolute path for a test file stored under |
| 103 // chrome/test/data/chromeos/gdata. |
| 104 FilePath GetTestFilePath(const FilePath::StringType& base_name); |
| 105 |
| 106 // Loads a test JSON file as a base::Value. |
| 107 base::Value* LoadJSONFile(const std::string& base_name); |
| 108 |
| 109 // Loads a test json file as root ("/drive") element. |
| 110 void LoadChangeFeed(const std::string& filename, |
| 111 DriveFileSystem* file_system, |
| 112 int64 start_changestamp, |
| 113 int64 root_feed_changestamp); |
| 114 |
97 } // namespace test_util | 115 } // namespace test_util |
98 } // namespace gdata | 116 } // namespace gdata |
99 | 117 |
100 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ | 118 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_TEST_UTIL_H_ |
OLD | NEW |