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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 base::FilePath GetTestFilePath(const std::string& relative_path); | 67 base::FilePath GetTestFilePath(const std::string& relative_path); |
| 68 | 68 |
| 69 // Returns the base URL for communicating with the local test server for | 69 // Returns the base URL for communicating with the local test server for |
| 70 // testing, running at the specified port number. | 70 // testing, running at the specified port number. |
| 71 GURL GetBaseUrlForTesting(int port); | 71 GURL GetBaseUrlForTesting(int port); |
| 72 | 72 |
| 73 // Writes the |content| to the file at |file_path|. Returns true on success, | 73 // Writes the |content| to the file at |file_path|. Returns true on success, |
| 74 // otherwise false. | 74 // otherwise false. |
| 75 bool WriteStringToFile(const base::FilePath& file_path, | 75 bool WriteStringToFile(const base::FilePath& file_path, |
| 76 const std::string& content); | 76 const std::string& content); |
| 77 | 77 |
|
hashimoto
2013/06/20 10:17:42
Please add a function comment.
BTW, do we need to
tzik
2013/06/20 13:37:22
It seems to work. OK, I'll drop this.
| |
| 78 bool ReadFile(const base::FilePath& file_path, | |
| 79 int64 offset, | |
| 80 char* buffer, | |
| 81 int size); | |
| 82 | |
| 78 // Creates a |size| byte file. The file is filled with random bytes so that | 83 // Creates a |size| byte file. The file is filled with random bytes so that |
| 79 // the test assertions can identify correct portion/position of the file is | 84 // the test assertions can identify correct portion/position of the file is |
| 80 // used. | 85 // used. |
| 81 // Returns true on success with the created file's |path| and |data|, otherwise | 86 // Returns true on success with the created file's |path| and |data|, otherwise |
| 82 // false. | 87 // false. |
| 83 bool CreateFileOfSpecifiedSize(const base::FilePath& temp_dir, | 88 bool CreateFileOfSpecifiedSize(const base::FilePath& temp_dir, |
| 84 size_t size, | 89 size_t size, |
| 85 base::FilePath* path, | 90 base::FilePath* path, |
| 86 std::string* data); | 91 std::string* data); |
| 87 | 92 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 const GetContentCallback callback_; | 311 const GetContentCallback callback_; |
| 307 ScopedVector<std::string> data_; | 312 ScopedVector<std::string> data_; |
| 308 | 313 |
| 309 DISALLOW_COPY_AND_ASSIGN(TestGetContentCallback); | 314 DISALLOW_COPY_AND_ASSIGN(TestGetContentCallback); |
| 310 }; | 315 }; |
| 311 | 316 |
| 312 } // namespace test_util | 317 } // namespace test_util |
| 313 } // namespace google_apis | 318 } // namespace google_apis |
| 314 | 319 |
| 315 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ | 320 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_UTIL_H_ |
| OLD | NEW |