| 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.cronet_test_apk; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.test.InstrumentationTestCase; | 7 import android.test.InstrumentationTestCase; |
| 8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
| 9 | 9 |
| 10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.net.ChunkedWritableByteChannel; | |
| 12 | 11 |
| 13 import java.io.IOException; | 12 import java.io.IOException; |
| 14 import java.nio.ByteBuffer; | 13 import java.nio.ByteBuffer; |
| 15 import java.nio.channels.ClosedChannelException; | 14 import java.nio.channels.ClosedChannelException; |
| 16 import java.nio.charset.Charset; | 15 import java.nio.charset.Charset; |
| 17 import java.util.Arrays; | 16 import java.util.Arrays; |
| 18 | 17 |
| 19 /** | 18 /** |
| 20 * Tests for {@link ChunkedWritableByteChannel} | 19 * Tests for {@link ChunkedWritableByteChannel} |
| 21 */ | 20 */ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 @SmallTest | 72 @SmallTest |
| 74 @Feature({"Cronet"}) | 73 @Feature({"Cronet"}) |
| 75 public void testCapacityGrows() throws Exception { | 74 public void testCapacityGrows() throws Exception { |
| 76 mChannel.setCapacity(123); | 75 mChannel.setCapacity(123); |
| 77 byte[] data = new byte[1234]; | 76 byte[] data = new byte[1234]; |
| 78 Arrays.fill(data, (byte) 'G'); | 77 Arrays.fill(data, (byte) 'G'); |
| 79 mChannel.write(ByteBuffer.wrap(data)); | 78 mChannel.write(ByteBuffer.wrap(data)); |
| 80 assertTrue(Arrays.equals(data, mChannel.getBytes())); | 79 assertTrue(Arrays.equals(data, mChannel.getBytes())); |
| 81 } | 80 } |
| 82 } | 81 } |
| OLD | NEW |