summaryrefslogtreecommitdiffstats
path: root/android_webview/java
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-20 17:05:17 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-20 17:05:17 +0000
commit86adfb7e19f91876e9b491172698decf6f371652 (patch)
tree2cb898cefaff5ea07a49deb136f3d37091691828 /android_webview/java
parent8b4e6291c402353914728a2619a0b07803d004df (diff)
downloadchromium_src-86adfb7e19f91876e9b491172698decf6f371652.zip
chromium_src-86adfb7e19f91876e9b491172698decf6f371652.tar.gz
chromium_src-86adfb7e19f91876e9b491172698decf6f371652.tar.bz2
Add Garbage collection test for AwContents
This is to ensure instances do not get leaked after GC, even if AwContents.destroy() is not called. This is a resurrection of the test in https://codereview.chromium.org/12658010/diff/23001/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java now that crbug.com/197020 is no longer an issue (due to new graphics pipeline) BUG=197020 Review URL: https://chromiumcodereview.appspot.com/16983009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/java')
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwContents.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 8cd9520..cec63c2 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -489,6 +489,15 @@ public class AwContents {
return nativeGetAwDrawGLFunction();
}
+ /**
+ * Intended for test code.
+ * @return the number of native instances of this class.
+ */
+ @VisibleForTesting
+ public static int getNativeInstanceCount() {
+ return nativeGetNativeInstanceCount();
+ }
+
public int getAwDrawGLViewContext() {
// Using the native pointer as the returned viewContext. This is matched by the
// reinterpret_cast back to BrowserViewRenderer pointer in the native DrawGLFunction.
@@ -1449,6 +1458,7 @@ public class AwContents {
private static native void nativeSetAwDrawSWFunctionTable(int functionTablePointer);
private static native void nativeSetAwDrawGLFunctionTable(int functionTablePointer);
private static native int nativeGetAwDrawGLFunction();
+ private static native int nativeGetNativeInstanceCount();
private native void nativeSetJavaPeers(int nativeAwContents, AwContents awContents,
AwWebContentsDelegate webViewWebContentsDelegate,
AwContentsClientBridge contentsClientBridge,