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

Unified Diff: net/test/remote_test_server.cc

Issue 10896050: Android: Use external storage for test data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 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
« no previous file with comments | « build/android/pylib/test_package_apk.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/remote_test_server.cc
diff --git a/net/test/remote_test_server.cc b/net/test/remote_test_server.cc
index 178b174d260a7356db5eef1c2d4ec724c4004f39..abd9ecf897dccd532077cf58d91bb9ab86616388 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;
« no previous file with comments | « build/android/pylib/test_package_apk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698