summaryrefslogtreecommitdiffstats
path: root/mobile/android/app/src/test/java
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /mobile/android/app/src/test/java
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'mobile/android/app/src/test/java')
-rw-r--r--mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoApplication.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoApplication.java b/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoApplication.java
new file mode 100644
index 000000000..fee9a426d
--- /dev/null
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoApplication.java
@@ -0,0 +1,27 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+package org.mozilla.gecko;
+
+import android.app.Application;
+
+import org.robolectric.TestLifecycleApplication;
+
+import java.lang.reflect.Method;
+
+/**
+ * GeckoApplication isn't test-lifecycle friendly: onCreate is called multiple times, which
+ * re-registers Gecko event listeners, which fails. This class is magically named so that
+ * Robolectric uses it instead of the application defined in the Android manifest. See
+ * http://robolectric.blogspot.ca/2013/04/the-test-lifecycle-in-20.html.
+ */
+public class TestGeckoApplication extends Application implements TestLifecycleApplication {
+ @Override public void beforeTest(Method method) {
+ }
+
+ @Override public void prepareTest(Object test) {
+ }
+
+ @Override public void afterTest(Method method) {
+ }
+}