Chromium Code Reviews| Index: media/base/test_data_util.cc |
| diff --git a/media/base/test_data_util.cc b/media/base/test_data_util.cc |
| index a83fa840b41c70ed4e36f11bfdc3d900fc2a079a..9cd886f29270baf5436db31c9096ebc59db1595c 100644 |
| --- a/media/base/test_data_util.cc |
| +++ b/media/base/test_data_util.cc |
| @@ -12,14 +12,38 @@ |
| namespace media { |
| +const base::FilePath::CharType kTestDataPath[] = |
| + FILE_PATH_LITERAL("media/test/data"); |
| + |
| base::FilePath GetTestDataFilePath(const std::string& name) { |
| base::FilePath file_path; |
| CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &file_path)); |
| + return file_path.Append(GetTestDataPath()).AppendASCII(name); |
| +} |
| + |
| +base::FilePath GetTestDataPath() { |
| + return base::FilePath(kTestDataPath); |
| +} |
| + |
| +std::string GetURLQueryString(const QueryParams& query_params) { |
| + std::string query = ""; |
| + QueryParams::const_iterator itr = query_params.begin(); |
| + for (; itr != query_params.end(); ++itr) { |
| + if (itr != query_params.begin()) |
| + query.append("&"); |
| + query.append(itr->first + "=" + itr->second); |
| + } |
| + return query; |
| +} |
| - return file_path.AppendASCII("media") |
| - .AppendASCII("test") |
| - .AppendASCII("data") |
| - .AppendASCII(name); |
| +scoped_ptr<net::SpawnedTestServer> StartMediaHttpTestServer() { |
| + scoped_ptr<net::SpawnedTestServer> http_test_server; |
| + http_test_server.reset(new net::SpawnedTestServer( |
|
asanka
2014/07/11 17:30:36
Have you considered using an EmbeddedTestServer in
shadi
2014/07/11 18:19:55
Yes I have looked into it. The problem is with tes
|
| + net::SpawnedTestServer::TYPE_HTTP, |
| + net::SpawnedTestServer::kLocalhost, |
| + GetTestDataPath())); |
| + CHECK(http_test_server->Start()); |
| + return http_test_server.Pass(); |
| } |
| scoped_refptr<DecoderBuffer> ReadTestDataFile(const std::string& name) { |