| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 android.os.ConditionVariable; | 7 import android.os.ConditionVariable; |
| 8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
| 9 | 9 |
| 10 import org.chromium.base.test.util.DisabledTest; | 10 import org.chromium.base.test.util.DisabledTest; |
| 11 import org.chromium.base.test.util.Feature; | 11 import org.chromium.base.test.util.Feature; |
| 12 import org.chromium.net.CronetTestBase.OnlyRunNativeCronet; | 12 import org.chromium.net.CronetTestBase.OnlyRunNativeCronet; |
| 13 import org.chromium.net.TestBidirectionalStreamCallback.FailureType; | 13 import org.chromium.net.TestBidirectionalStreamCallback.FailureType; |
| 14 import org.chromium.net.TestBidirectionalStreamCallback.ResponseStep; | 14 import org.chromium.net.TestBidirectionalStreamCallback.ResponseStep; |
| 15 import org.chromium.net.impl.CronetBidirectionalStream; |
| 15 | 16 |
| 16 import java.nio.ByteBuffer; | 17 import java.nio.ByteBuffer; |
| 17 import java.util.AbstractMap; | 18 import java.util.AbstractMap; |
| 18 import java.util.ArrayList; | 19 import java.util.ArrayList; |
| 19 import java.util.Arrays; | 20 import java.util.Arrays; |
| 20 import java.util.List; | 21 import java.util.List; |
| 21 import java.util.Map; | 22 import java.util.Map; |
| 22 import java.util.regex.Matcher; | 23 import java.util.regex.Matcher; |
| 23 import java.util.regex.Pattern; | 24 import java.util.regex.Pattern; |
| 24 | 25 |
| (...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 private static String bufferContentsToString(ByteBuffer byteBuffer, int star
t, int end) { | 1367 private static String bufferContentsToString(ByteBuffer byteBuffer, int star
t, int end) { |
| 1367 // Use a duplicate to avoid modifying byteBuffer. | 1368 // Use a duplicate to avoid modifying byteBuffer. |
| 1368 ByteBuffer duplicate = byteBuffer.duplicate(); | 1369 ByteBuffer duplicate = byteBuffer.duplicate(); |
| 1369 duplicate.position(start); | 1370 duplicate.position(start); |
| 1370 duplicate.limit(end); | 1371 duplicate.limit(end); |
| 1371 byte[] contents = new byte[duplicate.remaining()]; | 1372 byte[] contents = new byte[duplicate.remaining()]; |
| 1372 duplicate.get(contents); | 1373 duplicate.get(contents); |
| 1373 return new String(contents); | 1374 return new String(contents); |
| 1374 } | 1375 } |
| 1375 } | 1376 } |
| OLD | NEW |