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

Unified Diff: base/android/scoped_java_ref_unittest.cc

Issue 2268553002: Small improvements to JNI references. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Learn about, and then fix, the most vexing parse. :) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/scoped_java_ref.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « base/android/scoped_java_ref.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698