Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1504)

Unified Diff: android_webview/unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java

Issue 430443003: Use unchecked InputStream methods in the android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove old InputStream jni Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/webview_native.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « android_webview/native/webview_native.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698