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

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

Issue 20210002: [Android] Sets up a coverage system for java using EMMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleans up temporary changes, fixes a few more small things Created 7 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 | « content/content_shell.gypi ('k') | sync/sync_android.gypi » ('j') | 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/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 a887ffb051ffae7eabd0c9bb5376b584a8a9072d..476986e3c0823add87fac128c33295abdc60ec7b 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
@@ -36,6 +36,9 @@ public class CleanupReferenceTest extends InstrumentationTestCase {
}
}
+ volatile ReferredObject[] instances = null;
+ volatile ReferredObject instance = null;
+
@Override
public void setUp() throws Exception {
super.setUp();
@@ -54,7 +57,7 @@ public class CleanupReferenceTest extends InstrumentationTestCase {
public void testCreateSingle() throws Throwable {
assertEquals(0, sObjectCount.get());
- ReferredObject instance = new ReferredObject();
joth 2013/08/20 18:34:22 Use AtomicReference here, and then you won't need
+ instance = new ReferredObject();
assertEquals(1, sObjectCount.get());
instance = null;
joth 2013/08/20 18:34:22 instance.set(null); instance = null;
@@ -73,7 +76,7 @@ public class CleanupReferenceTest extends InstrumentationTestCase {
assertEquals(0, sObjectCount.get());
final int INSTANCE_COUNT = 20;
- ReferredObject[] instances = new ReferredObject[INSTANCE_COUNT];
+ instances = new ReferredObject[INSTANCE_COUNT];
for (int i = 0; i < INSTANCE_COUNT; ++i) {
instances[i] = new ReferredObject();
« no previous file with comments | « content/content_shell.gypi ('k') | sync/sync_android.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698