| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |