From 352b889c9393b4d2b67435c35df42956fb0bb10d Mon Sep 17 00:00:00 2001 From: Agi Sferro Date: Wed, 24 Mar 2021 20:19:57 +0000 Subject: [PATCH] Bug 1567341 - Properly initialize GeckoView in xpcshell-test. r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D106202 --- testing/xpcshell/head.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index a2b3d07cdeb0..5cc705d06835 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -503,6 +503,16 @@ function _initDebugging(port) { } function _execute_test() { + if (runningInParent && _AppConstants.platform == "android") { + _Services.obs.notifyObservers(null, "profile-after-change"); + // Wake up GeckoViewStartup + let geckoViewStartup = Cc["@mozilla.org/geckoview/startup;1"].getService( + Ci.nsIObserver + ); + geckoViewStartup.observe(null, "profile-after-change", null); + geckoViewStartup.observe(null, "app-startup", null); + } + // _JSDEBUGGER_PORT is dynamically defined by . if (_JSDEBUGGER_PORT) { try {