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

Side by Side Diff: testing/android/java/src/org/chromium/native_test/ChromeNativeTestInstrumentationTestRunner.java

Issue 869083004: [Android] Revised initial commit of the HttpTestServer. (abandoned) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/test/android/javatests/src/org/chromium/net/test/TestServerSpawner.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.native_test; 5 package org.chromium.native_test;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.Instrumentation; 8 import android.app.Instrumentation;
9 import android.content.ComponentName; 9 import android.content.ComponentName;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 File portFile = new File( 103 File portFile = new File(
104 Environment.getExternalStorageDirectory(), "net-test-ser ver-ports"); 104 Environment.getExternalStorageDirectory(), "net-test-ser ver-ports");
105 OutputStreamWriter writer = 105 OutputStreamWriter writer =
106 new OutputStreamWriter(new FileOutputStream(portFile)); 106 new OutputStreamWriter(new FileOutputStream(portFile));
107 writer.write(Integer.toString(mTestServerSpawner.getServerPort() ) + ":0"); 107 writer.write(Integer.toString(mTestServerSpawner.getServerPort() ) + ":0");
108 writer.close(); 108 writer.close();
109 109
110 mTestServerSpawnerThread = new Thread(mTestServerSpawner); 110 mTestServerSpawnerThread = new Thread(mTestServerSpawner);
111 mTestServerSpawnerThread.start(); 111 mTestServerSpawnerThread.start();
112 mTestServerSpawner.waitForServerToStart();
112 } catch (IOException e) { 113 } catch (IOException e) {
113 Log.e(TAG, "Error creating TestServerSpawner: " + e.toString()); 114 Log.e(TAG, "Error creating TestServerSpawner: " + e.toString());
114 } 115 }
115 } 116 }
116 } 117 }
117 118
118 private void tearDown() { 119 private void tearDown() {
119 if (mTestServerSpawnerThread != null) { 120 if (mTestServerSpawnerThread != null) {
120 try { 121 try {
121 mTestServerSpawner.stop(); 122 mTestServerSpawner.stop();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } else { 273 } else {
273 resultBuilder.append("\nOK (" + Integer.toString(testsPassed) + " tests)"); 274 resultBuilder.append("\nOK (" + Integer.toString(testsPassed) + " tests)");
274 } 275 }
275 resultsBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT, 276 resultsBundle.putString(Instrumentation.REPORT_KEY_STREAMRESULT,
276 resultBuilder.toString()); 277 resultBuilder.toString());
277 return resultsBundle; 278 return resultsBundle;
278 } 279 }
279 } 280 }
280 281
281 } 282 }
OLDNEW
« no previous file with comments | « net/test/android/javatests/src/org/chromium/net/test/TestServerSpawner.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698