| OLD | NEW |
| 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.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.os.ConditionVariable; | 7 import android.os.ConditionVariable; |
| 8 import android.test.MoreAsserts; | 8 import android.test.MoreAsserts; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
| 10 import android.util.Log; | 10 import android.util.Log; |
| 11 | 11 |
| 12 import org.chromium.base.test.util.Feature; | 12 import org.chromium.base.test.util.Feature; |
| 13 import org.chromium.base.test.util.FlakyTest; | 13 import org.chromium.base.test.util.FlakyTest; |
| 14 import org.chromium.net.TestUrlRequestCallback.FailureType; | 14 import org.chromium.net.TestUrlRequestCallback.FailureType; |
| 15 import org.chromium.net.TestUrlRequestCallback.ResponseStep; | 15 import org.chromium.net.TestUrlRequestCallback.ResponseStep; |
| 16 import org.chromium.net.impl.CronetUrlRequest; |
| 16 import org.chromium.net.test.FailurePhase; | 17 import org.chromium.net.test.FailurePhase; |
| 17 | 18 |
| 18 import java.io.IOException; | 19 import java.io.IOException; |
| 19 import java.net.ConnectException; | 20 import java.net.ConnectException; |
| 20 import java.nio.ByteBuffer; | 21 import java.nio.ByteBuffer; |
| 21 import java.util.AbstractMap; | 22 import java.util.AbstractMap; |
| 22 import java.util.ArrayList; | 23 import java.util.ArrayList; |
| 23 import java.util.Arrays; | 24 import java.util.Arrays; |
| 24 import java.util.List; | 25 import java.util.List; |
| 25 import java.util.Map; | 26 import java.util.Map; |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int
end) { | 1817 private String bufferContentsToString(ByteBuffer byteBuffer, int start, int
end) { |
| 1817 // Use a duplicate to avoid modifying byteBuffer. | 1818 // Use a duplicate to avoid modifying byteBuffer. |
| 1818 ByteBuffer duplicate = byteBuffer.duplicate(); | 1819 ByteBuffer duplicate = byteBuffer.duplicate(); |
| 1819 duplicate.position(start); | 1820 duplicate.position(start); |
| 1820 duplicate.limit(end); | 1821 duplicate.limit(end); |
| 1821 byte[] contents = new byte[duplicate.remaining()]; | 1822 byte[] contents = new byte[duplicate.remaining()]; |
| 1822 duplicate.get(contents); | 1823 duplicate.get(contents); |
| 1823 return new String(contents); | 1824 return new String(contents); |
| 1824 } | 1825 } |
| 1825 } | 1826 } |
| OLD | NEW |