Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7169)

Unified Diff: chrome/browser/google_apis/test_util.h

Issue 12093107: Extract testing utilities from gdata_wapi_operations_unittest to test_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/google_apis/test_util.h
diff --git a/chrome/browser/google_apis/test_util.h b/chrome/browser/google_apis/test_util.h
index e0ba436be585eaeff2899f164557535647d998a0..48890eb5c73398f7418698fa2aea4d68eb470604 100644
--- a/chrome/browser/google_apis/test_util.h
+++ b/chrome/browser/google_apis/test_util.h
@@ -26,6 +26,7 @@ class ResourceEntry;
class ResourceList;
namespace test_server {
+struct HttpRequest;
class HttpResponse;
}
@@ -40,6 +41,12 @@ namespace test_util {
// repeatedly.
void RunBlockingPoolTask();
+// Removes |prefix| from |input| and stores the result in |output|. Returns
+// true if the prefix is removed.
+bool RemovePrefix(const std::string& input,
+ const std::string& prefix,
+ std::string* output);
+
// Returns the absolute path for a test file stored under
// chrome/test/data/chromeos.
FilePath GetTestFilePath(const std::string& relative_path);
@@ -117,6 +124,15 @@ scoped_ptr<test_server::HttpResponse> CreateHttpResponseFromFile(
void DoNothingForReAuthenticateCallback(
AuthenticatedOperationInterface* operation);
+// Handles a request for downloading a file. Reads a file from the test
+// directory and returns the content. Also, copies the |request| to the memory
+// pointed by |out_request|.
+// |base_url| must be set to the server's base url.
+scoped_ptr<test_server::HttpResponse> HandleDownloadRequest(
+ const GURL& base_url,
+ test_server::HttpRequest* out_request,
+ const test_server::HttpRequest& request);
+
// Returns true if |json_data| is not NULL and equals to the content in
// |expected_json_file_path|. The failure reason will be logged into LOG(ERROR)
// if necessary.
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations_unittest.cc ('k') | chrome/browser/google_apis/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698