Index: content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
diff --git a/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java b/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
index dc61afc0f18ed8c3045c468bf2761f3c057fad89..602d2f6b625873bacd9a3e8ced9300a7c0727b65 100644 |
--- a/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
+++ b/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
@@ -91,6 +91,9 @@ public class CleanupReferenceTest extends InstrumentationTestCase { |
instances = null; |
// Ensure compiler / instrumentation does not strip out the assignment. |
assertTrue(instances == null); |
+ // Calling sObjectCount.get() before collectGarbage() seems to be required for the objects |
+ // to be GC'ed only when building using GN. |
+ assertTrue(sObjectCount.get() != -1); |
collectGarbage(); |
assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { |
@Override |