| OLD | NEW |
| 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/android/java/gin_java_method_invocation_helper.h" | 5 #include "content/browser/android/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/browser/android/java/jni_helper.h" | 8 #include "content/browser/android/java/jni_helper.h" |
| 9 #include "content/common/android/gin_java_bridge_value.h" | 9 #include "content/common/android/gin_java_bridge_value.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 bool IsObjectGetClassMethod(const JavaMethod* method) override { | 37 bool IsObjectGetClassMethod(const JavaMethod* method) override { |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 | 40 |
| 41 const base::android::JavaRef<jclass>& GetSafeAnnotationClass() override { | 41 const base::android::JavaRef<jclass>& GetSafeAnnotationClass() override { |
| 42 return safe_annotation_class_; | 42 return safe_annotation_class_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 base::android::ScopedJavaLocalRef<jclass> safe_annotation_class_; | 46 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_class_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(NullObjectDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(NullObjectDelegate); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class NullDispatcherDelegate | 51 class NullDispatcherDelegate |
| 52 : public GinJavaMethodInvocationHelper::DispatcherDelegate { | 52 : public GinJavaMethodInvocationHelper::DispatcherDelegate { |
| 53 public: | 53 public: |
| 54 NullDispatcherDelegate() {} | 54 NullDispatcherDelegate() {} |
| 55 | 55 |
| 56 ~NullDispatcherDelegate() override {} | 56 ~NullDispatcherDelegate() override {} |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 helper->Invoke(); | 326 helper->Invoke(); |
| 327 EXPECT_TRUE(object_delegate->find_method_called()); | 327 EXPECT_TRUE(object_delegate->find_method_called()); |
| 328 EXPECT_TRUE(object_delegate->get_class_called()); | 328 EXPECT_TRUE(object_delegate->get_class_called()); |
| 329 EXPECT_TRUE(helper->HoldsPrimitiveResult()); | 329 EXPECT_TRUE(helper->HoldsPrimitiveResult()); |
| 330 EXPECT_TRUE(helper->GetPrimitiveResult().empty()); | 330 EXPECT_TRUE(helper->GetPrimitiveResult().empty()); |
| 331 EXPECT_EQ(kGinJavaBridgeAccessToObjectGetClassIsBlocked, | 331 EXPECT_EQ(kGinJavaBridgeAccessToObjectGetClassIsBlocked, |
| 332 helper->GetInvocationError()); | 332 helper->GetInvocationError()); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace content | 335 } // namespace content |
| OLD | NEW |