Bug 1650118: Part 3 - Update tests; r=geckoview-reviewers,agi,perftest-reviewers,sparky
authorAaron Klotz <aklotz@mozilla.com>
Tue, 27 Oct 2020 16:43:22 +0000
changeset 554761 2feccdfcb9e28b8633ec0c260222d23a63958fa2
parent 554760 68a0c8b19d88dae0a9cb9da8b59212b337e6df25
child 554762 2d20f9b282dfb2038aad3c0d0b09a85963536234
push id37898
push userabutkovits@mozilla.com
push dateWed, 28 Oct 2020 09:24:21 +0000
treeherdermozilla-central@83bf4fd3b1fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, agi, perftest-reviewers, sparky
bugs1650118
milestone84.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1650118: Part 3 - Update tests; r=geckoview-reviewers,agi,perftest-reviewers,sparky Depends on D90930 Differential Revision: https://phabricator.services.mozilla.com/D90932
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentCrashTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateMultipleSessionsTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Environment.java
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentCrashTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentCrashTest.kt
@@ -26,17 +26,16 @@ class ContentCrashTest : BaseSessionTest
     fun setup() {
         assertTrue(client.connect(env.defaultTimeoutMillis))
         client.setEvalNextCrashDump(/* expectFatal */ false)
     }
 
     @IgnoreCrash
     @Test
     fun crashContent() {
-        assumeTrue(sessionRule.env.isMultiprocess)
         // We need the crash reporter for this test
         assumeTrue(BuildConfig.MOZ_CRASHREPORTER)
 
         mainSession.loadUri(CONTENT_CRASH_URL)
         mainSession.waitUntilCalled(Callbacks.ContentDelegate::class, "onCrash")
 
         // This test is really slow so we allow double the usual timeout
         var evalResult = client.getEvalResult(env.defaultTimeoutMillis * 2)
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateMultipleSessionsTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateMultipleSessionsTest.kt
@@ -114,19 +114,16 @@ class ContentDelegateMultipleSessionsTes
 
     @Before
     fun setup() {
         resetContentProcesses()
     }
 
     @IgnoreCrash
     @Test fun crashContentMultipleSessions() {
-        // This test doesn't make sense without multiprocess
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         val newSession = getSecondGeckoSession()
 
         // We can inadvertently catch the `onCrash` call for the cached session if we don't specify
         // individual sessions here. Therefore, assert 'onCrash' is called for the two sessions
         // individually...
         val mainSessionCrash = GeckoResult<Void>()
         val newSessionCrash = GeckoResult<Void>()
 
@@ -156,18 +153,16 @@ class ContentDelegateMultipleSessionsTes
 
         mainSession.loadUri(CONTENT_CRASH_URL)
 
         sessionRule.waitForResult(allCrashesFound)
     }
 
     @IgnoreCrash
     @Test fun killContentMultipleSessions() {
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         val newSession = getSecondGeckoSession()
 
         val mainSessionKilled = GeckoResult<Void>()
         val newSessionKilled = GeckoResult<Void>()
 
         val allKillEventsReceived = GeckoResult.allOf(mainSessionKilled, newSessionKilled)
 
         sessionRule.delegateUntilTestEnd(object : Callbacks.ContentDelegate {
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
@@ -106,19 +106,16 @@ class ContentDelegateTest : BaseSessionT
                 assertThat("Content length should be non-zero", response.headers.get("Content-Length")!!.toLong(), greaterThan(0L))
                 assertThat("Filename should match", response.headers.get("cONTent-diSPOsiTion"), equalTo("attachment; filename=\"download.txt\""))
             }
         })
     }
 
     @IgnoreCrash
     @Test fun crashContent() {
-        // This test doesn't make sense without multiprocess
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         mainSession.loadUri(CONTENT_CRASH_URL)
         mainSession.waitUntilCalled(object : Callbacks.ContentDelegate {
             @AssertCalled(count = 1)
             override fun onCrash(session: GeckoSession) {
                 assertThat("Session should be closed after a crash",
                            session.isOpen, equalTo(false))
             }
         })
@@ -132,19 +129,16 @@ class ContentDelegateTest : BaseSessionT
                 assertThat("Page should load successfully", success, equalTo(true))
             }
         })
     }
 
     @IgnoreCrash
     @WithDisplay(width = 10, height = 10)
     @Test fun crashContent_tapAfterCrash() {
-        // This test doesn't make sense without multiprocess
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         mainSession.delegateUntilTestEnd(object : Callbacks.ContentDelegate {
             override fun onCrash(session: GeckoSession) {
                 mainSession.open()
                 mainSession.loadTestPath(HELLO_HTML_PATH)
             }
         })
 
         mainSession.synthesizeTap(5, 5)
@@ -165,18 +159,16 @@ class ContentDelegateTest : BaseSessionT
             if (info.processName.matches(expr)) {
                 Process.killProcess(info.pid)
             }
         }
     }
 
     @IgnoreCrash
     @Test fun killContent() {
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         killAllContentProcesses()
         mainSession.waitUntilCalled(object : Callbacks.ContentDelegate {
             @AssertCalled(count = 1)
             override fun onKill(session: GeckoSession) {
                 assertThat("Session should be closed after being killed",
                         session.isOpen, equalTo(false))
             }
         })
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
@@ -1632,28 +1632,25 @@ class GeckoSessionTestRuleTest : BaseSes
         assertThat("Test delegate should still be registered", delegate, notNullValue())
         assertThat("Test delegate return value should be correct",
                 delegate?.onDelegate("", ""), equalTo(42))
         sessionRule.performTestEndCheck()
     }
 
     @IgnoreCrash
     @Test fun contentCrashIgnored() {
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
-
         mainSession.loadUri(CONTENT_CRASH_URL)
         mainSession.waitUntilCalled(object : Callbacks.ContentDelegate {
             @AssertCalled(count = 1)
             override fun onCrash(session: GeckoSession) = Unit
         })
     }
 
     @Test(expected = ChildCrashedException::class)
     fun contentCrashFails() {
-        assumeThat(sessionRule.env.isMultiprocess, equalTo(true))
         assumeThat(sessionRule.env.shouldShutdownOnCrash(), equalTo(false))
 
         sessionRule.session.loadUri(CONTENT_CRASH_URL)
         sessionRule.waitForPageStop()
     }
 
     @Test fun waitForResult() {
         val handler = Handler(Looper.getMainLooper())
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Environment.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Environment.java
@@ -33,22 +33,16 @@ public class Environment {
     public boolean isAutomation() {
         return !getEnvVar("MOZ_IN_AUTOMATION").isEmpty();
     }
 
     public boolean shouldShutdownOnCrash() {
         return !getEnvVar("MOZ_CRASHREPORTER_SHUTDOWN").isEmpty();
     }
 
-    public boolean isMultiprocess() {
-        return Boolean.valueOf(InstrumentationRegistry.getArguments()
-                .getString("use_multiprocess",
-                        "true"));
-    }
-
     public boolean isDebugging() {
         return Debug.isDebuggerConnected();
     }
 
     public boolean isEmulator() {
         return "generic".equals(Build.DEVICE) || Build.DEVICE.startsWith("generic_");
     }
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java
@@ -154,17 +154,16 @@ public class RuntimeCreator {
 
         final SafeBrowsingProvider google = SafeBrowsingProvider
                 .from(ContentBlocking.GOOGLE_SAFE_BROWSING_PROVIDER)
                 .getHashUrl("http://mochi.test:8888/safebrowsing4-dummy/gethash")
                 .updateUrl("http://mochi.test:8888/safebrowsing4-dummy/update")
                 .build();
 
         final GeckoRuntimeSettings runtimeSettings = new GeckoRuntimeSettings.Builder()
-                .useMultiprocess(env.isMultiprocess())
                 .contentBlocking(new ContentBlocking.Settings.Builder()
                         .safeBrowsingProviders(googleLegacy, google)
                         .build())
                 .arguments(new String[]{"-purgecaches"})
                 .extras(InstrumentationRegistry.getArguments())
                 .remoteDebuggingEnabled(true)
                 .consoleOutput(true)
                 .crashHandler(TestCrashHandler.class)