Buggy code:
public class RuntimeClientApiTestBase < T extends Activity > { private XWalkRuntimeClientTestUtilBase mTestUtil ; private ActivityInstrumentationTestCase2 < T > mTestCase ; private Timer mTimer = new Timer ( ) ; private String mSocketName ; private String mUrl = "file://////android_asset//index.html" ; enum Relation { EQUAL , GREATERTHAN , LESSSTHAN , NONE ; } public RuntimeClientApiTestBase ( XWalkRuntimeClientTestUtilBase testUtil , ActivityInstrumentationTestCase2 < T > testCase ) { } public String getTitleOnUiThread ( ) { } public void compareTitle ( String prevTitle , String title , String msg , RuntimeClientApiTestBase . Relation relation ) { } public void waitForTimerFinish ( int timer ) throws Throwable { } public class NotifyTask extends TimerTask { private Object mObj ; public NotifyTask ( Object obj ) { } @ Override public void run ( ) { } } public void sendBroadCast ( Activity activity , Context context , String extra ) throws Throwable { } public int getSocketNameIndex ( ) { } public void testLoadAppFromUrl ( ) throws Throwable { } public void testLoadAppFromManifest ( ) throws Throwable { } public void testCSP ( ) throws Throwable { } public void testCrossOriginXhr ( ) throws Throwable { <START_BUG> TestWebServer webServer = TestWebServer . start ( ) ; <END_BUG> try { final String path = "//cross_origin_xhr_test.html" ; final String responseStr = "Cross-Origin<seq2seq4repair_space>XHR" ; final String url = webServer . setResponse ( path , responseStr , null ) ; mTestCase . assertEquals ( "http:////localhost:4444//cross_origin_xhr_test.html" , url ) ; final String originalTitle = "Original<seq2seq4repair_space>Title" ; mTestUtil . loadManifestSync ( "file://////android_asset//www//manifest_without_xwalk_hosts.json" ) ; Thread . sleep ( 1000 ) ; mTestCase . getInstrumentation ( ) . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { String title = mTestUtil . getTestedView ( ) . getTitleForTest ( ) ; mTestCase . assertEquals ( originalTitle , title ) ; } } ) ; mTestUtil . loadManifestSync ( "file://////android_asset//www//manifest_xwalk_hosts.json" ) ; Thread . sleep ( 1000 ) ; mTestCase . getInstrumentation ( ) . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { String title = mTestUtil . getTestedView ( ) . getTitleForTest ( ) ; mTestCase . assertEquals ( responseStr , title ) ; } } ) ; final String host = mTestCase . getActivity ( ) . getPackageName ( ) ; mTestUtil . loadManifestSync ( ( ( "app:////" + host ) + "//manifest_without_xwalk_hosts.json" ) ) ; Thread . sleep ( 1000 ) ; mTestCase . getInstrumentation ( ) . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { String title = mTestUtil . getTestedView ( ) . getTitleForTest ( ) ; mTestCase . assertEquals ( originalTitle , title ) ; } } ) ; mTestUtil . loadManifestSync ( ( ( "app:////" + host ) + "//manifest_xwalk_hosts.json" ) ) ; Thread . sleep ( 1000 ) ; mTestCase . getInstrumentation ( ) . runOnMainSync ( new Runnable ( ) { @ Override public void run ( ) { String title = mTestUtil . getTestedView ( ) . getTitleForTest ( ) ; mTestCase . assertEquals ( responseStr , title ) ; } } ) ; } finally { webServer . shutdown ( ) ; } } public void testContacts ( ) throws Throwable { } public void testDeviceCapabilities ( ) throws Throwable { } public void testScreenOrientation ( ) throws Throwable { } public void testPresentationDisplayAvailable ( ) throws Throwable { } public void testExternalExtensionAsync ( ) throws Throwable { } public void testExternalExtensionSync ( ) throws Throwable { } public void testMessaging ( ) throws Throwable { } public void testNativeFileSystem ( ) throws Throwable { } public void testPauseAndResume ( Context context ) throws Throwable { } public void testEnableRemoteDebugging ( Activity activity , Context context ) throws Throwable { } public void testDisableRemoteDebugging ( Activity activity , Context context ) throws Throwable { } public void testGetVersion ( ) throws Throwable { } @ TargetApi ( VERSION_CODES . JELLY_BEAN_MR1 ) private boolean isSecondaryDisplayAvailable ( ) { } }

Fix:
TestWebServer webServer = TestWebServer . start ( 4444 ) ;