Open Bug 1908693 Opened 2 months ago Updated 2 months ago

[Gecko-iOS] Basic support for locally running mochitest-plain

Categories

(Testing :: Mochitest, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(8 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.

On desktop platforms, environment variables are implicitly inherited by content
processes, and on Android, custom environment variables are generally set as
part of GeckoThread initialization, which is performed in every process.

As these env vars are not inherited on iOS, we need to manually specify them
for child processes. This patch does this in a fairly hacky way, by enumerating
all environment variables, and copying ones with a MOZ_ prefix to child
processes as they are created.

We probably want to have a better system for this in the future.

This provides a convenient mechanism for our test runner to specify the initial
URL to load in the test browser. An environment variable was chosen over the
command line for initial implementation simplicity, but it may be worth
changing how the URL is loaded in the future.

Depends on D217131

Before this change, calls through EventDispatcher could be delivered before
the geckoview.js script had begun executing, which would mean that early calls
to the Gecko backend would not be handled. This patch ensures that these events
are queued up until the listeners are ready, which is more in line with the
behaviour on Android.

Depends on D217132

Before this change on iOS, when the application exits, UIKit's main loop method
does not return, so we exit before running through normal XPCOM shutdown. This
patch changes the behaviour around applicationWillTerminate to ensure that we
run at least some of XPCOM shutdown before the application is exited.

This fix also ensures that the iOS application will exit when Quit() is called
by Gecko JS code. This won't happen in normal operation on iOS, as the OS
generally controls app lifetimes, but is important for automated testing. As
iOS provides no proper support for gracefully exiting an app, we call
_exit(0); after performing as much of the shutdown process as possible.

Depends on D217133

This is intended to simplify transitioning code which is checking for Android to
instead check for Android/iOS.

Depends on D217134

Depends on D217135

This new python package is intended to contain helper types etc. for working
with iOS devices from our test runners. The design is still very much early
stages, and only simulator supports the bulk of the methods.

Depends on D217136

This patch centers around a hacked up version of runtestsremote.py which
instead uses the helper types from moziosdevice to run mochitests on an iOS
device. With this change it is possible to run some basic mochitests on
simulator from a local build. There is currently no support for running on CI.

Tests involving any form of more advanced features such as opening pop-up
windows still are not supported, as the testing browser doesn't support tabs
yet.

Depends on D217137

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: