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

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

Issue 2431753003: Merge EmbeddedTestServer#createAndStartDefaultServer() and createAndStartFileServer() (Closed)
Patch Set: Merge branch 'master' into webapk_embedded_test_server Created 4 years, 2 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 | « components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5c781e533a3a2198d3fd2c1b469d9868045b99fa 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
@@ -201,11 +201,11 @@ public class EmbeddedTestServer {
*/
public static EmbeddedTestServer createAndStartFileServer(Context context, File directory)
throws InterruptedException {
- // TODO(jbudorick): Update all callers to use createAndStartDefaultServer() directly.
+ // TODO(jbudorick): Update all callers to use createAndStartServer() directly.
if (!directory.equals(Environment.getExternalStorageDirectory())) {
throw new IllegalArgumentException("Expected directory to be ExternalStorageDirectory");
}
- return createAndStartDefaultServer(context);
+ return createAndStartServer(context);
}
/** Create and initialize a server with the default handlers.
@@ -218,6 +218,20 @@ public class EmbeddedTestServer {
*/
public static EmbeddedTestServer createAndStartDefaultServer(Context context)
throws InterruptedException {
+ // TODO(pkotwicz): Update all callers to use createAndStartServer() directly.
+ return createAndStartServer(context);
+ }
+
+ /** Create and initialize a server with the default handlers.
+ *
+ * This handles native object initialization, server configuration, and server initialization.
+ * On returning, the server is ready for use.
+ *
+ * @param context The context in which the server will run.
+ * @return The created server.
+ */
+ public static EmbeddedTestServer createAndStartServer(Context context)
+ throws InterruptedException {
EmbeddedTestServer server = new EmbeddedTestServer();
server.initializeNative(context);
server.addDefaultHandlers("");
« no previous file with comments | « components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698