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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java

Issue 1423713013: GN(Android): Fix CleanupReferenceTest#testCreateMany failing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.common; 5 package org.chromium.content.common;
6 6
7 import android.test.InstrumentationTestCase; 7 import android.test.InstrumentationTestCase;
8 import android.test.suitebuilder.annotation.SmallTest; 8 import android.test.suitebuilder.annotation.SmallTest;
9 9
10 import org.chromium.base.annotations.SuppressFBWarnings; 10 import org.chromium.base.annotations.SuppressFBWarnings;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 ReferredObject[] instances = new ReferredObject[instanceCount]; 84 ReferredObject[] instances = new ReferredObject[instanceCount];
85 85
86 for (int i = 0; i < instanceCount; ++i) { 86 for (int i = 0; i < instanceCount; ++i) {
87 instances[i] = new ReferredObject(); 87 instances[i] = new ReferredObject();
88 assertEquals(i + 1, sObjectCount.get()); 88 assertEquals(i + 1, sObjectCount.get());
89 } 89 }
90 90
91 instances = null; 91 instances = null;
92 // Ensure compiler / instrumentation does not strip out the assignment. 92 // Ensure compiler / instrumentation does not strip out the assignment.
93 assertTrue(instances == null); 93 assertTrue(instances == null);
94 // Calling sObjectCount.get() before collectGarbage() seems to be requir ed for the objects
95 // to be GC'ed only when building using GN.
96 assertTrue(sObjectCount.get() != -1);
94 collectGarbage(); 97 collectGarbage();
95 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { 98 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
96 @Override 99 @Override
97 public boolean isSatisfied() { 100 public boolean isSatisfied() {
98 return sObjectCount.get() == 0; 101 return sObjectCount.get() == 0;
99 } 102 }
100 })); 103 }));
101 } 104 }
102 105
103 } 106 }
OLDNEW
« 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