A few tests do the SimpleTest.waitForExplicitFinish/SimpleTest.finish dance
without a promise/async chain. This updates those tests to follow a more
async style and to send failures through SimpleTest.finishWithFailure.
Note that the conversion to async is done "locally" by wrapping callback-taking
helper function calls in promises. In some cases it probably makes sense to
modify the helper function itself to return a promise, but that's out of scope
for this bug, so I'm punting those kinds of changes to a follow-up bug.
Differential Revision: https://phabricator.services.mozilla.com/D94163
This updates APZ mochitests that are using .then(SimpleTest.finish) or
.finally(SimpleTest.finish) to instead pass the rejection/exception case
to SimpleTest.finishWithFailure.
Differential Revision: https://phabricator.services.mozilla.com/D94162
The warning is broken in older versions of clang. It also turns out we
were disabling it locally for some directories because of this very
problem.
A few local disable rules stay under accessible/ because they do hide
actual warnings from code generated by MIDL.
Differential Revision: https://phabricator.services.mozilla.com/D94262
We used to have a complicated scheme to figure out the minimum supported
version of clang on OSX, based on some compiler feature, which wouldn't
allow to do other version checks further down the line.
The main blocker for better tests was to be able to distinguish between
Xcode clang and plain clang, which turns out to be possible with the
__apple_build_version__ define.
We still need to map versions manually, but it's better than the current
status quo.
Differential Revision: https://phabricator.services.mozilla.com/D94261
ZoomToFocusedInput calls ScrollContentIntoView() which may queue up
one or more main-thread scroll position updates that get sent to
APZ as part of the next transaction.
If such updates were produced, we want the ZoomToRect call to arrive
at APZ after the updates, otherwise the updates can cancel the
zoom animation that APZ starts in response to the ZoomToRect.
Differential Revision: https://phabricator.services.mozilla.com/D93898
* Only use paperWidth/paperHeight values from the settings when searching for a paper size match
* Calculate unit-appropriate values for paperWidth, paperHeight and write them to settings whenever a paper size is selected
* Always write paperSizeUnit and the width/height values to settings to ensure any bad data from prefs is overwritten
Differential Revision: https://phabricator.services.mozilla.com/D91021
After landing bug 425915, we use NextWord instead of BreakInBetween.
NextWord is possible to return empty string (offset equals to current
position). So it shouldn't return empty string.
Differential Revision: https://phabricator.services.mozilla.com/D94266
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.
`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem. Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).
`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file. Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details. So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).
There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.
The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.
Differential Revision: https://phabricator.services.mozilla.com/D90605
ZoomToFocusedInput calls ScrollContentIntoView() which may queue up
one or more main-thread scroll position updates that get sent to
APZ as part of the next transaction.
If such updates were produced, we want the ZoomToRect call to arrive
at APZ after the updates, otherwise the updates can cancel the
zoom animation that APZ starts in response to the ZoomToRect.
Differential Revision: https://phabricator.services.mozilla.com/D93898
Per [1], change this test to a browser test.
In addition, the original test is testing if the sound indicator can show before calling play on media before it finishes loading metadata. The original test is using `preload=metadata`, but it seems that using `preload=none` is closer to the scenario they wanted to test. So I made that change in the browser test case.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1672292#c0
Differential Revision: https://phabricator.services.mozilla.com/D94335
These files were omitted from the original patch because reformatting them required some manual intervention in order to avoid breaking unit tests. Generally the `noqa` lines were already there and just needed to be moved from one line to another (due to the reformatting by `black`), but sometimes `black` saw fit to move a bunch of stuff all onto one line, requiring me to introduce new `noqa` lines.
Besides the autoformat by `black` and some manual fixups, this patch contains no other changes.
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94052
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
This test is mysteriously failing under a try push with e10s-multi enabled on
Android. Since MathML is not super-important to us, I'd like to disable it on
Android and file a follow-up bug in MathML for the failure.
Differential Revision: https://phabricator.services.mozilla.com/D94151