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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java

Issue 2431753003: Merge EmbeddedTestServer#createAndStartDefaultServer() and createAndStartFileServer() (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.net; 5 package org.chromium.net;
6 6
7 import static org.chromium.base.CollectionUtil.newHashSet; 7 import static org.chromium.base.CollectionUtil.newHashSet;
8 8
9 import android.os.ConditionVariable; 9 import android.os.ConditionVariable;
10 import android.test.suitebuilder.annotation.SmallTest; 10 import android.test.suitebuilder.annotation.SmallTest;
(...skipping 14 matching lines...) Expand all
25 * Test RequestFinishedInfo.Listener and the metrics information it provides. 25 * Test RequestFinishedInfo.Listener and the metrics information it provides.
26 */ 26 */
27 public class RequestFinishedInfoTest extends CronetTestBase { 27 public class RequestFinishedInfoTest extends CronetTestBase {
28 CronetTestFramework mTestFramework; 28 CronetTestFramework mTestFramework;
29 private EmbeddedTestServer mTestServer; 29 private EmbeddedTestServer mTestServer;
30 private String mUrl; 30 private String mUrl;
31 31
32 @Override 32 @Override
33 protected void setUp() throws Exception { 33 protected void setUp() throws Exception {
34 super.setUp(); 34 super.setUp();
35 mTestServer = EmbeddedTestServer.createAndStartDefaultServer(getContext( )); 35 mTestServer = EmbeddedTestServer.createAndStartServer(getContext());
36 mUrl = mTestServer.getURL("/echo?status=200"); 36 mUrl = mTestServer.getURL("/echo?status=200");
37 } 37 }
38 38
39 @Override 39 @Override
40 protected void tearDown() throws Exception { 40 protected void tearDown() throws Exception {
41 mTestServer.stopAndDestroyServer(); 41 mTestServer.stopAndDestroyServer();
42 super.tearDown(); 42 super.tearDown();
43 } 43 }
44 44
45 static class DirectExecutor implements Executor { 45 static class DirectExecutor implements Executor {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 assertEquals(new Date(sslEnd), metrics.getSslEnd()); 322 assertEquals(new Date(sslEnd), metrics.getSslEnd());
323 assertEquals(new Date(pushStart), metrics.getPushStart()); 323 assertEquals(new Date(pushStart), metrics.getPushStart());
324 assertEquals(new Date(pushEnd), metrics.getPushEnd()); 324 assertEquals(new Date(pushEnd), metrics.getPushEnd());
325 assertEquals(new Date(responseStart), metrics.getResponseStart()); 325 assertEquals(new Date(responseStart), metrics.getResponseStart());
326 assertEquals(new Date(requestEnd), metrics.getRequestEnd()); 326 assertEquals(new Date(requestEnd), metrics.getRequestEnd());
327 assertEquals(socketReused, metrics.getSocketReused()); 327 assertEquals(socketReused, metrics.getSocketReused());
328 assertEquals(sentBytesCount, (long) metrics.getSentBytesCount()); 328 assertEquals(sentBytesCount, (long) metrics.getSentBytesCount());
329 assertEquals(receivedBytesCount, (long) metrics.getReceivedBytesCount()) ; 329 assertEquals(receivedBytesCount, (long) metrics.getReceivedBytesCount()) ;
330 } 330 }
331 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698