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

Side by Side Diff: content/browser/renderer_host/java/gin_java_method_invocation_helper_unittest.cc

Issue 323403007: [Android] Java Bridge with Gin: implement Java bound object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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 #include "content/browser/renderer_host/java/gin_java_method_invocation_helper.h " 5 #include "content/browser/renderer_host/java/gin_java_method_invocation_helper.h "
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "content/common/android/gin_java_bridge_value.h" 8 #include "content/common/android/gin_java_bridge_value.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 namespace { 13 namespace {
14 14
15 class NullObjectDelegate 15 class NullObjectDelegate
16 : public GinJavaMethodInvocationHelper::ObjectDelegate { 16 : public GinJavaMethodInvocationHelper::ObjectDelegate {
17 public: 17 public:
18 NullObjectDelegate() {} 18 NullObjectDelegate() {}
19 19
20 virtual ~NullObjectDelegate() {} 20 virtual ~NullObjectDelegate() {}
21 21
22 virtual base::android::ScopedJavaLocalRef<jobject> GetLocalRef( 22 virtual base::android::ScopedJavaLocalRef<jobject> GetLocalRef(
23 JNIEnv* env) OVERRIDE { 23 JNIEnv* env) OVERRIDE {
24 return base::android::ScopedJavaLocalRef<jobject>(); 24 return base::android::ScopedJavaLocalRef<jobject>();
25 } 25 }
26 26
27 virtual base::android::ScopedJavaLocalRef<jclass> GetLocalClassRef(
28 JNIEnv* env) OVERRIDE {
29 return base::android::ScopedJavaLocalRef<jclass>();
30 }
31
27 virtual const JavaMethod* FindMethod(const std::string& method_name, 32 virtual const JavaMethod* FindMethod(const std::string& method_name,
28 size_t num_parameters) OVERRIDE { 33 size_t num_parameters) OVERRIDE {
29 return NULL; 34 return NULL;
30 } 35 }
31 36
32 virtual bool IsObjectGetClassMethod(const JavaMethod* method) OVERRIDE { 37 virtual bool IsObjectGetClassMethod(const JavaMethod* method) OVERRIDE {
33 return false; 38 return false;
34 } 39 }
35 40
36 virtual const base::android::JavaRef<jclass>& GetSafeAnnotationClass() 41 virtual const base::android::JavaRef<jclass>& GetSafeAnnotationClass()
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 EXPECT_TRUE(helper->GetErrorMessage().empty()); 276 EXPECT_TRUE(helper->GetErrorMessage().empty());
272 helper->Invoke(); 277 helper->Invoke();
273 EXPECT_TRUE(object_delegate->find_method_called()); 278 EXPECT_TRUE(object_delegate->find_method_called());
274 EXPECT_TRUE(object_delegate->get_class_called()); 279 EXPECT_TRUE(object_delegate->get_class_called());
275 EXPECT_TRUE(helper->HoldsPrimitiveResult()); 280 EXPECT_TRUE(helper->HoldsPrimitiveResult());
276 EXPECT_TRUE(helper->GetPrimitiveResult().empty()); 281 EXPECT_TRUE(helper->GetPrimitiveResult().empty());
277 EXPECT_FALSE(helper->GetErrorMessage().empty()); 282 EXPECT_FALSE(helper->GetErrorMessage().empty());
278 } 283 }
279 284
280 } // namespace content 285 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/java/gin_java_method_invocation_helper.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698