commit c12ca56703967736a197cf534209e480e104d7d1 parent 73e9309451926bea96318732e3cf2053214d21dc Author: Olivia Hall <ohall@mozilla.com> Date: Mon, 20 Oct 2025 23:30:36 +0000 Bug 1991512 - Add Taskcluster config to test App Zygote Preloading r=geckoview-reviewers,jmaher,tcampbell Creates a `zygote` variant to test App Zygote Preloading on request. Differential Revision: https://phabricator.services.mozilla.com/D266902 Diffstat:
7 files changed, 44 insertions(+), 1 deletion(-)
diff --git 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 @@ -4,6 +4,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.MediumTest import androidx.test.platform.app.InstrumentationRegistry import org.hamcrest.Matchers +import org.hamcrest.Matchers.equalTo import org.junit.After import org.junit.Assert.assertTrue import org.junit.Assume.assumeThat @@ -35,6 +36,7 @@ class ContentCrashTest : BaseSessionTest() { // TODO: bug 1710940 assumeThat(sessionRule.env.isIsolatedProcess, Matchers.equalTo(false)) + assumeThat(sessionRule.env.isAppZygoteProcess, equalTo(false)) mainSession.loadUri(CONTENT_CRASH_URL) mainSession.waitUntilCalled(ContentDelegate::class, "onCrash") @@ -52,6 +54,7 @@ class ContentCrashTest : BaseSessionTest() { // TODO: bug 1710940 assumeThat(sessionRule.env.isIsolatedProcess, Matchers.equalTo(false)) + assumeThat(sessionRule.env.isAppZygoteProcess, equalTo(false)) mainSession.loadUri(CONTENT_CRASH_JAVA_URL) // Default handler will call MOZ_CRASH by GeckoAppShell.reportJavaCrash diff --git 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 @@ -128,6 +128,7 @@ class ContentDelegateTest : BaseSessionTest() { fun crashContent() { // TODO: bug 1710940 assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false)) + assumeThat(sessionRule.env.isAppZygoteProcess, equalTo(false)) mainSession.loadUri(CONTENT_CRASH_URL) mainSession.waitUntilCalled(object : ContentDelegate { @@ -158,6 +159,7 @@ class ContentDelegateTest : BaseSessionTest() { fun crashContent_tapAfterCrash() { // TODO: bug 1710940 assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false)) + assumeThat(sessionRule.env.isAppZygoteProcess, equalTo(false)) mainSession.delegateUntilTestEnd(object : ContentDelegate { override fun onCrash(session: GeckoSession) { diff --git 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 @@ -2042,6 +2042,7 @@ class GeckoSessionTestRuleTest : BaseSessionTest(noErrorCollector = true) { fun contentCrashIgnored() { // TODO: bug 1710940 assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false)) + assumeThat(sessionRule.env.isAppZygoteProcess, equalTo(false)) mainSession.loadUri(CONTENT_CRASH_URL) mainSession.waitUntilCalled(object : ContentDelegate { diff --git a/taskcluster/kinds/test/misc.yml b/taskcluster/kinds/test/misc.yml @@ -8,7 +8,7 @@ task-defaults: geckoview-junit: description: "Geckoview junit run" suite: geckoview-junit - variants: ["geckoview-fission", "no-fission", "geckoview-no-fission-no-ship"] + variants: ["geckoview-fission", "no-fission", "geckoview-no-fission-no-ship", "geckoview-zygote"] treeherder-symbol: gv-junit loopback-video: true target: geckoview-androidTest.apk @@ -18,6 +18,7 @@ geckoview-junit: geckoview-fission: ['trunk'] no-fission: built-projects geckoview-no-fission-no-ship: built-projects + geckoview-zygote: [] default: [] tier: default mozharness: diff --git a/taskcluster/test_configs/variants.yml b/taskcluster/test_configs/variants.yml @@ -140,6 +140,18 @@ no-fission: extra-options: - "--disable-fission" +geckoview-zygote: + description: "{description} with app Zygote preloading enabled" + component: "GeckoView::General" + expiration: "2026-03-01" + suffix: "zygote" + when: + <<: *gv_e10s_filter + merge: + mozharness: + extra-options: + - "--enable-isolated-zygote-process" + geckoview-no-fission-no-ship: description: "{description} with fission disabled and ship disabled" component: "GeckoView::General" diff --git a/testing/mochitest/runjunit.py b/testing/mochitest/runjunit.py @@ -258,6 +258,10 @@ class JUnitTestRunner(MochitestDesktop): env["MOZ_FORCE_DISABLE_FISSION"] = "1" else: env["MOZ_FORCE_ENABLE_FISSION"] = "1" + if self.options.enable_isolated_zygote_process: + env["MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE"] = "1" + else: + env["MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE"] = "0" # Add additional env variables for [key, value] in [p.split("=", 1) for p in self.options.add_env]: @@ -597,6 +601,13 @@ class JunitArgumentParser(argparse.ArgumentParser): help="Run the tests without Fission (site isolation) enabled.", ) self.add_argument( + "--enable-isolated-zygote-process", + action="store_true", + dest="enable_isolated_zygote_process", + default=False, + help="Run with app Zygote preloading enabled.", + ) + self.add_argument( "--web-content-isolation-strategy", type=int, dest="web_content_isolation_strategy", diff --git a/testing/mozharness/scripts/android_emulator_unittest.py b/testing/mozharness/scripts/android_emulator_unittest.py @@ -130,6 +130,15 @@ class AndroidEmulatorTest( }, ], [ + ["--enable-isolated-zygote-process"], + { + "action": "store_true", + "dest": "enable_isolated_zygote_process", + "default": False, + "help": "Run with app Zygote preloading enabled.", + }, + ], + [ ["--repeat"], { "action": "store", @@ -206,6 +215,7 @@ class AndroidEmulatorTest( self.disable_e10s = c.get("disable_e10s") self.disable_fission = c.get("disable_fission") self.web_content_isolation_strategy = c.get("web_content_isolation_strategy") + self.enable_isolated_zygote_process = c.get("enable_isolated_zygote_process") self.extra_prefs = c.get("extra_prefs") self.test_tags = c.get("test_tags") @@ -347,6 +357,9 @@ class AndroidEmulatorTest( if c["disable_fission"] and category not in ["gtest", "cppunittest"]: cmd.append("--disable-fission") + if c["enable_isolated_zygote_process"]: + cmd.append("--enable-isolated-zygote-process") + if "web_content_isolation_strategy" in c: cmd.append( "--web-content-isolation-strategy=%s"