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

Unified Diff: media/base/test_data_util.cc

Issue 357413002: Have media content and chrome browser tests load data from media/test/data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix net dependency for media_perftests Created 6 years, 6 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: media/base/test_data_util.cc
diff --git a/media/base/test_data_util.cc b/media/base/test_data_util.cc
index a83fa840b41c70ed4e36f11bfdc3d900fc2a079a..c821308499a1b73e0696672cb88ffc9ee40972d7 100644
--- a/media/base/test_data_util.cc
+++ b/media/base/test_data_util.cc
@@ -15,11 +15,34 @@ namespace media {
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(FILE_PATH_LITERAL("media/test/data"));
xhwang 2014/07/07 17:39:55 nit: put "media/test/data" in a file level const c
shadi 2014/07/07 22:58:44 Can't make it a const char, it has to be a CharTyp
+}
+
+std::string GetURLQueryString(std::vector<StringPair>* query_params) {
+ std::string query = "";
+ if (query_params != NULL && !query_params->empty()) {
+ std::vector<StringPair>::const_iterator itr = query_params->begin();
+ query = itr->first + "=" + itr->second;
+ ++itr;
+ for (; itr != query_params->end(); ++itr) {
+ query.append("&" + itr->first + "=" + itr->second);
+ }
+ }
+ return query;
+}
xhwang 2014/07/07 17:39:55 How about letting this function return the query s
shadi 2014/07/07 22:58:44 Having query start with "?" would not work with co
- 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(
+ 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) {
« media/base/test_data_util.h ('K') | « media/base/test_data_util.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698