Chromium Code Reviews| 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_GOOGLE_APIS_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/google_apis/test_util.h" | |
|
satorux1
2012/11/28 23:59:47
wow, that was recursive!
| |
| 9 | |
| 10 #include <string> | 8 #include <string> |
| 11 | 9 |
| 12 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/google_apis/gdata_errorcode.h" | |
| 13 | 12 |
| 14 class FilePath; | 13 class FilePath; |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 class Value; | 16 class Value; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace google_apis { | 19 namespace google_apis { |
| 21 namespace test_util { | 20 namespace test_util { |
| 22 | 21 |
| 23 // Runs a task posted to the blocking pool, including subsequent tasks posted | 22 // Runs a task posted to the blocking pool, including subsequent tasks posted |
| 24 // to the UI message loop and the blocking pool. | 23 // to the UI message loop and the blocking pool. |
| 25 // | 24 // |
| 26 // A task is often posted to the blocking pool with PostTaskAndReply(). In | 25 // 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 | 26 // that case, a task is posted back to the UI message loop, which can again |
| 28 // post a task to the blocking pool. This function processes these tasks | 27 // post a task to the blocking pool. This function processes these tasks |
| 29 // repeatedly. | 28 // repeatedly. |
| 30 void RunBlockingPoolTask(); | 29 void RunBlockingPoolTask(); |
| 31 | 30 |
| 32 // Returns the absolute path for a test file stored under | 31 // Returns the absolute path for a test file stored under |
| 33 // chrome/test/data/chromeos. | 32 // chrome/test/data/chromeos. |
| 34 FilePath GetTestFilePath(const std::string& relative_path); | 33 FilePath GetTestFilePath(const std::string& relative_path); |
| 35 | 34 |
| 36 // Loads a test JSON file as a base::Value, from a test file stored under | 35 // Loads a test JSON file as a base::Value, from a test file stored under |
| 37 // chrome/test/data/chromeos. | 36 // chrome/test/data/chromeos. |
| 38 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path); | 37 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path); |
| 39 | 38 |
| 39 // Copies the results from GetDataCallback. | |
| 40 void CopyResultsFromGetDataCallback(GDataErrorCode* error_out, | |
| 41 scoped_ptr<base::Value>* value_out, | |
| 42 GDataErrorCode error_in, | |
| 43 scoped_ptr<base::Value> value_in); | |
| 44 | |
| 40 } // namespace test_util | 45 } // namespace test_util |
| 41 } // namespace google_apis | 46 } // namespace google_apis |
| 42 | 47 |
| 43 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ | 48 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ |
| OLD | NEW |