Skip to content

Commit

Permalink
launchers: pass URL arg to fenix and focus launchers (bug 1852787)
Browse files Browse the repository at this point in the history
WORK IN PROGRESS, DO NOT MERGE
  • Loading branch information
zzzeid committed Sep 25, 2023
1 parent 2fa869d commit b36b360
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions mozregression/launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,14 @@ def _start(
self.adb.rm(self.remote_profile, recursive=True)
LOG.debug("Pushing profile to device (%s -> %s)" % (profile.profile, self.remote_profile))
self.adb.push(profile.profile, self.remote_profile)
self._launch()
if cmdargs and len(cmdargs) == 1 and not cmdargs[0].startswith("-"):
url = cmdargs[0]
else:
url = None
if isinstance(self, FenixLauncher) or isinstance(self, FocusLauncher):
self._launch(url)
else:
self._launch()

def _wait(self):
while self.adb.process_exist(self.package_name):
Expand Down Expand Up @@ -537,21 +544,22 @@ class FenixLauncher(AndroidLauncher):
def _get_package_name(self):
return "org.mozilla.fenix"

def _launch(self):
def _launch(self, url=None):
LOG.debug("Launching fenix")
self.launch_browser(self.package_name, ".IntentReceiverActivity")
self.launch_browser(self.package_name, ".IntentReceiverActivity", url=url)


@REGISTRY.register("focus")
class FocusLauncher(AndroidLauncher):
def _get_package_name(self):
return "org.mozilla.focus.nightly"

def _launch(self):
def _launch(self, url=None):
LOG.debug("Launching focus")
self.launch_browser(
self.package_name,
"org.mozilla.focus.activity.IntentReceiverActivity",
url=url,
)


Expand Down

0 comments on commit b36b360

Please sign in to comment.