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

Unified Diff: net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java

Issue 2044523003: Revert of 👔 Reland of Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java
diff --git a/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java b/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java
index 1f43533525856b4444d750a7c0046aa8b4264ab1..e0e67d58adf09e22dd14a3681f4406535f78abc8 100644
--- a/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java
+++ b/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServer.java
@@ -8,7 +8,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
-import android.os.Environment;
import android.os.IBinder;
import android.os.RemoteException;
@@ -195,17 +194,19 @@
* On returning, the server is ready for use.
*
* @param context The context in which the server will run.
- * @param directory The directory from which files should be served. This must be
- * Environment.getExternalStorageDirectory().
+ * @param directory The directory from which files should be served.
* @return The created server.
*/
public static EmbeddedTestServer createAndStartFileServer(Context context, File directory)
throws InterruptedException {
- // TODO(jbudorick): Update all callers to use createAndStartDefaultServer() directly.
- if (!directory.equals(Environment.getExternalStorageDirectory())) {
- throw new IllegalArgumentException("Expected directory to be ExternalStorageDirectory");
- }
- return createAndStartDefaultServer(context);
+ EmbeddedTestServer server = new EmbeddedTestServer();
+ server.initializeNative(context);
+ server.serveFilesFromDirectory(directory);
+ if (!server.start()) {
+ throw new EmbeddedTestServerFailure(
+ "Failed to start serving files from " + directory.getPath());
+ }
+ return server;
}
/** Create and initialize a server with the default handlers.

Powered by Google App Engine
This is Rietveld 408576698