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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 base::FilePath GetTestFilePath(const std::string& relative_path); | 60 base::FilePath GetTestFilePath(const std::string& relative_path); |
61 | 61 |
62 // Returns the base URL for communicating with the local test server for | 62 // Returns the base URL for communicating with the local test server for |
63 // testing, running at the specified port number. | 63 // testing, running at the specified port number. |
64 GURL GetBaseUrlForTesting(int port); | 64 GURL GetBaseUrlForTesting(int port); |
65 | 65 |
66 // Loads a test JSON file as a base::Value, from a test file stored under | 66 // Loads a test JSON file as a base::Value, from a test file stored under |
67 // chrome/test/data. | 67 // chrome/test/data. |
68 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path); | 68 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path); |
69 | 69 |
70 // Copies the results from DownloadActionCallback. | |
71 void CopyResultsFromDownloadActionCallback( | |
72 GDataErrorCode* error_out, | |
73 base::FilePath* temp_file_out, | |
74 GDataErrorCode error_in, | |
75 const base::FilePath& temp_file_in); | |
76 | |
77 // Copies the results from InitiateUploadCallback. | 70 // Copies the results from InitiateUploadCallback. |
78 void CopyResultsFromInitiateUploadCallback( | 71 void CopyResultsFromInitiateUploadCallback( |
79 GDataErrorCode* error_out, | 72 GDataErrorCode* error_out, |
80 GURL* url_out, | 73 GURL* url_out, |
81 GDataErrorCode error_in, | 74 GDataErrorCode error_in, |
82 const GURL& url_in); | 75 const GURL& url_in); |
83 | 76 |
84 // Copies the results from InitiateUploadCallback and quit the message loop. | 77 // Copies the results from InitiateUploadCallback and quit the message loop. |
85 void CopyResultsFromInitiateUploadCallbackAndQuit( | 78 void CopyResultsFromInitiateUploadCallbackAndQuit( |
86 GDataErrorCode* error_out, | 79 GDataErrorCode* error_out, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 typename internal::CopyResultCallbackHelper<T3>::InType)> | 247 typename internal::CopyResultCallbackHelper<T3>::InType)> |
255 CreateCopyResultCallback(T1* out1, T2* out2, T3* out3) { | 248 CreateCopyResultCallback(T1* out1, T2* out2, T3* out3) { |
256 return base::Bind( | 249 return base::Bind( |
257 &internal::CopyResultCallback<T1, T2, T3>, out1, out2, out3); | 250 &internal::CopyResultCallback<T1, T2, T3>, out1, out2, out3); |
258 } | 251 } |
259 | 252 |
260 } // namespace test_util | 253 } // namespace test_util |
261 } // namespace google_apis | 254 } // namespace google_apis |
262 | 255 |
263 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ | 256 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ |
OLD | NEW |