| Index: base/android/java/src/org/chromium/base/ApplicationStatus.java
|
| diff --git a/base/android/java/src/org/chromium/base/ApplicationStatus.java b/base/android/java/src/org/chromium/base/ApplicationStatus.java
|
| index 9f775958491811c93237391ad9c55964dd29d2c9..d6da142663e704674a88c01f2ee8399f84ed697d 100644
|
| --- a/base/android/java/src/org/chromium/base/ApplicationStatus.java
|
| +++ b/base/android/java/src/org/chromium/base/ApplicationStatus.java
|
| @@ -393,6 +393,23 @@ public static void unregisterApplicationStateListener(ApplicationStateListener l
|
| }
|
|
|
| /**
|
| + * Robolectric JUnit tests create a new application between each test, while all the context
|
| + * in static classes isn't reset. This function allows to reset the application status to avoid
|
| + * being in a dirty state.
|
| + */
|
| + public static void destroyForJUnitTests() {
|
| + sApplicationStateListeners.clear();
|
| + sGeneralActivityStateListeners.clear();
|
| + sActivityInfo.clear();
|
| + synchronized (sCachedApplicationStateLock) {
|
| + sCachedApplicationState = null;
|
| + }
|
| + sActivity = null;
|
| + sApplication = null;
|
| + sNativeApplicationStateListener = null;
|
| + }
|
| +
|
| + /**
|
| * Registers the single thread-safe native activity status listener.
|
| * This handles the case where the caller is not on the main thread.
|
| * Note that this is used by a leaky singleton object from the native
|
|
|