Index: base/android/scoped_java_ref_unittest.cc |
diff --git a/base/android/scoped_java_ref_unittest.cc b/base/android/scoped_java_ref_unittest.cc |
index 3f4419af6d2b648174632dd9fa04ed24728ae1b4..99d035bb77defe2db4fa5253c820e2923f389a9f 100644 |
--- a/base/android/scoped_java_ref_unittest.cc |
+++ b/base/android/scoped_java_ref_unittest.cc |
@@ -106,6 +106,17 @@ TEST_F(ScopedJavaRefTest, RefCounts) { |
EXPECT_EQ(2, g_local_refs); |
} |
EXPECT_EQ(1, g_local_refs); |
+ { |
+ ScopedJavaLocalRef<jstring> str4((ScopedJavaLocalRef<jstring>(str2))); |
+ EXPECT_EQ(2, g_local_refs); |
+ } |
+ EXPECT_EQ(1, g_local_refs); |
+ { |
+ ScopedJavaLocalRef<jstring> str5; |
+ str5 = ScopedJavaLocalRef<jstring>(str2); |
+ EXPECT_EQ(2, g_local_refs); |
+ } |
+ EXPECT_EQ(1, g_local_refs); |
str2.Reset(); |
EXPECT_EQ(0, g_local_refs); |
global_str.Reset(); |