#include "google_apis/common/test_util.h"
#include <string_view>
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "url/gurl.h"
namespace google_apis {
namespace test_util {
bool RemovePrefix(const std::string& input,
const std::string& prefix,
std::string* output) { … }
base::FilePath GetTestFilePath(const std::string& relative_path) { … }
GURL GetBaseUrlForTesting(int port) { … }
void RunAndQuit(base::RunLoop* run_loop, base::OnceClosure closure) { … }
bool WriteStringToFile(const base::FilePath& file_path,
const std::string& content) { … }
bool CreateFileOfSpecifiedSize(const base::FilePath& temp_dir,
size_t size,
base::FilePath* path,
std::string* data) { … }
std::unique_ptr<base::Value> LoadJSONFile(const std::string& relative_path) { … }
std::unique_ptr<net::test_server::BasicHttpResponse> CreateHttpResponseFromFile(
const base::FilePath& file_path) { … }
std::unique_ptr<net::test_server::HttpResponse> HandleDownloadFileRequest(
const GURL& base_url,
net::test_server::HttpRequest* out_request,
const net::test_server::HttpRequest& request) { … }
bool ParseContentRangeHeader(const std::string& value,
int64_t* start_position,
int64_t* end_position,
int64_t* length) { … }
void AppendProgressCallbackResult(std::vector<ProgressInfo>* progress_values,
int64_t progress,
int64_t total) { … }
TestGetContentCallback::TestGetContentCallback()
: … { … }
TestGetContentCallback::~TestGetContentCallback() = default;
std::string TestGetContentCallback::GetConcatenatedData() const { … }
void TestGetContentCallback::OnGetContent(google_apis::ApiErrorCode error,
std::unique_ptr<std::string> data,
bool first_chunk) { … }
}
}