Skip to content

Commit cae1dbb

Browse files
committed
set console address for tests
1 parent aecca40 commit cae1dbb

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

testing/marionette/client/marionette_driver/geckoinstance.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ def _get_runner_args(self):
441441
if env.get("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS") is None:
442442
env.update({"MOZ_REMOTE_ALLOW_SYSTEM_ACCESS": "1"})
443443

444+
# Give enterprise builds a console address so generic builds never
445+
# start unconfigured (or block on the console setup dialog) under
446+
# Marionette. Set it to the empty string to exercise the unconfigured
447+
# state.
448+
env.setdefault("MOZ_ENTERPRISE_CONSOLE_ADDRESS", "http://127.0.0.1:1")
449+
444450
args = {
445451
"binary": self.binary,
446452
"profile": self.profile,

testing/mozbase/mozrunner/mozrunner/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ def test_environment(
101101
# override the user's choice here. See bug 1049688.
102102
env.setdefault("MOZ_DISABLE_NONLOCAL_CONNECTIONS", "1")
103103

104+
# Give enterprise builds a console address so generic builds never start
105+
# unconfigured (or block on the console setup dialog) under a test
106+
# harness. A closed local port, because non-local connections are
107+
# disabled above. Set it to the empty string to exercise the
108+
# unconfigured state.
109+
env.setdefault("MOZ_ENTERPRISE_CONSOLE_ADDRESS", "http://127.0.0.1:1")
110+
104111
# Only enable verbose WebRTC logging in CI.
105112
if "MOZ_AUTOMATION" in os.environ:
106113
env.setdefault("MOZ_LOG", "signaling:3,mtransport:4,DataChannel:3,jsep:4")

toolkit/xre/nsAppRunner.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6086,12 +6086,12 @@ int XREMain::XRE_mainStartup(bool* aExitFlag,
60866086
// We now know there is no existing instance using the selected profile.
60876087

60886088
#if defined(MOZ_ENTERPRISE)
6089-
// Never block automation on the interactive setup dialog: test harnesses
6090-
// launch the browser before any console address exists (Marionette's first
6091-
// launch precedes the test setUp that provides one via the AutoConfig file
6092-
// or MOZ_ENTERPRISE_CONSOLE_ADDRESS) and would time out waiting for it.
6093-
const bool enterpriseConsoleSetupAllowed =
6094-
!EnvHasValue("MOZ_AUTOMATION") && !CheckArgExists("marionette");
6089+
// Test harnesses provide a console address via
6090+
// MOZ_ENTERPRISE_CONSOLE_ADDRESS (mozrunner test_environment and
6091+
// Marionette's GeckoInstance), so setup should never be needed under
6092+
// automation. Keep a backstop for harnesses that miss it: the modal
6093+
// pre-profile dialog would otherwise hang the task until timeout.
6094+
const bool enterpriseConsoleSetupAllowed = !EnvHasValue("MOZ_AUTOMATION");
60956095
if (gEnterpriseConsoleSetupNeeded && enterpriseConsoleSetupAllowed &&
60966096
is_felt_ui()
60976097
# ifdef MOZ_BACKGROUNDTASKS

0 commit comments

Comments
 (0)