| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.android_webview.unittest; | 5 package org.chromium.android_webview.unittest; |
| 6 | 6 |
| 7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
| 8 | 8 |
| 9 import java.io.IOException; | 9 import java.io.IOException; |
| 10 import java.io.InputStream; | 10 import java.io.InputStream; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 }; | 48 }; |
| 49 } | 49 } |
| 50 | 50 |
| 51 @CalledByNative | 51 @CalledByNative |
| 52 static InputStream getCountingStream(final int size) { | 52 static InputStream getCountingStream(final int size) { |
| 53 return new InputStream() { | 53 return new InputStream() { |
| 54 private int mCount = 0; | 54 private int mCount = 0; |
| 55 | 55 |
| 56 @Override | 56 @Override |
| 57 public int read() { | 57 public int read() { |
| 58 if (mCount < size) | 58 if (mCount < size) { |
| 59 return mCount++ % 256; | 59 return mCount++ % 256; |
| 60 else | 60 } else { |
| 61 return -1; | 61 return -1; |
| 62 } |
| 62 } | 63 } |
| 63 }; | 64 }; |
| 64 } | 65 } |
| 65 } | 66 } |
| OLD | NEW |