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

Side by Side Diff: android_webview/native/input_stream_unittest.cc

Issue 2199973003: Android JNI gen: Don't emit code for empty RegisterNatives() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jnireg1
Patch Set: Android JNI gen: Don't emit code for empty RegisterNatives() Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include <memory> 5 #include <memory>
6 6
7 #include "android_webview/native/input_stream_impl.h" 7 #include "android_webview/native/input_stream_impl.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "jni/InputStreamUnittest_jni.h" 10 #include "jni/InputStreamUnittest_jni.h"
(...skipping 20 matching lines...) Expand all
31 using testing::_; 31 using testing::_;
32 32
33 class InputStreamTest : public Test { 33 class InputStreamTest : public Test {
34 public: 34 public:
35 InputStreamTest() { 35 InputStreamTest() {
36 } 36 }
37 protected: 37 protected:
38 void SetUp() override { 38 void SetUp() override {
39 env_ = AttachCurrentThread(); 39 env_ = AttachCurrentThread();
40 ASSERT_THAT(env_, NotNull()); 40 ASSERT_THAT(env_, NotNull());
41 ASSERT_TRUE(RegisterNativesImpl(env_));
42 } 41 }
43 42
44 scoped_refptr<IOBuffer> DoReadCountedStreamTest(int stream_size, 43 scoped_refptr<IOBuffer> DoReadCountedStreamTest(int stream_size,
45 int bytes_requested, 44 int bytes_requested,
46 int* bytes_read) { 45 int* bytes_read) {
47 ScopedJavaLocalRef<jobject> counting_jstream = 46 ScopedJavaLocalRef<jobject> counting_jstream =
48 Java_InputStreamUnittest_getCountingStream(env_, stream_size); 47 Java_InputStreamUnittest_getCountingStream(env_, stream_size);
49 EXPECT_FALSE(counting_jstream.is_null()); 48 EXPECT_FALSE(counting_jstream.is_null());
50 49
51 std::unique_ptr<InputStream> input_stream( 50 std::unique_ptr<InputStream> input_stream(
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 134
136 const int bytes_requested = 10; 135 const int bytes_requested = 10;
137 int bytes_read = 0; 136 int bytes_read = 0;
138 scoped_refptr<IOBuffer> buffer = new IOBuffer(bytes_requested); 137 scoped_refptr<IOBuffer> buffer = new IOBuffer(bytes_requested);
139 EXPECT_FALSE(input_stream->Read(buffer.get(), bytes_requested, &bytes_read)); 138 EXPECT_FALSE(input_stream->Read(buffer.get(), bytes_requested, &bytes_read));
140 EXPECT_EQ(0, bytes_read); 139 EXPECT_EQ(0, bytes_read);
141 140
142 // This closes the stream. 141 // This closes the stream.
143 input_stream.reset(NULL); 142 input_stream.reset(NULL);
144 } 143 }
OLDNEW
« no previous file with comments | « no previous file | base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698