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

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

Issue 2860673005: Add assertion to EmbeddedTestServer creation method (Closed)
Patch Set: address comments Created 3 years, 7 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 | « net/android/BUILD.gn ('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 cef3cccd84a2a176bbb5270dceedfe7b207590db..72f03e680dc198b0d733356e2cb05882521926ce 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
@@ -10,8 +10,11 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Environment;
import android.os.IBinder;
+import android.os.Looper;
import android.os.RemoteException;
+import org.junit.Assert;
+
import org.chromium.base.Log;
import java.io.File;
@@ -226,6 +229,9 @@ public class EmbeddedTestServer {
*/
public static EmbeddedTestServer createAndStartServer(Context context)
throws InterruptedException {
+ Assert.assertNotEquals("EmbeddedTestServer should not be created on UiThread, "
+ + "the instantiation will hang forever waiting for tasks to post to UI thread",
+ Looper.getMainLooper(), Looper.myLooper());
EmbeddedTestServer server = new EmbeddedTestServer();
server.initializeNative(context);
server.addDefaultHandlers("");
« no previous file with comments | « net/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698