Commit 667aa219 authored by brizental's avatar brizental Committed by Pier Angelo Vendrame
Browse files

BB 43243 [android]: Start GeckoEngineSession early when Marionette enabled

This is in the process of being uplifted.

Bug 2021884: https://bugzilla.mozilla.org/show_bug.cgi?id=2021884

Differential Revision: https://phabricator.services.mozilla.com/D286676
parent c3f36ae3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -525,6 +525,12 @@ open class FenixApplication : Application(), Provider, ThemeProvider {
                logElapsedTime(logger, "Starting Relay feature integration") {
                    components.relayFeatureIntegration.start()
                }

                // If running Marionette tests a GeckoEngineSession needs to be
                // started and that must happen on the main thread.
                logElapsedTime(logger, "Maybe setup Marionette") {
                    maybeSetupMarionette()
                }
            }
        }

@@ -695,6 +701,13 @@ open class FenixApplication : Application(), Provider, ThemeProvider {
        FxNimbus.initialize { nimbus }
    }

    private fun maybeSetupMarionette() {
        // If Marionette is enabled, start a GeckoEngineSession immediatelly.
        if (System.getenv("MOZ_MARIONETTE") == "1") {
            components.core.engine.speculativeCreateSession(components.appStore.state.mode.isPrivate)
        }
    }

    /**
     * Initiate Megazord sequence! Megazord Battle Mode!
     *