Index: android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java |
diff --git a/android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java b/android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java |
index 761094235d08f80775b1dce7bbbe83b2d7371afb..f6bbaa1bcfaea446278d92f52136ada3c666bc33 100644 |
--- a/android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java |
+++ b/android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java |
@@ -6,6 +6,7 @@ package org.chromium.android_webview.unittest; |
import org.chromium.base.CalledByNative; |
+import java.io.IOException; |
import java.io.InputStream; |
class InputStreamUnittest { |
@@ -23,6 +24,31 @@ class InputStreamUnittest { |
} |
@CalledByNative |
+ static InputStream getThrowingStream() { |
+ return new InputStream() { |
+ @Override |
+ public int available() throws IOException { |
+ throw new IOException(); |
+ } |
+ |
+ @Override |
+ public void close() throws IOException { |
+ throw new IOException(); |
+ } |
+ |
+ @Override |
+ public long skip(long n) throws IOException { |
+ throw new IOException(); |
+ } |
+ |
+ @Override |
+ public int read() throws IOException { |
+ throw new IOException(); |
+ } |
+ }; |
+ } |
+ |
+ @CalledByNative |
static InputStream getCountingStream(final int size) { |
return new InputStream() { |
private int count = 0; |