summaryrefslogtreecommitdiffstats
path: root/net/test
diff options
context:
space:
mode:
authornileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 18:50:48 +0000
committernileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 18:50:48 +0000
commitab4053905b067ac115cbe82428340b112eed09fe (patch)
tree6528eec77d7603a3f23402c0b72226b8f62c807b /net/test
parentf9a8400fc3fedeb9cebf89ae97cba7d5f8aa5c44 (diff)
downloadchromium_src-ab4053905b067ac115cbe82428340b112eed09fe.zip
chromium_src-ab4053905b067ac115cbe82428340b112eed09fe.tar.gz
chromium_src-ab4053905b067ac115cbe82428340b112eed09fe.tar.bz2
Android: Use external storage for test data.
Also increasing priority for logging test markers. BUG= Review URL: https://chromiumcodereview.appspot.com/10896050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r--net/test/remote_test_server.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/net/test/remote_test_server.cc b/net/test/remote_test_server.cc
index 178b174..abd9ecf8 100644
--- a/net/test/remote_test_server.cc
+++ b/net/test/remote_test_server.cc
@@ -6,6 +6,8 @@
#include <vector>
+#include "base/base_paths.h"
+#include "base/file_path.h"
#include "base/file_util.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
@@ -29,7 +31,16 @@ namespace {
// to a single testing device.
// The mapping between the test server spawner and the individual Python test
// servers is written to a file on the device prior to executing any tests.
-const char kTestServerPortInfoFile[] = "/data/local/tmp/net-test-server-ports";
+FilePath GetTestServerPortInfoFile() {
+#if !defined(OS_ANDROID)
+ return FilePath("/tmp/net-test-server-ports");
+#else
+ FilePath test_data_dir;
+ PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &test_data_dir);
+ test_data_dir.Append("net-test-server-ports");
+ return test_data_dir;
+#endif
+}
// Please keep it sync with dictionary SERVER_TYPES in testserver.py
std::string GetServerTypeString(BaseTestServer::Type type) {
@@ -139,7 +150,7 @@ bool RemoteTestServer::Init(const FilePath& document_root) {
// Parse file to extract the ports information.
std::string port_info;
- if (!file_util::ReadFileToString(FilePath(kTestServerPortInfoFile),
+ if (!file_util::ReadFileToString(GetTestServerPortInfoFile(),
&port_info) ||
port_info.empty()) {
return false;