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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java

Issue 1574753002: Ensure Oilpan garbage is collected on JavaBridgeChildFrameTest test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java
index fab571f2f8f5095e26713f89e37bf118855bc43b..cdec28bffb23d2efede2fb32796291b5f0b10497 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeChildFrameTest.java
@@ -223,7 +223,9 @@ public class JavaBridgeChildFrameTest extends JavaBridgeTestBase {
"(function(){ "
+ "var f = document.getElementById('frame2');"
+ "f.parentNode.removeChild(f); return typeof f; })()"));
- executeJavaScriptAndGetResult(getWebContents(), "gc();");
+ // Perform two major GCs at the end to flush out all wrappers
+ // and other Blink (Oilpan) objects.
+ executeJavaScriptAndGetResult(getWebContents(), "for (var i = 0; i < 2; ++i) gc();");
// Check that returned Java object is being held by the Java bridge, thus it's not
// collected. Note that despite that what JavaDoc says about invoking "gc()", both Dalvik
// and ART actually run the collector.
@@ -237,7 +239,7 @@ public class JavaBridgeChildFrameTest extends JavaBridgeTestBase {
"(function(){ "
+ "var f = document.getElementById('frame1');"
+ "f.parentNode.removeChild(f); return typeof f; })()"));
- executeJavaScriptAndGetResult(getWebContents(), "gc();");
+ executeJavaScriptAndGetResult(getWebContents(), "for (var i = 0; i < 2; ++i) gc();");
Runtime.getRuntime().gc();
assertNull(testObject.mWeakRefForInner.get());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698