Compare commits
99
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27f0501cea | ||
|
|
585acedecc | ||
|
|
05149cb8c8 | ||
|
|
95bcd4d1c3 | ||
|
|
4afd02e305 | ||
|
|
570d9997ad | ||
|
|
0eff758320 | ||
|
|
6bb7df2ba3 | ||
|
|
71ddb27003 | ||
|
|
1509415d7a | ||
|
|
0072328944 | ||
|
|
197a3e4f49 | ||
|
|
f0b83b089c | ||
|
|
b165ac7e90 | ||
|
|
c1c0a84214 | ||
|
|
674ba82359 | ||
|
|
7ee01460c3 | ||
|
|
476da7c8d0 | ||
|
|
eb052e7439 | ||
|
|
c8b3b086fa | ||
|
|
5e4adfbcfa | ||
|
|
f73432d5ed | ||
|
|
03dde48c06 | ||
|
|
e9d4f95d54 | ||
|
|
728bcbe5d7 | ||
|
|
633b72bbcf | ||
|
|
516edfc15c | ||
|
|
a3e647bf2f | ||
|
|
fee389c299 | ||
|
|
db40654e73 | ||
|
|
1c8c1bcbe7 | ||
|
|
8805cb8978 | ||
|
|
185c386b79 | ||
|
|
bee003ef27 | ||
|
|
4ba9c5e4e4 | ||
|
|
365f7da7e3 | ||
|
|
b60a2a89c5 | ||
|
|
27374a6a8f | ||
|
|
d667c6b55d | ||
|
|
2df8b8f773 | ||
|
|
029eb855e7 | ||
|
|
eed0facf61 | ||
|
|
063222b682 | ||
|
|
675ca17161 | ||
|
|
7b5a7fd182 | ||
|
|
685db8ffb7 | ||
|
|
ca6f2bef5b | ||
|
|
4ebb18c26a | ||
|
|
6017f94910 | ||
|
|
62d623a816 | ||
|
|
e1ef053355 | ||
|
|
2ea8c602e5 | ||
|
|
3ebc864346 | ||
|
|
e5798ba80c | ||
|
|
f0a2a8d304 | ||
|
|
7cc5a4494a | ||
|
|
6b5f5c78a0 | ||
|
|
9437e06399 | ||
|
|
2d0620e33e | ||
|
|
6aebe0eb15 | ||
|
|
039c2e8bdc | ||
|
|
c4d5ffe903 | ||
|
|
73add864d3 | ||
|
|
49838e1df3 | ||
|
|
66530eadba | ||
|
|
49f9ac900c | ||
|
|
a0d7c627a6 | ||
|
|
704fd5f98c | ||
|
|
262937350f | ||
|
|
50cda456cb | ||
|
|
ce913bbf4b | ||
|
|
a6fe4ea53b | ||
|
|
34f02cdcdc | ||
|
|
a3ff6087f1 | ||
|
|
d7b0cb8638 | ||
|
|
66a682cfe6 | ||
|
|
1717c2063c | ||
|
|
5ea88e57d5 | ||
|
|
b7ef739d56 | ||
|
|
23548f5822 | ||
|
|
5f58bdf808 | ||
|
|
e0273aac56 | ||
|
|
622f0d3eaf | ||
|
|
e0e620e8d5 | ||
|
|
a7f84eded4 | ||
|
|
06c2428572 | ||
|
|
3e082e07d7 | ||
|
|
3366497f7d | ||
|
|
aaf5863598 | ||
|
|
dfd35bb47e | ||
|
|
76c33a9e0a | ||
|
|
ce6db02d36 | ||
|
|
a1711b9802 | ||
|
|
c4dbbe8faf | ||
|
|
b916990a33 | ||
|
|
0b23228eb8 | ||
|
|
df491f2e67 | ||
|
|
8e342a1378 | ||
|
|
03425bb898 |
No files matched your search
@@ -28,3 +28,12 @@ ci/py-lock/** text eol=lf
|
||||
# The vendored bundles are third-party bytes whose sha256 is pinned in tests/vendor/README.md: no checkout converts their line endings
|
||||
# (a Windows runner with core.autocrlf=true would hand them over with CRLF and the hash would no longer match).
|
||||
tests/vendor/*.js -text
|
||||
|
||||
# The evidence of the known-defects tests and the copy of the core's matcher are hashed byte for byte against tests/data/known_mozilla_defects/sources.json: no checkout converts their line endings.
|
||||
tests/data/known_mozilla_defects/** -text
|
||||
|
||||
# The ready security state is hashed byte for byte against ci/security-state.pin.json.
|
||||
ci/security-state/** -text
|
||||
|
||||
# The page of the password-mask e2e is the same bytes as the page of the retail capture (its sha256 is checked), so no checkout may change its line endings.
|
||||
tests/data/password_mask_page.html -text
|
||||
@@ -446,6 +446,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
- name: Install wrapper + test deps (the stock client is in the dev extra)
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
@@ -537,6 +540,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
# The A/A of the three A/B oracles (page, network, host) runs on the first seeds of the candidate set on a pull request, and on ALL of them when the pull request
|
||||
# changes a file of that oracle (scripts/ci_ab_pr_seeds.py holds the lists). The checkout is shallow, so the script fetches the base commit and lists the files that
|
||||
# differ from it (`git diff --name-only <base> HEAD`: HEAD is the merge commit, so this is the pull request's own change); the tests read the variables it prints.
|
||||
@@ -761,6 +767,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
- name: How many seeds the A/A of each oracle visits (all of them when the pull request touches the oracle)
|
||||
if: github.event_name == 'pull_request'
|
||||
shell: bash
|
||||
@@ -984,6 +993,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
- name: How many seeds the A/A of each oracle visits (all of them when the pull request touches the oracle)
|
||||
if: github.event_name == 'pull_request'
|
||||
shell: bash
|
||||
@@ -1254,6 +1266,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
- name: How many seeds the A/A of each oracle visits (all of them when the pull request touches the oracle)
|
||||
if: github.event_name == 'pull_request'
|
||||
shell: bash
|
||||
@@ -1488,6 +1503,9 @@ jobs:
|
||||
New-ItemProperty -Force -Path $key -Name DumpCount -PropertyType DWord -Value 3 | Out-Null
|
||||
Get-ItemProperty -Path $key | Format-List DumpFolder, DumpType, DumpCount
|
||||
Get-ItemProperty -Path $wer | Format-List Disabled, DontShowUI
|
||||
# The one variable tests/conftest.py reads (tests/_wer_error_mode.py): every pytest process of the later steps clears SEM_NOGPFAULTERRORBOX of its error mode, which the
|
||||
# runner gives it and which would keep a crashing worker from ever reaching the LocalDumps above, and says so in dumps/error-mode.log.
|
||||
"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
- name: Install wrapper + test deps (+ Playwright ONLY as a system tool)
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# published-set.yml - the control side of the A/B oracles is the last PUBLISHED SET, and this keeps its lock equal to the index.
|
||||
#
|
||||
# An A/B oracle holds a candidate against the engine published before it, and that engine is launched by the core it was built for (it refuses a launch whose
|
||||
# declarations that core does not emit). So the control is a set: the last `invisible-playwright` on the index, the `invisible-core` it pins exactly, and the engine
|
||||
# that core's seal pins, in a venv of their own, installed by hash (ci-03): ci/py-lock/published.txt, made by scripts/ci_published_set.py. Nothing in it is chosen
|
||||
# by hand; a new release is the new baseline.
|
||||
#
|
||||
# The lock is a committed file so that a run installs it offline (the wheelhouse of the run holds the files it names). What can go stale is the lock, the day a
|
||||
# release is published: this reads the index (the JSON of the two packages, nothing is installed or run) and is RED when the committed lock is not the index's last
|
||||
# release. The fix is one command, `python scripts/ci_published_set.py resolve --write`, in the pull request that records the release.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
name: published-set
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "41 5 * * *"
|
||||
pull_request:
|
||||
paths:
|
||||
- ci/py-lock/published.txt
|
||||
- scripts/ci_published_set.py
|
||||
- .github/workflows/published-set.yml
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
lock-is-the-index:
|
||||
name: the committed published set is the index's last release
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Check out the lock and the script
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: The lock against the index (reads the index, installs nothing)
|
||||
run: python scripts/ci_published_set.py check
|
||||
@@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- **Breaking:** the environment variable `INVPW_TRUE_HEADLESS` is retired and is now refused at launch, on the sync, the async and the server
|
||||
entry points, with an error that says to unset it. The product always runs a real browser window on a hidden display; it no longer
|
||||
has a second mode that runs without a window.
|
||||
|
||||
## [0.61.0] - 2026-11-30
|
||||
|
||||
### Changed
|
||||
- Pins invisible-core 71.85.0 on the engine firefox-71 (Firefox 159.0).
|
||||
- The window origin is declared by the core, and the screen coordinates a page reads go through it, in the top document and in an
|
||||
out-of-process frame of another site: such a frame used to read the top document's origin without its own position.
|
||||
- The end point of a drag is mapped through the window of the drag source, and tooltips and autoscroll open at the real pointer.
|
||||
- A popup's position and outer size are set when it opens by Firefox's own rule, and a positioned popup is kept on the declared screen by
|
||||
Firefox's own clamp; the core no longer declares a popup position.
|
||||
- The height of the maximized browser chrome follows Firefox's toolbar density rule, and the window frame is computed from the system
|
||||
metrics at the declared scale: at 125% the bar above the page is 106 device pixels, as in retail Firefox 159, where 0.60.0 declared 107.
|
||||
- The core accepts exactly the display scales Windows offers (100% to 500%), and refuses a scale the declared screen does not offer.
|
||||
|
||||
### Fixed
|
||||
- The load of a frame waits for the processes below it, a navigation that does not create a new document no longer releases a frame, and
|
||||
the ready of a page is told once, after its document.
|
||||
- Drag and drop driven by the client reaches a frame of another site: the drag has one session, owned by the browser process, as a real
|
||||
drag does; `dragend` ends at the screen point of the declared window, the drag events carry the buttons held, and `drag` fires at the
|
||||
source.
|
||||
- A select dropdown opened by a click no longer closes on that click's own release: menus close on the next press or wheel, as with a
|
||||
real mouse, never on a release or a move.
|
||||
- `wait_for_selector(state="hidden")` returns at once when nothing matches and never returns a handle, as stock Playwright does.
|
||||
- A font face that our text code used after it could be released (a dangling HarfBuzz face pointer) is now held by its own type.
|
||||
- Through a UDP proxy, an IPv6 socket reaches its IPv4 relay after the association too.
|
||||
|
||||
## [0.60.0] - 2026-11-27
|
||||
|
||||
### Changed
|
||||
|
||||
+835
@@ -45843,6 +45843,841 @@
|
||||
}
|
||||
},
|
||||
"wheel_filename": "invisible_playwright-0.60.0-py3-none-any.whl"
|
||||
},
|
||||
{
|
||||
"published_at": "2026-11-30T12:28:40Z",
|
||||
"requires_dist": [
|
||||
"greenlet<4.0.0,>=3.1.1",
|
||||
"invisible-core==71.85.0",
|
||||
"psutil>=5.9",
|
||||
"pyee<14,>=13",
|
||||
"aioquic>=1.2; extra == 'dev'",
|
||||
"build>=1; extra == 'dev'",
|
||||
"cryptography>=41; extra == 'dev'",
|
||||
"h2<5,>=4; extra == 'dev'",
|
||||
"playwright==1.61.0; extra == 'dev'",
|
||||
"pytest-timeout>=2; extra == 'dev'",
|
||||
"pytest-xdist>=3; extra == 'dev'",
|
||||
"pytest>=7; extra == 'dev'",
|
||||
"ruff>=0.6; extra == 'dev'",
|
||||
"websockets>=13; extra == 'dev'",
|
||||
"websockets>=13; extra == 'remote'"
|
||||
],
|
||||
"sdist": {
|
||||
"digest": "490e5d71c05ebf57d95870ee7a0f5f22a917dc3ded5b6f467a027efa2a0dc546",
|
||||
"files": {
|
||||
"LICENSE": "2abb03e63a96918967f383cbc36e3faefe10a47ae20b2cab43212ef965e02f96",
|
||||
"PKG-INFO": "7d3090b18dc02382c0f4d075af891292a47522c506518f71ff211eec59b3f312",
|
||||
"README.md": "2114ecc63ee45954a88b4d91d3e11f01e416f40810a3d71963f3d5d986d4cf67",
|
||||
"docs/README.md": "ae694f21758d2b80d1dc8eb4d13867d7241ca80fb4137c0ead03e7af799b7192",
|
||||
"docs/integrations/README.md": "d9d4a01c5ce0b3a94123653bf8e78283113cae0a6ec22ba0bc2a2a77baf8ea19",
|
||||
"pyproject.toml": "93d8d0940284352ad53e189e17b9ad6e3109ce52e54ab138ecdfa01d8571b193",
|
||||
"src/invisible_playwright/THIRD_PARTY_FORK.md": "d54bd2a4c1e0b4d132d96647f82de205637d1ea0a739a61809b3d7c4048f65d7",
|
||||
"src/invisible_playwright/__init__.py": "8d0fb7aa787c73bec8140616d9762fa6f672dfe9cb58a6d39dea42c2a429d801",
|
||||
"src/invisible_playwright/__main__.py": "c6cd277050ead2d11c98b7cbab91ada7d19e495c95e4c86de1f9aaf2b2051d38",
|
||||
"src/invisible_playwright/_cursor.py": "a30bcac49cb88d2f568764cdf20359bd8b49f1051034dcd7451f161d7237cb46",
|
||||
"src/invisible_playwright/_engine.py": "5ee84a62eb30ead2632a49840b37cfc1a8bc0d41aef16e95186323085a364f38",
|
||||
"src/invisible_playwright/_juggler/__init__.py": "96d6d06dad40f3c5112ab2bf9852c9d273ca891647baaf86e9913a06112db829",
|
||||
"src/invisible_playwright/_juggler/_arguments.py": "244947f5e333010ed22e6680d29209bd6b28b7f8bc59ecace2e87bdf9aae1d16",
|
||||
"src/invisible_playwright/_juggler/_bindings.py": "3ccfc601acdee9fe67c6de693892ff90d53b60729df1be29f091493a4a3e0c9c",
|
||||
"src/invisible_playwright/_juggler/_marshal.py": "897e2fbf3868aac8d15ea2a2e01a8fb1bbe74545454bb471abda92c61c3dea72",
|
||||
"src/invisible_playwright/_juggler/_reaped.py": "81d85cdbcabbe9342486d90c995a27b7c31646936b51e264104acf436d49d453",
|
||||
"src/invisible_playwright/_juggler/_threads.py": "a790d60fae3815169f2692af3377e62add5ac3ec240fa0dc7e6b52a88c7fa5c0",
|
||||
"src/invisible_playwright/_juggler/dialogs.py": "5541004829d2484526fc93f11338bfdf9f63f3319e17fc95ea51f61e1b429220",
|
||||
"src/invisible_playwright/_juggler/dispatcher.py": "a0314cb560c7a01132b81583b146ef693b5610c5b25fc5eb348fe0e247e51511",
|
||||
"src/invisible_playwright/_juggler/memprobe.py": "b970afd7f877ac3ed631bd8b069000798034e32c1df497ce8102928aa29277d7",
|
||||
"src/invisible_playwright/_juggler/perimeter.py": "52f0e37b09cdc57b21fc6185a1c339a47b1dcaa866e9068a1cc538b665b2e760",
|
||||
"src/invisible_playwright/_juggler/pointer.py": "599663876f9a9d516889ecbfc1ba124ebdf501ab5b9de713ec609c93b7abb3b2",
|
||||
"src/invisible_playwright/_juggler/remote.py": "8429960e508ab23b9de54f47d71a97847e6398c579de5bdf726d3e62f47ae3fe",
|
||||
"src/invisible_playwright/_juggler/server.py": "dbd76a6133cbba311dffb3a26d67fbb3aee20e7b035d72e61739133b8dbab4a3",
|
||||
"src/invisible_playwright/_juggler/transport.py": "e928e74fbc49f7cd00ba196c5ba1867cf14b34f5627b8f3ad9a0be8e7e78519a",
|
||||
"src/invisible_playwright/_juggler/variants.py": "0ad98874f892ba1527be16230160166230aa846c5665bbf02fc0a643279a99c8",
|
||||
"src/invisible_playwright/_juggler/wire.py": "fbe0399da9896031a104bdbe83a7c24a42dd6c264a23bd65d83e8e5f2be9e840",
|
||||
"src/invisible_playwright/_pin.py": "34840d65c3ce32aa856f55344358a84cf47904471039a0a28d510166c6feda4b",
|
||||
"src/invisible_playwright/_pw/LICENSE": "7fab1461b41970ff376f1c9303a637076bfaaeb71cd12dd3a1c44aaf59a1a2b9",
|
||||
"src/invisible_playwright/_pw/README.md": "3ff2819bfde496151299983c4db167171e3e49933e7cf75613239893b2530570",
|
||||
"src/invisible_playwright/_pw/__init__.py": "06c3acdadd13e2813fcb95ad91d53ee3885c2b5f473beccc45a579d9ceead70b",
|
||||
"src/invisible_playwright/_pw/__main__.py": "dcc8e224337e54bb2febd50cc2e3c6db6ad345c2e148fe64612ca64c4dbea469",
|
||||
"src/invisible_playwright/_pw/_impl/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"src/invisible_playwright/_pw/_impl/__pyinstaller/__init__.py": "5a8c0cfeb2d84ed4287afdec24ffcec60d1ed827b92afdfbd82b2351ffae1c15",
|
||||
"src/invisible_playwright/_pw/_impl/__pyinstaller/hook-playwright.async_api.py": "d4a8c45554b3ba55e8102f03f576bab6ea4abfb70cdc60095471d504e34a1014",
|
||||
"src/invisible_playwright/_pw/_impl/__pyinstaller/hook-playwright.sync_api.py": "d4a8c45554b3ba55e8102f03f576bab6ea4abfb70cdc60095471d504e34a1014",
|
||||
"src/invisible_playwright/_pw/_impl/_api_structures.py": "7117217bc28b93311e0ded2232935bbb3e71cd36a69ace95faa5b5f019b6186d",
|
||||
"src/invisible_playwright/_pw/_impl/_artifact.py": "3f06f56db387ad34194b9287291843e32ee6b2fbd06417872085ba5cdf58c3d0",
|
||||
"src/invisible_playwright/_pw/_impl/_assertions.py": "ebfe537ce1c118606f256cf431d8acc55dbf45cec0ff8ce80b7d08189372d584",
|
||||
"src/invisible_playwright/_pw/_impl/_async_base.py": "411bdbf2019879b7338bfd11291dab77662c4de8c029ce233f6c8c173845e440",
|
||||
"src/invisible_playwright/_pw/_impl/_browser.py": "96af02910c9bd02ed3747049e4dc83f792b18ab363257bea5bb63e81335b5098",
|
||||
"src/invisible_playwright/_pw/_impl/_browser_context.py": "c91c6e44a0dbc4e9c0430807561d9b92a73a3b33c406792a71a1362ccf995e46",
|
||||
"src/invisible_playwright/_pw/_impl/_browser_type.py": "8e8fab1f8253952f971ea941948292e49fa08038e6566e6164ba1db927f16017",
|
||||
"src/invisible_playwright/_pw/_impl/_cdp_session.py": "da1f31e66ee6a1a47a77412f6efa3e72670835a81d20a42a939cc6043f4c3357",
|
||||
"src/invisible_playwright/_pw/_impl/_clock.py": "c3868a4cfdad993d99a554e58742f8c1e9f6806d51199e2870916e6c8b2eea2c",
|
||||
"src/invisible_playwright/_pw/_impl/_connection.py": "0c345f8afd418c42c9722126b4562009922135df050c076ce279481cc9ae2534",
|
||||
"src/invisible_playwright/_pw/_impl/_console_message.py": "4adcc1921c9ad348a2f796848b2ce92ab625b3f328ed611ac42d6576fe16ac66",
|
||||
"src/invisible_playwright/_pw/_impl/_credentials.py": "0d5e2ea044d6a0861de54aae29de5f0da8ef871635384f57a111e2d70cd9843e",
|
||||
"src/invisible_playwright/_pw/_impl/_debugger.py": "17a425f2c82a798098fe08a0a1b92be5fd7ccce0d56af25a6795e80d33aee2bd",
|
||||
"src/invisible_playwright/_pw/_impl/_dialog.py": "2061f36b8952cd8fcb74c9a9cc9930c3a600eb1e7f6fa4ef1867867f353d14a6",
|
||||
"src/invisible_playwright/_pw/_impl/_disposable.py": "564a3c3e3e2c5dc8db07727d682e2fb40c0e113e8489cf7fc179ed4aaea2ac87",
|
||||
"src/invisible_playwright/_pw/_impl/_download.py": "5349c613615cc690593537acbedc83e5a53fd056521358cacaf2a355238efdd4",
|
||||
"src/invisible_playwright/_pw/_impl/_element_handle.py": "b922cf771522209192727547185c922e9617f94fe55ae7c37ffa99cadf410a45",
|
||||
"src/invisible_playwright/_pw/_impl/_errors.py": "49407bd6164ab563f82b2bf37863a265555071544dcabedbf7beba8be1b618cd",
|
||||
"src/invisible_playwright/_pw/_impl/_event_context_manager.py": "55ea0fab5a17acbb3f6f797610cf20a77efcbc7b62e8c19bac53a138f39c7127",
|
||||
"src/invisible_playwright/_pw/_impl/_fetch.py": "2756ee00ffb7cf8e178af4d9f8d56ab7d06828fce431faa9318e54a2ade55e1f",
|
||||
"src/invisible_playwright/_pw/_impl/_file_chooser.py": "3efbf6c96f36cb906508330cb09ef5b5e1843e2b1aa95b27a5f85ec4376c8522",
|
||||
"src/invisible_playwright/_pw/_impl/_form_data.py": "a9ce4cb4f77a06d24d31ea0e81a0e007a965bf33ad848ebed7cf0ad2f40f36b7",
|
||||
"src/invisible_playwright/_pw/_impl/_frame.py": "0f974f94f52be86e510552900469c219007ba7a5ec05f3fe3a0d5cb78ff42b81",
|
||||
"src/invisible_playwright/_pw/_impl/_glob.py": "af927c1cc1a33e12094224ca96158964ce2c7ad9f4b4de3ac60e16e0baf9f887",
|
||||
"src/invisible_playwright/_pw/_impl/_greenlets.py": "27456c0ecfc181a04a6a1245e0f72549129e3af0b611e60607cb5d29f4fe2634",
|
||||
"src/invisible_playwright/_pw/_impl/_har_router.py": "24fe3134253de1b71a3738348444dea88b78bdd250851ac7cfdac2ffcdef68b8",
|
||||
"src/invisible_playwright/_pw/_impl/_helper.py": "c866f0dde846d84856404d7b6c72c5fbd5ac41302b1f6ac043016956256c2812",
|
||||
"src/invisible_playwright/_pw/_impl/_impl_to_api_mapping.py": "ea1e5b8ea94f344a18a6c049e465d45044cfd61c2ef779887f076e675dffa655",
|
||||
"src/invisible_playwright/_pw/_impl/_input.py": "14ed52c5e5bda7f5d8bde6b67fd651dee8c368344e13d652178d04e975ea1801",
|
||||
"src/invisible_playwright/_pw/_impl/_js_handle.py": "cbb76fdf29d5087e2f2d04bac5e729bf7905238a9b386f3be9e01a4e2a95406a",
|
||||
"src/invisible_playwright/_pw/_impl/_json_pipe.py": "c738956081dee483bbc032707553a9f9b3be38750f2ee7916390fa47fb1b19e8",
|
||||
"src/invisible_playwright/_pw/_impl/_local_utils.py": "93677e1277ef74efcf52630d98a8857c1ea847b6e16757538040ce49e2758490",
|
||||
"src/invisible_playwright/_pw/_impl/_locator.py": "c4457bbae669d98530a5bfd717619f8fc801a20c35e2e52e39b4f96193fba708",
|
||||
"src/invisible_playwright/_pw/_impl/_map.py": "606086b53edc29605a5ff0b22147dfc640e38c65089df790063aed9cb89bfaa7",
|
||||
"src/invisible_playwright/_pw/_impl/_network.py": "6af15cca7afa486ddb3edcea9ed2fdd2104f6ec268612dedf6707453a0c9433d",
|
||||
"src/invisible_playwright/_pw/_impl/_object_factory.py": "16cf089afe2a37a18c397ac6cc9aebd296db731b6e6fac2a1248cae09585f26e",
|
||||
"src/invisible_playwright/_pw/_impl/_page.py": "187b110afac50f94766b0b5b40a82c02b895e723c0000fbee7233deb0e08d11e",
|
||||
"src/invisible_playwright/_pw/_impl/_path_utils.py": "2c0c34e8c14e04d350044e5ecca4d804b4c5f9191a94c450f58e6a3f9d8bcd1c",
|
||||
"src/invisible_playwright/_pw/_impl/_playwright.py": "7f1771a504561f108c9e0faa9a44f4e4ab8cc13116bbf2686ea1a3b03ede7d52",
|
||||
"src/invisible_playwright/_pw/_impl/_screencast.py": "3bbef5e66981e9216f27f83428207f61d33d2e371ce2121d195c9ed646d1001f",
|
||||
"src/invisible_playwright/_pw/_impl/_selectors.py": "8f480ab03977b1d1d703a5519d195e3f3335e0e644cd559501167f39318db354",
|
||||
"src/invisible_playwright/_pw/_impl/_set_input_files_helpers.py": "a8863bbe7d98520c8770f51b130c69c259ae629a829e1286588da6b16950377e",
|
||||
"src/invisible_playwright/_pw/_impl/_str_utils.py": "0ff1b72ae6d0dfefc92939fca4cc0c2dcb7efe4fd8e520c72c630a6bd94b0fe3",
|
||||
"src/invisible_playwright/_pw/_impl/_stream.py": "0f05ac6e14aa97ae37b68986bee03d656e3b1f92944b8aa42b9ad927df1803fa",
|
||||
"src/invisible_playwright/_pw/_impl/_sync_base.py": "0bfe9eee479bad5295d7b281f20bb306ed652ef74a5053b14c320995a3187af5",
|
||||
"src/invisible_playwright/_pw/_impl/_tracing.py": "d88db6cdfedaa54ee6435fb7dd5e89b2906ad409374ec0177d17a2bf344d694b",
|
||||
"src/invisible_playwright/_pw/_impl/_transport.py": "96def727d12fec006999113563caca190e6f7e25bec81922ea274b552480dcf5",
|
||||
"src/invisible_playwright/_pw/_impl/_video.py": "f7002004b2c26d072bd108f9539b8e1b698f917be7b17cd30cc7eb3fb373d6d6",
|
||||
"src/invisible_playwright/_pw/_impl/_waiter.py": "d8cda0d02e1e92674c4c0a3127229ff87ca4ef214c1682daf3b64ad4268240e0",
|
||||
"src/invisible_playwright/_pw/_impl/_web_error.py": "238b060de72bdf92b54f771622e9e9739b64240d73e7d573c9125f68a28b64a8",
|
||||
"src/invisible_playwright/_pw/_impl/_web_storage.py": "7f942aee8cc96bd82ea59b3d0839e8b20e4f44f066343e8640e3180fe001ab70",
|
||||
"src/invisible_playwright/_pw/_impl/_writable_stream.py": "4a4936a37ee5c783f88d7f6c7bfda2850bcc18867a420581ca16c90e1248047e",
|
||||
"src/invisible_playwright/_pw/_repo_version.py": "d53af84ac37b99e382129383cbd4ae8f2c78798801ced917b9c0b0e23b34f58e",
|
||||
"src/invisible_playwright/_pw/async_api/__init__.py": "77bbd2c48813238c42211e1470f66bcf82ec31373f89fbe0670b8cba52aae7d6",
|
||||
"src/invisible_playwright/_pw/async_api/_context_manager.py": "acb8dc6cf148b3347a14ec8377ab269285363592ef3a3e703c3f537e41a21c4c",
|
||||
"src/invisible_playwright/_pw/async_api/_generated.py": "b0a5713e9b560387b04bf6410c56b231ec90f0dd7e571f58d2af50013d977f18",
|
||||
"src/invisible_playwright/_pw/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"src/invisible_playwright/_pw/sync_api/__init__.py": "a99ad0ce7f8511de29e3661e9e2c8b2dd5e8c4a0cfe7731de4428367df00c15e",
|
||||
"src/invisible_playwright/_pw/sync_api/_context_manager.py": "5bc3c715bedad07533173bd27d6f690f07779ebea3fd49f8ec4bcd896a8aec5e",
|
||||
"src/invisible_playwright/_pw/sync_api/_generated.py": "7881f3918cdeadd2909f82d36cfd993a54664638adf289cb9eb2e3dbd139f045",
|
||||
"src/invisible_playwright/_session.py": "cd515bc2f27b42b58a5105a78a0466e321fff37dec2044bc53ecba4981f26dae",
|
||||
"src/invisible_playwright/_version.py": "101d9ed902fb1a3a806f99f220eb10dd73ca656bd8b02f0c507ec338ef14890b",
|
||||
"src/invisible_playwright/async_api.py": "51ac8fd3c7b1f7bc3b68af15ba84e3f0688525c33086332058b4fa1ea7a06f97",
|
||||
"src/invisible_playwright/cli.py": "f8fb408ffdc93f3aeaeb775a454f71c1aa854b4921fc5cc3f618c3890bc4b81d",
|
||||
"src/invisible_playwright/launcher.py": "af22dcbda32407a6b62d050671e68d8ed9f809500cd4d2a1d895bae9925f6c8d",
|
||||
"src/invisible_playwright/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"src/invisible_playwright/sync_api.py": "4c42eacfdd306f1b610a54bb54fcd1cbaef3c20dd525e584d3c587c4a846ea6b",
|
||||
"tests/_ab_host_declared.py": "e7c330413fb71bf55ac8adf7a8e84d49e6dda4e4e16e47602c9074f03aceff3c",
|
||||
"tests/_bfcache_evidence.py": "49085e45eb21eb0c3cef0fcb39c2d82d936b5532277c7fa1c2ecbc38c0a93e25",
|
||||
"tests/_browser_census.py": "cf91f249e8e098366c59148ffd62aa10e1847675da6748e3d0e8a93e95b229ec",
|
||||
"tests/_canvas_readers.py": "aa64f3b78fadc8bf887bc5ed8568536a7e278f0accb83965fb7bf64c27959d84",
|
||||
"tests/_close_loop_verdicts.py": "9adad099186f5ba4d352db792b5265442c8926ea9ae24cc8659164348dd8907e",
|
||||
"tests/_cpu_by_type.py": "74a9acc80a560141b90966804b4f664ed6044caa7faff5f34a107bedd64dd2cf",
|
||||
"tests/_crash_cores.py": "36ea90a603174841ba79657acc336c9c521068dace1b5d997690f3ee6ab1f717",
|
||||
"tests/_doh_servers.py": "a852afcde070eca94ea6ee903b108602e322b1750e02e34e107355ddd6572766",
|
||||
"tests/_doh_support.py": "172caeae4992a91b57fa9866430cdb6bb4df53609c6c6646304b22dfa14b3941",
|
||||
"tests/_drag_record.py": "18b791a9426a06fb73d40ff8a2f0c0fdccee13f83056db6bd2a9cf53ac6f235f",
|
||||
"tests/_e2e_clocks.py": "c904aadc88ef40b2b5d8a4fd836df85497a39c701a58f677d9b50819a5b62bb8",
|
||||
"tests/_e2e_verdicts.py": "733e6489cb9f463dc544e47bb9e50faabbc16441e7595912f86d28d28bc770c7",
|
||||
"tests/_egress_sink.py": "57669610c5601b9fc351e86072db8092a403f6dac18e6b7b72e2c6a840a6b1df",
|
||||
"tests/_evidence_on_failure.py": "0ee4cce769c6e9491cae0a77c992894ec0d49d285e9b5b157f4a058aada6aa3d",
|
||||
"tests/_evidence_with_files.py": "b7a416d070d6144747d5a2c3c182ffe49b6f0ef39e08cfecaca2945dc0fa6c84",
|
||||
"tests/_fake_stock_playwright.py": "30930c3af5ec4eb43f09e0a0efee7dcec45de18a5dcb230e17641867087dc343",
|
||||
"tests/_far_away_probes.py": "dd97e8a840dc4d00074aa76cb78cd88340abff518a6d554d8f986297f4d04cfb",
|
||||
"tests/_fission_frames.py": "35520541f121ce63d20d523d4eb6988c3501702962c6678fa065b30a56cccccc",
|
||||
"tests/_font_names.py": "5b853969041673b04e6c4c5ccb21408e2ac5e16a021d4d172b57370ef5772f4c",
|
||||
"tests/_frame_evidence.py": "53c168f283a44026812cd3830afe3ba6d317cfd1b6c6d9ec5a608e9d8fb6431b",
|
||||
"tests/_generation_evidence.py": "670b27137caf8e438cf23f8cf07beb84d8ed5c68624dceb7edf7b3219f9a4215",
|
||||
"tests/_h3_server.py": "ca8efb0f784247d9c03a93587e465265bbff39247f6363c4bf21294b9848a660",
|
||||
"tests/_host_address.py": "f2dd658654b7735b8fb2455c4c0a00abcaffaa7d019942923ac3d9dc91a00694",
|
||||
"tests/_http_proxy.py": "8a3bafb2240dd29a24de5ab9aacdc0d2f49d665bd01e53ad87bf58b0c8565673",
|
||||
"tests/_lab_egress.py": "d592137c145b2e086f824194e32b8f3c5e992dbf2cfc778a1c6daf0abc7f44fb",
|
||||
"tests/_lab_pki.py": "6a5e87f3b5fee314e65dde231a54ad3ed28a0971431fdfcab081f5efafa5eb57",
|
||||
"tests/_leaks.py": "cbe026e0bef8cd4d6458fab6688a1c7a678f5c4db4b8820712c900d07a9a0b22",
|
||||
"tests/_locale_probe.py": "e2e0721bc4ec715a0a0090fb9cc18c514436ba18e466c0273e5bfa757b3a8a0a",
|
||||
"tests/_mdns_listener.py": "34af4cd382c34c12e562e9e66e5341b25f255765f7b1dd9a2d1c15bc6d52821f",
|
||||
"tests/_moving_page.py": "08d7913507a7f20aaf867ce3c891005d45a3d9aea238579f769ffc7c0a38b4c6",
|
||||
"tests/_navigation_moved_trace.py": "5a968fddee85788ed0574fcc590b13025d388ce55582bde94975a8b86b961a13",
|
||||
"tests/_no_network.py": "81883035924dcffb31fe612e245cc1600a232a4bece086d85e8bd5572c616f08",
|
||||
"tests/_os_cursor.py": "2f01332ccf8935c2b3d190d320bffeff1037cec44004b4baa32b8702697b05ab",
|
||||
"tests/_os_focus.py": "8294a6bf58a2c6354aecf65893ce2423edc14f652031fa293e05ab16f1124841",
|
||||
"tests/_page_bytes.py": "979e20aa6f97d28f084499ecc3ba3f412b3f4d92cfda4db9b187c285be5f0032",
|
||||
"tests/_page_work.py": "88fc590ca508a4c5ee37e1a40892083dbfb82e2ae0cff0635cc67a579d0a73d0",
|
||||
"tests/_pointer_fakes.py": "b27e66aeb9e173fd43a764e4a95866080ef80615a904ea6ce100bda8a552dcaf",
|
||||
"tests/_popup_evidence.py": "d1b829e286b85be9c4f16f4ddd033cc3375a601de84e6205214ecbb884ecd0f4",
|
||||
"tests/_popup_geometry.py": "6c2e3abcc06f59548047b60329b3e095feb1f23b4f597b226c7349bbfe7de3ad",
|
||||
"tests/_ports.py": "318c91399b6397395df993f55c5109e06d2b25b351d93d73d19369825d445202",
|
||||
"tests/_post_publication.py": "a7009a34d0b0a22f9eab18904d638becb3b776117843e70e59081d417905be40",
|
||||
"tests/_process_sampler.py": "686f6d303f6f8372a700ab812637e082000e2591364792411b871ce2e0bbae19",
|
||||
"tests/_processes.py": "c7a9bda6836a62679c6f9bea65e735df13c3c135ceb3820bcc8b455687df0672",
|
||||
"tests/_realness_support.py": "3b2413ad78be0742f7689e99293b508938bdcd1eeb57ff15a9f9b91f18edd0f7",
|
||||
"tests/_retail_reference.py": "44a138caef1ad268020f58d60eb279632cf63019a0469134dd0ad6b551ead806",
|
||||
"tests/_screencast_evidence.py": "0c45a3d092dc00c6b3c387f335d42bfefb49db1408d1f7124cef4bf308165c5d",
|
||||
"tests/_second_goto_verdicts.py": "37f418897eb22008ffe9cca0403225ae8a44367710b922e0efdcb596ac83cc3f",
|
||||
"tests/_servers.py": "d3e2668c7e4c3d4a2c54304dda334381012e6327838381279fd3d9802e73dd7d",
|
||||
"tests/_session_end.py": "c136592e3a915c32faa45703c8595c4e582e5fe3c1df9912f15eb57a25363932",
|
||||
"tests/_socks_servers.py": "8f9d391f581a19f4fad6d751bb25da3ca932a76005b688e33facb98166e15782",
|
||||
"tests/_stack_watchdog.py": "48d5d853d2072e2953e7e5b446c79a90df7266337fd1bec14cce11c53110c09e",
|
||||
"tests/_stock_twin.py": "fb5516a6262ff439fa336b96d4e58b0f9455c8180cdc4011db262035b972d2e4",
|
||||
"tests/_strace_stand_in.py": "38212c1ddd3134aa0ac256a378e9fd0b8fca1130540cbeb69462290d1f34cfe9",
|
||||
"tests/_trap_policy.py": "b71592501c795a14396a4dd2dcd4396ef54377d87a011af9475dbb3bb7d6cfcf",
|
||||
"tests/_turn_chain.py": "18ffb3f6332db5e3f175dd74ac6a36952258aeffe81dd4f96eeaff499e852ffe",
|
||||
"tests/_udp_line.py": "7355dc7478e806bdba8d3255d255b8e2084136db1fe1d138ffe36d0ea65da5ca",
|
||||
"tests/_waits.py": "68af63ff7bb0a1fe3b3ff58b4d390fa0b848b6e8ed1c9bee88192d571b4f05a8",
|
||||
"tests/_watchdog_log.py": "0c06d00748b30cd999b3aadd11aa9b4ebbd1123ba05697f01a38fbaa21cb7efe",
|
||||
"tests/_webgl_unavailable.py": "2c12948840005a6645e57f9c11883f20dec826369e54c2f77eeb0fc15eafb172",
|
||||
"tests/_wer_error_mode.py": "d233227a3273bfd0056635bd8b18fd3037aeaf66aa7557c0e14f5284c2b44788",
|
||||
"tests/_window_origin.py": "10262d907297aec04e5bb966c227ac61962d322daa1935622f48c6979d37a33e",
|
||||
"tests/_window_sessions.py": "60d383210b93a3d920b51b3e504339ce711d62692dad40592a63214dd93b328c",
|
||||
"tests/_wire_capture.py": "cb5434b43cd0366154c14f6b1a94234e679ec21ff067b77538ae382b2e8f3b84",
|
||||
"tests/_witness.py": "e3bf4f0c8a377daa5a51d52194e774b2d7be66e08eb573315dd6b7146b474c87",
|
||||
"tests/_x_visibility.py": "2c4e88ec1fae2dcdd793f07c4a21b5cbb3aacafbce928f155049be75bcc101e9",
|
||||
"tests/conftest.py": "56ce57af20f0599d7ebb65deee0100b5a6771f579f3847a148582d1f9334a5ac",
|
||||
"tests/data/ab_host_aa/45060573559/SOURCES.md": "a9751b0aecc7984db6c8d58a8b8c3d560081930175d4681eea7d5a8aea37461e",
|
||||
"tests/data/ab_host_aa/45060573559/footprint-68-again.json": "c8ca6c583f5fbcbac9ac0648dac29f58882c152c78ef82b9ed0f0986150f1fab",
|
||||
"tests/data/ab_host_aa/45060573559/footprint-68.json": "e231b2b166157af9328374a2ecbd4ee0ca2f3072acdc24cfcd380fa39db880c2",
|
||||
"tests/data/ab_host_aa/45060573559/footprint-candidate.json": "94a1857d12a6c43b9278393eacc87f11ca68f5043d59bfbd38a22a8b991b5adb",
|
||||
"tests/data/ab_host_aa/45077330681/SOURCES.md": "dce12131dbd237bbd0847559233aaaee4372cdf6e5d9b31075e5c6200e90f1e3",
|
||||
"tests/data/ab_host_aa/45077330681/footprint-68-again.json": "8c9e863246b6aaee7066ea37faa57ce4cb3427e478ea070eb178fb75d82cfb8d",
|
||||
"tests/data/ab_host_aa/45077330681/footprint-68.json": "a55d9d5dcf3504d0e8c42f2db429cc833b21ad03a26b3fb806bc697bc57cd446",
|
||||
"tests/data/ab_host_aa/45077433049/SOURCES.md": "512d16bb258eda8a3ca1814ad54c2fab3de0cb06567e53e50fb6c3cce7a4a93f",
|
||||
"tests/data/ab_host_aa/45077433049/footprint-68-again.json": "357b93f0cda5c59800627fef2c9e6a68099f5e6395bc45ef5c6cbb40a4c9779e",
|
||||
"tests/data/ab_host_aa/45077433049/footprint-68.json": "74f7e8403e6bfc36aca564b51d9fb428345b81d16a25bbabb90fa8f98facfed7",
|
||||
"tests/data/ab_host_aa/45077433049/footprint-candidate.json": "b0a55df560c5f069bfedd49d1cb21beae739cd858c992b72f4daf52988f17f64",
|
||||
"tests/data/ab_host_aa/45088980743-linux/SOURCES.md": "c7e8890349258939f947255dd342630f12ab9ea4cc25d0318c28604c52ceb889",
|
||||
"tests/data/ab_host_aa/45088980743-linux/footprint-68-again.json": "5c3257eb88e922767d38c13d309b11bd6e266ab230b7fca29abe78291026f805",
|
||||
"tests/data/ab_host_aa/45088980743-linux/footprint-68.json": "5bb457fe41a0b07da03423e54b9eb4c716eb2c8bcf6b568d638a813252e2118a",
|
||||
"tests/data/ab_host_aa/45088980743-linux/footprint-candidate.json": "6cca5b4cc41dad5ff376a07c4a1c08ea6bfb3a7b77dd87a340ccde743c63ce2a",
|
||||
"tests/data/ab_host_aa/45088980743/SOURCES.md": "aa9961cb3519566a28524ca086d7ead37ca443330d429f75bbd38089ac82d50e",
|
||||
"tests/data/ab_host_aa/45088980743/footprint-68-again.json": "e3b32093fbc5e6fd53e68c6ac4f5a4681abf21f69722c0beff1bd0327015e0b3",
|
||||
"tests/data/ab_host_aa/45088980743/footprint-68.json": "899c9ba171b6a45ab7de62a82a1ac695f8c43885e81f3b380cc92a8866c56ef4",
|
||||
"tests/data/ab_host_aa/45088980743/footprint-candidate.json": "273bb5df9246ed89bc3f4a38a09ba151cffd1ee5cadadafe6385a59d4581d7f0",
|
||||
"tests/data/ab_host_aa/45228081536/SOURCES.md": "5886bfb89b9b0c34a2a4b6d6ef28e268a75635c9ce5a5bc7744165c02605ea56",
|
||||
"tests/data/ab_host_aa/45228081536/footprint-68-again.json": "e2d92338c4282f4acd8e8fcca699d0da23809404466365360472a96165fa66a8",
|
||||
"tests/data/ab_host_aa/45228081536/footprint-68.json": "1e3dd3ef409ebd80e98cdb55bddcb42e1d060e3e7f5c3dd6999edd3907c42b21",
|
||||
"tests/data/ab_host_geo/45165805370/footprint-stock.json": "d6de929f7c7816b259d2360653a46c116d21ce93860e0c0c5e0e80e33544f803",
|
||||
"tests/data/ab_host_geo/45257636942/footprint-candidate.json": "7daaba9a1282e032bcedeb3fbdb1aad76cf60ff431423545800dc071540c3e96",
|
||||
"tests/data/ab_host_geo/45257636942/footprint-stock.json": "a1ffeaeb4746c3d0f8a1c2a16bd137f533f15b4a688bc08719f764bfa035255f",
|
||||
"tests/data/ab_host_geo/SOURCES.md": "eb32d3042f87e4821f645efdc40d54f394b20d126b9d66a062bd51d54339ccb0",
|
||||
"tests/data/ab_host_pid_reuse/45221868374/SOURCES.md": "f5a19971e3e9ffc9d8d6797ab81dad2d48748a1f9b5481143a37a096e24ed200",
|
||||
"tests/data/ab_host_pid_reuse/45221868374/idle-lifecycle.json": "c4a661f8d421397e4e483bd0bae3a50ca06f71a1a6b0e15b871b07eb9a925375",
|
||||
"tests/data/engine_gates.json": "f1dd63891ed77062f2342d3ae07381faa91a358e9150f078a2a85face5a5088a",
|
||||
"tests/data/page_bytes_linux.json": "50ee0f624eec21cc311efc92ae80f35163d287a8b90b426a136d048b05b3ad29",
|
||||
"tests/data/page_bytes_windows.json": "344d335caee6c446dec67a6a2a85bab24051ea1901c1d4704dc4d1681e2f09f9",
|
||||
"tests/data/pointer_golden.json": "1c1da4b1a064d5266b602623c7297712803fb0615d6bcf9927a4a335721a7498",
|
||||
"tests/data/pointer_golden_origin.py": "da88b31e7bdbc6e39638e6614530aad4773f72000dce19829496c96cd4bc990f",
|
||||
"tests/data/security_state_crlite.json": "d02d097407456c77dc642465e55af497bd64404578fb270bfba308022648c8f1",
|
||||
"tests/data/security_state_default_key.json": "5ba8b47b1a7f51343e19dafa0fe1c86913ca243658b9c116c6eb15bb1072ebbd",
|
||||
"tests/engine_process_tree.py": "eb3f55c756ca5c55dfb66b0c38fe4d5de2a38b11e222a46dcc94160bc6c707a2",
|
||||
"tests/engine_refusal.py": "6ccefd8c51d767a289d908e6aa70b2a194de82ec50f9286440763e5fa77f63cc",
|
||||
"tests/fakeweb/JOURNEY.md": "3304de57f33d841ee116ac48e980d2ff81f7caba1280d99d01b4fd088f0497c0",
|
||||
"tests/fakeweb/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"tests/fakeweb/journey_site.py": "3df9ca9be4001f8113e5c736263c5e945958e50a2f3bc929de4eea0fc46ef908",
|
||||
"tests/fakeweb/loader.py": "f04f12e55132c3eed2d3dedf28b5dc583630307e44fc2af91ce00908b1192681",
|
||||
"tests/fakeweb/pages.json": "fcb0261c209a4934ed85da6d340a0c3fcbe391975c9035af9faf94ab399b3739",
|
||||
"tests/fakeweb/profile_p2.py": "c701f611819426c9fa80d4ba9f70aaabde192d2438678ba73e8a21033f013266",
|
||||
"tests/fakeweb/profile_p4.py": "0ac01e6f7565efb1a21cb5956dab7029f4b96b1293ba0180b1e30e619f55da5e",
|
||||
"tests/fakeweb/sites.py": "05c031b13be48bbea935f69f8d540b8562a91797c63e6553e327e642a7cb1be7",
|
||||
"tests/fakeweb/stock.lock": "56a47089999a7a48278e6c894e2eb2df30bf0e2bc7b6c5ff554baced3829d26f",
|
||||
"tests/gates/e2e_clock_exceptions.json": "a4fbf67e4805b924c86be7d6ee363f77dfc3efcb1e6a85d1ed8e8cbb661f762f",
|
||||
"tests/gates/upstream_baseline.json": "d87ea58e2ea92b24b8d5d6f3451f1fc0055825c53e315555d522aed7fa6d273a",
|
||||
"tests/gates/wire_method_debt.json": "c00cdc605ac2b0f8886b6fa8aa8cc4cc88f3a9a7de53ac43a2e234c50086dce9",
|
||||
"tests/geoip_used.py": "59641c6c282016d36ed69254df2e3d571b81a4347537ed50da252161ec17a999",
|
||||
"tests/page_bytes_probe.js": "1a6a264dbaced1a9adf362194cda72db24f60734d9e8c057ca7895ee1492db05",
|
||||
"tests/realsites/sites.json": "f8215670a65015a0b711395b667f9bce5a5de7c9b756323eee6fff0944b7a20d",
|
||||
"tests/stroke_shape.py": "f4bb1315338dc4d1b402e2feff1b40ee8cb46358c2d66934c7456a183c5384e3",
|
||||
"tests/test_a_162_message_is_read_like_a_161_one.py": "793ffb99c62be438f17308e99541f1053378b5aebd4f936d8ae3c48445e1efec",
|
||||
"tests/test_a_bundled_stock_firefox_is_refused_by_binary_path.py": "58e9af4687623485cd538cfb09376f37733ea8bce362f1aedcd43df33e0b56db",
|
||||
"tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py": "f2fd377646fb1dec2feb061ee85395d20aac0da42ae4338b87819cf686deadec",
|
||||
"tests/test_a_click_makes_one_mousemove_at_its_point.py": "16685cfe4a40fc00d94168c8640478f48ec1943310c280a55a55e0f9459775c9",
|
||||
"tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py": "1325b13b438f819883f1aed5daa06cd4e6305c05eb8ceb01b844f5d4bed92970",
|
||||
"tests/test_a_closed_browser_leaves_the_others_alone_e2e.py": "f8454227ff36dc9413eab6cbe7203f4df15c83df6a8c372fcb6274a5085bf0f3",
|
||||
"tests/test_a_closed_context_leaves_nothing_in_the_registry.py": "7d8da81271cbd2fcba9ba40ba800ef07c47a02059e7edfbeddfdeeb3d0acfa5b",
|
||||
"tests/test_a_closed_page_says_nothing.py": "f21c0f2ca50c24f282d448b6eba299d98037820bccb5853f5e584a7eb3cb0723",
|
||||
"tests/test_a_closed_pipe_is_a_closed_target.py": "55e821fb6b1ffc0479f2c627e96e56484c51d3f4a7af39f735922149137e8885",
|
||||
"tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py": "d4c647ebb0ce8eb904f36c72b4bebe6ec3dd3b84cf3806f8c48d539c485c476d",
|
||||
"tests/test_a_context_init_script_runs_once_e2e.py": "670e2466cbce855fd1a83f0eb8568a3bbe4b5ce32e67ee795896da5c512e8711",
|
||||
"tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py": "9581a81284c25d1e389f8ed23c736acd58ac227d5cc8b7b9c7ab7d77ee92f95e",
|
||||
"tests/test_a_context_proxy_carries_its_measured_udp_exit.py": "86a99305db92194c848ac2884a552469736e88f4479d60dbb28e36babfa15b95",
|
||||
"tests/test_a_context_route_disables_the_cache.py": "da73964c3228320438a631d3a623e1c2dee748302d35b07cc37d2c52227614f4",
|
||||
"tests/test_a_context_that_ends_leaves_no_process_e2e.py": "aaaff597ff24840fded3cb0ea5fe929a7c4fd66f7969fda2997f9056d96252f8",
|
||||
"tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py": "3e60fa7bfac06611e41d0253c1fa798bb98b04dbdc9aca770219602be6425c68",
|
||||
"tests/test_a_declared_webgl_extension_survives_its_use_e2e.py": "955e14cf9ab2a0d4774dc77db317d0766be7dc92a32eeaa5b411130ab66ac478",
|
||||
"tests/test_a_detached_frame_answers_detached.py": "b4f7f6e825d4183eb3b5a07f57a78abe96885757e821d1fab24c36e9ce69c883",
|
||||
"tests/test_a_dialog_is_a_protocol_object.py": "23b67e1e0b26053407a0c37c8e08aff526c8e83bf62a667e12783b325c7ff4fd",
|
||||
"tests/test_a_dialog_is_answered_after_a_pause.py": "a9a50b2ec40b3a87a0088f82e1d71a1432c2fc4c84e3cd0029ee83fd640893bc",
|
||||
"tests/test_a_download_finished_before_it_was_announced_is_finished.py": "5d3be1aa70190287d020657b25b41600b691971c9f492d8ad51fc6ab85f82a58",
|
||||
"tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py": "485cee2f951124eb46f93c01611d9c0c3d4f0bf6d46ea84797576e558b94593b",
|
||||
"tests/test_a_drag_keeps_its_buttons_pressed_e2e.py": "d5ca808caa1bfad52503153a876382e9744969dadcb33ef0f9abe9248bba37a7",
|
||||
"tests/test_a_failed_expect_carries_its_call_log.py": "00c085fc57f814958c3ef49827a2c2bb3a8de7e8c72a551dac191b3073adb9f9",
|
||||
"tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py": "2f8e450f2c4369eaecd50d61c936956dec14918b1b058b57d528fea72f58c592",
|
||||
"tests/test_a_failed_launch_stops_the_display.py": "0b1abca525396088c48aaf7c5a93eead14bf304bf786dbf9f5aa2898c9333629",
|
||||
"tests/test_a_field_is_typed_after_a_pause.py": "8fcbe8fbfe30f022f07129aaaabc64d27c6b6c4deac628dab3d84a49c4ab1a39",
|
||||
"tests/test_a_file_chooser_is_never_dropped_in_silence.py": "513d7641e3c0467d562f3e57a89f3eae86b0d69bdade7779f40dd4c51ae39b41",
|
||||
"tests/test_a_file_chooser_reaches_every_client_e2e.py": "647135ce5d54bfefb7a00be22ef96793f9bbbc875916256973941e3ef1092c0b",
|
||||
"tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py": "5a783eac1114a31708343dc5f84df6b02329989aa0b4458483f75f241cd3d5d1",
|
||||
"tests/test_a_frame_tap_needs_a_context_with_touch.py": "58fa6e7c0df34f33c9d2c52e684744bd52f83d1432d7bce3dc59159a99e87de4",
|
||||
"tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py": "1b66588ab1ea115019535f6e1c1e46de43a70b6af2707dfdaf882daecdcc8700",
|
||||
"tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py": "7bbd188f8f6d207999dedf834e4653aa26cd296f0047c1c469bceeb57d2847b6",
|
||||
"tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py": "bfd2ff45312cdd863347c9d284f6d86edcf62b35c6ad3dda99850213f810c02a",
|
||||
"tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py": "db000204b439bd11302fd18d3348e9761dd02ae6b0327daa94894e85c56b008f",
|
||||
"tests/test_a_handle_action_walks_like_a_selector_action.py": "13c7984742054e53c8ad714d2652b7a80d1349acce3e731b703ee4b11d0b3342",
|
||||
"tests/test_a_handle_action_walks_like_a_selector_action_e2e.py": "206ba3520a38279816e1128f9f2fd01e2c9de0c7bf762e8681851bfe3cc00f67",
|
||||
"tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py": "cde5245e1993ee8abf623808d9a367178e7a7e5bd8bd9d2bef0e96018fc97012",
|
||||
"tests/test_a_keepalive_request_reaches_the_client_e2e.py": "ec2e25ac059f797ce3510fb7d21145e5ea5134dc9fa1f0b88d8ebac9cb32bb0e",
|
||||
"tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py": "ef8e2f386d6dd55a191118811708944c7a61364d5c97ba0f31083c4338aaf4c5",
|
||||
"tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py": "523aa91766dd66de92a3fd0a50b61705f22910c5ee161c16e419def7c152fb89",
|
||||
"tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py": "f3d1377be9f9c3b71d867034da87850330118f495697a0844cea7fdfac474a8a",
|
||||
"tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py": "47545e192a5afdfc81cc6af5b9dc5e70b7cbcb974092537790e9570410c43ebd",
|
||||
"tests/test_a_launch_has_one_deadline.py": "5754beba9d57035c43bb86203afb5e2c5c064ff58b0aeb58a55f6c7ea904d3ba",
|
||||
"tests/test_a_launch_without_a_session_gets_one.py": "c4d4e6d5d7ce2a26498695ae92709802c7c581a31a0a3fe5624709e42c3b0fd0",
|
||||
"tests/test_a_launch_without_a_session_gets_one_e2e.py": "12e3f35cca990ed253ba4f1f508f0bca5e1ad7ce8ee2447be79112a44ca1451b",
|
||||
"tests/test_a_left_documents_body_is_evicted_e2e.py": "b6ed55ef5c4b24396cb0d06c06980836d9978538afab3101ac1b86bd33b72c79",
|
||||
"tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py": "e78091bad22bf3d9e7669fc4f236abc34605f113dff55ce5bffb6f2f480756c9",
|
||||
"tests/test_a_marionette_session_is_asked_after_the_first_window.py": "3ee0caf221c1e6385da5741135fe8d0a74a768555862f1bc508a84445e3f589b",
|
||||
"tests/test_a_module_that_leaves_a_browser_open_fails.py": "a7075810abe82226ece71465bbe4521708d20243ac2bd41ac3d2877ae2d82d95",
|
||||
"tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py": "b6a8f47d0989c2a9e673a33bb42a5bd8909733890b6d849bf06a65d706ea0d96",
|
||||
"tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py": "33b3c4d8fa3eecbf6ea1c0853597e623a5830b8ef98a3623738c20c81794e0c0",
|
||||
"tests/test_a_new_page_waits_for_the_engine.py": "87d60be3ca55fb2e79accf35aa3c81bf97601a11045ce8fc52b57ad61f0edac4",
|
||||
"tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py": "cbb23cb5b6df948bb93f60375df27dbffc274e5c4f227502498f66edb32c2a40",
|
||||
"tests/test_a_page_cannot_probe_the_juggler_e2e.py": "2dec5b66b25c4bf6f220a5501e31b7d79b231bc120812e6cd31e72e6007f89e6",
|
||||
"tests/test_a_page_closed_before_its_announcement_is_not_announced.py": "e953ebd2671a4d8f560a1cc42488d4282ccb523f78292e1ad6011ea9fbaf1631",
|
||||
"tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py": "bb6e640169994bf68730ddbf26bd1ce99c98d734baadd67ee0de991749752c8f",
|
||||
"tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py": "10f1c7a7ab70b14e993be8c541fac609531ad501fb9a634fb848b252d1b3b18f",
|
||||
"tests/test_a_page_that_moves_on_e2e.py": "4df9b18f6b4a71bb2eeb9daaa4ad661854ae7d488a642fb52cb6b0b87782f7f5",
|
||||
"tests/test_a_path_leaves_as_one_stroke.py": "17946bc4a9b3ab18423724077273869071565d20bbe28baf3ac66d35ae526a2e",
|
||||
"tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py": "46fc161ba40a531035f191fcfd77712be50d6fb40d7a249860e1f7c708d773e5",
|
||||
"tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py": "ee46ac8428691bfde2a3fcfa42d24136c30a8e8c75a4688dc8ac49e7d18bcecc",
|
||||
"tests/test_a_popup_moves_and_resizes_as_declared_e2e.py": "c1a10035de9c12b24adbb9697deea3023a23bba19d8319b4c7826b219b4412b1",
|
||||
"tests/test_a_popup_of_a_link_reaches_the_client_e2e.py": "148dfd1da555ea44cb09a16a5093eae2b7f895499737b293b44a588f4147c0bd",
|
||||
"tests/test_a_port_number_is_held_until_it_is_used.py": "bb4702b79a453b9a194b66cc8ddec067d0dd79972079e51a2e75ae2172cf09e4",
|
||||
"tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py": "caf655dc5a1a647706db35cce5357160c284efd2d0cec6a3c69c7b9380ddbedf",
|
||||
"tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py": "83731d2f82a3b6fc298bf7b5e1aba75bc0b762c61ed5640f7156636f80124b0f",
|
||||
"tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py": "7f347eb51ef68794ed4f9d5c125a64fca6f43d11a6e717ce46b27da73b2a541c",
|
||||
"tests/test_a_request_and_a_response_are_light.py": "0a0c731037f9b1fbd8868721550f49a113da5e1cfc2f71fff5e75d5e474fe5a1",
|
||||
"tests/test_a_request_says_what_it_is.py": "e586459542963cc4f20617848f22b3eb4fd45b83d4bef73acc8cf1666b9a4a7d",
|
||||
"tests/test_a_request_says_what_it_is_e2e.py": "da770169408b00f01b3eb8bdf179875a02ceda5d900a270ef2f27325df0bfe93",
|
||||
"tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py": "1392b6b11967a9859642ad20d48b48cb2b461fb4a6045247bdd84b029b61c18c",
|
||||
"tests/test_a_screenshot_honours_its_scale_e2e.py": "4cb5f224aba03e48b66ebbf2f3a9216c7ca570a84bd785e62abfb09ecb1da68f",
|
||||
"tests/test_a_screenshot_refuses_what_would_touch_the_page.py": "5b05ae0ee48b70902b9a6a8b141b1bdd3e4de01c93a8694f837d85f7b56b68a7",
|
||||
"tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py": "4c96d8b6e86d0c5d1da2bfbaa43f87fd62d7c6fa95fee5d47c0bbac2c0774f86",
|
||||
"tests/test_a_screenshot_sends_its_scale_to_the_engine.py": "aa5c5235e89c79eefb90b170c6313483e974488cbc095fb11cacdb804c51e6af",
|
||||
"tests/test_a_select_dropdown_opens_at_its_element_e2e.py": "e7c201e179a9d26c6fce0cc9bb144a534efc368b75bae67a51169cc516124a80",
|
||||
"tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py": "c8f4ca44e045e6334876ca861164540f8038d59d4a214c9d22c2928e49c40e5f",
|
||||
"tests/test_a_served_browser_answers_a_plain_client_e2e.py": "b5147129eba86f91d10c6631615ba5f6153e66b405bb499081aa7c24e33c6799",
|
||||
"tests/test_a_session_ends_before_the_next_test_starts.py": "99cab200dbb0c95d99d7456dd0e303ef5474841f0e7c237c6823e7cd931b8c01",
|
||||
"tests/test_a_streamed_upload_is_staged_in_the_session.py": "77a09bc59e947ed12b7ec72163af8aded968257b801b16b7d89d2d72ae7b0e40",
|
||||
"tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py": "5e7c7028beaefeb73a9419656d8b9074d438383e05baa7fadc77b00615ff78f9",
|
||||
"tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py": "ce073c8987f0d0116604884dda9c3a9fb70871d8f01db9ba19684289e60c85f7",
|
||||
"tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py": "9c8f25ae0c31cff4ecbfe891d6d95ad87f453ae69607bee96897d1528afabb9c",
|
||||
"tests/test_a_tooltip_opens_at_the_pointer_e2e.py": "464c26bb1665f9d7207e60f580893274c7b74afd83bf830fa8a2030950f605e4",
|
||||
"tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py": "f14a69f6919b538b7599602ba82bca224a7088de7ff1f821645d38245d65256d",
|
||||
"tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py": "c6bf497cd53e8a3887b4a93cfeaf7819983a87a18bbbc37285e6333bcece0743",
|
||||
"tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py": "d5f4e4bc0359d11822bd6bef7b1200920196a7dc7b0cad6de395e7fa270a46e7",
|
||||
"tests/test_ab_host.py": "d5c6a87cc90c4ef5e16d4c1a15748b141db980eb96485fa081d88293d5c07c4e",
|
||||
"tests/test_ab_host_aa_stable.py": "17774e026445e773e3f28474f3a635340dd80f586c4b5eb7fffd636e8dc6a0af",
|
||||
"tests/test_ab_host_crash_linux_e2e.py": "225c865b605356f478f73cd92550e7e9675079a425b6b0159886dfc1f492056d",
|
||||
"tests/test_ab_host_e2e.py": "337547a62b3922db74a8a039b211904a0f0dc2e291f7453ba434801d43382e28",
|
||||
"tests/test_ab_network.py": "19b9f7fdcf3e17373c37e02d9d843192632f8d12e878ab0eab1079b2c3fd9b08",
|
||||
"tests/test_ab_network_e2e.py": "6b750e5339453991ec9daa56296f43ef692e29bd777f43c67d4eafa29bc31cdc",
|
||||
"tests/test_ab_network_turn_credential.py": "e4d354a1b02f63934e08a87b0405d828793cc4a39ff5ce1bc773b460ceb05d55",
|
||||
"tests/test_ab_network_turn_deallocation.py": "b04b7114fce80182b9bbe58a4611ac31c2fb51b2697269ac2afc2c0ebb5c8f0b",
|
||||
"tests/test_ab_network_webrtc_evidence.py": "0dc33948d57e8e8589032b37f039f1461e36df5bc46dfa3e60559550a186edc9",
|
||||
"tests/test_ab_oracle.py": "a3410c1991965c8fde08ee4ec06632aa5270dec869a7930d4bde2fba9c4d3ce6",
|
||||
"tests/test_ab_oracle_declared_differences.py": "1571033a180d22c2afabdcb2b6ed4bc2f1eb53f0b79c2dc4c292a44236f6eecf",
|
||||
"tests/test_ab_oracle_e2e.py": "01896182520db1e0faf631a7a395b7b4bfc499fb37bceb36ae534c9268597fec",
|
||||
"tests/test_accept_language_on_the_wire_e2e.py": "7881900b5508d20c97ac0828e0e489bf7970b80193a19126ddbfb9c1ec0cde83",
|
||||
"tests/test_actions_without_a_point.py": "ec47ae5f3dc31cc0c9431d5f19b86173475495d491e652162d5ba268861284d3",
|
||||
"tests/test_add_script_tag.py": "b513b68ef486b2837ad7e9dc411a24fe323160f8c75234ac53bb8295c77212c8",
|
||||
"tests/test_an_element_handle_serves_every_method_of_the_client.py": "8fb84f2bccc4d1fdcef7574fd14ba48588689ef33b5aa8d6687aed591f672965",
|
||||
"tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py": "3c7b67ad059494108b4b671b23dc5dfd0a47d77efb4a841a8ecafb56359c9680",
|
||||
"tests/test_an_expect_reads_its_value_once.py": "d23d6005eb6bf20307b010afce91b8b6f2128d3743dc76b264ef47ed5a3c3d43",
|
||||
"tests/test_an_isolated_page_and_the_next_e2e.py": "4a2286f13d75b39ccedd3d0a44823b6726c0e5732d61bb1d16ce088410deaf21",
|
||||
"tests/test_async_api.py": "c7c98b6fdbbd90bfbf5f9a936ad3e310ba7bb2b0d664d1d09e72e465d0afec04",
|
||||
"tests/test_audio_context_values_are_declared_e2e.py": "6553a3fdcc601f8e2997f6e74383df777155cada765b76a912b523c7334db169",
|
||||
"tests/test_audio_noise_e2e.py": "b0c8df9312b470eff554607f8b4fd56cebdaaed0ea6ce54efafe3cb5aa493e1b",
|
||||
"tests/test_audio_sample_rate_is_declared_e2e.py": "cd527dc88042f108218e6b6285b673906ff07c645ba04b9d07c834672c8592ab",
|
||||
"tests/test_browser_output_is_drained.py": "08a135852f9f1aa51944c57600e5e4ab0c50cdc0a5f9d549d5a5d0e26ed77284",
|
||||
"tests/test_build.py": "30fff1ce6fd17c1d81874fc6db7253a745a403d30e536cf6ed7186533584e13a",
|
||||
"tests/test_bundle_font_names_e2e.py": "be210630f3616cae93a347d7c7b21a1f6a25dac886b03255e5701b45296270f4",
|
||||
"tests/test_bypass_csp_e2e.py": "8cfae28f4acdd2d6e7bed95a8117bbac00064cb9d3cee2c39ebf9b7d16099078",
|
||||
"tests/test_caller_world_handles_e2e.py": "464332c1893f610e04f68cced2a3b03f2ca6b8790ff7346eb112200093371210",
|
||||
"tests/test_canvas_create_pattern_projection_e2e.py": "8e10a197b8d7029636bc3eaaced4ce40906ef1a6aad263398dccb02aa5c92d2e",
|
||||
"tests/test_canvas_measure_text_metrics_e2e.py": "d0117d6ff5c1d83028857d00267d705f2e2aca1f7e69bdb77c6c8db5b299b997",
|
||||
"tests/test_canvas_reads_as_drawn.py": "c00623631e037662892d7810c708ef5ac1eb09cf527142d9be7de4597d121750",
|
||||
"tests/test_canvas_render_stealth.py": "72a025572ba619a545ba10ce76ccd8ab5d52929a9ff0600034d6fcb9270f55fa",
|
||||
"tests/test_ci_downloads_are_authenticated.py": "04bef9dcb53092d2bff696c8ebc77dd9238e66ae80b204b707944fe82da547fb",
|
||||
"tests/test_ci_drive_gate_goes_through_the_core.py": "51a00b9ca3480f2df187a137467e16f6891850862e4c79671a3ef5ba898ebcc8",
|
||||
"tests/test_ci_host_gate.py": "a80d8751fadd799309d7ffbf343ef757be036b915d9e94e99205b31a95938302",
|
||||
"tests/test_ci_host_gate_ab.py": "aad3beeb62ff8880261c450930d9f093dc3c5a5098b7bef61760eb871dbc3ca2",
|
||||
"tests/test_ci_lab_geoip.py": "9bdae7f75db538cadc674df931522578f3e222a5fdb0eb3a006550f8e23d07e5",
|
||||
"tests/test_ci_lab_geoip_verify.py": "754081f6b6d01d877043d3511377c641e2aacb4fe751033f1c6633ef66f68037",
|
||||
"tests/test_ci_lab_intermediates.py": "d6accf8bc1e73e444d9a6ac8921dc7dee08064053090da57f22aa9515d067ced",
|
||||
"tests/test_ci_lab_security_state.py": "cdd6b990a5039d31296f1e458a46199109a486113a11e1c87602690a16fc7dc4",
|
||||
"tests/test_ci_linux_legs_read_no_mirror.py": "db6f4ed0af55e9f451ef65a4c5375aabd72a2980a31fe9c9d0aa0c5a29c82e0f",
|
||||
"tests/test_ci_poison_host.py": "f73e2c0045ede6a458511cee936db0f3e31e0745374c200273d9cf2c232401ec",
|
||||
"tests/test_ci_published_set.py": "11863e1a404935eac6c002b21a67f47e205caca17033acf9d40f9476026673d8",
|
||||
"tests/test_ci_real_geoip_check.py": "4e7abc43dab8c50ead9802137c7b34f80f8f2191cc8310aee73ac20f995e84fc",
|
||||
"tests/test_ci_real_geoip_exit_code.py": "e5acaa5829ccea2a930a0c7310c9aa3ddc725c16bf883095bcad8125b5014fa9",
|
||||
"tests/test_ci_runs_once_per_commit.py": "9bf79b5e9f03226a09998c1595683a9830267a0f515a6f53ae8ed63f5d738de1",
|
||||
"tests/test_ci_suite_run.py": "9a565bf9bc4ea405783c593bffed1ef6fc359ec3c22fffa9a77a8009d8df77a5",
|
||||
"tests/test_ci_verdict.py": "fb95179f5fad8e9373e329b9e72a5e08336f0ecab6d44a2dce99a5d0bc5b04da",
|
||||
"tests/test_ci_windows_temp_is_on_d.py": "280b693d386034d4ed9a70f342574a5dae1d73539a8df875490ec571e4a684cb",
|
||||
"tests/test_ci_workflows_build_the_geoip_database.py": "464e63eceb2dd24de324fe583e2efddda4c5542ff1dff35769f1a01227ca89e6",
|
||||
"tests/test_ci_workflows_set_the_intermediates_list.py": "48c18de15649eb4a6335cb56d7ee85f8a89ca3ba45b4d78b49d1068b492b84a0",
|
||||
"tests/test_ci_workflows_set_the_security_state.py": "f59442dd07c4333ef7cdbdf8b2d83673857e36ac789f3d85ac7c610eddfff049",
|
||||
"tests/test_cli.py": "3bbf3b676f1f698af0256b2a4e70de42e1a529d3fa52a13058c5b99316a0a54c",
|
||||
"tests/test_click_rhythm.py": "ddd74c6e55c75dfb66780deb6617eab54596fe23f4e77b8eadbd616eb07396e2",
|
||||
"tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py": "5af5f447d31c2dd8196d58f40c83dd5bcce370cadaf4f1bc68ab74221121d730",
|
||||
"tests/test_connect_does_not_start_threads_on_the_loop.py": "ba67e88ce653558499d7f064f9b39ee37d664700f63382c922cef5b6b55d015b",
|
||||
"tests/test_context_locale_e2e.py": "0ac151de91fc1d37e533013a91a50aedc83507e4648d35025a14ad34bc992625",
|
||||
"tests/test_context_locale_is_a_list.py": "31d2c45f8c6bfd3609f57b5b7cf33c954affac2ab3f272d8c8457e58ec8c5764",
|
||||
"tests/test_context_proxy_only_resolves_by_doh_e2e.py": "7200b081c443cb559a6e5cd40028f42509ce0832057a9fe9ae81db17e83be928",
|
||||
"tests/test_control_a_selects_all_in_a_field_e2e.py": "a10bd2c68c975bbfe8eb55e37c3f22626428608d177e803e1a9dfaabf1bbdbd8",
|
||||
"tests/test_core_pin.py": "85c4baf6afef4f3df928547d82e651c8bc8f5262717adc82a8bcce341d00bc46",
|
||||
"tests/test_cpu_by_type_window.py": "b02f4918c9e4394a34bb2ec8703effebe92e5dc233fd3659f986cb03b8cc0f92",
|
||||
"tests/test_cross_origin_iframe.py": "3c3fb9113da40a62694eac0251a6fb60b4a604db9d3bdeec03ae8fb1f7bf406c",
|
||||
"tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py": "717d77851cfc77d524b261873b3312274f21c4db54321fc480b335d8215c5049",
|
||||
"tests/test_cursor_dispatch.py": "7ea3d9aca83e672f059fbf85da3dead955176afc639a13e8ebf29b5b66ee04a8",
|
||||
"tests/test_cursor_wiring.py": "eb70b80733fd73346c7d6a3cf22def2655ca499ed02eaed09e9f6b277e8f8648",
|
||||
"tests/test_declared_host_network_e2e.py": "18b667477a7bba7151a7b0b0b0df0fd6109fcc9a303e954ba7438a541daf27aa",
|
||||
"tests/test_detectors_e2e.py": "2333f0ad8d5a54bcf98d424b73f171eaca86c86b347babe074b9194ea2a2f8b8",
|
||||
"tests/test_docs_name_the_mcp_repo_as_it_is.py": "c6563d16a9c56fc80b6edee8b82de09288a939afbc3fa97b0c3d43bfbd9da4fa",
|
||||
"tests/test_doh_session_prefs_unit.py": "802e51996616c044858add5df6b5e831879354b643326112e6faafa91f4e4f08",
|
||||
"tests/test_doh_through_the_proxy_e2e.py": "59a3bfb8f262e3e934801d0bae7bfc144264e8286b5ad6e7e113204da405cc72",
|
||||
"tests/test_doh_under_stress_e2e.py": "f86402c51e4445cdf793c9075fdffb6cb5dc8d8c0ef1967cb73db41c2cdfa275",
|
||||
"tests/test_dom_iterables_from_evaluate_e2e.py": "e43e8dd09126b77845192db66257b146353608187c87ca06e7e61603ea6795a3",
|
||||
"tests/test_download_is_intercepted_e2e.py": "c1ccb1f16e9233b832b820ba50e14ed60608978b6650292921e5bc1b88b5b5de",
|
||||
"tests/test_drag_motion.py": "41f3c98814257526b5473cb235515b58e38e75452c0becf6615fe8d418501f4c",
|
||||
"tests/test_e2e.py": "60fe4aad2e8fb6b146f09c590eb18037bcd8dfd009e2c29cacb217c882b001d6",
|
||||
"tests/test_e2e_hermetic.py": "6ff72fb72345fc1f766edc63f741818c708a805b1041d18cc1bf7bddfce3dc91",
|
||||
"tests/test_element_handle_actions.py": "0ebf2e1b53a0cb200339fe2de36bdf7195d99266894179f55dba0966ade31c91",
|
||||
"tests/test_element_screenshot_e2e.py": "42d9b82c856bd86140c64a959ab552d4391866916a2c59b0303c681a6e18a9f2",
|
||||
"tests/test_every_action_is_pinned_by_commit_sha.py": "9b89001d169660d7fc7acf9718ae9932bd52bf62cec35f51aaec02665f8dba6f",
|
||||
"tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py": "f01ddee8cdf2469f7d64b8d29e7674e776d802c477d546b59c554e7f7bd4f5f7",
|
||||
"tests/test_every_argument_reaches_the_page_e2e.py": "618e1f461c44055674623967f27f3e81f1131c32a0bf9a2cf436430bea79c925",
|
||||
"tests/test_every_held_request_of_the_journey_starts_after_the_load.py": "15ccc31cb604716a49649836c9cd6aa64e741bd9bd851d7ec58ad593d0e266c5",
|
||||
"tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py": "3a7e3cd3ffeb285843d1e457a52199c9490851a5756ad307f2a5b076a91c5f1d",
|
||||
"tests/test_every_page_a_twin_asks_for_is_routed.py": "93c224ef024ddf2bdf74027017ee56a9325f186242f94f0a3ca1ba487186fac2",
|
||||
"tests/test_every_page_draws_its_own_acts.py": "3a1f821d191e9c92b25e95f293094315cf9218f7e7083d08c0301a5824c2472f",
|
||||
"tests/test_every_pytest_process_clears_the_gp_fault_error_box_on_windows.py": "236d2d6214bc5718fb4e91173710808cda8e6ef6f4bb62da289fe36510d292df",
|
||||
"tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py": "49b89020589f469f8c754f04be0f9332efba1d5717ba5d2894aaac7c1a049bb9",
|
||||
"tests/test_every_refusal_is_declared.py": "85c388c6fbde233b09fc4003adf5e6123f7884a83c2b95480b64dff795fd1cae",
|
||||
"tests/test_every_route_command_is_answered_may_fail.py": "15359fc307e1dfdfb73e74bd1965b72a7d7de53dc9b07b7f5e10d0bc6ea820e2",
|
||||
"tests/test_every_suite_runs_on_linux_and_windows.py": "bded76458724f831dfd4514ca7a35350650eab18f27bc42733c7e94f3c000515",
|
||||
"tests/test_every_windows_job_keeps_a_dump_of_a_crashing_python.py": "b07e0020b47e001c567be8e3d6b12172d6f70e5ed4aa5abf21390e1bcc602d63",
|
||||
"tests/test_every_wire_method_is_served_or_refused.py": "f83ad0cbca50c08592027819bb6e211c39a1d8b3436ca053abc8bfcdc5f38eae",
|
||||
"tests/test_expose_binding_e2e.py": "87fc46eda36fa78e885add276c285e65db23c72d46add9fdafe79fc364473e12",
|
||||
"tests/test_expose_binding_refusal.py": "830fa5b68be646ca2e51d187b2dd9ef1401ef6231aa648bec501e6992f19f24e",
|
||||
"tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py": "25b9f5218337daead8ae7a7fecaae25e10549c9ece69830075cfef04b4d45762",
|
||||
"tests/test_fakeweb_p2_e2e.py": "349d5eb521ebc50ed9fa4ca2d6aed886e5831b14d1b0217a95a2f5ee7126738a",
|
||||
"tests/test_fakeweb_p4_e2e.py": "1d43ab050a9469a886c25781810b412a9dcb40052ab5edd466601653e0c8e5e2",
|
||||
"tests/test_fakeweb_p4_report.py": "39e7e2aa4bc7444cab2064e013ab798cb2ea7e0cf5457b2e1f2b62a0a871677e",
|
||||
"tests/test_fakeweb_stock_unsettled.py": "6bf9655fb56b2d86e5613e2bc2ee6c57fff5bbb4d55a7db7b34d7f78bdab568c",
|
||||
"tests/test_file_chooser.py": "bdc2112386776e3c348eab585e0c6fb1c3ad75627e9e51588295d6ffa0ab8f62",
|
||||
"tests/test_fingerprint_consistency.py": "ca3ae9242666ea07ea1ef4a644711610dff2dd811e04f0d75485731506b724c2",
|
||||
"tests/test_fingerprint_surface.py": "68be79bba18d02b47e5290ad6081017b15b6864df237443178ee0e1832239864",
|
||||
"tests/test_first_launch_from_a_new_path.py": "b7b0bf98764ea88302747f402ce4101e70a7e71d7063de4c6d76f923a9cd38d3",
|
||||
"tests/test_fission_frames_dialogs_downloads_popups_e2e.py": "f206299cf493f63b4ebbb8b4c11fad5b657ef4ee0699675dcfd9e832547e5eb5",
|
||||
"tests/test_fission_frames_history_and_processes_e2e.py": "5974c37bac0794aedb76e869bdc0536860825c02ba019768c6d9898e019fcb7f",
|
||||
"tests/test_fission_frames_route_and_bindings_e2e.py": "2c443bf43fff41aa0143049c9650a9e16af4af2ef142c05a55c7bf4dd52dfc6c",
|
||||
"tests/test_fission_frames_tree_input_and_pixels_e2e.py": "f9539f83f6d6130a90b1d3c75a96ce3d283c05b50a3e6f5d5ca816f927cf4319",
|
||||
"tests/test_fission_frames_workers_storage_and_special_frames_e2e.py": "ad52e93348d8862c7b81d7a3268b3a8ac0fb9f7465f28b9fbd8cc196bb07431c",
|
||||
"tests/test_fission_identity_parity_e2e.py": "9b5eb515f8758fb29aa6d6017d3f0a19b1ce3ad75d5134f0c391938d03653d7d",
|
||||
"tests/test_fission_iframe_crash_e2e.py": "e64583b724671f81c796eebbcfa9667ae61f8732cd2f8d23cfae7675ab319a78",
|
||||
"tests/test_fission_strategy1_bench.py": "c0d8da2b8b50cd1a480fa21dec114508e011e27e76071c8f93c6b6e6a53d7a8e",
|
||||
"tests/test_fixtures_name_why_the_package_is_missing.py": "8de82b31e4baef3dc2485a082e7e9136501a1796aa2a73b73ae40d9722cd581b",
|
||||
"tests/test_focus_survives_os_deactivation_e2e.py": "f6dc9ff126939ee2a43df18ae1303148d6a09dd688710f827964143b4a2493ca",
|
||||
"tests/test_fork.py": "fbd37d915c3aa8ea8490578b4da4b4207970efc928c5209a00c885cb6423e06d",
|
||||
"tests/test_frame_dispatch.py": "04ca6dcba6e13064d201531ed14c23b1212fee14e3c1aa6027badd30699aa598",
|
||||
"tests/test_frames_outlive_the_back_forward_cache_e2e.py": "75409e7e4b7d4259db5ece525042f6507884e05e1d2306ed7e33e39d8c904e7b",
|
||||
"tests/test_fullscreen_without_wm_e2e.py": "b1056586cd8e8ba716a3a4ad7cc32fdd30f0f956f5ddb2004d0b3c1cca079ca4",
|
||||
"tests/test_geoip_used.py": "0ad66c33f98711bd00d909c3f421f4b02bfef0aae141f01751238cc88448b3e7",
|
||||
"tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py": "11020be5e1f655f8387343af85a233edbba6ae17941883d833b90e56222620ce",
|
||||
"tests/test_glean_ready.py": "3dc9e071a1e38c5c789ebfec0f9505dcb199e8202d40a1e6a9dc96296600869e",
|
||||
"tests/test_goto_and_every_way_it_is_stopped_e2e.py": "91dfeef1b7f73d388cbf973d50892d9b72cdf75dafcec4ee4d27901efe988ab9",
|
||||
"tests/test_goto_follows_the_base_url.py": "bd4867905bbf341333d6d84927452276a0c5595e96f4ce192251796fb13677a0",
|
||||
"tests/test_goto_networkidle_after_spa_e2e.py": "ff985e48769cc3f0cb28a89b3a6f908ee33d98390be3eca09c16a9ae123b3ead",
|
||||
"tests/test_goto_script_redirect_e2e.py": "03bf95321341a1ecb74938fe6129c63c829c122b991314bd3bce9746e3735ef4",
|
||||
"tests/test_goto_to_the_same_url_e2e.py": "60ca2644145a3b727c273487d18787d81a1ba9c7627ca495ffebdbdf7e96eac4",
|
||||
"tests/test_hardware_values_are_declared_e2e.py": "b45208e8f4aaa84fd35b870bcec8c4a09a7808e5f9d2f9cd68a58561489b2ec8",
|
||||
"tests/test_hidden_desktop.py": "0c3f58545f8dbd43acf527b7bd773e8d25abea9c912ba7bbfae2d570fa5a8af4",
|
||||
"tests/test_hidden_display_linux.py": "101be6358fd7dcc2fea46fe992c2d12cf08b0ec99513ef76a0cfdad0c89314e6",
|
||||
"tests/test_hook_wiring.py": "b06a8d0c747c695987086128cc4946e6baf2afbdd953f340cb1d0270c8bd88cd",
|
||||
"tests/test_http3_through_the_proxy_e2e.py": "a51ee96c45dbe823ce7c14c1fc0808580ea6f2cf076bfc77e9705f401db43624",
|
||||
"tests/test_ice_names_by_the_context_proxy_e2e.py": "45135ea743e5afdc1c91bef419f09d5a1a0f5da5bce81be11f6d0016ac09838d",
|
||||
"tests/test_ignore_https_errors_e2e.py": "7fa328cb862aa97d398e418a04c1e3185f0b34d33df20b3296b8f11070c7313d",
|
||||
"tests/test_imports.py": "42bc09d1118cead72eae269ac3799bab9a3e622290edf720a7cfbf1ace9fd1fc",
|
||||
"tests/test_injected_node_surface.py": "406e309fe370888aa337487694745a1cefbcc98a648b485eec8a0a7325649194",
|
||||
"tests/test_input_is_born_before_the_page_sees_it_e2e.py": "72df96d948bc3eb1e3f44a2e18fb0a4cf500c702f8ad362b54dbc76c4f7fb95f",
|
||||
"tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py": "bab881caecc21903a8f617d0281c9b5f518b742507fc52ed19416fac77449cbe",
|
||||
"tests/test_integration.py": "39859483ad6fb2fed8137fb2c9310833248daf5d298ab35ed677c87fa5d47fe6",
|
||||
"tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py": "475cf45e77fbf2ac8b7856b9aa755a10ea4c36712206425b79f790e3560bd05c",
|
||||
"tests/test_ipv6_literal_connect_e2e.py": "d2d122ee9eb6ecb6f9b30d7d03e56fa00b91a2c0c738458cfd25cb2ecf48f66e",
|
||||
"tests/test_juggler_actions.py": "dc84e5349674bee27d7cda61003210bca15afb9a49a9964b6e71940a4b398ef6",
|
||||
"tests/test_juggler_connection.py": "aa2bb990598281dcf1da2a7b3e220b023bd1dac644d76e4231c7fcb402dad571",
|
||||
"tests/test_juggler_event_buffer.py": "3b67fee3ecc8b806e1cf4dd1d6b644617b3f67537133e598a126757120108bb8",
|
||||
"tests/test_juggler_event_listeners.py": "47b8c44423c8d250f465656b70264004102115d84e3b02863c63ef6b23469e85",
|
||||
"tests/test_juggler_injected.py": "765e7974f840fb5d692b86de90fe653d71f176065c8206129ee6dfc1053b2c2e",
|
||||
"tests/test_juggler_lifecycle_e2e.py": "d0e49fb71347926b11e4715d5f1aa0bbf6758e2ca96d1a9acba771fb00bf8989",
|
||||
"tests/test_juggler_lives_in_the_core.py": "e14acc31eb3c31499f4270b5eb5e06ffbd89bd97892b4b5e796fd80b4d5e1885",
|
||||
"tests/test_juggler_posix_pipe.py": "e26156bc3ee89d9c8213ce88ea45402a4c084b78212e735cea0a818885d423ed",
|
||||
"tests/test_juggler_transport.py": "7f8af14f45dcaf7f7f48643266583fd4153a84144bcca15d9c932561cf9b16a6",
|
||||
"tests/test_key_delay_reaches_the_keyboard.py": "daa93adecd07cad1cd1603c301c0f55e2fc2266f1c39b34ea6e8bedec28a1a0d",
|
||||
"tests/test_keyboard_rhythm.py": "432cc602ce9625fc0fbddf767093d68d4ad3382c0ff5558d5947df7f699d3427",
|
||||
"tests/test_launch_counters_run_on_github.py": "b36040ceacf6add9606be1aef2e18579ad0488dd9ec4981f5e6eb460577a79b9",
|
||||
"tests/test_launcher_config.py": "1066c6e51a4646df95a0761555683a14dfc6441c6a99d7b643dd689d58bc9936",
|
||||
"tests/test_launcher_helpers.py": "25fc5130f91c0b5988ca6ec8e4619137f03c2b2f1b0f43e58b813e817b7f4961",
|
||||
"tests/test_long_session_e2e.py": "96cd8fd6bb5ec76d56574d9bfb1bea0a3803dde55f7ed261f91ff6922f5e064a",
|
||||
"tests/test_motion_never_hides_a_programming_error.py": "d70b395a2b156106064941dfbfa5c2247f2ed1f6f0701a9dac7d7101fa41dd8f",
|
||||
"tests/test_mouse.py": "5cc71129476cf16fea22c787b663bef64b23421ef9e0005c6e3966fb640db31d",
|
||||
"tests/test_mouse_events_keep_their_values_e2e.py": "e6e15634894279baf58532c76c250fe29c33c5060dbed9369a3e81c26ef44768",
|
||||
"tests/test_moving_page_model.py": "98dbedb6670c84f0d62e2befcd482bae8b1fd640db728df7f0982660d976dfd6",
|
||||
"tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py": "15d5bc3e71818ed880b52daad68c0531984009768da25d78a6b3b0f1aa53664b",
|
||||
"tests/test_native_line_endings_are_windows_e2e.py": "3473e237118507dfcbdb4cee38a4238280d13ffaf9bc2d44d4aa9c872e4dcab3",
|
||||
"tests/test_navigation_across_processes_e2e.py": "a497530248ce0de43022dccf33caa0fde1c9570f7e986267f40df4e783784e9a",
|
||||
"tests/test_navigation_response.py": "ce6aaeb066d035234d6856197243a8ce6a6d8d321baa068e6cc45810db42427b",
|
||||
"tests/test_nested_frame_actions.py": "a58d3b8507122d2336ab64a4150f2aad26a485708095dc71ab6354209ab2f9c1",
|
||||
"tests/test_networkidle_reaches_the_client_e2e.py": "409edcc8c65b6b9be721e0e0a92bfdd9dafe8aec02186e297bf53897287fd70c",
|
||||
"tests/test_networkidle_through_a_served_browser_with_routes_e2e.py": "a13e33f8f23bff09baa9321aaa4c62771349c3ab6d842c90f786eaf1a4424841",
|
||||
"tests/test_new_page_defaults.py": "e74367f3e008e5345c8391070bce0ac857395a47b2aa69ca69d6376926d3c4ce",
|
||||
"tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py": "48e8f6401d729269ff0d60f6a5e6f673b44339da49066420b5f14e4d6145b537",
|
||||
"tests/test_no_file_arms_a_gil_free_thread_dump.py": "110398687983ffccb7db9cf1506b51414edefc0d6859bda8b03c91c11f5c16b3",
|
||||
"tests/test_no_legacy_in_the_wrapper.py": "510d0ad825eff4880775d55713ded24c19b3530d9b1da4866cbcb25e71381ed0",
|
||||
"tests/test_no_override_leaves_the_persona_scheme.py": "d46a4c66359afafdac275ac1ef6994018de990e061d5a2d1d22c18b1e89a14f1",
|
||||
"tests/test_no_thread_is_started_on_the_reader.py": "f882ec09a53c4d4541ecdaffe5a263523c355470109dd3f53c517cc8e8eb2e16",
|
||||
"tests/test_nothing_leaves_but_the_proxy_e2e.py": "d025caeb277cae7fcb0dc2fd8966db714ffe97700be05f133141976a1f7b8427",
|
||||
"tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py": "d1c1928e350a05721321d4e7c88314fd0663595d136ff0c162d68cc0d4c2f0f8",
|
||||
"tests/test_oop_frame_element.py": "cc81644aa23226b5ff6c7d7e1f78863d33f4b4e07bf86b7c3fcb441c261cab86",
|
||||
"tests/test_oop_frame_geometry.py": "03064113e169395e8edf2218b75fb38f0df9049d75342d4c2a2b0b892a27c589",
|
||||
"tests/test_page_element_atoms_run_in_a_sandbox_e2e.py": "4bea881740982695e77f714da6bdc0a7e40b952f1eaeddb477b8997afb43055e",
|
||||
"tests/test_page_number_follows_the_call.py": "19fccae03e22cd302251cc78395e3f846d0b5477483bd59aea0b8a60ed60fe93",
|
||||
"tests/test_persistent_profile_keeps_state.py": "b4f8a819fe44239cb4f1537e7acbaa1b97c07384dd5c6af5d53044607d8b999a",
|
||||
"tests/test_persona_cover.py": "e2af622cfcdde6be3f5ff8b15a7f7912cdb3b950293bedb3965cdc77a5f856b8",
|
||||
"tests/test_pin.py": "e297f630a7c281d951c536cd7e683ce9daaefed78afafbeb6c9f91410f6a7a85",
|
||||
"tests/test_pin_dicts_are_valid.py": "a6bbc441942cd5772a1a0d3a0b3b69540c2ae1b9f955fcd70b052e47cb68a0eb",
|
||||
"tests/test_pinning_doc.py": "50a620a3b9fd9077eeda7806bf891f8a138aa5f9ba3dba7fd5f9d12b1b4fbd48",
|
||||
"tests/test_pointer_position.py": "c2132d7ea8b1b8f628d262d2df2246d70d213723adc5a1f8ab5be91482041d1a",
|
||||
"tests/test_pointer_server.py": "39b3a3026fee49a4a0516ae94a08ebf2d70545caca34cbade27c9206c23a8197",
|
||||
"tests/test_popup_adoption_unit.py": "ee9c2b940346cc0ab71151bdbb0b0ab988983df961847d3c548996c7e03ce4ab",
|
||||
"tests/test_popup_destinations_e2e.py": "1d857eb23f9c81edda31bfdac4627cf082adb63e7ffbff978ebda7f75c57b2de",
|
||||
"tests/test_popup_geometry_is_the_declared_frame_e2e.py": "8fa5456b38eb220a4994ea60b3c3e936742529b03a920865ab1c4eea7a0452c2",
|
||||
"tests/test_popup_pages.py": "46a7b68824947c9b50082f1d269223472c6058dd54d2eeee9355b32a61767c50",
|
||||
"tests/test_popups_reach_the_client_e2e.py": "82556ca17c9b8db3a0432b0030ebde116d21c56c8a7bb78b376247b2a94d4013",
|
||||
"tests/test_prefs_composition_arm.py": "d3f59845a2ce9b600d095136d656ce73395a7a562a6dc16ce1cbc71ccfcaa62e",
|
||||
"tests/test_prefs_composition_arm_on_windows.py": "042064c088b2dd741f0ea44ea5905b024e83760fe1b90594370416d12029e8bf",
|
||||
"tests/test_preload_newtab_is_written_only_when_asked.py": "a8a993de6e6d4d884e35657315604d4792eceed22914d3bf4d9c520a6813b8da",
|
||||
"tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py": "e809201dbcd2194a5e26ac0a1b4586f14cf75d5d04fae6fad7419004061216a3",
|
||||
"tests/test_protocol_names_are_declared.py": "d9fb8913d290c8a61bf461a2198a3e6fbe2c1a81f6a6f6384280595c97ee290e",
|
||||
"tests/test_proxy_http_auth_e2e.py": "884f978221e7f968c43b2bf7261da93aac37049572aa563a27af153722701b0a",
|
||||
"tests/test_proxy_reaches_the_browser.py": "b9fd7bde8fd419834c5171daab0de4d4b9865eb05739a2dad323abb323d6d04b",
|
||||
"tests/test_proxy_socks_auth_e2e.py": "65987cec44fc0ecaaff2eb11912e6a5bc4d40135b55c11727bd8a4391925000a",
|
||||
"tests/test_publish_gate_wiring.py": "cc66c7d57450913222b0151175a27ba5549543c53cf2e026aefd8ed54f5d7994",
|
||||
"tests/test_pyproject_names_real_paths.py": "a142fd2737ac94e3f965ad7d9bb40297fb3a9016379baf1b756a62b72be92bf1",
|
||||
"tests/test_readme_claims.py": "0407f77f5c08c66a55a0f8fcac0857881c55c04cea8163ae1482018df5aa9e11",
|
||||
"tests/test_real_sites_judge.py": "93f0a634b0813d4a520ca165fa39c6b91cae35b5099292995fc7a3f7d988e13c",
|
||||
"tests/test_realness_behind_a_declared_exit_e2e.py": "7673b3d1bf0f9f058991ab78b00c0f94f1e62a031b43ba9c2cd04a77b0581d4d",
|
||||
"tests/test_reaper.py": "4ff4b0473f20634704270cf9aabc16076adb80fa2a33121d630432c9e51c8801",
|
||||
"tests/test_reaper_on_windows.py": "9b1748ed9fcd21883f23914cd1e0852f82ecf46b926c0eaac34ca83d708fd039",
|
||||
"tests/test_release_e2e.py": "90254e1d3b8e19faf2419cc48d43772ffa85ed655656617fabb1f0a86fc4e964",
|
||||
"tests/test_release_notes_install.py": "e0a6024ef78995e9650bccf0bcc7a72727b6bb6fb32f21f38b467c105f37e5fa",
|
||||
"tests/test_request_gc_uses_the_page_session.py": "1a574bf6aa857a139548142211b05b34705fa15fa08fe0abe6e4be7a194ac3aa",
|
||||
"tests/test_requestless_navigation.py": "6a9b2b8be968d5fcae0d089edd77f3d8fa5bfe2e6e4195ef0835b182d410d176",
|
||||
"tests/test_resolver_race_e2e.py": "97bd5a66b47a0cde5b2e2f75f8dbdada255e2c30f4749601fec2bee356eb3d95",
|
||||
"tests/test_resource_types_match_the_pinned_driver.py": "d7f2bfb2e8eb31deefcb283ccbc0c19401ebb36ef5369877a786fb1dd3493ec4",
|
||||
"tests/test_route_abort_code.py": "6ec26ec73dce79161a7b2446955ef4c6d1697d1431a8402c3027fe1c5ef28209",
|
||||
"tests/test_route_e2e.py": "0ee793c246bd5c5e200af069a300d626b85da6e641660efaaf382adefc7a5483",
|
||||
"tests/test_route_header_order_e2e.py": "a5e58720c0dddd3a1090b565064170b1213bdc9061484e5eb9193a94fba8e1ea",
|
||||
"tests/test_route_post_data_e2e.py": "88e0b42229841441ccaf9145ae58e2c6808ac3852c29d6c68751aeb4c77a1d32",
|
||||
"tests/test_route_sends_a_navigation_elsewhere_e2e.py": "278fb9fa637586066c7352bafbab7c0ab0a6482e387e9fac2ee5a24053d1f8af",
|
||||
"tests/test_route_superseded_e2e.py": "300b3eb7a7330cad9bd2b9a8eca42800c05e1c465a360fcecaa7478c2db0b467",
|
||||
"tests/test_same_document_goto_e2e.py": "a10b3d5d1604ce4221e5d66e65191cfec9652d7a7a85167d54e7d63c6ead4a0b",
|
||||
"tests/test_same_document_navigation.py": "5f7f61f265b6c5121595c799a7a24760d0df73618c665e127d8a7cb6bf6e02f8",
|
||||
"tests/test_screencast.py": "2ffd209e3906c27a341fce7ab2f4238be9ea998a96cc6476e0f6c88590977988",
|
||||
"tests/test_screencast_ack_race.py": "b66e8fa467fa41b48222f83809737e51a828e9adbc7479d1a53645cf5ba2b045",
|
||||
"tests/test_screencast_stop_e2e.py": "27ef3263a76e8315623e059e6574d84cb84caec20f43c7a6246adf21e18c755f",
|
||||
"tests/test_screenshot_looks_where_you_are.py": "03547af251d768a3d4885edae275ce0d14db59220f3f65abb0a6851e9852795e",
|
||||
"tests/test_screenshot_of_text_returns_linux_e2e.py": "8d39b03f9c2dee6940b07ecd0dd4d51f2fe7608d24d467220ff71cddaeeaf245",
|
||||
"tests/test_script_cache_written_is_adopted_e2e.py": "0ab3c6114f64130269bbb5314ba08ae930e3382b0d92d28b1beb4e6e04acc4c5",
|
||||
"tests/test_scroll_into_view.py": "16651e6f43cee76f95d96d0593d0aec44c4344a3a63ec78a0489db61d894ad7b",
|
||||
"tests/test_scroll_only_if_needed_e2e.py": "b78ed5fcb9a596d63c68ceecb77ecdf92e744a6a64b16dc7b17b88dde9929125",
|
||||
"tests/test_seal_binary_path.py": "b2655c6bb6b7747b0226ef44d65a13c58cfe1d168a8ca2026ff34624bb3dbaa7",
|
||||
"tests/test_seal_floor.py": "da21918a05f93e50296c70815cc583262c9dd7bfa03a622f67e7dd62bd2c9b70",
|
||||
"tests/test_seal_playwright_range.py": "bbd420a41cdbcc21f1f40b6412334b70b0d4b2e0e3e5d4645fec249a0ab3cba6",
|
||||
"tests/test_seal_wire_version.py": "56173e3f3a622abcc3a564573b4c359185021ce784f755ddb84523be4be75658",
|
||||
"tests/test_security_state_engine_e2e.py": "03067b4303e008946ef7b0b9342b96f8a9fb80d96963180c7b2b44e9ee3f7060",
|
||||
"tests/test_service_worker.py": "9a76bbedad588fb2a43e4913b326f58b442b8354369a3d05270c1fdac05fd8a8",
|
||||
"tests/test_service_worker_controller_e2e.py": "d28afd1e19243df2479116b8321e5cca253717b90d00a55cd265ceb7932eea06",
|
||||
"tests/test_service_worker_options.py": "40e70e6ec5744024ee280466924c10159b43c74a6a079085de84b7aadac4800f",
|
||||
"tests/test_service_workers_blocked.py": "2a3571778f3c13eb1a19ff32bd46b1e40e85f753894d4738e2475d59fb348a20",
|
||||
"tests/test_session_transport.py": "60c413770e0ea78bd01bae528818c0cb51dcf262ca9712a4a0bf87aac3620675",
|
||||
"tests/test_set_input_files_payloads.py": "49107918de7d93d2f203a802b475b3a9c50ab9b80b848420923eb8f6c973cc51",
|
||||
"tests/test_set_offline_e2e.py": "fb6a2d29871b1b1fe85acdbf9d6df60cfa6737dc96765c81a0ca45a6dddf2ac7",
|
||||
"tests/test_shadow_trusted_input.py": "9dbb0dfa1ebf700ec2ec993d3752a2d47225571524382efae996d9587f5cba93",
|
||||
"tests/test_software_compositing_is_declared_e2e.py": "7154574ed65f88ce0e27991b1c9146ccace742806ced8f3d15053ac9e611d18b",
|
||||
"tests/test_strict_and_force.py": "707556806be438e1fb6663e174ec3c76770f95459ff92a46cbf2ef66d570e546",
|
||||
"tests/test_the_argument_does_not_rewrite_the_expression.py": "bfd094b08582355c60d6e2d8df8b2cf39a5f3134f7dc492d06f1fed8b24b9c69",
|
||||
"tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py": "ebfe2d15987c16a368f5da902593e6017fa9c4dd500ba50c7d5d2e8773239ed2",
|
||||
"tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py": "2c276bffd18115b854e655394685131488d75cc4462bdbd540cbb592f9305c62",
|
||||
"tests/test_the_callers_code_is_not_counted_e2e.py": "366598118ceb6dada6c67a0bf521449258a0e0a5cc6b4f88ef851ca3dcb330ea",
|
||||
"tests/test_the_callers_code_runs_once.py": "5a3d86180bd11ab1e9433905c2f99485269c7dfe6cf3c75a5530cf7d94384a01",
|
||||
"tests/test_the_callers_code_runs_once_e2e.py": "f988010379d0af6527a584461f0001ad8cc83ecae32cd74f10fa355f3e748ea7",
|
||||
"tests/test_the_census_needs_no_package.py": "225e8c1821085da1f18da20d45c83997411e000632e3d6537f4017f5674e692b",
|
||||
"tests/test_the_changelog_covers_this_version.py": "3cfd227ac69901ab7cfe5a3286d5c3dbfdc1322b15279521253b1b733c159af3",
|
||||
"tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py": "027063272233e562b566c56c98f3eb655509970b5c61836a79523d9740f6ac12",
|
||||
"tests/test_the_close_loop_verdicts_see_the_defects.py": "0aaa3afe2812f20f6fa326f8a0330e2639d1a32e3c2058eb45acf6e1734af976",
|
||||
"tests/test_the_close_returns_when_the_browser_has_exited_e2e.py": "95dcd55b3cd8889c75ec3854aba9db1b376c222c2cd040a2fbc2fa282650f81e",
|
||||
"tests/test_the_consecutive_port_tests_run_serially.py": "186412cc691a7b12b46d13fa3accbac1902d1e6ef5ff3e1615901abd411ed2db",
|
||||
"tests/test_the_core_of_a_crash_is_read_by_gdb_after_a_failed_test.py": "cf7a5f6b17951c853aa2894961f5598db08ed68cddafee53a4aa1111effa5b97",
|
||||
"tests/test_the_device_enumeration_takes_the_declared_time_e2e.py": "2ae9f5f7c51a78ae45095ec5f44c2f18a60d412284799f7c54af212ee92ed48b",
|
||||
"tests/test_the_doh_e2e_launch_on_a_virtual_display.py": "33ae300b61cf37a8cce81adb14711ca870d1dcdf11d66ebd3377c10c526f910c",
|
||||
"tests/test_the_drag_twin_records_every_event_the_page_reads.py": "781350242168122515b0d33ef3594f6b98b06ac98893e04d92de2f2648b7bbcf",
|
||||
"tests/test_the_e2e_run_stops_at_the_first_engine_refusal.py": "0f29e035ee261be18d2d7d2250c6da072e7a35ea024525be4eeb6716d0dd0772",
|
||||
"tests/test_the_e2e_suite_is_accounted_for.py": "ac60cc62100d3b859eeb9a257f198f10074cbd5900a9ea7162251a3691f4657b",
|
||||
"tests/test_the_e2e_tests_do_not_wait_on_clocks.py": "7569510337703ed71115fc6667bcce4f381cf9e83a50d217da15a68d52435963",
|
||||
"tests/test_the_egress_sink_helpers.py": "af6bd061089da4363b99ce9dc7d3d244218ba05c86e52a3c0dc77b9c27e29b6f",
|
||||
"tests/test_the_engine_is_born_in_the_job_e2e.py": "4db6c8e5274d095c489e25e481d5ec5a17fcdc1c3100a8069982497bc1d93f73",
|
||||
"tests/test_the_engine_processes_of_a_test_come_from_its_tree.py": "32f45d4e7af16761dec0257fae360f9fa241fc5f37b3ff8d9453318c6f40c693",
|
||||
"tests/test_the_evaluated_code_has_no_debugger_name_e2e.py": "34cada4d09972bc445e6a569d19cfe72cc84b1f539098b2dced2ee1077d3dbbd",
|
||||
"tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py": "a07027f344b531a9c6d047af0131a35a9b0811d03430f4c638ddf9de5e723b8b",
|
||||
"tests/test_the_extractor_of_the_chrome_names_reads_idl_and_webidl.py": "fa09daad1b77f291fe407f7d69cce1f6e6d3d212073ed3fcba833243c9739a5d",
|
||||
"tests/test_the_fake_doh_answers.py": "eee1db51996881388c3d3cbbabe66a97ae6a1317fb61892f0ccecfa8c40e9d72",
|
||||
"tests/test_the_fake_doh_delays_and_refuses.py": "e3d8737e872039decb8d9dc876d37d5c4d621f09dbf897b602382d42e487f0f4",
|
||||
"tests/test_the_fake_doh_tells_a_refused_certificate_from_a_dropped_connection.py": "4fa9aa72435612edd665719d82ca725925fd0722e049e49044256d7c36463009",
|
||||
"tests/test_the_fake_web_asks_nothing_of_the_internet.py": "c4b41ba2f74400e63c51bd7097980e95e829ec3d097b9a18333534d9eb24963b",
|
||||
"tests/test_the_far_away_probes_say_where_the_time_went.py": "2115d3e9f528559b1c6dfbab9ca17ebe508f2466a584a387eb94a8f4a8b687ac",
|
||||
"tests/test_the_far_away_watch_never_breaks_the_gateway.py": "5aa5818d8f597d1531e825a9f73e901c7a535ad57017cca4d8a11dd95a4bb46b",
|
||||
"tests/test_the_favicon_stays_out_of_sight_e2e.py": "d89a381cf59c081cbd59097c85377bc8347dbb6de71419fc985202ec9e3db962",
|
||||
"tests/test_the_floor_says_the_installer_of_this_environment.py": "baa238883691235250b426537e95e9da6bd68749073bd980b392bd050d83536a",
|
||||
"tests/test_the_font_list_is_the_bundle_e2e.py": "e1fac27fcb69670b4742c5040c67c5e28928416f0b24688de75c98de4081f78c",
|
||||
"tests/test_the_frame_evidence_never_changes_the_call_it_watches.py": "2a5e67a73841cd95dd7ee5abdef6ddc1e60a2e0753c072e191ff7b603736cfd3",
|
||||
"tests/test_the_gate_lock_follows_the_sources.py": "7a8dc59793adf5f9e064d53c9bab01db0687bc76353a46d977a56c67a693a581",
|
||||
"tests/test_the_gateways_of_the_tests_carry_only_the_lab.py": "253972c9705f6e5b58074aebe555b764d57aca3b4f655d61e29b1354f38c11ee",
|
||||
"tests/test_the_h3_lab_server_lets_quic_finish_first.py": "ad3c7497ac63b179bf0175f4ca3bc474c1d613c410facb7120ca76d7b38bc76b",
|
||||
"tests/test_the_h3_line_helpers.py": "fee679ecf663001a5fb455207985c9bd53f7d8629e51d922cfe320b5bc9b5445",
|
||||
"tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py": "ea075622ed1dbc8f3ad58a5a5606ef94ce94711f3440c53280882b8bcc6c6f1e",
|
||||
"tests/test_the_host_address_helper.py": "e104c158686333a80603ba838e6b5210ceb99570b2772d859523e6fd7f6c5905",
|
||||
"tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py": "089508e0398991858dfec3d66ca202e4716a0da1ac3ec2204ce2b909e8a470ca",
|
||||
"tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py": "6dff62aaf9b926f78bd682a5e0e352534bf4dfe53bf5403ecd6f59314d55ebed",
|
||||
"tests/test_the_http_proxy_helper_asks_for_credentials.py": "e2c16386e7c356a61c13bd307695b35f2bf579cc1766bc3718964d34bb2e0023",
|
||||
"tests/test_the_install_job_has_every_module_its_tests_import.py": "c15dbab9c94f84f0648e637c1ea5f07bb9c6fc580aabe228f4f933ed5efc310a",
|
||||
"tests/test_the_install_job_waits_for_the_index.py": "9545e8d19202731297eab8a9ac8bcaf01eafc37f0bc8635362e1c7b79a65d6df",
|
||||
"tests/test_the_journey_waits_have_a_hang_guard.py": "88ab9960e315bdea47f14b7c0a2281f8778ce755c128c7a3e20aa71eb0fe979c",
|
||||
"tests/test_the_keyboard_follows_the_session_language.py": "a745ec07a7020f4df8a6f1d3101b3efaccd9937a7f7abb573b6d349e2af86f95",
|
||||
"tests/test_the_lab_ca_and_its_ocsp_leaf.py": "723e542175fcc9156869d0e43759acab1bce2b91028938d78f65ed31c32b31b8",
|
||||
"tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py": "521e71b84f1fdab01afb06db32d436cafeb75555ff0f1e23566f194eadb21db2",
|
||||
"tests/test_the_leak_watcher_sees_a_direct_connection.py": "a5dc39c2ebc379a17e80d8667c12623dc04fd138dddc30db64d5cd46fa64801d",
|
||||
"tests/test_the_marionette_helpers.py": "b3283dba145af967cfd3a5f3d8617af58030f77441e41fea3a7df4c2e1aa4f58",
|
||||
"tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py": "6ced1798bb0165c09a69aa8321b95c3563b318ffd581cd49a7cb0c0bf4626f98",
|
||||
"tests/test_the_names_of_a_permission_are_the_engines.py": "e59caecfc07bbbd7fa574e098e730dfa28baacca7d5a0180709cd9d6bb72b9da",
|
||||
"tests/test_the_network_declaration_reaches_the_engine.py": "31c11a5d6527ac341b8ad602f3343c17b50afe620769b61d5c058b9e21dbcfe7",
|
||||
"tests/test_the_os_cursor_is_parked_outside_the_window.py": "763865eff13004c57e3eb859eab331b5d30e89cc0ae3bf9898047cc7111fe6f9",
|
||||
"tests/test_the_p2_open_requests_history.py": "f292ef4dbb31bfdb755231442679206db87c7d338825324a7d0357c968b7f600",
|
||||
"tests/test_the_page_bytes_reference_compares_decoded_pixels.py": "fef6096a0ec7fd1e564e682300a27e93b0720cedc1725c958b1c38db3dfe3c38",
|
||||
"tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py": "5794b3ecf03990cc6c15c07a6622776507e41ce037be9be7caba7f8dfc75db8d",
|
||||
"tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py": "5374a67658c9c48359c68146b9644fab0d4197ce0424021f294feca2953eb698",
|
||||
"tests/test_the_playwright_browsers_pin_follows_the_pin.py": "870a2e59ae7ff810b3ed759a843ecbaca08521d396ab0def7a0903c6b41e9e73",
|
||||
"tests/test_the_popups_test_helpers.py": "c0aef893d174e3cde3fbf741b09ffa8d058a1d1176a76591cd23f9a909170c91",
|
||||
"tests/test_the_ports_are_one_sequence.py": "8d997db80819dcd8452d64178f3e15910a92ea2b17b82ff12ea95c9f70037688",
|
||||
"tests/test_the_post_publication_files_run_only_in_their_own_round.py": "be772574b9e0f3b1047f37e6a0625f56685dd327d1e326ff37388e62518c144a",
|
||||
"tests/test_the_process_sampler_cannot_miss_a_short_lived_probe.py": "3fd97c048d58f4b70fd96965a25e5a1569a18f67d4f75e3e259e546d8a0ea48c",
|
||||
"tests/test_the_real_sites_runner_imports_its_own_package.py": "ecdf34c87f70a0641e76182c50630066ab5ebe63833161ddda423002365d4961",
|
||||
"tests/test_the_real_sites_workflow.py": "2cd373ab48ab800fb262753b12a718b118bcaa5a84d4dde2a723683a2b29d155",
|
||||
"tests/test_the_realness_helpers.py": "3211aaf9a1f01e03a4efbf9c64c81f183fdfa51d20a157a4976f30945af78fe8",
|
||||
"tests/test_the_registry_collects_the_oldest_like_playwright.py": "188e319115e0c441a7075c342bc30e22378b7f70e889cce09cf1967cf85c1b09",
|
||||
"tests/test_the_registry_rows_carry_the_leg_fields.py": "3e6726020ce7bdff7a695e51fdfaa6b82e6152f83cd3bfb3175917f0ff35ae16",
|
||||
"tests/test_the_remote_server_memory_probe_and_trim.py": "501fcae728a3bee087094493a785872584f20b41b894f984bb4cbd9fb56557de",
|
||||
"tests/test_the_remote_server_serves_the_protocol.py": "8e9f36d9783c015133d12f614d5e97d994d654e1548ffec245e008cded349e1a",
|
||||
"tests/test_the_resolver_trap_counts_its_own_users.py": "74189c33495ca93a33cc6479a77f6c035511ebb77f936169735da6b479c73399",
|
||||
"tests/test_the_resolver_trap_is_required_by_the_gate.py": "862c3da5f21f192c297be545c23eb3c2cf4dfcfea934a286124f08904f221653",
|
||||
"tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py": "a9a0653f3c905fb29b889d558819454d939dc977d06ff29a90d2f897df19381a",
|
||||
"tests/test_the_sandbox_e2e_runs_where_user_namespaces_are_on.py": "d802b43c5a3e103dc167b501f94438e6467b8bd466001f191bbba4a96eaf3e45",
|
||||
"tests/test_the_scheme_is_the_personas_e2e.py": "63143d88c1ee6e368bb7dc302d27a5a19bd39a2faa8dd5e1326582ef5c86939a",
|
||||
"tests/test_the_second_goto_verdicts_see_the_defects.py": "507b462c4b60877fb072807b8b004cb2bbb6d04d55a20b736ff52aaa08fb733e",
|
||||
"tests/test_the_select_twin_says_what_it_clicked_and_where.py": "6a83dc67c363a42da7139d9d6562ba2b5170e2cb3e8ab0089978c9725da4d257",
|
||||
"tests/test_the_server_is_exported_and_the_readme_shows_it.py": "fb666592d1574036c6a3d1536f43605a906eddeb094537064de6b46dcb780df5",
|
||||
"tests/test_the_server_says_nothing_about_the_launch_counter.py": "8132a7c996fee1d93a7680db238dd53e538f2fe30b78b877a2623da68e7a17f4",
|
||||
"tests/test_the_session_files_go_to_the_reaper.py": "8f30c22392ae1a573694e893fbd84bed26951928a2d6736771ebd0735f4c60de",
|
||||
"tests/test_the_session_position_reaches_every_context.py": "2164f0dd6d46260fe7a351c9307833abd255ddcc3261225ddb0905f7e33c6194",
|
||||
"tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py": "56027fa08f2916d0de0a35a2eebb58cf944866eaad52ce515a8b8c43482c9a44",
|
||||
"tests/test_the_socket_process_is_sandboxed_e2e.py": "274af0db09fbc66f58918064ba689c309c1506019638c7ac35bc47ebe364b732",
|
||||
"tests/test_the_stack_watchdog_log_lands_in_the_uploaded_evidence.py": "354865bd11629310868f15423e6143dbf1f24cb7a5f2a31c1bb52d5e9cc6d760",
|
||||
"tests/test_the_stack_watchdog_writes_every_thread_after_its_threshold.py": "2e8bc64ff9ec86eb238f7659c0f30c91433a9facec97cd1e383e931875cb3b20",
|
||||
"tests/test_the_stock_and_retail_browsers_get_a_display_from_the_wrapper.py": "f753ac16f9490af930350388a9eb3b83b0accc27e2c1e694e46cf4c3b61b357a",
|
||||
"tests/test_the_stock_twin_gets_the_display_scale_as_ours_does.py": "5007dc2bf939ba4eceb0864e88eb8c0e1ed57be5cf2bdd3cd2301c82ff10554b",
|
||||
"tests/test_the_stock_twins_do_not_compare_what_stock_decides_by_its_process.py": "92563ce031cd5c77d4b4b4a0d191d5518f99b16238468d5afb8593c98d84c1dd",
|
||||
"tests/test_the_timing_comparisons_run_serially.py": "5232f69f2ebce950d64401432d9de1b76be4e0858cce9101eeede1436585d8e8",
|
||||
"tests/test_the_timing_of_the_e2e_tests_is_the_browsers_not_the_runners.py": "516741ff7057f44bd01334ffd4f99312d32df785ca415ebbb6e4358184c67cea",
|
||||
"tests/test_the_trace_of_a_moved_navigation_is_read_exactly.py": "625d630abcfb54fde94883c7e12df1e2a84301a0abf6f6bc2aaaa6f372fa720d",
|
||||
"tests/test_the_udp_bench_survives_what_a_loaded_machine_does_to_it.py": "6f82661690088942537addeaff558e88bc99c6bf49df441c55f95b12a61a89d1",
|
||||
"tests/test_the_udp_chain_helper.py": "144ea82e740f92e17e615d515b4d40ed7b0088470af89e4ad9bca7f635e26d45",
|
||||
"tests/test_the_udp_line_helpers.py": "e089fb12d8671230d761b0f6e4acff8fe1d47a025028333f2f67edb1fec69f43",
|
||||
"tests/test_the_unit_job_judges_the_exact_counts_of_the_gate.py": "ef4783d0065989518ba3941a6fa746a0eb134e83f61c7cb71f61e3f2181afe72",
|
||||
"tests/test_the_unit_suite_is_accounted_for.py": "5c577bbc78edfd17b802068af3de29a4b95c38956246a9a530505a263ed51b71",
|
||||
"tests/test_the_vendored_bundles_are_listed_with_their_hash.py": "c3fd497a383e7e40c8cfcf90c7b58fd5212259c57b548d3ffe2d7b61993d9fab",
|
||||
"tests/test_the_version_describes_the_code.py": "6db64fe0b6d59c073f5b64ffb0c175260f7552bdb89f61abd70ca6c7b46a9fa5",
|
||||
"tests/test_the_waits_of_the_e2e_tests_end_on_a_condition.py": "4656dd1dcd2065d3f77c797c9b40877cc5e42c8dc53a0b10a0f068a776616f47",
|
||||
"tests/test_the_webgl_reference_launches_run_on_our_gl.py": "a74eef5fa7570395596c39f24cb960b931e7ad60a25d4495a8466b2a302499e2",
|
||||
"tests/test_the_wer_dump_reader_names_the_faulting_module.py": "d6166c318f25b1d018d87a3ceb711c400ececce123a7c76cd8a1c032e41570cb",
|
||||
"tests/test_the_whole_udp_chain_by_name_e2e.py": "f57051acaea9c3daa564b7f5f969182bd0f555709f6419cc285601d41659d9a0",
|
||||
"tests/test_the_wire_is_json.py": "48f89523b0d83f49876cd3eb1f92b50dd36ecf7eb91a939575f9e795d2a6c306",
|
||||
"tests/test_the_witness_hears_a_direct_send.py": "863d5b77c0f3451b830f3d268e9241679505cd4e158daaab13ea0ed77a0b1e93",
|
||||
"tests/test_the_witness_picks_a_port_both_sockets_bind.py": "acc056c825c07eeb71b55af526e4ab7bd40301bfbf0d32c980ba2bd09fff06da",
|
||||
"tests/test_the_working_clone_has_its_hooks_armed.py": "37ba9063c8ba90b7059c3e3ef44d5eee6fe2c10dec49357d64530c1359315bd9",
|
||||
"tests/test_the_working_clone_has_main_to_compare_the_debt.py": "56aa9d2367117b43cd5c64e96205c36f1353b4061d88bbd342f2beedcb6a5e23",
|
||||
"tests/test_the_working_clone_has_the_workbench_next_to_it.py": "eb1cc18021c5f37dc2fbaea0329fea4c2ce0e7172df54cae5659782f8db6c07b",
|
||||
"tests/test_the_x_record_of_the_occlusion_test.py": "c4659cdfaa07b89277b1ec65ab968654f2e00ae26658d3d6c8bfb2fc1f422d77",
|
||||
"tests/test_timeout_zero_is_no_limit.py": "f4b7dc56a2b5840fc6daf0ea1dea22a8d9798d20febf8261a46a5b6e70d1ebaf",
|
||||
"tests/test_trial_does_not_act.py": "5b836b82b7cf3e6f41814d9c6505cba637da2f1740f140eb64a24997826d429a",
|
||||
"tests/test_turn_over_tcp_is_tried_for_real_e2e.py": "2bf090d730807bbf380202f230cbac59da3142bfc87472a448f8ff5239b26354",
|
||||
"tests/test_typing_a_character_without_a_key_e2e.py": "2018dec5589d58ce1cbb320bd2fc2e7372d5bebf092fa24ef6e8c782b3f4f4f4",
|
||||
"tests/test_ua_widget_not_selectable.py": "c9c8af8f6176efce558deca44dc3fb1dbb5d707921f519be52361c0382063aec",
|
||||
"tests/test_upgrade_e2e.py": "283179707e6ed13b03c19b27b981e91415bb267bd9da8eefb2a38a4b8e224bfe",
|
||||
"tests/test_version.py": "b22609f731743835f3f681ed3227aa2e5d8462a166dfd9934440b744344914a6",
|
||||
"tests/test_version_is_not_taken.py": "254661fd419fc5df2957c01238e333e9be32391ff719b9a11292a864f232d8be",
|
||||
"tests/test_virtual_display_start_off_the_loop.py": "0e09954f3b6e9aa0531e21e31a8a90ca42779fc2c48d8db0abe45732ff6b7881",
|
||||
"tests/test_voices_e2e.py": "07452c9e9350bd19162ac88a604ce6ed6455de7ca048a053e00a39329545588e",
|
||||
"tests/test_wait_for_function.py": "007d6818c4fc7a1041f1afb836050f34467c4a33957df7b034e1f7168a41d8f3",
|
||||
"tests/test_wait_for_timeout.py": "9f1ee4b14e315532f4e0e2c113d537ef943ca0a11587b347ccde4f4a33fa9373",
|
||||
"tests/test_web_fonts_of_closed_contexts_e2e.py": "6f0733b723e6a68d11804fe6ad2de7e18bdc97c19ebbbb17c3ee3bcc90b4c531",
|
||||
"tests/test_webgl_declared_parameters_e2e.py": "b6ce01474a4e2aa97ce2d3dd6a663c4384d12c6ce6ff72bbaf23dadc4aca35fa",
|
||||
"tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py": "1820a4fccf1a8f39b4026c1f8919349837ed75d3ab228712b1e12a7a29c049ef",
|
||||
"tests/test_webgl_noise_active.py": "5c6a4a0e99d2924db7cf0e80e2415c3e0aaee3558ab4ec11aae3675c68a4e229",
|
||||
"tests/test_webgl_shader_language_e2e.py": "4a5fae2b709f404823192764d9131dc35843c55413ace9d2cf11315fd3442a97",
|
||||
"tests/test_webgpu_adapter_is_declared_e2e.py": "234ded45e0dd468ca48d18d9f10fb1fbe6f0dfa0b7367ec1f1b6498a5b63660c",
|
||||
"tests/test_webgpu_canvas_readback_is_noised_e2e.py": "ac1cceace5b721beb9bf70b8494994cc19bacd04b3786fbe19c97c1227c4c174",
|
||||
"tests/test_webgpu_external_texture_e2e.py": "b8ff4c99a84684ca1852134e58d66bc40d48314aaa5f226640ede73c4b740f8a",
|
||||
"tests/test_webrtc_realness.py": "e9373bfe4964a702d4f353da12082ba624ba5c0ed74783274490cae338887faa",
|
||||
"tests/test_window_occlusion_e2e.py": "f494b229feb0a0c292c07569f82660126c70aa16b7e4d3493d7929892c6e009a",
|
||||
"tests/test_wire_capture.py": "01822161a6c7da7af9d1f50ebac81f40f6e3bcca9bea7cfb87b61b0d7aef806d",
|
||||
"tests/test_wire_capture_quic.py": "075f3da77c9f38e7101fed6cb535597eed7a5925b355e7e1f00c4f9f980b3517",
|
||||
"tests/unit/test_a_webgl_canvas_that_cannot_be_made_says_why.py": "7ad59247f7d9788e699f476786ee86272dc8ccf731e1b91a14beae1beacd8fee",
|
||||
"tests/unit/test_bfcache_evidence.py": "aac37eae30b4140a84593973486b784b0f48771d4a08ed91bee102ea972f5a7e",
|
||||
"tests/unit/test_config_public.py": "069eafa80209d3f7d7f2d099542c59acef93390185884c7abe50646202ef95c5",
|
||||
"tests/unit/test_engine_at_least.py": "be413dfa62c48677d2685cdf2806f2c7eec2b0b6c84b69d86bac0a87e1511ea3",
|
||||
"tests/unit/test_fontconfig_cache_criterion.py": "117e968a6e52a0765367d9d716ae13d09577000f9438cd17d72d5b45b4b919ae",
|
||||
"tests/unit/test_processes_counts_sites.py": "744bc2c07fb4f33d44e34ae034a4878dbc4fef0a6f15144d96c1b345aa1f1043",
|
||||
"tests/unit/test_the_popup_probe_never_changes_the_outcome.py": "343984cfe680e648abfea0c9a91eef362049f884b0b078d8c1920ad5126cbcbf",
|
||||
"tests/unit/test_the_rebuilt_page_asks_its_new_worker_once.py": "b70ac6e7b98311243754756189d150c59a3afcc89496e9f6f33059b5fc19a10e",
|
||||
"tests/vendor/README.md": "b09ac48aa5ff2e595f3f0991abc968f0b887b787a28c2a731e697889e0ec2db3",
|
||||
"tests/vendor/bot-detector-2.0.0.esm.js": "f438ed251dc7414ece9d4a2b6941441ad9ffae1a1905817f5f0c7366e701dd86",
|
||||
"tests/vendor/fingerprint-library-5.2.0.umd.min.js": "a8de5ead580c42d2e2b01a5752aa08da510852230971aa18554d67cd5de5775b",
|
||||
"tests/vendor/rules-scanner-1.0.6.es.js": "4ae2557e92451687e275877039d4dff4601ad1344c5bc8206e9c7087fbf5e91a",
|
||||
"tests/webfont_probe.py": "2760fe5d0eb510555e8247219940c21ec84c25a07d9f3610238595a122ece76c"
|
||||
}
|
||||
},
|
||||
"sdist_filename": "invisible_playwright-0.61.0.tar.gz",
|
||||
"seal_tag": "",
|
||||
"version": "0.61.0",
|
||||
"wheel": {
|
||||
"digest": "210be8af73dec92e1afebcecf47ec763e0543b3d090bb523708e78dc9fc1fe5f",
|
||||
"files": {
|
||||
"<dist-info>/METADATA": "7d3090b18dc02382c0f4d075af891292a47522c506518f71ff211eec59b3f312",
|
||||
"<dist-info>/WHEEL": "da266b2640c891e0e1d24f528a428ca85b913feb9aea66f822bd40b04478044c",
|
||||
"<dist-info>/entry_points.txt": "f07941bc791c2c31375755627886bfe11ba2d83df7b2522064f84be8299ee3a3",
|
||||
"<dist-info>/licenses/LICENSE": "2abb03e63a96918967f383cbc36e3faefe10a47ae20b2cab43212ef965e02f96",
|
||||
"invisible_playwright/THIRD_PARTY_FORK.md": "d54bd2a4c1e0b4d132d96647f82de205637d1ea0a739a61809b3d7c4048f65d7",
|
||||
"invisible_playwright/__init__.py": "8d0fb7aa787c73bec8140616d9762fa6f672dfe9cb58a6d39dea42c2a429d801",
|
||||
"invisible_playwright/__main__.py": "c6cd277050ead2d11c98b7cbab91ada7d19e495c95e4c86de1f9aaf2b2051d38",
|
||||
"invisible_playwright/_cursor.py": "a30bcac49cb88d2f568764cdf20359bd8b49f1051034dcd7451f161d7237cb46",
|
||||
"invisible_playwright/_engine.py": "5ee84a62eb30ead2632a49840b37cfc1a8bc0d41aef16e95186323085a364f38",
|
||||
"invisible_playwright/_juggler/__init__.py": "96d6d06dad40f3c5112ab2bf9852c9d273ca891647baaf86e9913a06112db829",
|
||||
"invisible_playwright/_juggler/_arguments.py": "244947f5e333010ed22e6680d29209bd6b28b7f8bc59ecace2e87bdf9aae1d16",
|
||||
"invisible_playwright/_juggler/_bindings.py": "3ccfc601acdee9fe67c6de693892ff90d53b60729df1be29f091493a4a3e0c9c",
|
||||
"invisible_playwright/_juggler/_marshal.py": "897e2fbf3868aac8d15ea2a2e01a8fb1bbe74545454bb471abda92c61c3dea72",
|
||||
"invisible_playwright/_juggler/_reaped.py": "81d85cdbcabbe9342486d90c995a27b7c31646936b51e264104acf436d49d453",
|
||||
"invisible_playwright/_juggler/_threads.py": "a790d60fae3815169f2692af3377e62add5ac3ec240fa0dc7e6b52a88c7fa5c0",
|
||||
"invisible_playwright/_juggler/dialogs.py": "5541004829d2484526fc93f11338bfdf9f63f3319e17fc95ea51f61e1b429220",
|
||||
"invisible_playwright/_juggler/dispatcher.py": "a0314cb560c7a01132b81583b146ef693b5610c5b25fc5eb348fe0e247e51511",
|
||||
"invisible_playwright/_juggler/memprobe.py": "b970afd7f877ac3ed631bd8b069000798034e32c1df497ce8102928aa29277d7",
|
||||
"invisible_playwright/_juggler/perimeter.py": "52f0e37b09cdc57b21fc6185a1c339a47b1dcaa866e9068a1cc538b665b2e760",
|
||||
"invisible_playwright/_juggler/pointer.py": "599663876f9a9d516889ecbfc1ba124ebdf501ab5b9de713ec609c93b7abb3b2",
|
||||
"invisible_playwright/_juggler/remote.py": "8429960e508ab23b9de54f47d71a97847e6398c579de5bdf726d3e62f47ae3fe",
|
||||
"invisible_playwright/_juggler/server.py": "dbd76a6133cbba311dffb3a26d67fbb3aee20e7b035d72e61739133b8dbab4a3",
|
||||
"invisible_playwright/_juggler/transport.py": "e928e74fbc49f7cd00ba196c5ba1867cf14b34f5627b8f3ad9a0be8e7e78519a",
|
||||
"invisible_playwright/_juggler/variants.py": "0ad98874f892ba1527be16230160166230aa846c5665bbf02fc0a643279a99c8",
|
||||
"invisible_playwright/_juggler/wire.py": "fbe0399da9896031a104bdbe83a7c24a42dd6c264a23bd65d83e8e5f2be9e840",
|
||||
"invisible_playwright/_pin.py": "34840d65c3ce32aa856f55344358a84cf47904471039a0a28d510166c6feda4b",
|
||||
"invisible_playwright/_pw/LICENSE": "7fab1461b41970ff376f1c9303a637076bfaaeb71cd12dd3a1c44aaf59a1a2b9",
|
||||
"invisible_playwright/_pw/README.md": "3ff2819bfde496151299983c4db167171e3e49933e7cf75613239893b2530570",
|
||||
"invisible_playwright/_pw/__init__.py": "06c3acdadd13e2813fcb95ad91d53ee3885c2b5f473beccc45a579d9ceead70b",
|
||||
"invisible_playwright/_pw/__main__.py": "dcc8e224337e54bb2febd50cc2e3c6db6ad345c2e148fe64612ca64c4dbea469",
|
||||
"invisible_playwright/_pw/_impl/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"invisible_playwright/_pw/_impl/__pyinstaller/__init__.py": "5a8c0cfeb2d84ed4287afdec24ffcec60d1ed827b92afdfbd82b2351ffae1c15",
|
||||
"invisible_playwright/_pw/_impl/__pyinstaller/hook-playwright.async_api.py": "d4a8c45554b3ba55e8102f03f576bab6ea4abfb70cdc60095471d504e34a1014",
|
||||
"invisible_playwright/_pw/_impl/__pyinstaller/hook-playwright.sync_api.py": "d4a8c45554b3ba55e8102f03f576bab6ea4abfb70cdc60095471d504e34a1014",
|
||||
"invisible_playwright/_pw/_impl/_api_structures.py": "7117217bc28b93311e0ded2232935bbb3e71cd36a69ace95faa5b5f019b6186d",
|
||||
"invisible_playwright/_pw/_impl/_artifact.py": "3f06f56db387ad34194b9287291843e32ee6b2fbd06417872085ba5cdf58c3d0",
|
||||
"invisible_playwright/_pw/_impl/_assertions.py": "ebfe537ce1c118606f256cf431d8acc55dbf45cec0ff8ce80b7d08189372d584",
|
||||
"invisible_playwright/_pw/_impl/_async_base.py": "411bdbf2019879b7338bfd11291dab77662c4de8c029ce233f6c8c173845e440",
|
||||
"invisible_playwright/_pw/_impl/_browser.py": "96af02910c9bd02ed3747049e4dc83f792b18ab363257bea5bb63e81335b5098",
|
||||
"invisible_playwright/_pw/_impl/_browser_context.py": "c91c6e44a0dbc4e9c0430807561d9b92a73a3b33c406792a71a1362ccf995e46",
|
||||
"invisible_playwright/_pw/_impl/_browser_type.py": "8e8fab1f8253952f971ea941948292e49fa08038e6566e6164ba1db927f16017",
|
||||
"invisible_playwright/_pw/_impl/_cdp_session.py": "da1f31e66ee6a1a47a77412f6efa3e72670835a81d20a42a939cc6043f4c3357",
|
||||
"invisible_playwright/_pw/_impl/_clock.py": "c3868a4cfdad993d99a554e58742f8c1e9f6806d51199e2870916e6c8b2eea2c",
|
||||
"invisible_playwright/_pw/_impl/_connection.py": "0c345f8afd418c42c9722126b4562009922135df050c076ce279481cc9ae2534",
|
||||
"invisible_playwright/_pw/_impl/_console_message.py": "4adcc1921c9ad348a2f796848b2ce92ab625b3f328ed611ac42d6576fe16ac66",
|
||||
"invisible_playwright/_pw/_impl/_credentials.py": "0d5e2ea044d6a0861de54aae29de5f0da8ef871635384f57a111e2d70cd9843e",
|
||||
"invisible_playwright/_pw/_impl/_debugger.py": "17a425f2c82a798098fe08a0a1b92be5fd7ccce0d56af25a6795e80d33aee2bd",
|
||||
"invisible_playwright/_pw/_impl/_dialog.py": "2061f36b8952cd8fcb74c9a9cc9930c3a600eb1e7f6fa4ef1867867f353d14a6",
|
||||
"invisible_playwright/_pw/_impl/_disposable.py": "564a3c3e3e2c5dc8db07727d682e2fb40c0e113e8489cf7fc179ed4aaea2ac87",
|
||||
"invisible_playwright/_pw/_impl/_download.py": "5349c613615cc690593537acbedc83e5a53fd056521358cacaf2a355238efdd4",
|
||||
"invisible_playwright/_pw/_impl/_element_handle.py": "b922cf771522209192727547185c922e9617f94fe55ae7c37ffa99cadf410a45",
|
||||
"invisible_playwright/_pw/_impl/_errors.py": "49407bd6164ab563f82b2bf37863a265555071544dcabedbf7beba8be1b618cd",
|
||||
"invisible_playwright/_pw/_impl/_event_context_manager.py": "55ea0fab5a17acbb3f6f797610cf20a77efcbc7b62e8c19bac53a138f39c7127",
|
||||
"invisible_playwright/_pw/_impl/_fetch.py": "2756ee00ffb7cf8e178af4d9f8d56ab7d06828fce431faa9318e54a2ade55e1f",
|
||||
"invisible_playwright/_pw/_impl/_file_chooser.py": "3efbf6c96f36cb906508330cb09ef5b5e1843e2b1aa95b27a5f85ec4376c8522",
|
||||
"invisible_playwright/_pw/_impl/_form_data.py": "a9ce4cb4f77a06d24d31ea0e81a0e007a965bf33ad848ebed7cf0ad2f40f36b7",
|
||||
"invisible_playwright/_pw/_impl/_frame.py": "0f974f94f52be86e510552900469c219007ba7a5ec05f3fe3a0d5cb78ff42b81",
|
||||
"invisible_playwright/_pw/_impl/_glob.py": "af927c1cc1a33e12094224ca96158964ce2c7ad9f4b4de3ac60e16e0baf9f887",
|
||||
"invisible_playwright/_pw/_impl/_greenlets.py": "27456c0ecfc181a04a6a1245e0f72549129e3af0b611e60607cb5d29f4fe2634",
|
||||
"invisible_playwright/_pw/_impl/_har_router.py": "24fe3134253de1b71a3738348444dea88b78bdd250851ac7cfdac2ffcdef68b8",
|
||||
"invisible_playwright/_pw/_impl/_helper.py": "c866f0dde846d84856404d7b6c72c5fbd5ac41302b1f6ac043016956256c2812",
|
||||
"invisible_playwright/_pw/_impl/_impl_to_api_mapping.py": "ea1e5b8ea94f344a18a6c049e465d45044cfd61c2ef779887f076e675dffa655",
|
||||
"invisible_playwright/_pw/_impl/_input.py": "14ed52c5e5bda7f5d8bde6b67fd651dee8c368344e13d652178d04e975ea1801",
|
||||
"invisible_playwright/_pw/_impl/_js_handle.py": "cbb76fdf29d5087e2f2d04bac5e729bf7905238a9b386f3be9e01a4e2a95406a",
|
||||
"invisible_playwright/_pw/_impl/_json_pipe.py": "c738956081dee483bbc032707553a9f9b3be38750f2ee7916390fa47fb1b19e8",
|
||||
"invisible_playwright/_pw/_impl/_local_utils.py": "93677e1277ef74efcf52630d98a8857c1ea847b6e16757538040ce49e2758490",
|
||||
"invisible_playwright/_pw/_impl/_locator.py": "c4457bbae669d98530a5bfd717619f8fc801a20c35e2e52e39b4f96193fba708",
|
||||
"invisible_playwright/_pw/_impl/_map.py": "606086b53edc29605a5ff0b22147dfc640e38c65089df790063aed9cb89bfaa7",
|
||||
"invisible_playwright/_pw/_impl/_network.py": "6af15cca7afa486ddb3edcea9ed2fdd2104f6ec268612dedf6707453a0c9433d",
|
||||
"invisible_playwright/_pw/_impl/_object_factory.py": "16cf089afe2a37a18c397ac6cc9aebd296db731b6e6fac2a1248cae09585f26e",
|
||||
"invisible_playwright/_pw/_impl/_page.py": "187b110afac50f94766b0b5b40a82c02b895e723c0000fbee7233deb0e08d11e",
|
||||
"invisible_playwright/_pw/_impl/_path_utils.py": "2c0c34e8c14e04d350044e5ecca4d804b4c5f9191a94c450f58e6a3f9d8bcd1c",
|
||||
"invisible_playwright/_pw/_impl/_playwright.py": "7f1771a504561f108c9e0faa9a44f4e4ab8cc13116bbf2686ea1a3b03ede7d52",
|
||||
"invisible_playwright/_pw/_impl/_screencast.py": "3bbef5e66981e9216f27f83428207f61d33d2e371ce2121d195c9ed646d1001f",
|
||||
"invisible_playwright/_pw/_impl/_selectors.py": "8f480ab03977b1d1d703a5519d195e3f3335e0e644cd559501167f39318db354",
|
||||
"invisible_playwright/_pw/_impl/_set_input_files_helpers.py": "a8863bbe7d98520c8770f51b130c69c259ae629a829e1286588da6b16950377e",
|
||||
"invisible_playwright/_pw/_impl/_str_utils.py": "0ff1b72ae6d0dfefc92939fca4cc0c2dcb7efe4fd8e520c72c630a6bd94b0fe3",
|
||||
"invisible_playwright/_pw/_impl/_stream.py": "0f05ac6e14aa97ae37b68986bee03d656e3b1f92944b8aa42b9ad927df1803fa",
|
||||
"invisible_playwright/_pw/_impl/_sync_base.py": "0bfe9eee479bad5295d7b281f20bb306ed652ef74a5053b14c320995a3187af5",
|
||||
"invisible_playwright/_pw/_impl/_tracing.py": "d88db6cdfedaa54ee6435fb7dd5e89b2906ad409374ec0177d17a2bf344d694b",
|
||||
"invisible_playwright/_pw/_impl/_transport.py": "96def727d12fec006999113563caca190e6f7e25bec81922ea274b552480dcf5",
|
||||
"invisible_playwright/_pw/_impl/_video.py": "f7002004b2c26d072bd108f9539b8e1b698f917be7b17cd30cc7eb3fb373d6d6",
|
||||
"invisible_playwright/_pw/_impl/_waiter.py": "d8cda0d02e1e92674c4c0a3127229ff87ca4ef214c1682daf3b64ad4268240e0",
|
||||
"invisible_playwright/_pw/_impl/_web_error.py": "238b060de72bdf92b54f771622e9e9739b64240d73e7d573c9125f68a28b64a8",
|
||||
"invisible_playwright/_pw/_impl/_web_storage.py": "7f942aee8cc96bd82ea59b3d0839e8b20e4f44f066343e8640e3180fe001ab70",
|
||||
"invisible_playwright/_pw/_impl/_writable_stream.py": "4a4936a37ee5c783f88d7f6c7bfda2850bcc18867a420581ca16c90e1248047e",
|
||||
"invisible_playwright/_pw/_repo_version.py": "d53af84ac37b99e382129383cbd4ae8f2c78798801ced917b9c0b0e23b34f58e",
|
||||
"invisible_playwright/_pw/async_api/__init__.py": "77bbd2c48813238c42211e1470f66bcf82ec31373f89fbe0670b8cba52aae7d6",
|
||||
"invisible_playwright/_pw/async_api/_context_manager.py": "acb8dc6cf148b3347a14ec8377ab269285363592ef3a3e703c3f537e41a21c4c",
|
||||
"invisible_playwright/_pw/async_api/_generated.py": "b0a5713e9b560387b04bf6410c56b231ec90f0dd7e571f58d2af50013d977f18",
|
||||
"invisible_playwright/_pw/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"invisible_playwright/_pw/sync_api/__init__.py": "a99ad0ce7f8511de29e3661e9e2c8b2dd5e8c4a0cfe7731de4428367df00c15e",
|
||||
"invisible_playwright/_pw/sync_api/_context_manager.py": "5bc3c715bedad07533173bd27d6f690f07779ebea3fd49f8ec4bcd896a8aec5e",
|
||||
"invisible_playwright/_pw/sync_api/_generated.py": "7881f3918cdeadd2909f82d36cfd993a54664638adf289cb9eb2e3dbd139f045",
|
||||
"invisible_playwright/_session.py": "cd515bc2f27b42b58a5105a78a0466e321fff37dec2044bc53ecba4981f26dae",
|
||||
"invisible_playwright/_version.py": "101d9ed902fb1a3a806f99f220eb10dd73ca656bd8b02f0c507ec338ef14890b",
|
||||
"invisible_playwright/async_api.py": "51ac8fd3c7b1f7bc3b68af15ba84e3f0688525c33086332058b4fa1ea7a06f97",
|
||||
"invisible_playwright/cli.py": "f8fb408ffdc93f3aeaeb775a454f71c1aa854b4921fc5cc3f618c3890bc4b81d",
|
||||
"invisible_playwright/launcher.py": "af22dcbda32407a6b62d050671e68d8ed9f809500cd4d2a1d895bae9925f6c8d",
|
||||
"invisible_playwright/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"invisible_playwright/sync_api.py": "4c42eacfdd306f1b610a54bb54fcd1cbaef3c20dd525e584d3c587c4a846ea6b"
|
||||
}
|
||||
},
|
||||
"wheel_filename": "invisible_playwright-0.61.0-py3-none-any.whl"
|
||||
}
|
||||
],
|
||||
"schema": 1
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
{
|
||||
"format": "ab-host-expected/1",
|
||||
"differences": [
|
||||
{
|
||||
"id": "gfxtest-69",
|
||||
"os": "linux",
|
||||
"category": "proc",
|
||||
"name": "gfxtest",
|
||||
"published": "present",
|
||||
"candidate": "absent",
|
||||
"reason": "the 69 no longer spawns the graphics probe gfxtest (GFX_PROBE_BINARY, widget/gtk/GfxInfo.cpp:55; commit 0e896e4ee1, the probe never reads the host); the paths only that process touched go with it"
|
||||
}
|
||||
]
|
||||
"differences": []
|
||||
}
|
||||
@@ -0,0 +1,749 @@
|
||||
{
|
||||
"format": "ab-oracle-expected/1",
|
||||
"differences": [
|
||||
{
|
||||
"id": "linux-seed6-state.after_fullscreen.events.mousemove",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
86
|
||||
],
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-state.after_fullscreen.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-state.after_fullscreen.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-state.normal.events.mousemove",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
86
|
||||
],
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-state.normal.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-state.normal.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-surface.visualViewport.height",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.visualViewport.height",
|
||||
"published": 730.4000244140625,
|
||||
"candidate": 731.2000122070312,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: visualViewport.height, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-surface.window.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.window.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed6-surface.window.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.window.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.events.click",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.click",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.events.mousedown",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mousedown",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.events.mousemove",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
],
|
||||
[
|
||||
0,
|
||||
72
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.events.mouseup",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mouseup",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.after_fullscreen.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.events.click",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.click",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.events.mousedown",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mousedown",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.events.mousemove",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
72
|
||||
],
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.events.mouseup",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mouseup",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-state.normal.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-surface.visualViewport.height",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.visualViewport.height",
|
||||
"published": 587.3333129882812,
|
||||
"candidate": 599.3333129882812,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: visualViewport.height, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-surface.window.innerHeight",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.window.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "linux-seed63-surface.window.mozInnerScreenY",
|
||||
"os": "linux",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.window.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.after_fullscreen.events.mousemove",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
86
|
||||
],
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.after_fullscreen.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.after_fullscreen.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.after_fullscreen.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.normal.events.mousemove",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
86
|
||||
],
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.normal.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-state.normal.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "state.normal.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-surface.visualViewport.height",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.visualViewport.height",
|
||||
"published": 730.4000244140625,
|
||||
"candidate": 731.2000122070312,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: visualViewport.height, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-surface.window.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.window.innerHeight",
|
||||
"published": 730,
|
||||
"candidate": 731,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed6-surface.window.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 6,
|
||||
"dpr": 1.25,
|
||||
"leaf": "surface.window.mozInnerScreenY",
|
||||
"published": 85.5999984741211,
|
||||
"candidate": 84.80000305175781,
|
||||
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.events.click",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.click",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.events.mousedown",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mousedown",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.events.mousemove",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
],
|
||||
[
|
||||
0,
|
||||
72
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.events.mouseup",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.events.mouseup",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.after_fullscreen.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.after_fullscreen.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.events.click",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.click",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.events.mousedown",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mousedown",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.events.mousemove",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mousemove",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
],
|
||||
[
|
||||
0,
|
||||
84
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
72
|
||||
],
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.events.mouseup",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.events.mouseup",
|
||||
"published": [
|
||||
[
|
||||
0,
|
||||
85
|
||||
]
|
||||
],
|
||||
"candidate": [
|
||||
[
|
||||
0,
|
||||
73
|
||||
]
|
||||
],
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-state.normal.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "state.normal.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-surface.visualViewport.height",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.visualViewport.height",
|
||||
"published": 587.3333129882812,
|
||||
"candidate": 599.3333129882812,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: visualViewport.height, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-surface.window.innerHeight",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.window.innerHeight",
|
||||
"published": 587,
|
||||
"candidate": 599,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
|
||||
},
|
||||
{
|
||||
"id": "windows-seed63-surface.window.mozInnerScreenY",
|
||||
"os": "windows",
|
||||
"seed": 63,
|
||||
"dpr": 1.5,
|
||||
"leaf": "surface.window.mozInnerScreenY",
|
||||
"published": 84.66666412353516,
|
||||
"candidate": 72.66666412353516,
|
||||
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"id": "D31",
|
||||
"bug": "",
|
||||
"firefox": {
|
||||
"from": "159.0",
|
||||
"to": "159.*"
|
||||
},
|
||||
"signature": {
|
||||
"process": "backgroundtask",
|
||||
"phase": "exit",
|
||||
"thread": "FSBroker",
|
||||
"reason": "MOZ_CRASH(mozilla::detail::MutexImpl::mutexLock: pthread_mutex_lock failed)"
|
||||
},
|
||||
"seen": "oss-invisible/firefox_antidetect_patch/actions/runs/46539190316/job/142310624770",
|
||||
"why": "at the exit of a -backgroundtask process the FSBroker thread unregisters from the profiler after the static destructors ran and locks a destroyed mutex"
|
||||
}
|
||||
]
|
||||
@@ -6,7 +6,7 @@
|
||||
6,
|
||||
63
|
||||
],
|
||||
"core_version": "70.83.0",
|
||||
"core_version": "71.85.0",
|
||||
"counts": {
|
||||
"audio": {
|
||||
"audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2": 4315,
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# Input of the gate lock; `python scripts/ci_py_lock.py` writes it and gate.txt from the sources below. Wrapper-owned (ci-03), read at the wrapper_ref.
|
||||
# python-version: 3.11
|
||||
# exclude-newer: 2026-11-25T00:00:00Z
|
||||
# wrapper: pyproject.toml sha256 64c93d06773cc6573cd062fe67b1c852d2a36b07426ea7076632900eebe956a1 (at generation); its dependencies without invisible_core, and its `dev` extra
|
||||
# core: invisible_core==70.83.0, tag v70.83.0, pyproject.toml sha256 c0d14a4d26d3650005076ab72347eb24fba4b89e643f514e7f7334bd0a2ac174 (at generation); the core is a wheel of ours, only what it depends on is locked
|
||||
# wrapper: pyproject.toml sha256 93d8d0940284352ad53e189e17b9ad6e3109ce52e54ab138ecdfa01d8571b193 (at generation); its dependencies without invisible_core, and its `dev` extra
|
||||
# core: invisible_core==71.85.0, tag v71.85.0, pyproject.toml sha256 c0d14a4d26d3650005076ab72347eb24fba4b89e643f514e7f7334bd0a2ac174 (at generation); the core is a wheel of ours, only what it depends on is locked
|
||||
# core-requires: platformdirs>=4 | psutil>=5.9 | requests[socks]>=2.31 | maxminddb>=2.2 | tzdata>=2024.1
|
||||
# playwright: 1.61.0 from scripts/playwright_pin.txt (the stock client the gate drives the engine with)
|
||||
# cryptography: 44.0.3 (the lab's PKI)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Generated by `python scripts/ci_py_lock.py`: do not edit. Wrapper-owned (ci-03).
|
||||
# input: ci/py-lock/gate.in sha256 fc40deb4a528db91e487756180b44cfc8d6c9a1f64d548c1e8746e1cacf483e9
|
||||
# input: ci/py-lock/gate.in sha256 7de18cd95f842ff5df52b931d6fb2f318936f54b0ff1be1c8d66df1d6706d9df
|
||||
# resolver: uv pip compile --universal --generate-hashes --no-build --python-version 3.11 --exclude-newer 2026-11-25T00:00:00Z
|
||||
# Every file of each version is hashed (Linux and Windows wheels of every Python from 3.11, and the sdist): one lock for every OS.
|
||||
# A consumer installs it with: pip install --no-index --find-links <wheelhouse> --require-hashes -r <this file>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# The PUBLISHED SET, the control side of the A/B oracles (scripts/ci_published_set.py): the last published invisible-playwright and the invisible-core it pins (its seal pins the engine). Written by `python scripts/ci_published_set.py resolve --write`; .github/workflows/published-set.yml keeps it equal to the index.
|
||||
# wrapper-requires: greenlet<4.0.0,>=3.1.1 | psutil>=5.9 | pyee<14,>=13
|
||||
# core-requires: maxminddb>=2.2 | platformdirs>=4 | psutil>=5.9 | requests[socks]>=2.31 | tzdata>=2024.1
|
||||
invisible-core==70.83.0 \
|
||||
--hash=sha256:1dff040e41f5aba5aa07e086328ca436291fddbd31514d1bc9a9dbfc4ba7fb6a \
|
||||
--hash=sha256:f7144262686adf54a4a1c85a8d17f76b31dc4ddcfbd6636d777c5c39963d3293
|
||||
invisible-playwright==0.60.0 \
|
||||
--hash=sha256:00509578944ff0d742761d4d5f19fcde21b7657197fa24ab0718e076ebdf9aa6 \
|
||||
--hash=sha256:7285f5756ad2031087d12f339c2e89b76bdb953449c9151c0edc11a58d96d9c6
|
||||
+16
-13
@@ -7,27 +7,30 @@
|
||||
{"id": "wrapper.e2e.context.egress", "giro": "G2", "os": ["linux", "windows"], "min_tests": 14, "exact": true, "tests": ["tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Taken from the minimal-engine port (branch tests/minimal-port) unchanged but for the removed engine gate: 12 = 6 kinds of page work (hints, image/fetch/WebSocket/EventSource, WebRTC STUN and TURN-udp by name, geolocation, a service worker with push, a page still loading when its context closes) x 2 schemes (no proxy at launch and a gateway on the context; a launch gateway and a different one on the context), and 2 = the TURN server named over TCP in those two schemes. EXPECTED RED on the published firefox-63: the 2 TURN-by-name cases (the lookup of the TCP socket takes user context 0; fixed by commits ac0214bff4 and 058edd6cc6 of firefox-64). The 12 have not run on any engine yet. Like wrapper.e2e.doh: the Linux leg runs as root for the resolver trap (INVPW_REQUIRE_TRAP=1); on Windows the DoH log and the gateway's CONNECTs are the sink."},
|
||||
{"id": "wrapper.e2e.context.sink", "giro": "G2", "os": ["linux", "windows"], "min_tests": 36, "exact": true, "tests": ["tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The behavioural half of the class gate 'nothing of a context leaves but through its proxy', with a witness at an address of this host (no root, no address on lo) and the engine's own resolver log as the native-lookup sink. 35 = 31 + the 4 OCSP cases; the 31 are 19 probes (fetch, WebSocket, stun, turn over UDP, turn and turns over TCP, each by name, by IP and by a .local name, behind SOCKS5 and behind an HTTP proxy where the road differs) + 3 controls (the same probe by IP with no proxy IS heard by the witness) + 1 control of the native sink. + 4 PeerConnections built from a torn-down window (a detached iframe, a closed popup; behind SOCKS5 and behind HTTP; defect B3: EXPECTED RED on firefox-63, green on firefox-64) + 2 controls of them (the same PeerConnection from an attached iframe, green on both). + 2 cases of two contexts alive at once (each with its own proxy and DoH, a TURN server over TCP by a different name in each; behind SOCKS5 EXPECTED RED on firefox-63 like turn_tcp-name-socks5, behind HTTP green on both). EXPECTED RED on firefox-63: turn_tcp-name-socks5, turns_tcp-name-socks5 (user context 0, fixed in firefox-64) and the three .local cases fetch-local-socks5, stun-local-socks5, stun-local-http (audit B4, also red on firefox-64 until decided). The Linux leg runs as root so the resolver trap is a second sink. Windows reads the same engine log (its getaddrinfo lines are in the parent process file under the sandbox: run 43574494194), with the no-proxy native control as its positive control. THE OCSP CASES (4): a TLS page whose leaf, signed by a lab CA the engine trusts (put in the profile by the engine's xpcshell, no ignore_https_errors), names its OCSP responder by a NAME (ocsp-<nonce>.lab.test) and by an IP; a context behind the gateway loads it and the request must go through the gateway, never be looked up natively, in user context 0, or reach the responder (2 cases, EXPECTED RED on firefox-63, green on firefox-64); the same page in a context with no proxy IS asked of the responder (control); a page of an issuer the engine does not trust makes no OCSP request (negative control). THE CLOSED CONTEXT CASE (1, gated firefox-65): a beacon sent on pagehide as a proxied context closes, to a name never looked up, is resolved over the DoH through the context's gateway after the close; on firefox-64 it went to the machine's resolver every time (hunt 43733181674)."},
|
||||
{"id": "wrapper.e2e.realness", "giro": "G2", "os": ["linux", "windows"], "min_tests": 31, "exact": true, "tests": ["tests/test_realness_behind_a_declared_exit_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The realness check without a real proxy: six declared exits, the values a page reads, and the roads. Linux runs as root without xdist like the DoH suite (the resolver trap); on Windows the trap does not exist and the assertion on the system resolver is the only one omitted."},
|
||||
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 273, "exact": true, "tests": ["tests/test_doh_session_prefs_unit.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_the_doh_e2e_launch_on_a_virtual_display.py", "tests/test_the_egress_sink_helpers.py", "tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py", "tests/test_the_fake_doh_answers.py", "tests/test_the_fake_doh_delays_and_refuses.py", "tests/test_the_h3_line_helpers.py", "tests/test_the_host_address_helper.py", "tests/test_the_http_proxy_helper_asks_for_credentials.py", "tests/test_the_lab_ca_and_its_ocsp_leaf.py", "tests/test_the_leak_watcher_sees_a_direct_connection.py", "tests/test_the_network_declaration_reaches_the_engine.py", "tests/test_the_realness_helpers.py", "tests/test_the_resolver_trap_counts_its_own_users.py", "tests/test_the_resolver_trap_is_required_by_the_gate.py", "tests/test_the_server_says_nothing_about_the_launch_counter.py", "tests/test_the_udp_bench_survives_what_a_loaded_machine_does_to_it.py", "tests/test_the_udp_chain_helper.py", "tests/test_the_witness_hears_a_direct_send.py", "tests/test_the_witness_picks_a_port_both_sockets_bind.py"], "marker": "unit", "needs_root": false, "note": "The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
|
||||
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 282, "exact": true, "tests": ["tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_doh_session_prefs_unit.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_the_doh_e2e_launch_on_a_virtual_display.py", "tests/test_the_egress_sink_helpers.py", "tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py", "tests/test_the_fake_doh_answers.py", "tests/test_the_fake_doh_delays_and_refuses.py", "tests/test_the_h3_line_helpers.py", "tests/test_the_host_address_helper.py", "tests/test_the_http_proxy_helper_asks_for_credentials.py", "tests/test_the_lab_ca_and_its_ocsp_leaf.py", "tests/test_the_leak_watcher_sees_a_direct_connection.py", "tests/test_the_network_declaration_reaches_the_engine.py", "tests/test_the_realness_helpers.py", "tests/test_the_resolver_trap_counts_its_own_users.py", "tests/test_the_resolver_trap_is_required_by_the_gate.py", "tests/test_the_server_says_nothing_about_the_launch_counter.py", "tests/test_the_udp_bench_survives_what_a_loaded_machine_does_to_it.py", "tests/test_the_udp_chain_helper.py", "tests/test_the_witness_hears_a_direct_send.py", "tests/test_the_witness_picks_a_port_both_sockets_bind.py"], "marker": "unit", "needs_root": false, "note": "The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
|
||||
{"id": "wrapper.e2e.page", "giro": "G2", "os": ["linux", "windows"], "min_tests": 130, "exact": true, "tests": ["tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py"], "marker": "e2e", "needs_root": false, "note": "130 = 126 + the 4 of test_a_drag_keeps_its_buttons_pressed_e2e.py (a drag reaches the page with the button it holds: event.buttons is 1 on every mousemove of a left drag, 2 on a right one, 0 after the release; with and without humanize). The 126 before it: 116 + the 9 of test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py (four browsers in one process, one closes: the loop is never seen inside a step of the close, the removal of the profile is held still and reached on a thread of the reaper while the close has returned, the other three keep answering; one control holds the loop on purpose, the other leaves it late in its selector and must not be charged). 116 = 100 + the 16 of test_a_page_that_moves_on_e2e.py (a navigation the page overtook with location.replace ends; the engine fix 860ef8a6d9 is proved by it; 2 of them the strict networkidle cases, a document still arriving that moves). 100 counted at the collection; was 96 = 10+32+16+34+4 before the popup tests of 6200bc2). A page is handed over when the engine says Page.ready; a popup reaches the client (link, noopener, window.open; own site and another; with and without a route; in-process and over launch_server) as Playwright's does; a superseded route. Needs the candidate binary, and the stock Playwright client of the dev extra.", "moz_log": "DocumentChannel:5,ProcessIsolation:5,nsDocShell:4,DocLoader:4", "juggler_trace": true},
|
||||
{"id": "wrapper.unit.page", "giro": "G1", "os": ["linux", "windows"], "min_tests": 72, "exact": true, "tests": ["tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_page_number_follows_the_call.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py"], "marker": "unit", "needs_root": false, "note": "72 = 44 + 3+9+5+1+10 of the popup hand-over (24 counted at the collection before; was 20 = 3+8+1+8 before 6200bc2). The page dispatcher's wait for Page.ready and what it hands over; the drive gate goes through the core (the engine waits for the session's road)."},
|
||||
{"id": "wrapper.e2e.compositing", "giro": "G2", "os": ["linux", "windows"], "min_tests": 9, "exact": true, "tests": ["tests/test_software_compositing_is_declared_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The engine DECLARES software compositing on every machine (core: the compositing entries of zoom.stealth.gfx.feature_status carry the VM decision, and on Windows gfx.webrender.software=true, gfx.webrender.software.d3d11=false). 3 = (1) the compositor read from a privileged context is 'WebRender (Software)' on Windows and on Linux (windowUtils.layerManagerType of each window: Troubleshoot.snapshot().graphics throws on this engine, `ext is null`, so it is not the route); (2) the GPU process uses under 1.5 s of CPU on the fixed 10-scene loop of one browser (Windows runner: 0.32 s declared, 2.7-4.2 s not, runs 43652292533 and 43642744101; on Linux it is held to the bound if a GPU process exists); (3) the 86 keys of the page-bytes probe plus the canvas 2D scenes (drawImage scaled with smoothing off/low/medium/high, text with linear/radial/conic gradients) equal tests/data/page_bytes_<os>.json, PNGs on decoded pixels. EXPECTED RED on the core 64.71.0 (tests 1 and 2 on Windows). The reference of Windows holds the 75 stable keys and 6 of the 11 PNG keys of run 43652292533; the five other PNG keys and the new canvas keys, and all of Linux, are written from the first run on the engine of the reference (the failure of test 3 prints RECORD-BEGIN ... RECORD-END with the entries to merge): a reference that is not complete is red, never skipped. 9 = those 3 + the 6 families of tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py (from firefox-66, engine_at_least): a screenshot draws the text of Arial, Times New Roman, Consolas and Segoe UI, with accents, the typographic apostrophe, the euro sign, Chinese, Arabic and Russian, and of MS PGothic (face 2 of msgothic5_32.ttc: Japanese and Latin) and NSimSun (face 1 of simsun.ttc: Chinese), two faces that are not the first of their collection, with the same bytes as the content process drew them in a canvas (an SVG image with a foreignObject of the same markup), cut from the same page.screenshot, on both systems and with no threshold. EXPECTED RED on every engine that rebuilds the text in the parent with another font than the bundle (Linux: fontconfig answers DejaVu Sans), and skipped, hence red here, on an engine older than firefox-66. It saves the screenshot, the two boxes and a result.json under RUNNER_TEMP/invpw-evidence.", "runner_image": {"windows": "windows-2022"}},
|
||||
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 7, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4: every step as stock, and every page left only once its noise is done), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 7 = 3 + 4 (the last two: a `load` that takes 20 s is a step that succeeds, and a `load` that never comes ends in an error that names the wait and the page). Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY).", "stock_firefox": true, "extra_steps": ["fakeweb_profiles"]},
|
||||
{"id": "wrapper.e2e.stock_twin", "giro": "G2", "os": ["linux", "windows"], "min_tests": 20, "exact": true, "tests": ["tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py", "tests/test_a_select_dropdown_opens_at_its_element_e2e.py", "tests/test_a_tooltip_opens_at_the_pointer_e2e.py", "tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The twins of the browser's own popups and of the frame's reads. Two references, one browser at a time, the reference first and ours second, and the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). The select dropdown (4 scales) and the tooltip (4 scales) are measured from chrome scope, against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe). The real drag from the top into a frame of another site (4 scales), what the IntersectionObserver of a scrolled frame of another site reads (8 steps, 4 scales) and when a lazy frame is requested (4 distances, 4 scales) are measured against Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client. 20 = 4 + 4 + 4 + 4 + 4. Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The files are in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
|
||||
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 2, "exact": true, "tests": ["tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the parent of the engine shows <GRE>/fonts to it (FcConfigAppFontAddDir) to rebuild a font from a path and a face index. On Windows DirectWrite opens the file from its path, with no folder to scan and no cache to read, so this test has no Windows counterpart.", "note": "2 = (1) the stand-in that runs the engine under strace stays in the engine's place, as the core launches it (the leader of a process group of its own): a fake engine with a child, no browser; the process the launcher holds lives as long as the fake engine, and the group killed holds strace and the child (the stand-in that exec'd setsid forked and exited 0 at once: candidate 44161687675); (2) the warm launch of the parent reads the bundle from fontconfig's cache and does not scan it again (from firefox-66, engine_at_least). Two launches under strace with the same XDG_CACHE_HOME of the test, the first cold and the second warm: the cold parent opens every font file of <GRE>/fonts (the folder as the disk lists it) before any page and fontconfig writes its cache; the warm parent does not open every one of them, and it opens a *.cache-* file of fontconfig (a few files are opened to be used, so the verdict asks about the whole folder, as a scan does). Scan and drawing are told apart by position: only what the parent opens before the first page counts (the opens that draw are written as after_startup). Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-cache: the interval and the number of opens of the bundle, the names of the files of the bundle each launch opened before the first page, the size of the cache file, the VmRSS of the parent after about:blank and after a page with every family, and a third launch with gfx.bundled-fonts.activate=0 (the behaviour before), which is evidence only. Needs strace on the runner: without it both are red, not skipped. No threshold."},
|
||||
{"id": "wrapper.e2e.stock_twin.dnd", "giro": "G2", "os": ["linux", "windows"], "min_tests": 8, "exact": true, "tests": ["tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py", "tests/test_a_press_outside_an_open_datalist_list_ends_as_on_stock_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one leg. The twin of the real drag from the top into a frame of another site (4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs. Second file: the twin of a press outside the open list of a datalist (4 scales): the list must be open in chrome on both before the press (else BROKEN CONTROL), and the events the page hears and the state of the list after must be the reference's (the leg took 2 minutes with one file).", "stock_firefox": true},
|
||||
{"id": "wrapper.e2e.stock_twin.select", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_select_dropdown_opens_at_its_element_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the select dropdown (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
|
||||
{"id": "wrapper.e2e.stock_twin.tooltip", "giro": "G2", "os": ["linux", "windows"], "min_tests": 6, "exact": true, "tests": ["tests/test_a_tooltip_opens_at_the_pointer_e2e.py", "tests/test_temp_a_listener_of_a_sandbox_world_is_recorded_on_retail_and_on_ours_e2e.py", "tests/test_temp_the_planted_getters_are_recorded_on_retail_and_on_ours_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the tooltip (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs. Second file (TEMPORARY, remove with the control it explains): the plant and the page's own read of the getters planted by tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py, run on retail and on ours, dumped side by side to the evidence folder, no verdict about ours. Third file (TEMPORARY, same): what window.onerror is told when a listener registered from another script world (retail: the default sandbox of Marionette's ExecuteScript; ours: the client's evaluate) throws an Error and a non-error, against the page's own throwing listener as control, for the two listener cases of tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py.", "stock_firefox": true},
|
||||
{"id": "wrapper.e2e.stock_twin.intersection", "giro": "G2", "os": ["linux", "windows"], "min_tests": 8, "exact": true, "tests": ["tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of what the IntersectionObserver of a scrolled frame of another site reads (8 steps, 4 scales) and of when a lazy frame is requested (4 distances, 4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
|
||||
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 9, "exact": true, "tests": ["tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py", "tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the engine runs it on its own empty configuration, and the rules of a user and the files of the host are what these tests try to make reach it. On Windows DirectWrite draws the text from the path of the font, with no rule of a user and no configuration or cache of fonts to read, so these tests have no Windows counterpart.", "note": "7 = (1-3) the fontconfig rules of a user do not reach the pixels of the text a page reads: seven launches of one seed, each with its own system-wide rule file (/etc/fonts/local.conf, written with sudo before the launch and put back after it; not the environment, which the core owns: it strips FONTCONFIG_*, and points XDG_CONFIG_HOME and XDG_CONFIG_DIRS at empty folders): nothing; rgba=none with lcdfilter=lcdnone; rgba=bgr; embeddedbitmap=false; autohint=true; hintstyle=hintfull with antialias=false; a strong prepend rule on system-ui. fc-match, in the same environment, must show each rule in force (a launch that measures nothing is red). Three tests: every rule in force in fc-match on the host; the hashes of the pixels of getImageData (an opaque canvas and the default one, Arial, SimSun, MS Gothic at 9-16 px) equal to those of the launch with nothing; the computed family and the widths of system-ui equal. (4-7) no fontconfig file of the host is opened and the screenshot draws the bundle: the stand-in that runs the engine under strace stays in the engine's place (a fake engine with a child, no browser); the caches $HOME/.fontconfig and $XDG_CACHE_HOME/fontconfig hold a valid cache of the bundle that lacks msgothic5_32.ttc (fc-list proves it); under strace no process opens a path under /etc/fonts, a fonts.conf or a *.cache-* file; the screenshot of Japanese text in MS PGothic equals the content's own drawing. Needs strace, fc-cache, fc-list, fc-match and sudo without a password on the runner: without them the tests are red, not skipped. Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-rules and fontconfig-host-files. Also in the row until the 72 is released: the old file of the warm-cache test (2 tests, same ids), rewritten to assert the 72's behaviour: the stand-in, and two launches with the same XDG_CACHE_HOME and HOME under strace write no fontconfig cache file (*.cache-*, .NEW, .TMP-*) and no process opens one. E1 and E2 replace it; its retirement entry goes to main after the release of the 72."},
|
||||
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 4057, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_windows_job_keeps_a_dump_of_a_crashing_python.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_reportLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 4061, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_every_windows_job_keeps_a_dump_of_a_crashing_python.py", "tests/test_every_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_reLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 4595, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.py", Line truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 4607, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.pLine truncated
|
||||
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode).", "core_dumps": "invpw-cores"},
|
||||
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 447, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_throuLine truncated
|
||||
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 414, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 564 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapLine truncated
|
||||
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 333, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py", "tests/test_webgpu_external_texture_e2e.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.3", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 565 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on linux (a skip is red in the verdict).", "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 463, "exact": true, "tests": ["tests/test_a_click_under_the_login_autocomplete_list_reaches_the_page_e2e.py", "tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_press_on_an_open_select_follows_windows_rollup_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py", "tests/test_no_popup_is_left_when_a_page_closes_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of Line truncated
|
||||
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 396, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_page_sees_no_pointer_event_before_the_first_input_on_the_hidden_display_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py", "tests/test_webgpu_external_texture_e2e.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.3", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 565 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on linux (a skip is red in the verdict).", "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.1", "giro": "G2", "os": ["windows"], "min_tests": 332, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_detectors_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_ignore_https_errors_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_transport.py", "tests/test_keyboard_rhythm.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_workers_blocked.py", "tests/test_strict_and_force.py", "tests/test_the_engine_is_born_in_the_job_e2e.py", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_ua_widget_not_selectable.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 1 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 286, "exact": true, "tests": ["tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_declared_host_network_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_expose_binding_e2e.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_desktop.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_oop_frame_geometry.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_e2e.py", "tests/test_screencast_stop_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 276, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 293, "exact": true, "tests": ["tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_injected_node_surface.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_juggler_connection.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_oop_frame_element.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_scroll_into_view.py", "tests/test_shadow_trusted_input.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 327, "exact": true, "tests": ["tests/test_a_click_under_the_login_autocomplete_list_reaches_the_page_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_press_on_an_open_select_follows_windows_rollup_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_declared_host_network_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_expose_binding_e2e.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_desktop.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_no_popup_is_left_when_a_page_closes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_oop_frame_geometry.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_e2e.py", "tests/test_screencast_stop_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the fLine truncated
|
||||
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 299, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_page_sees_no_pointer_event_before_the_first_input_on_the_hidden_display_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 334, "exact": true, "tests": ["tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_injected_node_surface.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_juggler_connection.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_oop_frame_element.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_scroll_into_view.py", "tests/test_shadow_trusted_input.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.suite.windows.control_a", "giro": "G2", "os": ["windows"], "min_tests": 20, "exact": true, "tests": ["tests/test_control_a_selects_all_in_a_field_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "The keyboard shortcut Control+A selects all in a field (5 ways to press it x an input and a textarea, in-process and served to the stock client), alone on its own Windows runner (windows-latest), as e2e.yml runs it on the published engine: the Windows keyboard of a real user is what it needs. The same file is in one of wrapper.e2e.suite.windows.1..4 and in wrapper.e2e.suite.linux.1.", "run": "suite_run"},
|
||||
{"id": "wrapper.e2e.ab_oracle", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_oracle_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Same seed, same bytes: the engine published as firefox-68 against the candidate, on one machine, with the same core and wrapper, after the control: the published engine against ITSELF (the A/A; a difference is a broken control, exit 2, and the A/B is not run). On a pull request (no candidate: INVPW_BINARY_PATH is the published engine, no INVISIBLE_SEAL_FILE) the A/A is the whole test, on the first two seeds of the candidate set (all five when the pull request changes a file of this oracle: the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py exports AB_ORACLE_PR_SEEDS), and saves both dumps and the diff under $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. scripts/ci_ab_oracle.py runs the host gate's dump (scripts/ci_host_gate.py dump: the persona seeds of ci/persona-seeds.json, each at its own DPR with nothing pinned, the whole page of scripts/host_gate; the `candidate` set of 5 seeds that reach every webgl renderer and every DPR, or with AB_ORACLE_SEED_SET=final and AB_ORACLE_SHARD=i/n the 20 seeds that reach every value of every dimension split over n jobs) twice, once with the firefox-68 binary (the release's seal.json, then the core's own download.ensure_binary under that seal: the archive's sha256 is checked against the seal) and once with the candidate binary of the leg under its own seal, and compares every leaf of every visit: the only differences allowed are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys; anything else is red with the leaf, the two values and the seed; fewer leaves than the host gate's reference holds (16439 per visit; a DPR the reference does not record is held to the least of those it does) is red. The files (dump-68.json, dump-68-again.json, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) are the artifact ab-oracle-<os> of the leg. 1 = the one test; the comparator's own cases (51, the A/A's among them) are in tests/test_ab_oracle.py, the persona seeds' (15) in tests/test_persona_cover.py, in the rows of the whole unit suite. Needs the engine's binary (INVPW_BINARY_PATH) and, for the A/B, the candidate's seal (INVISIBLE_SEAL_FILE) and the network (the release assets of firefox-68). The engine of the candidate must accept the core of the leg and the 68 engine must accept it too: a core that declares something the published engine refuses is a red of this suite, not of the engine.", "timeout_minutes": 50, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"], "artifact": "ab-oracle"},
|
||||
{"id": "wrapper.e2e.ab_network", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_network_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Network A/B oracle: the P4 journey, HTTPS h1/h2 (ClientHello, h2 frames, header order), HTTP/3 (transport parameters, H3 SETTINGS), WebRTC through the coherent SOCKS5 lab gateway, DNS through the fake DoH, and an idle launch; transcripts compared leaf by leaf, direct connections red on either side. A/A first (the published engine twice: a difference is a broken control; ci/ab-network-volatile.json holds the leaves the A/A proved volatile, and may only shrink), then the published engine against the candidate. Without a candidate (a PR's e2e) the A/A alone, on the first seed (all five when the pull request changes a file of this oracle: AB_NETWORK_PR_SEEDS), in jobs of its own in e2e.yml on Linux and on Windows (the shared e2e jobs leave this file out).", "timeout_minutes": 75, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]},
|
||||
{"id": "wrapper.e2e.ab_host", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_host_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Host A/B oracle: the whole TRACE of a closed run, from the launch to the exit of the browser, after the same journey. Compared: the processes by kind (the parent, -contentproc type, sandboxingKind, isForBrowser, the helpers by what they ran) with their count, except for the kinds of type tab whose count follows the idle time (only their presence counts), and the host paths the tree touched, judged by one rule (red if and only if a path is in all the measured launches of one engine and in no launch of the other, the long launches included; every other path that differs is listed in not-judged.json, not judged); what is ours (the package, the profile and temp dirs of the launch, the run cache, its own shared memory) leaves the comparison as a class. Linux: strace of the whole tree. Windows: the process-creation audit (event 4688, with the command line) and an ETW file trace of Kernel-File, which need an administrator. It has jobs of its own in e2e.yml on Linux and on Windows (a measurement shares the machine with no other browser), and its footprints keep the lifecycle of the tree (who started and ended when, how) and how the close ended. Each engine run starts with a discarded warm-up launch whose trace is kept and listed apart (what only the warm-up did, with the process that did it); only the tree of the launch is compared (a Windows service's paths are counted by process name and left out), and a path or a kind that differs names the processes to blame. A/A first, then the published engine against the candidate; the one declared difference (Linux glxtest, gone on the 69) is in ci/ab-host-expected.json, applied by kind, a list that may only shrink. There is no list of noise. Without a candidate (a PR e2e) the A/A alone, on the first two seeds (all five when the pull request changes a file of this oracle: AB_HOST_PR_SEEDS).", "runner_image": {"windows": "windows-2022"}, "timeout_minutes": 50, "core_dumps": "cores", "stock_firefox": ["windows"], "location_service": ["windows"], "extra_steps": ["keep_oracle_files"]},
|
||||
{"id": "wrapper.e2e.ab_oracle", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_oracle_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Same seed, same bytes: the engine of the published set (the last published engine, with its own core and wrapper) against the candidate (with core_ref and wrapper_ref), on one machine, after the control: the published engine against ITSELF (the A/A; a difference is a broken control, exit 2, and the A/B is not run). On a pull request (no candidate: INVPW_BINARY_PATH is the published engine, no INVISIBLE_SEAL_FILE) the A/A is the whole test, on the first two seeds of the candidate set (all five when the pull request changes a file of this oracle: the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py exports AB_ORACLE_PR_SEEDS), and saves both dumps and the diff under $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. scripts/ci_ab_oracle.py runs the host gate's dump (scripts/ci_host_gate.py dump: the persona seeds of ci/persona-seeds.json, each at its own DPR with nothing pinned, the whole page of scripts/host_gate; the `candidate` set of 5 seeds that reach every webgl renderer and every DPR, or with AB_ORACLE_SEED_SET=final and AB_ORACLE_SHARD=i/n the 20 seeds that reach every value of every dimension split over n jobs) twice, once with the published engine (fetched by the published set's own core under its own seal, which checks the archive's sha256, and dumped in that set's venv) and once with the candidate binary of the leg under its own seal, and compares every leaf of every visit: the only differences allowed are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys; anything else is red with the leaf, the two values and the seed; fewer leaves than the host gate's reference holds (16439 per visit; a DPR the reference does not record is held to the least of those it does) is red. The files (dump-<N>.json, dump-<N>-again.json for the tag of the published set, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) are the artifact ab-oracle-<os> of the leg. 1 = the one test; the comparator's own cases (51, the A/A's among them) are in tests/test_ab_oracle.py, the persona seeds' (15) in tests/test_persona_cover.py, in the rows of the whole unit suite. Needs the engine's binary (INVPW_BINARY_PATH) and, for the A/B, the candidate's seal (INVISIBLE_SEAL_FILE) and the network (the release assets of the published engine, and INVPW_PUBLISHED_PYTHON). Each engine runs with the core it was built for: a core that declares less than the published engine requires is no longer a red of this suite (it was: engine candidate 5, every A/B a broken control). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "timeout_minutes": 50, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"], "artifact": "ab-oracle"},
|
||||
{"id": "wrapper.e2e.ab_network", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_network_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Network A/B oracle: the P4 journey, HTTPS h1/h2 (ClientHello, h2 frames, header order), HTTP/3 (transport parameters, H3 SETTINGS), WebRTC through the coherent SOCKS5 lab gateway, DNS through the fake DoH, and an idle launch; transcripts compared leaf by leaf, direct connections red on either side. A/A first (the published engine twice: a difference is a broken control; ci/ab-network-volatile.json holds the leaves the A/A proved volatile, and may only shrink), then the published engine against the candidate. Without a candidate (a PR's e2e) the A/A alone, on the first seed (all five when the pull request changes a file of this oracle: AB_NETWORK_PR_SEEDS), in jobs of its own in e2e.yml on Linux and on Windows (the shared e2e jobs leave this file out). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "timeout_minutes": 75, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]},
|
||||
{"id": "wrapper.e2e.ab_host", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_host_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Host A/B oracle: the whole TRACE of a closed run, from the launch to the exit of the browser, after the same journey. Compared: the processes by kind (the parent, -contentproc type, sandboxingKind, isForBrowser, the helpers by what they ran) with their count, except for the kinds of type tab whose count follows the idle time (only their presence counts), and the host paths the tree touched, judged by one rule (red if and only if a path is in all the measured launches of one engine and in no launch of the other, the long launches included; every other path that differs is listed in not-judged.json, not judged); what is ours (the package, the profile and temp dirs of the launch, the run cache, its own shared memory) leaves the comparison as a class. Linux: strace of the whole tree. Windows: the process-creation audit (event 4688, with the command line) and an ETW file trace of Kernel-File, which need an administrator. It has jobs of its own in e2e.yml on Linux and on Windows (a measurement shares the machine with no other browser), and its footprints keep the lifecycle of the tree (who started and ended when, how) and how the close ended. Each engine run starts with a discarded warm-up launch whose trace is kept and listed apart (what only the warm-up did, with the process that did it); only the tree of the launch is compared (a Windows service's paths are counted by process name and left out), and a path or a kind that differs names the processes to blame. A/A first, then the published engine against the candidate; the one declared difference (Linux glxtest, gone on the 69) is in ci/ab-host-expected.json, applied by kind, a list that may only shrink. There is no list of noise. Without a candidate (a PR e2e) the A/A alone, on the first two seeds (all five when the pull request changes a file of this oracle: AB_HOST_PR_SEEDS). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "runner_image": {"windows": "windows-2022"}, "timeout_minutes": 50, "core_dumps": "cores", "stock_firefox": ["windows"], "location_service": ["windows"], "extra_steps": ["keep_oracle_files"]},
|
||||
{"id": "wrapper.e2e.ab_host_crash", "giro": "G2", "os": ["linux"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_host_crash_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "A signal sent to the parent of the browser with os.kill, the core the kernel writes and gdb reads, and the signal line of strace exist on Linux only: Windows has no counterpart of this test. What a Windows launch that did not end with 0 leaves (the `.extra` files and the minidump names, read from the crash folders) is held by the unit tests of the recorder with fake launches, and by every Windows leg of the three oracles, which are red on any parent that does not end with 0.", "note": "The recorder of the host oracle, tested on a launch that dies on purpose: scripts/ci_ab_host.py crash-probe launches the engine once under the oracle's stand-in (strace of the tree, cores enabled, a crash watcher), sends SIGSEGV to the browser's parent with os.kill and closes it as the oracle closes its launches; the test passes when the oracle reports RED (exit 1, `FAIL the parent process exited with code ...: seed N, launch crash`) and the artifact (RUNNER_TEMP/invpw-evidence/ab-host-crash) holds the signal line of the strace log (strace-signals.txt, strace-tail.txt), the core run through gdb (gdb-core.*.txt: `thread apply all bt`, the MOZ_CRASH reason, `info sharedlibrary`), the build ids and what the collectors did not find (said.txt). It fails when the oracle says green for a launch that died, when the evidence is missing and when the probe did not run; the red of the probe does not make the job red. It runs in the job of the host oracle on Linux (e2e-host: strace, gdb and elfutils installed, kernel.core_pattern pointed at INVPW_CORE_DIR), after the A/A, and is left out of the shared e2e job (OWN_JOB_FILES).", "timeout_minutes": 35, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]}
|
||||
]
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"about": "What retail Firefox on Windows reads on a password field in the page tests/data/password_mask_page.html (the width of 40 x 'a' in Arial 16px, which is 40 times the advance of the mask character), extracted by scripts/extract_retail_password_mask.py. Never edited by hand.",
|
||||
"capture": {
|
||||
"folder": "captures/firefox-159.0/windows-server-2025/password-mask/2026-12-02",
|
||||
"retail_captures_commit": "e81da117a01c8d05b00beb62cd544dc057d40f85",
|
||||
"run": "https://github.com/oss-invisible/core/actions/runs/46769343558",
|
||||
"browser": {
|
||||
"firefox_version": "159.0",
|
||||
"build_id": "20261022150525",
|
||||
"installer_sha256": "8776887b79925abbdd407fcdfe257d8382b54e24be52a6466426b95a804d6790",
|
||||
"firefox_exe_sha256": "d8b5ed82fcd9c0f159dc86dc1c4526ceae981c4d9651f21908b6de90d0a56d85",
|
||||
"xul_dll_sha256": "fec21f3e7c281c836ff4fb9658bf321857e101750bc4a6280d1b419996ce7e29"
|
||||
},
|
||||
"host": {
|
||||
"runner_image": "windows-2025",
|
||||
"os_version": "10.0.26100",
|
||||
"os_ubr": "33828"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"path": "result.json",
|
||||
"sha256": "980ac7f4ee06ffeef80c3aa3ddb594216b30c4b221b43156b1fa39f92153571a"
|
||||
},
|
||||
{
|
||||
"path": "meta.json",
|
||||
"sha256": "3ecefececdca063d84b48f7bb8905039077356b5c6c46e59e2a7551e1bdaf2ad"
|
||||
}
|
||||
],
|
||||
"page": {
|
||||
"path": "tests/data/password_mask_page.html",
|
||||
"sha256": "4b0c454f723392003e75325036effc576627a71f29c8d82cb01033a963e8de2a"
|
||||
},
|
||||
"n": 40,
|
||||
"cases": {
|
||||
"arial16": {
|
||||
"password_scrollWidth": 387,
|
||||
"mask": "U+25CF",
|
||||
"devicePixelRatio": 1,
|
||||
"platform": "Win32"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,541 @@
|
||||
{
|
||||
"about": "What retail Firefox reads in a popup opened from a maximized main window, per display case and feature string, extracted by scripts/extract_retail_popup_sizes.py. Never edited by hand.",
|
||||
"capture": {
|
||||
"round": "2026-12-01-window-geometry-r12",
|
||||
"run": "https://github.com/oss-invisible/core/actions/runs/46545487209",
|
||||
"retail_captures_commit": "ef2250dee8704d3023c36661e39ea9525fe41a04",
|
||||
"browser": {
|
||||
"firefox_version": "159.0",
|
||||
"build_id": "20261022150525",
|
||||
"installer_sha256": "8776887b79925abbdd407fcdfe257d8382b54e24be52a6466426b95a804d6790"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"path": "dpr1/1920x1080/a/raw.json",
|
||||
"sha256": "1e4413e6e06ff1a8fc49eba8d87cd2c1e3642550bd67242fcd8ebd03777baf6a"
|
||||
},
|
||||
{
|
||||
"path": "dpr1/1920x1080/b/raw.json",
|
||||
"sha256": "ee2d4d2b60dea8e56450fca62446a5c3135e358b6f47ead030b55eea174a35a8"
|
||||
},
|
||||
{
|
||||
"path": "dpr1.25/1920x1080/a/raw.json",
|
||||
"sha256": "440d03adc9782905764e34e983c202f816d79059e81f298316e7a0d9d19f29ab"
|
||||
},
|
||||
{
|
||||
"path": "dpr1.25/1920x1080/b/raw.json",
|
||||
"sha256": "4110bbc9b49f5f5c47b340b4a3e6f91328fe14f10247f888fbb301f9f3ff6f80"
|
||||
},
|
||||
{
|
||||
"path": "dpr1.5/1920x1080/a/raw.json",
|
||||
"sha256": "69ba9333f235aab0cf6ef86ddf14f076d67e23aec22616b5a95dabd67680a19f"
|
||||
},
|
||||
{
|
||||
"path": "dpr1.5/1920x1080/b/raw.json",
|
||||
"sha256": "ac9200c9ed122b35ba448149f08e2a560b868e80e20fa92fc2864a3b3856a1f3"
|
||||
},
|
||||
{
|
||||
"path": "dpr2/1600x1200/a/raw.json",
|
||||
"sha256": "947921aac122dd18dab3227b83b47146a9016ac5591adaa956a6bd11d9c3aa64"
|
||||
},
|
||||
{
|
||||
"path": "dpr2/1600x1200/b/raw.json",
|
||||
"sha256": "7566628ff7822d7de6d9233cb4d2e94e3d129fd79df6920dd39cee3c96c07dac"
|
||||
}
|
||||
],
|
||||
"csv_checked": {
|
||||
"path": "WINDOW_GEOMETRY_POPUP_FRAME.csv",
|
||||
"sha256": "205b2f62aa4d721967a011738fefb505e6a09bfc79e014d2479010756ed2ea77"
|
||||
},
|
||||
"cases": {
|
||||
"1920x1080-dpr1.0": {
|
||||
"width=500,height=400": {
|
||||
"inner": [
|
||||
500,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
516,
|
||||
480
|
||||
],
|
||||
"screen": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"vv_height": 400
|
||||
},
|
||||
"popup": {
|
||||
"inner": [
|
||||
1920,
|
||||
968
|
||||
],
|
||||
"outer": [
|
||||
1936,
|
||||
1048
|
||||
],
|
||||
"screen": [
|
||||
-8,
|
||||
-8
|
||||
],
|
||||
"vv_height": 968
|
||||
},
|
||||
"width=500": {
|
||||
"inner": [
|
||||
500,
|
||||
856
|
||||
],
|
||||
"outer": [
|
||||
516,
|
||||
936
|
||||
],
|
||||
"screen": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"vv_height": 856
|
||||
},
|
||||
"height=400": {
|
||||
"inner": [
|
||||
1280,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
1296,
|
||||
480
|
||||
],
|
||||
"screen": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"vv_height": 400
|
||||
},
|
||||
"width=300,height=200": {
|
||||
"inner": [
|
||||
300,
|
||||
200
|
||||
],
|
||||
"outer": [
|
||||
316,
|
||||
280
|
||||
],
|
||||
"screen": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"vv_height": 200
|
||||
},
|
||||
"width=800,height=600": {
|
||||
"inner": [
|
||||
800,
|
||||
600
|
||||
],
|
||||
"outer": [
|
||||
816,
|
||||
680
|
||||
],
|
||||
"screen": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"vv_height": 600
|
||||
},
|
||||
"left=100,top=100": {
|
||||
"inner": [
|
||||
1280,
|
||||
856
|
||||
],
|
||||
"outer": [
|
||||
1296,
|
||||
936
|
||||
],
|
||||
"screen": [
|
||||
100,
|
||||
96
|
||||
],
|
||||
"vv_height": 856
|
||||
},
|
||||
"left=5000,top=5000": {
|
||||
"inner": [
|
||||
1280,
|
||||
856
|
||||
],
|
||||
"outer": [
|
||||
1296,
|
||||
936
|
||||
],
|
||||
"screen": [
|
||||
624,
|
||||
96
|
||||
],
|
||||
"vv_height": 856
|
||||
}
|
||||
},
|
||||
"1920x1080-dpr1.25": {
|
||||
"width=500,height=400": {
|
||||
"inner": [
|
||||
500,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
514,
|
||||
478
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 400
|
||||
},
|
||||
"popup": {
|
||||
"inner": [
|
||||
1536,
|
||||
752
|
||||
],
|
||||
"outer": [
|
||||
1550,
|
||||
830
|
||||
],
|
||||
"screen": [
|
||||
-7,
|
||||
-7
|
||||
],
|
||||
"vv_height": 752
|
||||
},
|
||||
"width=500": {
|
||||
"inner": [
|
||||
500,
|
||||
662
|
||||
],
|
||||
"outer": [
|
||||
514,
|
||||
741
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 662.4000244140625
|
||||
},
|
||||
"height=400": {
|
||||
"inner": [
|
||||
1280,
|
||||
401
|
||||
],
|
||||
"outer": [
|
||||
1294,
|
||||
479
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 400.79998779296875
|
||||
},
|
||||
"width=300,height=200": {
|
||||
"inner": [
|
||||
300,
|
||||
200
|
||||
],
|
||||
"outer": [
|
||||
314,
|
||||
278
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 200
|
||||
},
|
||||
"width=800,height=600": {
|
||||
"inner": [
|
||||
800,
|
||||
600
|
||||
],
|
||||
"outer": [
|
||||
814,
|
||||
678
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 600
|
||||
},
|
||||
"left=100,top=100": {
|
||||
"inner": [
|
||||
1280,
|
||||
662
|
||||
],
|
||||
"outer": [
|
||||
1294,
|
||||
741
|
||||
],
|
||||
"screen": [
|
||||
100,
|
||||
75
|
||||
],
|
||||
"vv_height": 662.4000244140625
|
||||
},
|
||||
"left=5000,top=5000": {
|
||||
"inner": [
|
||||
1280,
|
||||
662
|
||||
],
|
||||
"outer": [
|
||||
1294,
|
||||
741
|
||||
],
|
||||
"screen": [
|
||||
242,
|
||||
75
|
||||
],
|
||||
"vv_height": 662.4000244140625
|
||||
}
|
||||
},
|
||||
"1920x1080-dpr1.5": {
|
||||
"width=500,height=400": {
|
||||
"inner": [
|
||||
500,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
515,
|
||||
478
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 400
|
||||
},
|
||||
"popup": {
|
||||
"inner": [
|
||||
1280,
|
||||
609
|
||||
],
|
||||
"outer": [
|
||||
1295,
|
||||
687
|
||||
],
|
||||
"screen": [
|
||||
-7,
|
||||
-7
|
||||
],
|
||||
"vv_height": 608.6666870117188
|
||||
},
|
||||
"width=500": {
|
||||
"inner": [
|
||||
501,
|
||||
533
|
||||
],
|
||||
"outer": [
|
||||
515,
|
||||
611
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 533.3333129882812
|
||||
},
|
||||
"height=400": {
|
||||
"inner": [
|
||||
1153,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
1168,
|
||||
478
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 400
|
||||
},
|
||||
"width=300,height=200": {
|
||||
"inner": [
|
||||
300,
|
||||
200
|
||||
],
|
||||
"outer": [
|
||||
315,
|
||||
278
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
3
|
||||
],
|
||||
"vv_height": 200
|
||||
},
|
||||
"width=800,height=600": {
|
||||
"inner": [
|
||||
800,
|
||||
594
|
||||
],
|
||||
"outer": [
|
||||
815,
|
||||
672
|
||||
],
|
||||
"screen": [
|
||||
3,
|
||||
0
|
||||
],
|
||||
"vv_height": 594
|
||||
},
|
||||
"left=100,top=100": {
|
||||
"inner": [
|
||||
1153,
|
||||
533
|
||||
],
|
||||
"outer": [
|
||||
1168,
|
||||
611
|
||||
],
|
||||
"screen": [
|
||||
100,
|
||||
61
|
||||
],
|
||||
"vv_height": 533.3333129882812
|
||||
},
|
||||
"left=5000,top=5000": {
|
||||
"inner": [
|
||||
1153,
|
||||
533
|
||||
],
|
||||
"outer": [
|
||||
1168,
|
||||
611
|
||||
],
|
||||
"screen": [
|
||||
112,
|
||||
61
|
||||
],
|
||||
"vv_height": 533.3333129882812
|
||||
}
|
||||
},
|
||||
"1600x1200-dpr2.0": {
|
||||
"width=500,height=400": {
|
||||
"inner": [
|
||||
500,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
513,
|
||||
476
|
||||
],
|
||||
"screen": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"vv_height": 399.5
|
||||
},
|
||||
"popup": {
|
||||
"inner": [
|
||||
800,
|
||||
489
|
||||
],
|
||||
"outer": [
|
||||
813,
|
||||
565
|
||||
],
|
||||
"screen": [
|
||||
-6,
|
||||
-6
|
||||
],
|
||||
"vv_height": 488.5
|
||||
},
|
||||
"width=500": {
|
||||
"inner": [
|
||||
500,
|
||||
428
|
||||
],
|
||||
"outer": [
|
||||
513,
|
||||
504
|
||||
],
|
||||
"screen": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"vv_height": 427.5
|
||||
},
|
||||
"height=400": {
|
||||
"inner": [
|
||||
720,
|
||||
400
|
||||
],
|
||||
"outer": [
|
||||
733,
|
||||
476
|
||||
],
|
||||
"screen": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"vv_height": 399.5
|
||||
},
|
||||
"width=300,height=200": {
|
||||
"inner": [
|
||||
300,
|
||||
200
|
||||
],
|
||||
"outer": [
|
||||
313,
|
||||
276
|
||||
],
|
||||
"screen": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"vv_height": 199.5
|
||||
},
|
||||
"width=800,height=600": {
|
||||
"inner": [
|
||||
787,
|
||||
476
|
||||
],
|
||||
"outer": [
|
||||
800,
|
||||
552
|
||||
],
|
||||
"screen": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"vv_height": 475.5
|
||||
},
|
||||
"left=100,top=100": {
|
||||
"inner": [
|
||||
720,
|
||||
428
|
||||
],
|
||||
"outer": [
|
||||
733,
|
||||
504
|
||||
],
|
||||
"screen": [
|
||||
67,
|
||||
48
|
||||
],
|
||||
"vv_height": 427.5
|
||||
},
|
||||
"left=5000,top=5000": {
|
||||
"inner": [
|
||||
720,
|
||||
428
|
||||
],
|
||||
"outer": [
|
||||
733,
|
||||
504
|
||||
],
|
||||
"screen": [
|
||||
67,
|
||||
48
|
||||
],
|
||||
"vv_height": 427.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "invisible_playwright"
|
||||
version = "0.60.0"
|
||||
version = "0.61.0"
|
||||
description = "Playwright wrapper for a patched Firefox with deterministic stealth profile."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
@@ -69,7 +69,7 @@ dependencies = [
|
||||
# metadata; nothing in src/ hardcodes a second copy (tests/test_core_pin.py
|
||||
# fails if one appears). What stays invisible to install-time machinery is the
|
||||
# --no-deps / lockfile residue, and _pin.py is the only layer that sees it.
|
||||
"invisible_core==70.83.0",
|
||||
"invisible_core==71.85.0",
|
||||
# ⛔ playwright is NO LONGER a dependency: since the full fork, the Python
|
||||
# client lives in src/invisible_playwright/_pw/ and its server in
|
||||
# src/invisible_playwright/_juggler/ (no Node driver). Reintroducing it would not visibly
|
||||
|
||||
+30
-18
@@ -116,6 +116,7 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
import tempfile
|
||||
import time
|
||||
import threading
|
||||
@@ -1996,11 +1997,23 @@ def default_seeds() -> list:
|
||||
return list(gate.SEEDS)
|
||||
|
||||
|
||||
def install_folders() -> set:
|
||||
"""The folders the python of THIS process installs its packages in (sysconfig's purelib and platlib, the link and the real folder): the install prefix of the side that runs.
|
||||
|
||||
Each side's engine reads the branding of ITS OWN core, in the install folder of that core. The published side runs in the venv of the published set and the candidate in the
|
||||
python of the job (`run_subprocess`), so the two folders differ, and the same read of one file is a different path on each side. That folder is the side's own package, as the
|
||||
folder of its engine is; any other path under the install prefix (the python's own library, another folder of the machine, the other side's folder) stays the host's."""
|
||||
paths = sysconfig.get_paths()
|
||||
folders = {paths[name] for name in ("purelib", "platlib") if paths.get(name)}
|
||||
return folders | {os.path.realpath(folder) for folder in folders}
|
||||
|
||||
|
||||
def _context(binary: str, windows: bool, work: Path) -> Context:
|
||||
"""The run's own folders: the package (the link and the real folder), the temp root of this process (the oracle's subprocess runs with a
|
||||
TMPDIR / TEMP of its own, `run_subprocess`) and the folder of the work of the seed, and the cache folder of the run."""
|
||||
"""The run's own folders: the package (the link and the real folder) and the install folders of this process's python (`install_folders`: the core and the wrapper this
|
||||
engine is launched by), the temp root of this process (the oracle's subprocess runs with a TMPDIR / TEMP of its own, `run_subprocess`) and the folder of the work of the seed,
|
||||
and the cache folder of the run."""
|
||||
real = os.path.realpath(binary)
|
||||
app = {os.path.dirname(real), os.path.dirname(os.path.abspath(binary))}
|
||||
app = {os.path.dirname(real), os.path.dirname(os.path.abspath(binary))} | install_folders()
|
||||
temp = {tempfile.gettempdir(), str(work)}
|
||||
if windows:
|
||||
folders = [*app, *temp, os.path.expanduser("~"), *(os.environ.get(v, "") for v in ("USERPROFILE", "LOCALAPPDATA", "APPDATA", "TEMP", "TMP", "ProgramData", "SystemRoot"))]
|
||||
@@ -2706,17 +2719,14 @@ def staged_engine(binary: str, base=None):
|
||||
shutil.rmtree(dest, ignore_errors=True)
|
||||
|
||||
|
||||
def run_subprocess(binary: str, seal: Path | None, leg: str, out: Path, label: str, seeds: list, crash_with: str | None = None) -> int:
|
||||
def run_subprocess(binary: str, seal: Path | None, leg: str, out: Path, label: str, seeds: list, crash_with: str | None = None, python: str | None = None) -> int:
|
||||
"""`run` in a process of its own, with a cache folder and a temp root of its own: they are the run's, so what the engine does in them is `ours`
|
||||
(the cache of the bundle's fonts, the profile and the temp dirs of the launch) and the rest of the machine is the host's.
|
||||
|
||||
`crash_with` (a signal name) makes the run the recorder's own test: one launch, whose parent is sent that signal (`crash-probe`)."""
|
||||
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
|
||||
if seal:
|
||||
env["INVISIBLE_SEAL_FILE"] = str(seal)
|
||||
for name in ("MOZ_LOG", "MOZ_LOG_FILE"):
|
||||
env.pop(name, None)
|
||||
cmd = [sys.executable, "-u", str(Path(__file__).resolve()), "run", binary, "--leg", leg, "--out", str(out), "--label", label,
|
||||
`crash_with` (a signal name) makes the run the recorder's own test: one launch, whose parent is sent that signal (`crash-probe`). `python` is the published set's
|
||||
(scripts/ci_published_set.py): the control side runs in the venv that holds the published core and wrapper, never in the candidate's."""
|
||||
env = oracle.process_env(seal, python)
|
||||
cmd = [python or sys.executable, "-u", str(Path(__file__).resolve()), "run", binary, "--leg", leg, "--out", str(out), "--label", label,
|
||||
"--seeds", ",".join(str(s) for s in seeds)]
|
||||
if crash_with:
|
||||
cmd += ["--crash-with", crash_with]
|
||||
@@ -2844,18 +2854,18 @@ def ab(candidate: str | None, candidate_seal: Path | None, leg: str, out: Path,
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-host-fetch-"))
|
||||
try:
|
||||
binary, seal = published or oracle.fetch_published(engine_tag, work)
|
||||
runs = [(engine_tag, "footprint-%s.json" % engine_tag.rsplit("-", 1)[-1], binary, seal),
|
||||
(engine_tag + " again", "footprint-%s-again.json" % engine_tag.rsplit("-", 1)[-1], binary, seal)]
|
||||
binary, seal, python = oracle.split_published(published or oracle.fetch_published(engine_tag, work))
|
||||
runs = [(engine_tag, "footprint-%s.json" % engine_tag.rsplit("-", 1)[-1], binary, seal, python),
|
||||
(engine_tag + " again", "footprint-%s-again.json" % engine_tag.rsplit("-", 1)[-1], binary, seal, python)]
|
||||
if candidate:
|
||||
runs.append((oracle.CANDIDATE, "footprint-candidate.json", candidate, candidate_seal))
|
||||
runs.append((oracle.CANDIDATE, "footprint-candidate.json", candidate, candidate_seal, None))
|
||||
failed = []
|
||||
for label, name, exe, seal_file in runs:
|
||||
for label, name, exe, seal_file, side_python in runs:
|
||||
print("=== footprint with %s: %s (run from %s)" % (label, exe, stage_dir()))
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
with staged_engine(exe) as staged:
|
||||
rc = run_subprocess(staged, Path(seal_file) if seal_file else None, leg, out / name, label, seeds)
|
||||
rc = run_subprocess(staged, Path(seal_file) if seal_file else None, leg, out / name, label, seeds, **({"python": side_python} if side_python else {}))
|
||||
except OSError as e:
|
||||
print("the engine of %s could not be staged: %s" % (label, e))
|
||||
rc = 125
|
||||
@@ -2921,7 +2931,7 @@ def main(argv=None) -> int:
|
||||
x.add_argument("--candidate-seal", type=Path, default=os.environ.get("INVISIBLE_SEAL_FILE"))
|
||||
x.add_argument("--leg", required=True)
|
||||
x.add_argument("--out", type=Path, required=True)
|
||||
x.add_argument("--engine-tag", default=oracle.ENGINE_TAG)
|
||||
x.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
|
||||
x.add_argument("--seeds", default=None)
|
||||
x.add_argument("--published-binary", type=Path, help="use this binary for the published engine instead of fetching it")
|
||||
x.add_argument("--published-seal", type=Path, help="its seal (default: the environment's)")
|
||||
@@ -2947,6 +2957,8 @@ def main(argv=None) -> int:
|
||||
return 3
|
||||
return crash_probe(args.binary, args.leg, args.out, args.seed if args.seed is not None else default_seeds()[0])
|
||||
seeds = [int(s) for s in args.seeds.split(",")] if args.seeds else default_seeds()
|
||||
if args.cmd == "ab":
|
||||
args.engine_tag = args.engine_tag or oracle.default_tag()
|
||||
if args.cmd == "run":
|
||||
if sys.platform.startswith("linux") and not shutil.which("strace"):
|
||||
print("needs strace (apt install strace): without it the processes and the files of the run are not seen")
|
||||
|
||||
+32
-21
@@ -96,7 +96,6 @@ VOLATILE_FILE = ROOT / "ci" / "ab-network-volatile.json"
|
||||
SEEDS_FILE = ROOT / "ci" / "persona-seeds.json"
|
||||
#: The seeds the A/B oracle of the page uses today (scripts/ci_host_gate.py: SEEDS), when ci/persona-seeds.json has no "candidate" key.
|
||||
FALLBACK_SEEDS = (11, 12, 13)
|
||||
ENGINE_TAG = "firefox-68"
|
||||
CANDIDATE = "candidate"
|
||||
#: The most times the engine sends one STUN request (a transmit and its retransmissions) before it gives the transaction up: the pref
|
||||
#: ``media.peerconnection.ice.stun_client_maximum_transmits`` (modules/libpref/init/all.js), 7. The first RTO is 100 ms and doubles, so how
|
||||
@@ -2026,9 +2025,15 @@ def judge(report: Dict[str, Any], control: bool) -> int:
|
||||
return 2 if control else 1
|
||||
|
||||
|
||||
def engine_env(seal: Optional[str]) -> Dict[str, str]:
|
||||
"""The environment of a process that runs one engine: its seal, no autofix, no pin check, no browser logging."""
|
||||
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
|
||||
def engine_env(seal: Optional[str], python: Optional[str] = None) -> Dict[str, str]:
|
||||
"""The environment of a process that runs one engine: its seal, no autofix, no pin check, no browser logging. With `python` (the published set's venv,
|
||||
scripts/ci_published_set.py) it is the set's: nothing of the candidate's job that makes it import another core or run another seal, and the pin check stays on."""
|
||||
if python:
|
||||
from ci_published_set import clean_env
|
||||
|
||||
env = clean_env({"INVISIBLE_CORE_AUTOFIX": "off"})
|
||||
else:
|
||||
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
|
||||
if seal:
|
||||
env["INVISIBLE_SEAL_FILE"] = str(seal)
|
||||
for name in ("MOZ_LOG", "MOZ_LOG_FILE"):
|
||||
@@ -2036,11 +2041,12 @@ def engine_env(seal: Optional[str]) -> Dict[str, str]:
|
||||
return env
|
||||
|
||||
|
||||
def run_engine(binary: str, seal: Optional[str], label: str, seeds: Tuple[int, ...], out: Path) -> int:
|
||||
"""``run`` in a process of its own: the seal a process runs under is read at import, so each engine gets its own."""
|
||||
env = engine_env(seal)
|
||||
def run_engine(binary: str, seal: Optional[str], label: str, seeds: Tuple[int, ...], out: Path, python: Optional[str] = None) -> int:
|
||||
"""``run`` in a process of its own: the seal a process runs under is read at import, so each engine gets its own. `python` is the published set's: the control
|
||||
side runs in the venv that holds the published core and wrapper, never in the candidate's."""
|
||||
env = engine_env(seal, python)
|
||||
env[crash.CRASH_DIR_ENV] = str(Path(out).parent / (Path(out).stem + ".crash")) # footprint-68.json -> transcript-68.crash/: what a launch that did not end with 0 left
|
||||
command = [sys.executable, "-u", str(Path(__file__).resolve()), "run", "--binary", binary, "--label", label, "--seeds", ",".join(map(str, seeds)), "--out", str(out)]
|
||||
command = [python or sys.executable, "-u", str(Path(__file__).resolve()), "run", "--binary", binary, "--label", label, "--seeds", ",".join(map(str, seeds)), "--out", str(out)]
|
||||
print("=== run %s: %s (seal %s)" % (label, binary, seal or "the one this process has"))
|
||||
sys.stdout.flush()
|
||||
from ci_ab_oracle import own_cache_env
|
||||
@@ -2161,10 +2167,10 @@ HUNT_BASE_S = 600
|
||||
HUNT_PER_REPETITION_S = 120
|
||||
|
||||
|
||||
def hunt_engine(binary: str, seal: Optional[str], label: str, seed: int, n: int, out_dir: Path) -> int:
|
||||
def hunt_engine(binary: str, seal: Optional[str], label: str, seed: int, n: int, out_dir: Path, python: Optional[str] = None) -> int:
|
||||
"""``hunt_run`` in a process of its own, as ``run_engine`` runs ``run``: each engine its own seal and its own cache."""
|
||||
env = engine_env(seal)
|
||||
command = [sys.executable, "-u", str(Path(__file__).resolve()), "hunt-run", "--binary", binary, "--label", label, "--seed", str(seed), "--n", str(n), "--out", str(out_dir)]
|
||||
env = engine_env(seal, python)
|
||||
command = [python or sys.executable, "-u", str(Path(__file__).resolve()), "hunt-run", "--binary", binary, "--label", label, "--seed", str(seed), "--n", str(n), "--out", str(out_dir)]
|
||||
print("=== hunt %s: %s (seal %s), %d repetitions of the WebRTC walk of seed %d" % (label, binary, seal or "the one this process has", n, seed))
|
||||
sys.stdout.flush()
|
||||
from ci_ab_oracle import own_cache_env
|
||||
@@ -2176,14 +2182,15 @@ def hunt_engine(binary: str, seal: Optional[str], label: str, seed: int, n: int,
|
||||
return 124
|
||||
|
||||
|
||||
def published_engine(args: argparse.Namespace, work: Path) -> Tuple[str, Optional[str]]:
|
||||
"""The published engine of an ``ab``: the binary the caller gave, or the one the release holds, with its seal."""
|
||||
def published_engine(args: argparse.Namespace, work: Path) -> Tuple[str, Optional[str], Optional[str]]:
|
||||
"""The published engine of an ``ab``: the binary the caller gave (run as this process is), or the one the published set fetches with its own core (its seal and its
|
||||
python: the control side runs in that venv)."""
|
||||
if args.published_binary:
|
||||
return str(args.published_binary), (str(args.published_seal) if args.published_seal else None)
|
||||
return str(args.published_binary), (str(args.published_seal) if args.published_seal else None), None
|
||||
import ci_ab_oracle as oracle
|
||||
|
||||
binary, seal = oracle.fetch_published(args.engine_tag, work)
|
||||
return binary, str(seal)
|
||||
binary, seal, python = oracle.split_published(oracle.fetch_published(args.engine_tag, work))
|
||||
return binary, (str(seal) if seal else None), python
|
||||
|
||||
|
||||
def cmd_hunt(args: argparse.Namespace, spec: str) -> int:
|
||||
@@ -2198,9 +2205,9 @@ def cmd_hunt(args: argparse.Namespace, spec: str) -> int:
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-network-"))
|
||||
try:
|
||||
binary, seal = published_engine(args, work)
|
||||
binary, seal, python = published_engine(args, work)
|
||||
for label in (args.engine_tag, args.engine_tag + "-again"):
|
||||
code = hunt_engine(binary, seal, label, seed, n, out)
|
||||
code = hunt_engine(binary, seal, label, seed, n, out, **({"python": python} if python else {}))
|
||||
if code != 0:
|
||||
print("hunt %s ended with %s" % (label, code))
|
||||
summary = hunt_summary(read_hunt_records(out))
|
||||
@@ -2224,6 +2231,10 @@ def compare_files(a: Path, b: Path, out: Optional[Path], floor: int, volatile_pa
|
||||
|
||||
|
||||
def cmd_ab(args: argparse.Namespace) -> int:
|
||||
if args.engine_tag is None:
|
||||
from ci_ab_oracle import default_tag
|
||||
|
||||
args.engine_tag = default_tag()
|
||||
spec = os.environ.get(HUNT_ENV)
|
||||
if spec:
|
||||
return cmd_hunt(args, spec)
|
||||
@@ -2238,12 +2249,12 @@ def cmd_ab(args: argparse.Namespace) -> int:
|
||||
return 2
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-network-"))
|
||||
try:
|
||||
binary, seal = published_engine(args, work)
|
||||
binary, seal, python = published_engine(args, work)
|
||||
tag = args.engine_tag.rsplit("-", 1)[-1]
|
||||
first, again = out / ("transcript-%s.json" % tag), out / ("transcript-%s-again.json" % tag)
|
||||
problems = []
|
||||
for path, label in ((first, args.engine_tag), (again, args.engine_tag + "-again")):
|
||||
if run_engine(binary, seal, label, seeds, path) != 0 or not path.is_file():
|
||||
if run_engine(binary, seal, label, seeds, path, **({"python": python} if python else {})) != 0 or not path.is_file():
|
||||
problems.append("the run %s did not produce a transcript" % label)
|
||||
if problems:
|
||||
print("\n".join("FAIL " + p for p in problems))
|
||||
@@ -2296,7 +2307,7 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
a.add_argument("--candidate-seal", default=os.environ.get("INVISIBLE_SEAL_FILE"))
|
||||
a.add_argument("--published-binary", type=Path, default=None, help="use this binary as the published engine instead of fetching it")
|
||||
a.add_argument("--published-seal", type=Path, default=None)
|
||||
a.add_argument("--engine-tag", default=ENGINE_TAG)
|
||||
a.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
|
||||
a.add_argument("--seeds", default=None)
|
||||
a.add_argument("--floor", type=int, default=0)
|
||||
a.add_argument("--volatile", type=Path, default=VOLATILE_FILE)
|
||||
|
||||
+229
-75
@@ -3,17 +3,19 @@
|
||||
|
||||
A page reads the same values from two engines that differ only by the work of one
|
||||
release. This runs the host gate's dump (scripts/ci_host_gate.py dump: the page in
|
||||
scripts/host_gate, whole APIs) twice on the SAME machine, with the same core and the same
|
||||
wrapper, over the persona seeds (ci/persona-seeds.json, computed by scripts/persona_cover.py
|
||||
scripts/host_gate, whole APIs) twice on the SAME machine, each engine with ITS OWN core and wrapper
|
||||
(the published engine with the published set, the candidate with core_ref and wrapper_ref), over the persona seeds (ci/persona-seeds.json, computed by scripts/persona_cover.py
|
||||
from the prefs the core emits: the `candidate` set, 5 seeds that reach every webgl renderer
|
||||
and every DPR, or the `final` set, 20 seeds that reach every value of every dimension). Each
|
||||
seed runs at its OWN DPR (nothing is pinned):
|
||||
|
||||
1. with the published engine (firefox-68 by default): its seal and its archive are
|
||||
downloaded the way the core downloads an engine (the release's seal.json, then
|
||||
invisible_core.download.ensure_binary under that seal, which checks the sha256 of
|
||||
the archive against the seal and the engine against the seal);
|
||||
2. with the candidate binary the gate already holds, under its own seal.
|
||||
1. with the published engine: the one the PUBLISHED SET carries (scripts/ci_published_set.py:
|
||||
the last wrapper on the index, the core it pins, the engine that core's seal pins). The
|
||||
set's venv fetches its own engine the way a user's core does (ensure_binary under its
|
||||
own seal, which checks the sha256 of the archive and the engine against the seal) and
|
||||
the dump runs in that venv: the engine is launched by the core it was built for;
|
||||
2. with the candidate binary the gate already holds, under its own seal, in the venv of
|
||||
the job (core_ref, wrapper_ref).
|
||||
|
||||
The dump also reads what the host gate's retail comparison leaves alone, the ab. leaves (ci_host_gate.is_ab): ab.poison on every seed (zone, language, colour scheme, a
|
||||
canary font and the audio context, which scripts/ci_poison_host.py holds to the declared identity on a poisoned host) and, on seeds 0 and 63, the extra visit of every realm and
|
||||
@@ -27,8 +29,15 @@ the two values and the seed. It is also red when a visit is missing on one side,
|
||||
visit compares fewer leaves than MIN_LEAVES says: a page that dumped less than the host gate's
|
||||
own reference would pass anything.
|
||||
|
||||
DECLARED DIFFERENCES. ci/ab-oracle-expected.json (format ab-oracle-expected/1) lists, one row per os x seed x dpr x leaf, the differences between the published engine and the candidate that a
|
||||
release is known to make, each with the two values and the reason. They are applied to the A/B only, never to the A/A (the engine against itself has none). A difference is allowed only
|
||||
when a row matches it exactly: the same os (the leg's), seed, dpr and leaf, and both values. Any other difference is red, and so is a row that does not show in the run (its os, a visit the
|
||||
run made, and no matching difference): it is STALE and the verdict says "remove it". The rows say what the published engine reads and what the candidate reads, never a tag: when the published set
|
||||
moves to the release that holds the candidate's work, the two sides agree on those leaves, every row is stale, and the stale check forces them out. A row for a visit this run did not make (another
|
||||
shard, another seed set) is not judged here.
|
||||
|
||||
python ci_ab_oracle.py run <candidate-firefox> --candidate-seal gate.seal.json \\
|
||||
--leg linux-x86_64 --out ab-oracle [--engine-tag firefox-68] [--seed-set candidate|final] [--shard i/n]
|
||||
--leg linux-x86_64 --out ab-oracle [--engine-tag <the set's tag>] [--seed-set candidate|final] [--shard i/n]
|
||||
python ci_ab_oracle.py run --published-binary <firefox> --leg linux-x86_64 --out ab-oracle --limit 2 (the A/A alone)
|
||||
python ci_ab_oracle.py compare ab-oracle [--a-a] [--seed-set ...] [--shard i/n] (again, from the dumps)
|
||||
|
||||
@@ -83,11 +92,21 @@ from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import ci_crash_evidence as crash # noqa: E402
|
||||
import ci_host_gate as gate # noqa: E402
|
||||
import ci_published_set as published_set # noqa: E402
|
||||
import persona_cover as personas # noqa: E402
|
||||
|
||||
FORMAT = "ab-oracle/1"
|
||||
#: The engine the candidate is held to: the last one published.
|
||||
ENGINE_TAG = "firefox-68"
|
||||
EXPECTED_FORMAT = "ab-oracle-expected/1"
|
||||
EXPECTED_FILE = Path(__file__).resolve().parents[1] / "ci" / "ab-oracle-expected.json"
|
||||
#: What a row of the file has, and nothing else.
|
||||
EXPECTED_KEYS = ("id", "os", "seed", "dpr", "leaf", "published", "candidate", "reason")
|
||||
#: The legs the gate runs, and the os a row names for each.
|
||||
LEG_OS = {"linux-x86_64": "linux", "win-x86_64": "windows"}
|
||||
#: The control side is the PUBLISHED SET (scripts/ci_published_set.py): the wrapper the index published last, the core that wrapper pins, and the engine that core's seal pins, in a venv
|
||||
#: of their own. The variable names that venv's python; the job sets it (or the oracle's test makes the venv from the run's wheelhouse). No tag is written in this file: the engine the
|
||||
#: candidate is held to is the one the set carries, so a new release is the new baseline.
|
||||
PUBLISHED_PYTHON_ENV = "INVPW_PUBLISHED_PYTHON"
|
||||
SET_SCRIPT = Path(__file__).resolve().parent / "ci_published_set.py"
|
||||
CANDIDATE = "candidate"
|
||||
#: What the host gate's own reference holds per visit (non-diag leaves at each DPR, today).
|
||||
#: A visit that compares fewer leaves than this is red. Moves by hand with the reference
|
||||
@@ -192,8 +211,68 @@ def tab_crashes(leaves: dict) -> list:
|
||||
return [(launch, f.get("error"), f.get("step")) for (_second, launch), f in sorted(found.items())]
|
||||
|
||||
|
||||
def os_of_leg(leg: str) -> str:
|
||||
"""The os a row of the declared differences names for this leg ("linux-x86_64" is linux, "win-x86_64" is windows); any other leg is refused."""
|
||||
if leg not in LEG_OS:
|
||||
raise SystemExit("--leg is one of %s, not %r: the declared differences are per os" % ("/".join(sorted(LEG_OS)), leg))
|
||||
return LEG_OS[leg]
|
||||
|
||||
|
||||
def load_expected(path: Path | None = None) -> list:
|
||||
"""The rows of ci/ab-oracle-expected.json (EXPECTED_FILE when no path is given). Refused: another format, a row that does not have exactly EXPECTED_KEYS, an os that is not
|
||||
linux or windows, an empty reason, two rows with one id or with one (os, seed, dpr, leaf)."""
|
||||
path = Path(path or EXPECTED_FILE)
|
||||
document = json.loads(path.read_text(encoding="utf-8"))
|
||||
if document.get("format") != EXPECTED_FORMAT:
|
||||
raise SystemExit("%s is not an %s file" % (path, EXPECTED_FORMAT))
|
||||
rows, ids, places = document["differences"], set(), set()
|
||||
for row in rows:
|
||||
if sorted(row) != sorted(EXPECTED_KEYS):
|
||||
raise SystemExit("%s: the row %r has the keys %s, it must have exactly %s" % (path, row.get("id"), sorted(row), sorted(EXPECTED_KEYS)))
|
||||
if row["os"] not in LEG_OS.values():
|
||||
raise SystemExit("%s: the row %r names the os %r, it is linux or windows" % (path, row["id"], row["os"]))
|
||||
if not str(row["reason"]).strip():
|
||||
raise SystemExit("%s: the row %r has no reason" % (path, row["id"]))
|
||||
place = (row["os"], row["seed"], row["dpr"], row["leaf"])
|
||||
if row["id"] in ids or place in places:
|
||||
raise SystemExit("%s: the row %r is declared twice (by id, or by os, seed, dpr and leaf)" % (path, row["id"]))
|
||||
ids.add(row["id"])
|
||||
places.add(place)
|
||||
return rows
|
||||
|
||||
|
||||
def _same_value(a, b) -> bool:
|
||||
"""Equal as JSON says it (1 is not true, a list is its elements in order)."""
|
||||
return json.dumps(a, sort_keys=True) == json.dumps(b, sort_keys=True)
|
||||
|
||||
|
||||
def declared_covers(entry: dict, os_name: str, diff: dict) -> bool:
|
||||
"""A row covers a difference only when os, seed, dpr, leaf and BOTH values are the row's."""
|
||||
return (entry["os"] == os_name and entry["seed"] == diff["seed"] and entry["dpr"] == diff["dpr"] and entry["leaf"] == diff["leaf"]
|
||||
and _same_value(entry["published"], diff["a"]) and _same_value(entry["candidate"], diff["b"]))
|
||||
|
||||
|
||||
def apply_declared(differences: list, declared: list, os_name: str, seen: set, expected) -> tuple:
|
||||
"""(the differences no row covers, the differences the rows cover with the id of the row, the stale rows).
|
||||
|
||||
A row is judged only when it names this os and a visit this run asked for and both sides have (`seen`); it is stale when no difference of the run is exactly its own."""
|
||||
left, covered, stale = list(differences), [], []
|
||||
for entry in declared:
|
||||
visit = (entry["dpr"], entry["seed"])
|
||||
if entry["os"] != os_name or visit not in expected or visit not in seen:
|
||||
continue
|
||||
hit = [d for d in left if declared_covers(entry, os_name, d)]
|
||||
if not hit:
|
||||
stale.append(entry)
|
||||
for d in hit:
|
||||
left.remove(d)
|
||||
covered.append(dict(d, id=entry["id"]))
|
||||
return left, covered, stale
|
||||
|
||||
|
||||
def compare_visits(a: dict, b: dict, noise: list, min_leaves: dict | None = None,
|
||||
expected: tuple | None = None, relaunch: tuple | None = None) -> dict:
|
||||
expected: tuple | None = None, relaunch: tuple | None = None,
|
||||
declared: list | None = None, os_name: str | None = None) -> dict:
|
||||
"""a and b map (dpr, seed) to the items of that visit (as the dump returns them).
|
||||
|
||||
Returns the report: {"verdict": "green"|"red", "problems": [str], "differences":
|
||||
@@ -202,7 +281,12 @@ def compare_visits(a: dict, b: dict, noise: list, min_leaves: dict | None = None
|
||||
fewest leaves a visit of that dpr may compare; `expected` is the visits both sides must have
|
||||
(default: every seed at every DPR of the host gate). `relaunch` is the visits that were launched twice on one profile (default: those of RELAUNCH_SEED among the expected ones): each side must have the
|
||||
second launch's leaves (prefix `relaunch.`) in them, as many as the floor, counted apart (report["relaunch"]), and a side must not have them in a visit that
|
||||
was not asked to."""
|
||||
was not asked to.
|
||||
|
||||
`declared` is the rows of ci/ab-oracle-expected.json, applied only with the `os_name` of the leg: the A/B passes them, the A/A never does. A difference that a row covers exactly
|
||||
is not a problem and is listed in report["declared"] with the row's id; a row that this run does not show is a problem (stale) and its id is in report["stale"]."""
|
||||
if declared and os_name is None:
|
||||
raise ValueError("declared differences are per os: say which (os_name)")
|
||||
min_leaves = MIN_LEAVES if min_leaves is None else min_leaves
|
||||
if expected is None:
|
||||
expected = tuple((dpr, seed) for dpr in gate.DPRS for seed in gate.SEEDS)
|
||||
@@ -262,10 +346,14 @@ def compare_visits(a: dict, b: dict, noise: list, min_leaves: dict | None = None
|
||||
" (the %d leaves of this visit that the tab could not read, or that only the other side has, are not compared)" % cascade[visit_name(c["dpr"], c["seed"])]
|
||||
if visit_name(c["dpr"], c["seed"]) in cascade else "") for c in crashes]
|
||||
problems = tab_lines + problems # the tab crash is the first line of the verdict, before anything it caused
|
||||
covered, stale = [], []
|
||||
if declared:
|
||||
differences, covered, stale = apply_declared(differences, declared, os_name, {k for k in a if k in b}, expected)
|
||||
problems += ["the declared difference %r (%s) does not show in this run: it is stale, remove it" % (e["id"], e["reason"]) for e in stale]
|
||||
for d in differences:
|
||||
problems.append("seed %d dpr %s %s: %s" % (d["seed"], d["dpr"], d["leaf"], d["what"]))
|
||||
return {"verdict": "red" if problems else "green", "problems": problems, "differences": differences, "tab_crashes": crashes,
|
||||
"compared": compared, "relaunch": relaunched, "excused": excused}
|
||||
"compared": compared, "relaunch": relaunched, "excused": excused, "declared": covered, "stale": [e["id"] for e in stale]}
|
||||
|
||||
|
||||
# -
|
||||
@@ -292,8 +380,9 @@ def unpack(document: dict) -> dict:
|
||||
|
||||
|
||||
def judge(published: dict, candidate: dict, noise: list, extra_problems=(), expected: tuple | None = None,
|
||||
relaunch: tuple | None = None) -> dict:
|
||||
report = compare_visits(published, candidate, noise, expected=expected, relaunch=relaunch)
|
||||
relaunch: tuple | None = None, declared: list | None = None, os_name: str | None = None) -> dict:
|
||||
"""The verdict on two sets of visits. `declared` and `os_name` are the A/B's: the rows of ci/ab-oracle-expected.json and the os of the leg; the A/A is judged without them."""
|
||||
report = compare_visits(published, candidate, noise, expected=expected, relaunch=relaunch, declared=declared, os_name=os_name)
|
||||
if extra_problems:
|
||||
crashed = [x for x in report["problems"] if x.startswith(TAB_CRASH)] # a tab that died is named before the exit code of the dump it left
|
||||
report["problems"] = crashed + list(extra_problems) + report["problems"][len(crashed):]
|
||||
@@ -312,6 +401,11 @@ def print_report(report: dict, published: str, other: str = CANDIDATE, title: st
|
||||
report["excused"]))
|
||||
if report.get("relaunch"):
|
||||
print("second launch on a reused profile, leaves per visit: %s" % ", ".join("%s %d" % kv for kv in sorted(report["relaunch"].items())))
|
||||
if report.get("declared"):
|
||||
print("%d differences declared in ci/ab-oracle-expected.json (the A/B only), each one exactly as its row says:" % len(report["declared"]))
|
||||
for d in report["declared"]:
|
||||
print("DECLARED %s seed %d dpr %s leaf %s: %s | %s" % (d["id"], d["seed"], d["dpr"], d["leaf"],
|
||||
json.dumps(d["a"], sort_keys=True)[:80], json.dumps(d["b"], sort_keys=True)[:80]))
|
||||
for d in report["differences"][:PRINT_LIMIT]:
|
||||
print("DIFF seed %d dpr %s leaf %s: %s %s | %s %s" % (d["seed"], d["dpr"], d["leaf"], published,
|
||||
json.dumps(d["a"], sort_keys=True)[:160],
|
||||
@@ -327,35 +421,68 @@ def print_report(report: dict, published: str, other: str = CANDIDATE, title: st
|
||||
# -
|
||||
# The run: two dumps, one per engine, as subprocesses (the seal a process runs under is read at import).
|
||||
|
||||
def fetch_published(tag: str, work: Path) -> tuple:
|
||||
"""(binary, seal path) of the published engine `tag`, fetched the way the core fetches an engine."""
|
||||
os.environ.setdefault("INVISIBLE_CORE_AUTOFIX", "off")
|
||||
os.environ.setdefault("INVISIBLE_CORE_PIN", "allow")
|
||||
from invisible_core import download
|
||||
from invisible_core.constants import RELEASE_URL_TEMPLATE
|
||||
from invisible_core.seal import load_seal
|
||||
def published_python() -> str:
|
||||
"""The python of the published set's venv (INVPW_PUBLISHED_PYTHON). RuntimeError when there is none: a candidate held to a control that is not the published set is
|
||||
the broken control this file used to run (the candidate's core with the published engine, which refuses a launch whose declarations that core does not emit)."""
|
||||
python = os.environ.get(PUBLISHED_PYTHON_ENV)
|
||||
if not python or not Path(python).is_file():
|
||||
raise RuntimeError("%s names no python (%r): the control side of an A/B is the PUBLISHED SET in a venv of its own (scripts/ci_published_set.py install --house <the "
|
||||
"run's wheelhouse> --venv <dir>, then export the python it prints), never the core and the wrapper of the candidate" % (PUBLISHED_PYTHON_ENV, python))
|
||||
return python
|
||||
|
||||
owner, repo = download._parse_owner_repo(RELEASE_URL_TEMPLATE)
|
||||
seal_path = work / ("seal-%s.json" % tag)
|
||||
sources = download.release_asset_urls(owner, repo, tag, "seal.json",
|
||||
RELEASE_URL_TEMPLATE.format(tag=tag, asset="seal.json"))
|
||||
download._download_file(sources, seal_path)
|
||||
seal = load_seal(seal_path)
|
||||
if seal.tag != tag or seal.is_local:
|
||||
raise SystemExit("the seal of the release %s says tag %r (local: %s)" % (tag, seal.tag, seal.is_local))
|
||||
print("published engine %s: %s" % (tag, seal.describe()))
|
||||
|
||||
def set_command(python: str, *argv: str) -> list:
|
||||
"""`python scripts/ci_published_set.py <argv>`, run BY the set's python: stdlib and its own invisible_core."""
|
||||
return [python, str(SET_SCRIPT)] + list(argv)
|
||||
|
||||
|
||||
def default_tag() -> str:
|
||||
"""The tag of the engine the control side runs: the one the seal of the published set's core names; without a set (a pull request, whose engine IS the published one and
|
||||
runs under the core the wrapper pins) the seal of the core of this process."""
|
||||
python = os.environ.get(PUBLISHED_PYTHON_ENV)
|
||||
if python and Path(python).is_file():
|
||||
done = subprocess.run(set_command(python, "tag"), capture_output=True, text=True, env=published_set.clean_env(), timeout=120)
|
||||
if done.returncode != 0:
|
||||
raise RuntimeError("the published set's core names no seal tag: %s" % (done.stderr or done.stdout)[-600:])
|
||||
return done.stdout.strip().splitlines()[-1]
|
||||
from invisible_core.seal import active_seal
|
||||
|
||||
return active_seal().tag
|
||||
|
||||
|
||||
def fetch_published(tag: str | None, work: Path) -> tuple:
|
||||
"""(binary, None, python) of the published set: the engine its own core fetches under its own seal, and the python that is its venv's. `tag`, when given, is held
|
||||
to the seal of the set (a label that names another engine than the one the set carries is a wrong control, said here)."""
|
||||
python = published_python()
|
||||
done = subprocess.run(set_command(python, "fetch", "--work", str(work)), capture_output=True, text=True, env=published_set.clean_env(), timeout=DUMP_TIMEOUT_S)
|
||||
if done.returncode != 0:
|
||||
raise RuntimeError("the published set could not fetch its engine (exit %s): %s" % (done.returncode, (done.stderr or done.stdout)[-800:]))
|
||||
fetched = json.loads(done.stdout.strip().splitlines()[-1])
|
||||
if tag and fetched["tag"] != tag:
|
||||
raise RuntimeError("the control is labelled %s but the published set carries %s" % (tag, fetched["tag"]))
|
||||
print("published engine %s: %s (core and wrapper of the published set, %s)" % (fetched["tag"], fetched["describe"], python))
|
||||
sys.stdout.flush()
|
||||
# the engine store of this fetch only: the dumps that follow run under the environment they were given
|
||||
before = os.environ.get(download.ENGINE_DIR_ENV)
|
||||
os.environ[download.ENGINE_DIR_ENV] = str(work / "engines")
|
||||
try:
|
||||
binary = download.ensure_binary(seal=seal)
|
||||
finally:
|
||||
if before is None:
|
||||
os.environ.pop(download.ENGINE_DIR_ENV, None)
|
||||
else:
|
||||
os.environ[download.ENGINE_DIR_ENV] = before
|
||||
return str(binary), seal_path
|
||||
return fetched["binary"], None, python
|
||||
|
||||
|
||||
def process_env(seal, python: str | None = None) -> dict:
|
||||
"""The environment of a process that runs ONE engine: no autofix, no browser logging, and the seal of that engine. With `python` (the published set's venv) the process is the
|
||||
set's: nothing of the candidate's job that could make it import another core or run another seal reaches it, and the core's pin check stays ON (a set whose wrapper and
|
||||
core do not agree is refused, as it is on a user's machine). Without it (the candidate, or a pull request's published engine) it is as it always was."""
|
||||
if python:
|
||||
env = published_set.clean_env({"INVISIBLE_CORE_AUTOFIX": "off"})
|
||||
else:
|
||||
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
|
||||
if seal: # None: the engine runs under the seal of the core it is launched with (the published set's, a pull request's published engine)
|
||||
env["INVISIBLE_SEAL_FILE"] = str(seal)
|
||||
for name in ("MOZ_LOG", "MOZ_LOG_FILE"): # the e2e legs log the engine; a run is as the host gate's
|
||||
env.pop(name, None)
|
||||
return env
|
||||
|
||||
|
||||
def split_published(published: tuple) -> tuple:
|
||||
"""(binary, seal, python or None) of a `published` tuple: two items (a binary given, run in this process's environment) or three (the published set)."""
|
||||
return (published[0], published[1], published[2] if len(published) > 2 else None)
|
||||
|
||||
|
||||
def own_cache_env(env: dict, folder: str, platform: str | None = None) -> dict:
|
||||
@@ -381,27 +508,44 @@ def own_cache_env(env: dict, folder: str, platform: str | None = None) -> dict:
|
||||
return out
|
||||
|
||||
|
||||
def dump_with_exits(name: str, exe: str, seal_file, leg: str, visits, target: Path, out: Path) -> tuple:
|
||||
def visits_complete(rc, target: Path, expected) -> tuple:
|
||||
"""`(True, [])` when the dump ended with 0 and every visit of `expected` ([(dpr, seed)]) has its result in `target` and none of them lost its tab; else `(False, [what is missing])`.
|
||||
This is where a run learns that its measurements are all there: the A/A's verdict on a known Mozilla defect depends on it (a crash that cost a measurement stays red)."""
|
||||
missing = [] if rc == 0 else ["the dump process ended with %s" % (rc,)]
|
||||
try:
|
||||
got = read_visits(target) if target.is_dir() else {}
|
||||
except (OSError, ValueError, KeyError, TypeError) as exc:
|
||||
got = {}
|
||||
missing.append("the dumps of %s cannot be read (%s: %s)" % (target.name, type(exc).__name__, exc))
|
||||
missing += ["no dump of %s" % visit_name(*key) for key in expected if key not in got]
|
||||
for key in expected:
|
||||
if key in got and tab_crashes(comparable(got[key])):
|
||||
missing.append("the tab of %s died: its leaves are not all there" % visit_name(*key))
|
||||
return not missing, missing
|
||||
|
||||
|
||||
def dump_with_exits(name: str, exe: str, seal_file, leg: str, visits, target: Path, out: Path, python: str | None = None, notes: list | None = None, control: bool = False) -> tuple:
|
||||
"""The dump of one engine run as `run_dump` makes it, with the folder where its probe writes how each browser ended (`<out>/crash/<name>`, named to the dump process by
|
||||
AB_CRASH_DIR): `(rc or "timeout", the red lines of the launches that did not end with 0, or that nobody saw)`. A dump process whose probe wrote nothing is red: an oracle
|
||||
that does not see how its browsers end does not see them."""
|
||||
that does not see how its browsers end does not see them.
|
||||
|
||||
`control` is the A/A's: a core a browser left while its parent ended with 0 is then judged against the known Mozilla defects (ci/mozilla-defects.json), with the run's measurements
|
||||
complete only when every visit has its result (`visits_complete`); a crash that matches is a line of `notes` and not a red line. Any other dump judges no core: every core is red."""
|
||||
crash_dir = out / "crash" / name
|
||||
try:
|
||||
with crash.environment(**{crash.CRASH_DIR_ENV: crash_dir}):
|
||||
rc = run_dump(exe, Path(seal_file) if seal_file else None, leg, target, visits)
|
||||
rc = run_dump(exe, Path(seal_file) if seal_file else None, leg, target, visits, **({"python": python} if python else {}))
|
||||
except subprocess.TimeoutExpired:
|
||||
rc = "timeout"
|
||||
return rc, crash.exits_of_run(crash_dir, name, windows=leg.startswith("win"), needed=(rc == 0))
|
||||
complete, missing = visits_complete(rc, target, visits) if control else (None, [])
|
||||
return rc, crash.exits_of_run(crash_dir, name, windows=leg.startswith("win"), needed=(rc == 0), notes=notes, measurements_complete=complete, missing=missing, binary=exe)
|
||||
|
||||
|
||||
def run_dump(binary: str, seal: Path | None, leg: str, out: Path, visits: list | None = None) -> int:
|
||||
"""The host gate's dump of `visits` ([(dpr, seed)], each seed at its own DPR) as a subprocess; None is the host gate's own grid."""
|
||||
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
|
||||
if seal is not None: # None: the engine runs under the seal of the core it is launched with (a pull request's published engine)
|
||||
env["INVISIBLE_SEAL_FILE"] = str(seal)
|
||||
for name in ("MOZ_LOG", "MOZ_LOG_FILE"): # the e2e legs log the engine; a dump runs as the host gate's does
|
||||
env.pop(name, None)
|
||||
cmd = [sys.executable, str(Path(gate.__file__)), "dump", binary, "--leg", leg, "--out", str(out)]
|
||||
def run_dump(binary: str, seal: Path | None, leg: str, out: Path, visits: list | None = None, python: str | None = None) -> int:
|
||||
"""The host gate's dump of `visits` ([(dpr, seed)], each seed at its own DPR) as a subprocess; None is the host gate's own grid. `python` is the published set's: the
|
||||
dump of the control side runs in the venv that holds the published core and wrapper, never in the candidate's."""
|
||||
env = process_env(seal, python)
|
||||
cmd = [python or sys.executable, str(Path(gate.__file__)), "dump", binary, "--leg", leg, "--out", str(out)]
|
||||
if visits is not None:
|
||||
if relaunch_visits(visits):
|
||||
cmd += ["--relaunch-seed", str(RELAUNCH_SEED)]
|
||||
@@ -419,13 +563,13 @@ def run(candidate: str, candidate_seal: Path, leg: str, out: Path, engine_tag: s
|
||||
started = time.time()
|
||||
problems, dumps = [], {}
|
||||
try:
|
||||
binary, seal = published or fetch_published(engine_tag, work)
|
||||
for name, exe, seal_file in ((engine_tag, binary, seal), (CANDIDATE, candidate, candidate_seal)):
|
||||
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
|
||||
for name, exe, seal_file, side_python in ((engine_tag, binary, seal, python), (CANDIDATE, candidate, candidate_seal, None)):
|
||||
target = work / name
|
||||
print("=== dump with %s: %s (seal %s), seeds %s"
|
||||
% (name, exe, seal_file, " ".join("%d@%s" % (seed, dpr) for dpr, seed in visits)))
|
||||
sys.stdout.flush()
|
||||
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out)
|
||||
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out, side_python)
|
||||
if rc != 0:
|
||||
problems.append("the dump with %s ended with %s" % (name, rc))
|
||||
problems += exits
|
||||
@@ -441,7 +585,7 @@ def run(candidate: str, candidate_seal: Path, leg: str, out: Path, engine_tag: s
|
||||
finally:
|
||||
shutil.rmtree(work, ignore_errors=True)
|
||||
noise = gate.load_exceptions().get("noise", [])
|
||||
report = judge(dumps[engine_tag], dumps[CANDIDATE], noise, problems, expected=tuple(visits))
|
||||
report = judge(dumps[engine_tag], dumps[CANDIDATE], noise, problems, expected=tuple(visits), declared=load_expected(), os_name=os_of_leg(leg))
|
||||
report.update(format=FORMAT, engine=engine_tag, leg=leg, seconds=round(time.time() - started),
|
||||
visits=["%d@%s" % (seed, dpr) for dpr, seed in visits])
|
||||
write_json(out / "diff.json", report)
|
||||
@@ -454,13 +598,14 @@ def again_name(engine_tag: str) -> str:
|
||||
return dump_name(engine_tag)[:-len(".json")] + "-again.json"
|
||||
|
||||
|
||||
def _dump_visits(name: str, exe: str, seal_file, leg: str, visits: list, work: Path, out: Path, file_name: str) -> tuple:
|
||||
"""One engine's dump of `visits`: ({(dpr, seed): items}, problems); the packed dump is written to out/file_name."""
|
||||
def _dump_visits(name: str, exe: str, seal_file, leg: str, visits: list, work: Path, out: Path, file_name: str, python: str | None = None,
|
||||
notes: list | None = None, control: bool = False) -> tuple:
|
||||
"""One engine's dump of `visits`: ({(dpr, seed): items}, problems); the packed dump is written to out/file_name. `control` (the A/A's dumps) and `notes` are `dump_with_exits`'."""
|
||||
target = work / name
|
||||
print("=== dump with %s: %s (seal %s), seeds %s"
|
||||
% (name, exe, seal_file or "of the core", " ".join("%d@%s" % (seed, dpr) for dpr, seed in visits)))
|
||||
sys.stdout.flush()
|
||||
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out)
|
||||
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out, python, notes, control)
|
||||
problems = ([] if rc == 0 else ["the dump with %s ended with %s" % (name, rc)]) + exits
|
||||
dumped = read_visits(target) if target.is_dir() else {}
|
||||
write_json(out / file_name, pack(name, dumped))
|
||||
@@ -472,7 +617,8 @@ def run_ab(leg: str, out: Path, engine_tag: str, published: tuple | None = None,
|
||||
"""The A/A (the published engine twice), then, with a candidate, the A/B against the first dump. 0 green, 1 a finding,
|
||||
2 a broken control (the A/A differs, or a dump of it did not run: the A/B is not run) .
|
||||
|
||||
`published` is (binary, seal or None); without it the engine is fetched the way the core fetches one."""
|
||||
`published` is (binary, seal or None) of a binary the caller gave, run in this process's environment, or (binary, None, python) of the published set; without it the
|
||||
set the job made (INVPW_PUBLISHED_PYTHON) fetches its own engine."""
|
||||
visits = select_visits() if visits is None else visits
|
||||
expected = tuple(visits)
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
@@ -480,20 +626,24 @@ def run_ab(leg: str, out: Path, engine_tag: str, published: tuple | None = None,
|
||||
started = time.time()
|
||||
noise = gate.load_exceptions().get("noise", [])
|
||||
asked = ["%d@%s" % (seed, dpr) for dpr, seed in visits]
|
||||
notes: list = [] # the cores of the A/A that the list of known Mozilla defects names: said, not red
|
||||
try:
|
||||
try:
|
||||
binary, seal = published or fetch_published(engine_tag, work)
|
||||
first, p1 = _dump_visits(engine_tag, binary, seal, leg, visits, work, out, dump_name(engine_tag))
|
||||
again, p2 = _dump_visits(engine_tag + "-again", binary, seal, leg, visits, work, out, again_name(engine_tag))
|
||||
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
|
||||
first, p1 = _dump_visits(engine_tag, binary, seal, leg, visits, work, out, dump_name(engine_tag), notes=notes, control=True, **({"python": python} if python else {}))
|
||||
again, p2 = _dump_visits(engine_tag + "-again", binary, seal, leg, visits, work, out, again_name(engine_tag), notes=notes, control=True,
|
||||
**({"python": python} if python else {}))
|
||||
problems = p1 + p2
|
||||
except SystemExit:
|
||||
raise
|
||||
except Exception as e: # noqa: BLE001 - a run that could not get its engine is red and says why
|
||||
first, again, problems = {}, {}, ["%s: %s" % (type(e).__name__, str(e)[:500])]
|
||||
control = judge(first, again, noise, problems, expected=expected)
|
||||
control.update(format=FORMAT, engine=engine_tag, leg=leg, control=True, seconds=round(time.time() - started), visits=asked)
|
||||
control.update(format=FORMAT, engine=engine_tag, leg=leg, control=True, seconds=round(time.time() - started), visits=asked, known_defects=notes)
|
||||
write_json(out / "diff-a-a.json", control)
|
||||
print_report(control, engine_tag, engine_tag + "-again", "AB ORACLE A/A")
|
||||
for note in notes:
|
||||
print("NOTE " + note)
|
||||
if control["verdict"] != "green":
|
||||
print("BROKEN CONTROL: the published engine differs from itself (or did not run twice), so what is compared is not stable: "
|
||||
"the A/B is not run, and the candidate is not judged")
|
||||
@@ -501,7 +651,7 @@ def run_ab(leg: str, out: Path, engine_tag: str, published: tuple | None = None,
|
||||
if candidate is None:
|
||||
return 0
|
||||
cand, pc = _dump_visits(CANDIDATE, candidate, candidate_seal, leg, visits, work, out, "dump-%s.json" % CANDIDATE)
|
||||
report = judge(first, cand, noise, pc, expected=expected)
|
||||
report = judge(first, cand, noise, pc, expected=expected, declared=load_expected(), os_name=os_of_leg(leg))
|
||||
report.update(format=FORMAT, engine=engine_tag, leg=leg, seconds=round(time.time() - started), visits=asked)
|
||||
write_json(out / "diff.json", report)
|
||||
print_report(report, engine_tag)
|
||||
@@ -521,8 +671,8 @@ def run_clean(leg: str, out: Path, engine_tag: str, visits: list, published: tup
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-oracle-clean-"))
|
||||
try:
|
||||
binary, seal = published or fetch_published(engine_tag, work)
|
||||
_, problems = _dump_visits(engine_tag + "-clean", binary, seal, leg, visits, work, out, clean_name(engine_tag))
|
||||
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
|
||||
_, problems = _dump_visits(engine_tag + "-clean", binary, seal, leg, visits, work, out, clean_name(engine_tag), **({"python": python} if python else {}))
|
||||
except SystemExit:
|
||||
raise
|
||||
except Exception as e: # noqa: BLE001 - said, not raised: this is a by-product
|
||||
@@ -534,7 +684,8 @@ def run_clean(leg: str, out: Path, engine_tag: str, visits: list, published: tup
|
||||
return 1 if problems else 0
|
||||
|
||||
|
||||
def recompare(directory: Path, engine_tag: str, visits: list | None = None, a_a: bool = False) -> int:
|
||||
def recompare(directory: Path, engine_tag: str, visits: list | None = None, a_a: bool = False, leg: str | None = None) -> int:
|
||||
"""`leg` (default: the os this runs on) says which rows of the declared differences apply to the A/B; the A/A takes none."""
|
||||
visits = select_visits() if visits is None else visits
|
||||
published = unpack(json.loads((directory / dump_name(engine_tag)).read_text(encoding="utf-8")))
|
||||
if a_a:
|
||||
@@ -545,7 +696,8 @@ def recompare(directory: Path, engine_tag: str, visits: list | None = None, a_a:
|
||||
print_report(report, engine_tag, engine_tag + "-again", "AB ORACLE A/A")
|
||||
return 0 if report["verdict"] == "green" else 2
|
||||
candidate = unpack(json.loads((directory / ("dump-%s.json" % CANDIDATE)).read_text(encoding="utf-8")))
|
||||
report = judge(published, candidate, gate.load_exceptions().get("noise", []), expected=tuple(visits))
|
||||
leg = leg or ("win-x86_64" if sys.platform == "win32" else "linux-x86_64")
|
||||
report = judge(published, candidate, gate.load_exceptions().get("noise", []), expected=tuple(visits), declared=load_expected(), os_name=os_of_leg(leg))
|
||||
report.update(format=FORMAT, engine=engine_tag, visits=["%d@%s" % (seed, dpr) for dpr, seed in visits])
|
||||
write_json(directory / "diff.json", report)
|
||||
print_report(report, engine_tag)
|
||||
@@ -568,7 +720,7 @@ def main(argv=None) -> int:
|
||||
help="the candidate's seal (default: INVISIBLE_SEAL_FILE)")
|
||||
r.add_argument("--leg", required=True)
|
||||
r.add_argument("--out", type=Path, required=True)
|
||||
r.add_argument("--engine-tag", default=ENGINE_TAG)
|
||||
r.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
|
||||
r.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET,
|
||||
help="the persona seeds to visit (ci/persona-seeds.json), each at its own DPR")
|
||||
r.add_argument("--shard", help="i/n: every n-th seed of the set from the i-th (the final set over n jobs)")
|
||||
@@ -580,17 +732,18 @@ def main(argv=None) -> int:
|
||||
k = sub.add_parser("clean", help="the published engine's dump on this (clean) machine, for the poisoned run's by-product")
|
||||
k.add_argument("--leg", required=True)
|
||||
k.add_argument("--out", type=Path, required=True)
|
||||
k.add_argument("--engine-tag", default=ENGINE_TAG)
|
||||
k.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
|
||||
k.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET)
|
||||
k.add_argument("--shard")
|
||||
k.add_argument("--limit", type=int)
|
||||
c = sub.add_parser("compare")
|
||||
c.add_argument("directory", type=Path)
|
||||
c.add_argument("--engine-tag", default=ENGINE_TAG)
|
||||
c.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
|
||||
c.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET)
|
||||
c.add_argument("--shard")
|
||||
c.add_argument("--limit", type=int)
|
||||
c.add_argument("--a-a", action="store_true", help="compare the two dumps of the published engine (the control)")
|
||||
c.add_argument("--leg", help="the leg the dumps are of, which says the os of the declared differences (default: this machine's)")
|
||||
args = ap.parse_args(argv)
|
||||
if args.cmd == "touched":
|
||||
import ci_ab_pr_seeds as pr
|
||||
@@ -598,10 +751,11 @@ def main(argv=None) -> int:
|
||||
sys.stdout.reconfigure(newline="\n") # the line goes to $GITHUB_OUTPUT: a carriage return would be part of the value
|
||||
print("touched=%s" % ("true" if touched(pr.changed_files(args.base)) else "false"))
|
||||
return 0
|
||||
args.engine_tag = args.engine_tag or default_tag()
|
||||
if args.cmd == "clean":
|
||||
return run_clean(args.leg, args.out, args.engine_tag, select_visits(args.seed_set, args.shard, limit=args.limit))
|
||||
if args.cmd == "compare":
|
||||
return recompare(args.directory, args.engine_tag, select_visits(args.seed_set, args.shard, limit=args.limit), args.a_a)
|
||||
return recompare(args.directory, args.engine_tag, select_visits(args.seed_set, args.shard, limit=args.limit), args.a_a, args.leg)
|
||||
if args.published_seal and not args.published_binary:
|
||||
ap.error("--published-seal goes with --published-binary")
|
||||
if args.candidate:
|
||||
|
||||
@@ -28,10 +28,10 @@ ROOT = Path(__file__).resolve().parent.parent
|
||||
SHARED = ("scripts/ci_ab_oracle.py", "scripts/ci_crash_evidence.py", "scripts/ci_ab_pr_seeds.py", "scripts/persona_cover.py", "ci/persona-seeds.json")
|
||||
#: variable -> (oracle, seeds by default on a pull request that does not touch it, the files of the oracle: exact paths or fnmatch patterns).
|
||||
ORACLES = {
|
||||
"AB_ORACLE_PR_SEEDS": ("page", 2, SHARED + ("scripts/ci_host_gate.py", "scripts/ci_poison_host.py", "scripts/host_gate/*", "tests/test_ab_oracle*", "tests/test_ci_host_gate*",
|
||||
"AB_ORACLE_PR_SEEDS": ("page", 2, SHARED + ("scripts/ci_host_gate.py", "scripts/ci_poison_host.py", "scripts/host_gate/*", "ci/ab-oracle-expected.json", "tests/test_ab_oracle*", "tests/test_ci_host_gate*",
|
||||
"tests/test_ci_poison_host.py")),
|
||||
"AB_NETWORK_PR_SEEDS": ("network", 1, SHARED + ("scripts/ci_ab_network.py", "ci/ab-network-volatile.json", "tests/test_ab_network*")),
|
||||
"AB_HOST_PR_SEEDS": ("host", 2, SHARED + ("scripts/ci_ab_host.py", "tests/_strace_stand_in.py", "ci/ab-host-expected.json", "tests/test_ab_host*")),
|
||||
"AB_HOST_PR_SEEDS": ("host", 2, SHARED + ("scripts/ci_ab_host.py", "tests/_strace_stand_in.py", "tests/_ab_host_declared.py", "ci/ab-host-expected.json", "tests/test_ab_host*")),
|
||||
}
|
||||
FALLBACK_SEEDS = 5
|
||||
|
||||
|
||||
@@ -117,9 +117,18 @@ def exit_problem(code, windows: bool | None = None, **who) -> str | None:
|
||||
return "the parent process exited with code %s: %s" % (describe_exit(code, windows), where or "launch not named")
|
||||
|
||||
|
||||
def exit_problems(launches, run: str, windows: bool | None = None, side: str | None = None) -> list:
|
||||
"""The red lines of the launches a probe recorded (`LaunchProbe.launches`, or the `launches` of an exits file) for the run `run`."""
|
||||
def exit_problems(launches, run: str, windows: bool | None = None, side: str | None = None, notes: list | None = None,
|
||||
measurements_complete: bool | None = None, missing=(), binary: str | None = None, judge=None) -> list:
|
||||
"""The red lines of the launches a probe recorded (`LaunchProbe.launches`, or the `launches` of an exits file) for the run `run`.
|
||||
|
||||
A launch whose parent ended with 0 and that left cores is judged against the known Mozilla defects when the caller says whether its measurements are complete
|
||||
(`measurements_complete` True or False; `missing` names what is not there): every core is a crash record (`crash_record`), and the list's matcher (`defects_judge`,
|
||||
the engine of `binary` for the version) rules on all of them at once. A launch whose crashes all match a defect and whose measurements are complete is not red: a
|
||||
line `known Mozilla defect D<n> (<bug or not filed>): <why>: <who>` goes into `notes`. Any other result is the red line below plus the lines of the verdict. A caller that
|
||||
does not know (`measurements_complete` None) judges nothing: its cores are red as ever. A launch whose parent did not end with 0, a minidump and a core with no record are
|
||||
never excused."""
|
||||
out = []
|
||||
judges: list = []
|
||||
for launch in launches or []:
|
||||
who = {"run": run, "side": side or side_of(run)}
|
||||
label = launch.get("label") or {}
|
||||
@@ -132,12 +141,25 @@ def exit_problems(launches, run: str, windows: bool | None = None, side: str | N
|
||||
out.append(line)
|
||||
elif launch.get("cores") or launch.get("dmp"):
|
||||
# the parent ended with 0 and a process of the browser left a core or a minidump: a content process died (the parent does not say so)
|
||||
where = ", ".join("%s %s" % kv for kv in who.items() if kv[1] not in (None, ""))
|
||||
line = "a process of the browser crashed while the parent ended with 0: %s left %s" % (
|
||||
", ".join("%s %s" % kv for kv in who.items() if kv[1] not in (None, "")),
|
||||
where,
|
||||
" and ".join(x for x in ("core " + ", ".join(launch["cores"]) if launch.get("cores") else "", "minidump " + ", ".join(launch["dmp"]) if launch.get("dmp") else "") if x))
|
||||
if launch.get("evidence"):
|
||||
line += " (evidence: %s)" % launch["evidence"]
|
||||
out.append(line)
|
||||
if measurements_complete is None or not launch.get("cores") or launch.get("dmp"):
|
||||
out.append(line)
|
||||
continue
|
||||
if not judges:
|
||||
judges.append(judge if judge is not None else defects_judge(binary))
|
||||
excused, lines = _judge_launch(judges[0], launch, measurements_complete, missing)
|
||||
if excused:
|
||||
for found in lines:
|
||||
if notes is not None:
|
||||
notes.append("known Mozilla defect %s: %s" % (found[len("MATCHED "):], where))
|
||||
else:
|
||||
out.append(line)
|
||||
out.extend(lines)
|
||||
return out
|
||||
|
||||
|
||||
@@ -154,6 +176,269 @@ def parent_exit_problems(lifecycle, root_code, **who) -> list:
|
||||
return out
|
||||
|
||||
|
||||
# -
|
||||
# Known Mozilla defects: a core of a crash that the list names is reported by its D<n>, never silently.
|
||||
#
|
||||
# The crash-record parser of this section (process_type, function_name, crashing_thread, reason_of, thread_name, phase_of, crash_record) moves to
|
||||
# the core in S1, next to the matcher, and is fetched by sha like it; the series' gtest_run then uses the same one. Until then this is the wrapper's copy.
|
||||
|
||||
#: The matcher is the core's main `scripts/ci_mozilla_defects.py`: the judge is never the branch being judged. A caller that has it on disk names its path here; otherwise it is fetched once
|
||||
#: per process from the core's main (the sha is resolved with `git ls-remote` and printed).
|
||||
MATCHER_ENV = "MOZILLA_DEFECTS_CHECKER"
|
||||
CORE_REPO = "oss-invisible/core"
|
||||
MATCHER_PATH_IN_CORE = "scripts/ci_mozilla_defects.py"
|
||||
MATCHER_API = ("load", "problems", "verdict")
|
||||
#: The wrapper's own list of known Mozilla defects, next to the scripts that run: the list of the wrapper under test. It is read from the wrapper's
|
||||
#: main once main holds it (after the engine release that carries the first row), so that a branch cannot excuse its own crash.
|
||||
DEFECTS_LIST = Path(__file__).resolve().parent.parent / "ci" / "mozilla-defects.json"
|
||||
FETCH_TIMEOUT_S = 60
|
||||
#: The process types a Firefox child is started as (`-contentproc ... <type>`).
|
||||
CHILD_TYPES = ("tab", "gpu", "rdd", "socket", "utility", "forkserver", "vr", "inference", "gmplugin")
|
||||
#: The kernel keeps 80 bytes of a process's arguments with the NUL: a `Core was generated by` line of 79 visible characters or more is cut.
|
||||
CUT_LINE = 79
|
||||
#: The shortest prefix of a flag that names it: `back` is the start of `backgroundtask`, the one Firefox flag that begins with it.
|
||||
FLAG_PREFIX_MIN = 4
|
||||
_HEADER = re.compile(r"Core was generated by `([^']*)'")
|
||||
_THREAD_HEADER = re.compile(r"^Thread (\d+) \((.*)\):\s*$")
|
||||
_CURRENT_THREAD = re.compile(r"\[Current thread is (\d+) ")
|
||||
_FRAME = re.compile(r"^#\d+\s+(.*)$")
|
||||
_REASON_LINE = re.compile(r'^0x[0-9a-fA-F]+(?: <[^>]*>)?:\s+"(.*)"\s*$')
|
||||
_CORE_NAME = re.compile(r"^core\.(.+)\.(\d+)\.(\d+)$")
|
||||
_SHA = re.compile(r"^[0-9a-f]{40}$")
|
||||
_FETCHED: dict = {}
|
||||
|
||||
|
||||
def process_type(text: str) -> str | None:
|
||||
"""The process type of the crashed process, from gdb's `Core was generated by` line; None when the line cannot say.
|
||||
|
||||
`-backgroundtask` (one or two dashes) gives `backgroundtask`. `-contentproc` gives its last token when that is a whole child type (`tab`, `gpu`, ...) and the line is not cut.
|
||||
A line with neither flag and not cut is the `parent`. A cut line (the kernel keeps 80 bytes of the arguments with the NUL, so 79 visible characters or more) whose last token,
|
||||
without its leading dashes, is a prefix of `backgroundtask` of at least 4 characters gives `backgroundtask` (no other Firefox flag begins with `back`); anything else cut gives None."""
|
||||
found = _HEADER.search(text or "")
|
||||
if not found:
|
||||
return None
|
||||
line = found.group(1)
|
||||
tokens = line.split()[1:]
|
||||
cut = len(line) >= CUT_LINE
|
||||
if any(t in ("-backgroundtask", "--backgroundtask") for t in tokens):
|
||||
return "backgroundtask"
|
||||
if any(t in ("-contentproc", "--contentproc") for t in tokens):
|
||||
return tokens[-1] if not cut and tokens[-1] in CHILD_TYPES else None
|
||||
if not cut:
|
||||
return "parent"
|
||||
last = tokens[-1].lstrip("-") if tokens else ""
|
||||
return "backgroundtask" if len(last) >= FLAG_PREFIX_MIN and "backgroundtask".startswith(last) else None
|
||||
|
||||
|
||||
def function_name(frame: str) -> str:
|
||||
"""The function of a gdb frame line (after `#N `): `0x.. in ns::f<T> (args) at file:7` is `ns::f<T>`; `?? () from lib` is `??`; `<signal handler called>` is itself."""
|
||||
text = re.sub(r"^0x[0-9a-fA-F]+ in ", "", frame.strip())
|
||||
depth = 0
|
||||
for i, ch in enumerate(text):
|
||||
depth += ch == "<"
|
||||
depth -= ch == ">" and depth > 0
|
||||
if ch == " " and depth == 0 and text[i + 1:i + 2] == "(":
|
||||
return text[:i]
|
||||
cut = text.find(" (")
|
||||
text = text[:cut] if cut > 0 else text
|
||||
return text.split(" from ")[0].split(" at ")[0].strip()
|
||||
|
||||
|
||||
def crashing_thread(text: str) -> tuple:
|
||||
"""(the name gdb quotes in the header of the crashing thread or None, the function names of its frames top first or None): the thread `[Current thread is N` names, found in the
|
||||
`thread apply all bt` blocks."""
|
||||
current = _CURRENT_THREAD.search(text or "")
|
||||
if not current:
|
||||
return None, None
|
||||
name, frames, inside = None, [], False
|
||||
for line in text.splitlines():
|
||||
head = _THREAD_HEADER.match(line)
|
||||
if head:
|
||||
inside = head.group(1) == current.group(1)
|
||||
if inside:
|
||||
quoted = re.search(r'"([^"]+)"\s*$', head.group(2))
|
||||
name, frames = (quoted.group(1) if quoted else None), []
|
||||
continue
|
||||
frame = _FRAME.match(line) if inside else None
|
||||
if frame:
|
||||
frames.append(function_name(frame.group(1)))
|
||||
return name, frames or None
|
||||
|
||||
|
||||
def reason_of(text: str) -> str | None:
|
||||
"""The MOZ_CRASH text: the quoted string of the line `x/s *(char**)&gMozCrashReason` prints (`0x...:<tab>"MOZ_CRASH(...)"`), else None."""
|
||||
for line in (text or "").splitlines():
|
||||
found = _REASON_LINE.match(line)
|
||||
if found and found.group(1):
|
||||
return found.group(1)
|
||||
return None
|
||||
|
||||
|
||||
def core_name_parts(name: str) -> tuple:
|
||||
"""(%e, %p, %t) of a core named by the job's `core.%e.%p.%t`: the crashing thread's name, the pid and the time as text; (None, None, None) for any other name."""
|
||||
found = _CORE_NAME.match(name or "")
|
||||
return found.groups() if found else (None, None, None)
|
||||
|
||||
|
||||
def thread_name(text: str, core_name: str) -> str | None:
|
||||
"""The name of the crashing thread without Mozilla's instance number: the name gdb quotes in the thread's header when it does, else %e of the core's name; then a trailing run of
|
||||
decimal digits is dropped. Mozilla names a thread of a process with its instance number appended (the broker thread `FSBroker` is `FSBroker14298`), so the name a row holds is
|
||||
the name without it. None when no name is known or nothing is left."""
|
||||
name = crashing_thread(text)[0] or core_name_parts(core_name)[0]
|
||||
name = re.sub(r"\d+$", "", name or "")
|
||||
return name or None
|
||||
|
||||
|
||||
def phase_of(core_name: str, mtime: float | None, closing_at: float | None) -> str | None:
|
||||
"""`exit` when the core was written at or after the moment the launch began to close the browser, `run` when before; None when either moment cannot be known.
|
||||
The core's time is %t of its name (whole seconds: a core of the second the close began is an exit), else the file's mtime."""
|
||||
if closing_at is None:
|
||||
return None
|
||||
stamp = core_name_parts(core_name)[2]
|
||||
if stamp is not None:
|
||||
return "exit" if int(stamp) + 1 > closing_at else "run"
|
||||
if mtime is None:
|
||||
return None
|
||||
return "exit" if mtime >= closing_at else "run"
|
||||
|
||||
|
||||
def crash_record(text: str, core_name: str, mtime: float | None = None, closing_at: float | None = None) -> dict:
|
||||
"""The record the matcher takes for one core: {process, phase, thread, frames, reason}; a field the evidence cannot give is left out, so a row that names it cannot match.
|
||||
`text` is gdb's text of the core (`gdb_report`), `core_name` the core's file name, `mtime` its modification time, `closing_at` the moment the launch began to close."""
|
||||
frames = crashing_thread(text)[1]
|
||||
out = {"process": process_type(text), "phase": phase_of(core_name, mtime, closing_at), "thread": thread_name(text, core_name), "frames": frames, "reason": reason_of(text)}
|
||||
return {key: value for key, value in out.items() if value is not None}
|
||||
|
||||
|
||||
class DefectsUnavailable(Exception):
|
||||
"""The matcher of known Mozilla defects cannot be had: every crash stays red and the message says why."""
|
||||
|
||||
|
||||
def _download_matcher(run, urlopen, say) -> Path:
|
||||
"""The matcher of the core's main, written to a temporary file: main's sha is resolved with `git ls-remote`, then that exact file is downloaded."""
|
||||
try:
|
||||
done = run(["git", "ls-remote", "https://github.com/%s" % CORE_REPO, "refs/heads/main"], capture_output=True, text=True, timeout=FETCH_TIMEOUT_S, check=False)
|
||||
except (OSError, subprocess.SubprocessError) as exc:
|
||||
raise DefectsUnavailable("main of %s cannot be resolved (%s: %s)" % (CORE_REPO, type(exc).__name__, exc)) from exc
|
||||
words = (done.stdout or "").split()
|
||||
if done.returncode != 0 or not words or not _SHA.match(words[0]):
|
||||
raise DefectsUnavailable("main of %s cannot be resolved (git ls-remote exited %s: %s)" % (CORE_REPO, done.returncode, ((done.stdout or "") + (done.stderr or "")).strip()[:200]))
|
||||
sha = words[0]
|
||||
url = "https://raw.githubusercontent.com/%s/%s/%s" % (CORE_REPO, sha, MATCHER_PATH_IN_CORE)
|
||||
if urlopen is None:
|
||||
import urllib.request
|
||||
|
||||
urlopen = urllib.request.urlopen
|
||||
try:
|
||||
with urlopen(url, timeout=FETCH_TIMEOUT_S) as response:
|
||||
data = response.read()
|
||||
path = Path(tempfile.mkdtemp(prefix="mozilla-defects-checker-")) / Path(MATCHER_PATH_IN_CORE).name
|
||||
path.write_bytes(data)
|
||||
except Exception as exc: # noqa: BLE001 - whatever the download does, the judge is not available
|
||||
raise DefectsUnavailable("%s cannot be downloaded (%s: %s)" % (url, type(exc).__name__, exc)) from exc
|
||||
say("known Mozilla defects: the matcher is %s of %s main, sha %s" % (MATCHER_PATH_IN_CORE, CORE_REPO, sha))
|
||||
return path
|
||||
|
||||
|
||||
def matcher_path(environ=None, run=subprocess.run, urlopen=None, say=print) -> Path:
|
||||
"""Where the matcher is: `$MOZILLA_DEFECTS_CHECKER` when set, else the core's main fetched once per process. DefectsUnavailable when it cannot be had."""
|
||||
env = os.environ if environ is None else environ
|
||||
if env.get(MATCHER_ENV):
|
||||
return Path(env[MATCHER_ENV])
|
||||
if "result" not in _FETCHED:
|
||||
try:
|
||||
_FETCHED["result"] = _download_matcher(run, urlopen, say)
|
||||
except DefectsUnavailable as exc:
|
||||
_FETCHED["result"] = exc
|
||||
if isinstance(_FETCHED["result"], Exception):
|
||||
raise _FETCHED["result"]
|
||||
return _FETCHED["result"]
|
||||
|
||||
|
||||
def load_matcher(path):
|
||||
"""The matcher module imported by path; DefectsUnavailable when it is not a file, does not import or lacks `load`, `problems` or `verdict`."""
|
||||
import importlib.util
|
||||
|
||||
if not Path(path).is_file():
|
||||
raise DefectsUnavailable("the matcher %s does not exist" % path)
|
||||
try:
|
||||
spec = importlib.util.spec_from_file_location("ci_mozilla_defects_of_the_core", str(path))
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
except Exception as exc: # noqa: BLE001 - whatever the file does, the judge is not available
|
||||
raise DefectsUnavailable("the matcher %s cannot be imported (%s: %s)" % (path, type(exc).__name__, exc)) from exc
|
||||
lacking = [name for name in MATCHER_API if not callable(getattr(module, name, None))]
|
||||
if lacking:
|
||||
raise DefectsUnavailable("the matcher %s has no %s: it is not the matcher of known Mozilla defects" % (path, ", ".join(lacking)))
|
||||
return module
|
||||
|
||||
|
||||
def engine_version(binary) -> str:
|
||||
"""The `Version=` of the `application.ini` beside the browser binary (159.0); DefectsUnavailable when there is none."""
|
||||
if not binary:
|
||||
raise DefectsUnavailable("the browser binary is not known, so the engine version is not known")
|
||||
ini = Path(binary).parent / "application.ini"
|
||||
try:
|
||||
text = ini.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError as exc:
|
||||
raise DefectsUnavailable("%s cannot be read (%s): the engine version is not known" % (ini, exc)) from exc
|
||||
found = re.search(r"^Version=(\S+)\s*$", text, re.M)
|
||||
if not found:
|
||||
raise DefectsUnavailable("%s has no Version= line: the engine version is not known" % ini)
|
||||
return found.group(1)
|
||||
|
||||
|
||||
class DefectsJudge:
|
||||
"""The matcher, the wrapper's list of known defects and the engine's version, ready to rule on the crashes of one launch; or, with `why`, the reason it is not available (then
|
||||
every crash is red)."""
|
||||
|
||||
def __init__(self, module=None, rows=None, version: str = "", why: str = "") -> None:
|
||||
self.module, self.rows, self.version, self.why = module, rows, version, why
|
||||
|
||||
def verdict(self, records: list, measurements_complete: bool) -> tuple:
|
||||
"""(red, lines) as the matcher's `verdict` gives them; without a matcher, red and the reason."""
|
||||
if self.module is None:
|
||||
return True, ["known Mozilla defects: not judged, every crash stays red: %s" % self.why]
|
||||
try:
|
||||
red, lines = self.module.verdict(self.rows, self.version, records, measurements_complete)
|
||||
except Exception as exc: # noqa: BLE001 - a crash that cannot be judged stays red
|
||||
return True, ["known Mozilla defects: the matcher cannot rule (%s: %s): the crash stays red" % (type(exc).__name__, exc)]
|
||||
return bool(red), [str(line) for line in lines]
|
||||
|
||||
|
||||
def defects_judge(binary, environ=None, list_path=None, run=subprocess.run, urlopen=None, say=print) -> DefectsJudge:
|
||||
"""The judge for the engine whose browser binary is `binary`. Closed: no matcher, a matcher without the API, a list that cannot be read or no engine version is a judge
|
||||
that keeps every crash red and says why."""
|
||||
try:
|
||||
module = load_matcher(matcher_path(environ, run, urlopen, say))
|
||||
path = Path(list_path) if list_path else DEFECTS_LIST
|
||||
try:
|
||||
rows = module.load(path)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
raise DefectsUnavailable("the list of known defects %s cannot be read (%s)" % (path, exc)) from exc
|
||||
version = engine_version(binary)
|
||||
try:
|
||||
module.problems([], version)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
raise DefectsUnavailable("the matcher cannot use the engine version %s (%s)" % (version, exc)) from exc
|
||||
except DefectsUnavailable as exc:
|
||||
return DefectsJudge(why=str(exc))
|
||||
return DefectsJudge(module, rows, version)
|
||||
|
||||
|
||||
def _judge_launch(judge, launch: dict, measurements_complete: bool, missing=()) -> tuple:
|
||||
"""(excused, lines) of one launch that left cores. The records are the probe's (`launch["crash_records"]`, one per core name); a core with no record is not judged and stays red."""
|
||||
names = list(dict.fromkeys(launch.get("cores") or []))
|
||||
by_core = {c.get("core"): c.get("record") for c in launch.get("crash_records") or [] if isinstance(c, dict)}
|
||||
absent = [n for n in names if not isinstance(by_core.get(n), dict)]
|
||||
if absent:
|
||||
return False, ["known Mozilla defects: no crash record for core %s: the crash stays red" % ", ".join(absent)]
|
||||
red, lines = judge.verdict([by_core[n] for n in names], bool(measurements_complete))
|
||||
if not measurements_complete and missing:
|
||||
lines = list(lines) + ["measurement missing: %s" % "; ".join(str(m) for m in missing)]
|
||||
return (not red), lines
|
||||
|
||||
|
||||
# -
|
||||
# What a crash leaves: the folders, the files, the cores (the collectors that scripts/ci_ab_host.py and the probe's launches share live here).
|
||||
|
||||
@@ -570,6 +855,7 @@ class LaunchProbe:
|
||||
probe._began(conn)
|
||||
|
||||
def close(conn, *args, **kwargs):
|
||||
probe._closing(conn)
|
||||
try:
|
||||
return original_close(conn, *args, **kwargs)
|
||||
finally:
|
||||
@@ -620,6 +906,16 @@ class LaunchProbe:
|
||||
except Exception: # noqa: BLE001 - a probe never breaks a launch
|
||||
pass
|
||||
|
||||
def _closing(self, conn) -> None:
|
||||
"""The launch begins to close the browser (before the close it already makes runs): the moment is the line between a core of the run and a core of the exit."""
|
||||
try:
|
||||
with self._lock:
|
||||
state = self._open.get(id(conn))
|
||||
if state is not None:
|
||||
state.setdefault("closing", self.clock())
|
||||
except Exception: # noqa: BLE001 - a probe never breaks a launch
|
||||
pass
|
||||
|
||||
def _core_folders(self) -> list:
|
||||
if self.core_folders is not None:
|
||||
return list(self.core_folders() if callable(self.core_folders) else self.core_folders)
|
||||
@@ -644,6 +940,8 @@ class LaunchProbe:
|
||||
# EVERY launch: what the browser wrote is saved, and the cores since it began (a content process can die and the parent still end with 0)
|
||||
self._save_output(conn, entry)
|
||||
entry["cores"], entry["dmp"] = [c.name for c in cores], dmp
|
||||
if state.get("closing") is not None:
|
||||
entry["closing_at"] = state["closing"]
|
||||
if not cores:
|
||||
entry["core_said"] = core_said(folders, kernel_core_pattern(), self.windows)
|
||||
if entry["returncode"] != 0 or cores or dmp:
|
||||
@@ -654,11 +952,29 @@ class LaunchProbe:
|
||||
write_crash_files(crash, self.crash_dir / name)
|
||||
entry["evidence"] = "%s/%s" % (self.crash_dir.name, name)
|
||||
entry["said"] = crash["said"]
|
||||
if cores:
|
||||
entry["crash_records"] = self._crash_records(cores, crash, entry.get("closing_at"))
|
||||
except Exception as e: # noqa: BLE001 - what could not be collected is said
|
||||
entry["probe_error"] = "%s: %s" % (type(e).__name__, e)
|
||||
with self._lock:
|
||||
self.launches.append(entry)
|
||||
|
||||
@staticmethod
|
||||
def _crash_records(cores, crash: dict, closing_at) -> list:
|
||||
"""One record per core name (`crash_record`), from the text gdb gave of that core and the core's own name and time: what `exit_problems` judges."""
|
||||
texts = (crash.get("cores") or {}).get("backtraces") or {}
|
||||
records, done = [], set()
|
||||
for core in cores:
|
||||
if core.name in done:
|
||||
continue
|
||||
done.add(core.name)
|
||||
try:
|
||||
mtime = core.stat().st_mtime
|
||||
except OSError:
|
||||
mtime = None
|
||||
records.append({"core": core.name, "record": crash_record(texts.get(core.name, ""), core.name, mtime, closing_at)})
|
||||
return records
|
||||
|
||||
# -
|
||||
# What the browsers wrote.
|
||||
|
||||
@@ -946,9 +1262,11 @@ def read_exits(path) -> dict | None:
|
||||
return document if document.get("format") == FORMAT else None
|
||||
|
||||
|
||||
def exits_of_run(crash_dir, run: str, windows: bool | None = None, needed: bool = True) -> list:
|
||||
def exits_of_run(crash_dir, run: str, windows: bool | None = None, needed: bool = True, notes: list | None = None, measurements_complete: bool | None = None,
|
||||
missing=(), binary: str | None = None) -> list:
|
||||
"""The red lines of the launches a run process recorded in `crash_dir/exits.json`. No file, or no launch in it, is red when the run was to make some: an oracle
|
||||
that did not see how its browsers ended did not see them."""
|
||||
that did not see how its browsers ended did not see them. `notes`, `measurements_complete`, `missing` and `binary` are `exit_problems`': the cores of the launches are judged against
|
||||
the known Mozilla defects only when the caller says whether the run's measurements are complete."""
|
||||
if not crash_dir:
|
||||
return []
|
||||
document = read_exits(Path(crash_dir) / "exits.json")
|
||||
@@ -956,7 +1274,7 @@ def exits_of_run(crash_dir, run: str, windows: bool | None = None, needed: bool
|
||||
return ["the run %s left no record of how its browsers ended (%s/exits.json): the probe did not see them" % (run, Path(crash_dir).name)] if needed else []
|
||||
if not document["launches"] and needed:
|
||||
return ["the run %s recorded no launch in %s/exits.json: the probe did not see a browser" % (run, Path(crash_dir).name)]
|
||||
problems = exit_problems(document["launches"], run, windows)
|
||||
problems = exit_problems(document["launches"], run, windows, notes=notes, measurements_complete=measurements_complete, missing=missing, binary=binary)
|
||||
if document.get("stderr_said"):
|
||||
problems.append("the run %s could not save what its browsers wrote: %s" % (run, document["stderr_said"]))
|
||||
for launch in document["launches"]:
|
||||
|
||||
@@ -248,8 +248,15 @@ def dump_findings(dump: dict, wants: Callable = declared) -> list:
|
||||
# the same seeds. Every leaf that differs is a host dependency the published engine ALREADY has: not a failure of the candidate and never red,
|
||||
# a finding, kept in a file of its own and summarised in the job's summary.
|
||||
|
||||
CLEAN_FILE = "poison-clean-68.json"
|
||||
DEPENDENCE_FILE = "poison-host-dependence-68.json"
|
||||
def clean_file(engine_tag: str) -> str:
|
||||
"""poison-clean-70.json for firefox-70: the published engine's dump on the clean runner (ci_ab_oracle.clean_name). The tag is the one the published set carries."""
|
||||
return "poison-clean-%s.json" % engine_tag.rsplit("-", 1)[-1]
|
||||
|
||||
|
||||
def dependence_file(engine_tag: str) -> str:
|
||||
return "poison-host-dependence-%s.json" % engine_tag.rsplit("-", 1)[-1]
|
||||
|
||||
|
||||
DEPENDENCE_FORMAT = "poison-host-dependence/1"
|
||||
CLIP = 300
|
||||
|
||||
@@ -305,14 +312,17 @@ def dependence_markdown(report: dict | None) -> str:
|
||||
return "\n".join(lines + [""])
|
||||
|
||||
|
||||
def write_dependence(out: Path, summary: Path | None = None) -> dict | None:
|
||||
"""Write DEPENDENCE_FILE in `out` from CLEAN_FILE and dump-68.json there, and the markdown to `summary` (the job's $GITHUB_STEP_SUMMARY).
|
||||
Returns the report, or None when there is no clean dump. Never a verdict."""
|
||||
clean, poisoned = out / CLEAN_FILE, out / "dump-68.json"
|
||||
def write_dependence(out: Path, summary: Path | None = None, engine_tag: str | None = None) -> dict | None:
|
||||
"""Write the dependence file in `out` from the clean dump and the published engine's dump there (named for `engine_tag`, by default the tag the published set carries),
|
||||
and the markdown to `summary` (the job's $GITHUB_STEP_SUMMARY). Returns the report, or None when there is no clean dump. Never a verdict."""
|
||||
import ci_ab_oracle as oracle
|
||||
|
||||
engine_tag = engine_tag or oracle.default_tag()
|
||||
clean, poisoned = out / clean_file(engine_tag), out / oracle.dump_name(engine_tag)
|
||||
report = None
|
||||
if clean.is_file() and poisoned.is_file():
|
||||
report = host_dependence(json.loads(clean.read_text(encoding="utf-8")), json.loads(poisoned.read_text(encoding="utf-8")))
|
||||
(out / DEPENDENCE_FILE).write_text(json.dumps(report, sort_keys=True, ensure_ascii=False), encoding="utf-8")
|
||||
(out / dependence_file(engine_tag)).write_text(json.dumps(report, sort_keys=True, ensure_ascii=False), encoding="utf-8")
|
||||
text = dependence_markdown(report)
|
||||
if summary:
|
||||
with open(summary, "a", encoding="utf-8", newline="\n") as f:
|
||||
|
||||
@@ -0,0 +1,442 @@
|
||||
#!/usr/bin/env python3
|
||||
"""The PUBLISHED SET: the control side of every A/B oracle, exactly as a user installs it.
|
||||
|
||||
An A/B oracle holds a candidate against the engine published before it. That engine is not a binary alone: it is launched by the core that declares the prefs it
|
||||
requires (the engine refuses a launch whose declarations are not the ones it was built for), and that core is the one the published wrapper pins. So the control
|
||||
side is a SET, and nothing in it is chosen by hand: the last published `invisible-playwright` on PyPI pins its core exactly, and that core's seal pins its engine.
|
||||
|
||||
ci/py-lock/published.txt the set as a lock (ci-03): the wrapper and the core it pins, each at an exact version with the sha256 of EVERY file of that
|
||||
version on the index, and the requirements each declares (the headers), which the gate's own lock must satisfy.
|
||||
python scripts/ci_published_set.py resolve [--write] reads PyPI (the only command that does), prints the lock, or writes it
|
||||
python scripts/ci_published_set.py check PyPI's last release against the committed lock: red when they differ (.github/workflows/published-set.yml)
|
||||
python scripts/ci_published_set.py install --house DIR --venv DIR [--lock FILE]
|
||||
OFFLINE and hash-checked: a venv of its own with the gate's third-party lock (DIR/lock.txt), then the two wheels of the set by their hashes
|
||||
(`--no-deps`, from DIR/published: the wheelhouse of the run, whose job downloaded the files this lock names there). Prints the venv's python.
|
||||
DIR itself holds the candidate's wheels of the same two packages (built from core_ref and wrapper_ref, and at an equal version with the SAME
|
||||
file names): the set never takes a file of invisible-core or invisible-playwright from DIR, only from DIR/published.
|
||||
python scripts/ci_published_set.py verify --python PY what that python imports is the lock's set, from its own venv and from nowhere else
|
||||
python scripts/ci_published_set.py fetch --work DIR (run BY the set's python) fetches the engine the way a user's core does: its own seal
|
||||
python scripts/ci_published_set.py tag (run BY the set's python) the tag its seal names
|
||||
|
||||
Exit codes: 0 green, 1 red (a finding), 2 the command could not run.
|
||||
|
||||
The candidate's side is untouched: its core is core_ref's, its wrapper is wrapper_ref's, its engine is the candidate.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import base64
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib.request
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
LOCK_PATH = ROOT / "ci" / "py-lock" / "published.txt"
|
||||
GATE_LOCK_PATH = ROOT / "ci" / "py-lock" / "gate.txt"
|
||||
#: Where the wheelhouse of the run keeps the two wheels of the published set (the wheelhouse's own folder holds the candidate's wheels of the same names).
|
||||
PUBLISHED_DIR = "published"
|
||||
#: What install writes in the venv: which wheel of each package it installed (file name, sha256) and the digest of every file of the package as that wheel holds it. verify reads it
|
||||
#: and holds it to the lock and to the disk: the lock and the candidate's lock can name the same package at the same version, so a version says nothing of WHICH file is installed.
|
||||
RECORD_FILE = "published-set.json"
|
||||
RECORD_FORMAT = "published-set-installed/1"
|
||||
|
||||
WRAPPER = "invisible-playwright"
|
||||
CORE = "invisible-core"
|
||||
INDEX = "https://pypi.org/pypi"
|
||||
|
||||
HASH_RE = re.compile(r"^--hash=sha256:([0-9a-f]{64})$")
|
||||
PIN_RE = re.compile(r"^([A-Za-z0-9][A-Za-z0-9._-]*)==([0-9][A-Za-z0-9.!+_-]*)$")
|
||||
HEADER = ("The PUBLISHED SET, the control side of the A/B oracles (scripts/ci_published_set.py): the last published invisible-playwright and the invisible-core it pins "
|
||||
"(its seal pins the engine). Written by `python scripts/ci_published_set.py resolve --write`; .github/workflows/published-set.yml keeps it equal to the index.")
|
||||
|
||||
#: What a process of the published set must not inherit from the candidate's job: anything that makes its python import another wrapper or another core, or run
|
||||
#: another engine's seal. The set is what its venv holds, as it is on a user's machine.
|
||||
SET_LEAKS = ("PYTHONPATH", "PYTHONHOME", "PYTHONSTARTUP", "PYTHONUSERBASE", "VIRTUAL_ENV", "INVISIBLE_SEAL_FILE", "INVISIBLE_CORE_PIN", "INVISIBLE_CORE_AUTOFIX",
|
||||
"INVISIBLE_PLAYWRIGHT_ENGINE_DIR")
|
||||
|
||||
|
||||
def norm(name: str) -> str:
|
||||
return re.sub(r"[-_.]+", "-", name).lower()
|
||||
|
||||
|
||||
# -
|
||||
# The lock: text <-> parts (pure, no network)
|
||||
|
||||
def _release_parts(release: dict, name: str) -> tuple:
|
||||
"""(version, [sha256 of every file], [requirements without extras]) of a PyPI release document (`/pypi/<name>/<version>/json`)."""
|
||||
info = release.get("info") or {}
|
||||
if norm(info.get("name") or "") != norm(name):
|
||||
raise ValueError("the document is of %r, not %s" % (info.get("name"), name))
|
||||
files = [f for f in release.get("urls") or [] if not f.get("yanked")]
|
||||
hashes = sorted({(f.get("digests") or {}).get("sha256", "") for f in files})
|
||||
if not files or not all(re.fullmatch(r"[0-9a-f]{64}", h) for h in hashes):
|
||||
raise ValueError("%s %s has no file with a sha256 on the index" % (name, info.get("version")))
|
||||
if not any(f.get("packagetype") == "bdist_wheel" for f in files):
|
||||
raise ValueError("%s %s has no wheel on the index" % (name, info.get("version")))
|
||||
requires = [r for r in (info.get("requires_dist") or []) if "extra ==" not in r]
|
||||
return info["version"], hashes, requires
|
||||
|
||||
|
||||
def core_pin_of(requires: list) -> str:
|
||||
"""The version of `invisible-core==X` among the requirements of the wrapper; ValueError when there is not exactly one exact pin."""
|
||||
pins = []
|
||||
for r in requires:
|
||||
m = re.fullmatch(r"\s*invisible[-_.]core\s*==\s*([0-9][A-Za-z0-9.!+_-]*)\s*(?:;.*)?", r)
|
||||
if m:
|
||||
pins.append(m.group(1))
|
||||
if len(pins) != 1:
|
||||
raise ValueError("the published wrapper does not pin invisible-core exactly once with `==` (it declares %s)" % (requires or "nothing"))
|
||||
return pins[0]
|
||||
|
||||
|
||||
def lock_text(wrapper_release: dict, core_release: dict) -> str:
|
||||
version, hashes, requires = _release_parts(wrapper_release, WRAPPER)
|
||||
core_version, core_hashes, core_requires = _release_parts(core_release, CORE)
|
||||
pin = core_pin_of(requires)
|
||||
if pin != core_version:
|
||||
raise ValueError("%s %s pins invisible-core==%s but the core document is of %s" % (WRAPPER, version, pin, core_version))
|
||||
others = [r for r in requires if not re.match(r"\s*invisible[-_.]core\b", r, re.I)]
|
||||
out = ["# " + HEADER,
|
||||
"# wrapper-requires: " + " | ".join(sorted(others)),
|
||||
"# core-requires: " + " | ".join(sorted(core_requires))]
|
||||
for name, v, hs in ((CORE, core_version, core_hashes), (WRAPPER, version, hashes)):
|
||||
out.append("%s==%s \\" % (name, v))
|
||||
out.append(" \\\n".join(" --hash=sha256:" + h for h in hs))
|
||||
return "\n".join(out) + "\n"
|
||||
|
||||
|
||||
def parse_lock(text: str) -> dict:
|
||||
"""{"wrapper": (version, hashes), "core": (version, hashes), "wrapper_requires": [...], "core_requires": [...]}; ValueError names what is wrong.
|
||||
Every entry is `name==version` with at least one sha256: no range, no URL, no entry without a hash."""
|
||||
meta, entries, current = {}, {}, None
|
||||
joined = text.replace("\\\n", " ")
|
||||
for raw in joined.splitlines():
|
||||
line = raw.strip()
|
||||
if not line:
|
||||
continue
|
||||
m = re.match(r"^#\s*(wrapper-requires|core-requires):\s*(.*)$", line)
|
||||
if m:
|
||||
meta[m.group(1)] = [r.strip() for r in m.group(2).split(" | ") if r.strip()]
|
||||
continue
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
parts = line.split()
|
||||
pin = PIN_RE.match(parts[0])
|
||||
if not pin:
|
||||
raise ValueError("a line that is not `name==version --hash=sha256:...`: %r" % line[:80])
|
||||
hashes = []
|
||||
for p in parts[1:]:
|
||||
h = HASH_RE.match(p)
|
||||
if not h:
|
||||
raise ValueError("%s: %r is not a --hash=sha256:<64 hex>" % (parts[0], p[:40]))
|
||||
hashes.append(h.group(1))
|
||||
if not hashes:
|
||||
raise ValueError("%s has no hash: an entry without a hash is an unchecked install" % parts[0])
|
||||
current = norm(pin.group(1))
|
||||
if current in entries:
|
||||
raise ValueError("%s is listed twice" % current)
|
||||
entries[current] = (pin.group(2), sorted(hashes))
|
||||
if sorted(entries) != sorted([CORE, WRAPPER]):
|
||||
raise ValueError("the lock holds %s, it must hold exactly %s and %s" % (sorted(entries), CORE, WRAPPER))
|
||||
for key in ("wrapper-requires", "core-requires"):
|
||||
if key not in meta:
|
||||
raise ValueError("the header line `# %s:` is missing" % key)
|
||||
return {"wrapper": entries[WRAPPER], "core": entries[CORE], "wrapper_requires": meta["wrapper-requires"], "core_requires": meta["core-requires"]}
|
||||
|
||||
|
||||
def locked_versions(gate_text: str) -> dict:
|
||||
"""{normalized name: version} of the pinned entries of a lock (ci/py-lock/gate.txt)."""
|
||||
out = {}
|
||||
for line in gate_text.replace("\\\n", " ").splitlines():
|
||||
m = PIN_RE.match(line.split()[0]) if line.strip() and not line.lstrip().startswith("#") else None
|
||||
if m:
|
||||
out[norm(re.sub(r"\[.*\]", "", m.group(1)))] = m.group(2)
|
||||
return out
|
||||
|
||||
|
||||
def problems_of_lock(parsed: dict, gate_text: str) -> list:
|
||||
"""What makes the set not installable, offline, over the gate's lock: the wrapper's pin of the core is not the core in the lock, or a requirement of either is
|
||||
not met by the third-party package the gate's lock holds (the venv of the set is the gate's lock plus these two wheels, `--no-deps`)."""
|
||||
from packaging.requirements import Requirement # the gate lock installs it (pytest needs it); resolve/check do not come here
|
||||
|
||||
problems = []
|
||||
try:
|
||||
pin = core_pin_of(parsed["wrapper_requires"] + ["%s==%s" % (CORE, parsed["core"][0])])
|
||||
if pin != parsed["core"][0]:
|
||||
problems.append("the lock names core %s" % parsed["core"][0])
|
||||
except ValueError as e:
|
||||
problems.append(str(e))
|
||||
held = locked_versions(gate_text)
|
||||
for owner, requires in (("the published wrapper", parsed["wrapper_requires"]), ("the published core", parsed["core_requires"])):
|
||||
for text in requires:
|
||||
req = Requirement(text)
|
||||
if req.marker is not None and not req.marker.evaluate({"extra": ""}):
|
||||
continue
|
||||
version = held.get(norm(req.name))
|
||||
if version is None:
|
||||
problems.append("%s requires %s: the gate's lock (ci/py-lock/gate.txt) does not hold it, so the set cannot be installed offline" % (owner, text))
|
||||
elif not req.specifier.contains(version, prereleases=True):
|
||||
problems.append("%s requires %s: the gate's lock holds %s==%s" % (owner, text, req.name, version))
|
||||
return problems
|
||||
|
||||
|
||||
# -
|
||||
# The index (the only network here)
|
||||
|
||||
def fetch_json(url: str) -> dict:
|
||||
request = urllib.request.Request(url, headers={"User-Agent": "ci-published-set"})
|
||||
with urllib.request.urlopen(request, timeout=60) as response: # noqa: S310 - the index of the package, https
|
||||
return json.loads(response.read().decode("utf-8"))
|
||||
|
||||
|
||||
def resolve(get=fetch_json) -> str:
|
||||
"""The lock of the last published set: PyPI's latest release of the wrapper, and the core that wrapper pins."""
|
||||
latest = get("%s/%s/json" % (INDEX, WRAPPER))
|
||||
version = (latest.get("info") or {}).get("version")
|
||||
if not version:
|
||||
raise ValueError("the index names no latest version of %s" % WRAPPER)
|
||||
wrapper = get("%s/%s/%s/json" % (INDEX, WRAPPER, version))
|
||||
pin = core_pin_of(_release_parts(wrapper, WRAPPER)[2])
|
||||
return lock_text(wrapper, get("%s/%s/%s/json" % (INDEX, CORE, pin)))
|
||||
|
||||
|
||||
def check(get=fetch_json, path: Path = LOCK_PATH) -> list:
|
||||
"""[] when the committed lock is the index's last release; else the lines that say how it differs (and how to fix it)."""
|
||||
committed = path.read_text(encoding="utf-8") if path.is_file() else ""
|
||||
try:
|
||||
wanted = resolve(get)
|
||||
except (ValueError, OSError) as e:
|
||||
return ["the index could not be read or is not what a release is: %s" % e]
|
||||
if committed == wanted:
|
||||
return []
|
||||
old = parse_lock(committed) if committed else None
|
||||
new = parse_lock(wanted)
|
||||
now = "%s %s + %s %s" % (WRAPPER, new["wrapper"][0], CORE, new["core"][0])
|
||||
was = "%s %s + %s %s" % (WRAPPER, old["wrapper"][0], CORE, old["core"][0]) if old else "nothing"
|
||||
return ["%s holds %s but the index's last release is %s. Fix: python scripts/ci_published_set.py resolve --write, and commit it. "
|
||||
"Rule: the control side of an A/B is the last published set" % (path.name, was, now)]
|
||||
|
||||
|
||||
# -
|
||||
# The venv of the set (offline) and what it must be
|
||||
|
||||
def venv_python(venv: Path) -> Path:
|
||||
return venv / ("Scripts/python.exe" if os.name == "nt" else "bin/python")
|
||||
|
||||
|
||||
def clean_env(extra: dict | None = None) -> dict:
|
||||
env = {k: v for k, v in os.environ.items() if k not in SET_LEAKS}
|
||||
env.update(extra or {})
|
||||
return env
|
||||
|
||||
|
||||
def install(house: Path, venv: Path, lock: Path = LOCK_PATH, run=subprocess.run) -> Path:
|
||||
"""A venv of its own: the gate's third-party lock from the wheelhouse (`house/lock.txt`, the lock of the run), then the two wheels of the set by their hashes, from
|
||||
`house/published` ONLY. Offline: `--no-index` and `--require-hashes` on both; the two are installed `--no-deps` because the first step holds everything they need.
|
||||
|
||||
The wheelhouse's own folder holds the candidate's wheels of invisible-core and invisible-playwright, built from core_ref and wrapper_ref; at an equal version they have
|
||||
the file names of the published ones, so the published ones live in their own folder and are the only place the second step looks: a wheel of ours taken from the wheelhouse
|
||||
would be the candidate's core in the control's venv, or a hash refused. pip never sees the wheelhouse's folder and `published/` in one call: with two `--find-links` it takes
|
||||
the first local file of a name and fails on a hash mismatch, it does not choose by hash. Then `pip check` over the venv: red, with what pip reports, when a requirement of
|
||||
the two wheels is not met."""
|
||||
parse_lock(lock.read_text(encoding="utf-8")) # a lock that does not read is no install
|
||||
house_lock = house / "lock.txt"
|
||||
if not house_lock.is_file():
|
||||
raise FileNotFoundError("the wheelhouse %s has no lock.txt (the gate's lock): it is not a py-deps wheelhouse" % house)
|
||||
published = house / PUBLISHED_DIR
|
||||
if not published.is_dir():
|
||||
raise FileNotFoundError("the wheelhouse %s has no %s/ folder: the two wheels of the published set (the files ci/py-lock/published.txt names) are kept there, "
|
||||
"apart from the candidate's wheels of the same names" % (house, PUBLISHED_DIR))
|
||||
parsed = parse_lock(lock.read_text(encoding="utf-8"))
|
||||
chosen = {name: published_wheel(published, name, *parsed[key]) for key, name in (("core", CORE), ("wrapper", WRAPPER))}
|
||||
run([sys.executable, "-m", "venv", str(venv)], check=True)
|
||||
python = str(venv_python(venv))
|
||||
base = [python, "-m", "pip", "install", "--quiet", "--no-index", "--require-hashes"]
|
||||
run(base + ["--find-links", str(house), "-r", str(house_lock)], check=True, env=clean_env())
|
||||
run(base + ["--find-links", str(published), "--no-deps", "-r", str(lock)], check=True, env=clean_env())
|
||||
# `--no-deps` installs the two wheels without looking at what they declare: pip check does, over the whole venv (the third-party lock and the two wheels).
|
||||
checked = run([python, "-m", "pip", "check"], capture_output=True, text=True, env=clean_env())
|
||||
if checked.returncode != 0:
|
||||
raise RuntimeError("pip check of the published set's venv %s is red (the requirements of the published wheels are not met by the wheelhouse's dependencies): %s"
|
||||
% (venv, (checked.stdout + checked.stderr).strip()[-1500:]))
|
||||
write_record(venv, chosen)
|
||||
return venv_python(venv)
|
||||
|
||||
|
||||
def file_digest(data: bytes) -> str:
|
||||
"""The digest of a file as a wheel's RECORD writes it: `sha256=<urlsafe base64, no padding>`."""
|
||||
return "sha256=" + base64.urlsafe_b64encode(hashlib.sha256(data).digest()).rstrip(b"=").decode()
|
||||
|
||||
|
||||
def published_wheel(published: Path, name: str, version: str, hashes: list) -> tuple:
|
||||
"""(path, sha256) of the wheel of `name` `version` in `published` whose sha256 is one the lock holds. FileNotFoundError names what was there and what the lock holds."""
|
||||
stem = name.replace("-", "_").lower() + "-" + version + "-"
|
||||
seen = []
|
||||
for path in sorted(published.glob("*.whl")):
|
||||
if path.name.lower().startswith(stem):
|
||||
sha = hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
if sha in hashes:
|
||||
return path, sha
|
||||
seen.append("%s sha256 %s" % (path.name, sha))
|
||||
raise FileNotFoundError("%s %s: no wheel in %s has a sha256 the lock (ci/py-lock/published.txt) holds (%s); there %s"
|
||||
% (name, version, published, ", ".join(hashes), "is " + "; ".join(seen) if seen else "is none of that name"))
|
||||
|
||||
|
||||
def package_digests(wheel: Path, package: str) -> dict:
|
||||
"""{path: digest} of every file of the package `package` in the wheel, taken from the bytes of the wheel (its RECORD is not believed)."""
|
||||
with zipfile.ZipFile(wheel) as z:
|
||||
return {n: file_digest(z.read(n)) for n in sorted(z.namelist()) if n.startswith(package + "/") and not n.endswith("/")}
|
||||
|
||||
|
||||
def write_record(venv: Path, chosen: dict) -> Path:
|
||||
"""`chosen` is {distribution: (wheel path, sha256)}: what was installed into `venv`, written where verify reads it."""
|
||||
packages = {name: {"wheel": path.name, "sha256": sha, "files": package_digests(path, name.replace("-", "_"))} for name, (path, sha) in chosen.items()}
|
||||
target = Path(venv) / RECORD_FILE
|
||||
Path(venv).mkdir(parents=True, exist_ok=True)
|
||||
target.write_text(json.dumps({"format": RECORD_FORMAT, "packages": packages}, sort_keys=True, indent=1) + "\n", encoding="utf-8", newline="\n")
|
||||
return target
|
||||
|
||||
|
||||
def installed_problems(prefix: str, parsed: dict, site_files: dict) -> list:
|
||||
"""What the record of the venv `prefix` says was installed, against the lock and against the disk. `site_files` is {distribution: the folder that holds its package}.
|
||||
A package the record names with a sha256 the lock does not hold is red, naming the file and both hashes; so is a file of the package that is not, byte for byte, the wheel's."""
|
||||
path = Path(prefix) / RECORD_FILE
|
||||
if not path.is_file():
|
||||
return ["%s has no %s: nothing says which wheel of invisible-core and invisible-playwright was installed (install writes it); the same version can be a "
|
||||
"different file (the candidate's wheels have the names of the published ones)" % (prefix, RECORD_FILE)]
|
||||
record = json.loads(path.read_text(encoding="utf-8"))
|
||||
problems = []
|
||||
for key, name in (("core", CORE), ("wrapper", WRAPPER)):
|
||||
entry = (record.get("packages") or {}).get(name)
|
||||
if not entry:
|
||||
problems.append("%s: the record of the venv does not name the wheel it installed" % name)
|
||||
continue
|
||||
lock_hashes = parsed[key][1]
|
||||
if entry["sha256"] not in lock_hashes:
|
||||
problems.append("%s: the file installed is %s with sha256 %s, and ci/py-lock/published.txt holds %s (the published set is %s %s)"
|
||||
% (name, entry["wheel"], entry["sha256"], ", ".join(lock_hashes), name, parsed[key][0]))
|
||||
for rel, digest in sorted(entry["files"].items()):
|
||||
target = Path(site_files[name]) / rel
|
||||
actual = file_digest(target.read_bytes()) if target.is_file() else "missing"
|
||||
if actual != digest:
|
||||
problems.append("%s: %s on disk is %s, the wheel %s (sha256 %s) holds %s" % (name, rel, actual, entry["wheel"], entry["sha256"], digest))
|
||||
break
|
||||
return problems
|
||||
|
||||
|
||||
IDENTITY_CODE = """
|
||||
import importlib.metadata as md, json, sys
|
||||
import invisible_core, invisible_playwright
|
||||
from invisible_core.seal import active_seal
|
||||
seal = active_seal()
|
||||
print(json.dumps({"prefix": sys.prefix, "core": md.version("invisible-core"), "core_version": invisible_core.__version__, "core_file": invisible_core.__file__,
|
||||
"wrapper": md.version("invisible-playwright"), "wrapper_file": invisible_playwright.__file__, "seal_tag": seal.tag, "seal_local": seal.is_local}))
|
||||
"""
|
||||
|
||||
|
||||
def identity(python: str, run=subprocess.run) -> dict:
|
||||
"""What `python` is when it imports the set: versions, files and the tag of the seal its core carries (read in isolated mode, with no variable of the job)."""
|
||||
done = run([python, "-I", "-c", IDENTITY_CODE], capture_output=True, text=True, env=clean_env(), timeout=120)
|
||||
if done.returncode != 0:
|
||||
raise RuntimeError("%s could not import the published set (exit %s): %s" % (python, done.returncode, (done.stderr or done.stdout)[-800:]))
|
||||
return json.loads(done.stdout.strip().splitlines()[-1])
|
||||
|
||||
|
||||
def verify(python: str, lock: Path = LOCK_PATH, run=subprocess.run) -> list:
|
||||
"""[] when `python` runs the lock's wrapper and the lock's core, both from its own prefix, under the seal its core was published with, and the files they are made of
|
||||
are the wheels the lock's sha256 name (read from the record install wrote and from the disk, never assumed from the version)."""
|
||||
parsed = parse_lock(lock.read_text(encoding="utf-8"))
|
||||
ident = identity(python, run)
|
||||
problems = []
|
||||
if ident["wrapper"] != parsed["wrapper"][0] or not ident["wrapper_file"].startswith(ident["prefix"]):
|
||||
problems.append("the wrapper it runs is %s from %s, the set says %s from its own venv" % (ident["wrapper"], ident["wrapper_file"], parsed["wrapper"][0]))
|
||||
if ident["core"] != parsed["core"][0] or ident["core_version"] != parsed["core"][0] or not ident["core_file"].startswith(ident["prefix"]):
|
||||
problems.append("the core it runs is %s (reports %s) from %s, the set says %s from its own venv"
|
||||
% (ident["core"], ident["core_version"], ident["core_file"], parsed["core"][0]))
|
||||
if ident["seal_local"]:
|
||||
problems.append("its core runs under a local seal: a published core carries a release seal")
|
||||
problems += installed_problems(ident["prefix"], parsed, {CORE: str(Path(ident["core_file"]).parent.parent), WRAPPER: str(Path(ident["wrapper_file"]).parent.parent)})
|
||||
return problems
|
||||
|
||||
|
||||
# -
|
||||
# What the set's own python does (the commands below are run BY it: they import the published core)
|
||||
|
||||
def fetch(work: Path) -> dict:
|
||||
"""The engine of the core this python has, fetched the way a user's core fetches it: its own seal, its own download, its own verification."""
|
||||
from invisible_core import download
|
||||
from invisible_core.seal import active_seal
|
||||
|
||||
work = Path(work)
|
||||
os.environ[download.ENGINE_DIR_ENV] = str(work / "engines")
|
||||
seal = active_seal()
|
||||
binary = download.ensure_binary()
|
||||
return {"binary": str(binary), "tag": seal.tag, "describe": seal.describe()}
|
||||
|
||||
|
||||
def main(argv=None) -> int:
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||
sub = ap.add_subparsers(dest="cmd", required=True)
|
||||
r = sub.add_parser("resolve")
|
||||
r.add_argument("--write", action="store_true")
|
||||
sub.add_parser("check")
|
||||
i = sub.add_parser("install")
|
||||
i.add_argument("--house", type=Path, required=True)
|
||||
i.add_argument("--venv", type=Path, required=True)
|
||||
i.add_argument("--lock", type=Path, default=LOCK_PATH)
|
||||
v = sub.add_parser("verify")
|
||||
v.add_argument("--python", required=True)
|
||||
v.add_argument("--lock", type=Path, default=LOCK_PATH)
|
||||
f = sub.add_parser("fetch")
|
||||
f.add_argument("--work", type=Path, required=True)
|
||||
sub.add_parser("tag")
|
||||
args = ap.parse_args(argv)
|
||||
try:
|
||||
if args.cmd == "resolve":
|
||||
text = resolve()
|
||||
if args.write:
|
||||
LOCK_PATH.write_text(text, encoding="utf-8", newline="\n")
|
||||
print("wrote %s" % LOCK_PATH)
|
||||
else:
|
||||
sys.stdout.write(text)
|
||||
return 0
|
||||
if args.cmd == "check":
|
||||
problems = check()
|
||||
print("\n".join("FAIL " + p for p in problems) if problems else "OK the committed published set is the index's last release")
|
||||
return 1 if problems else 0
|
||||
if args.cmd == "install":
|
||||
python = install(args.house, args.venv, args.lock)
|
||||
problems = verify(str(python), args.lock)
|
||||
for name, entry in sorted(json.loads((args.venv / RECORD_FILE).read_text(encoding="utf-8"))["packages"].items()):
|
||||
print("installed %s: %s sha256 %s" % (name, entry["wheel"], entry["sha256"]), file=sys.stderr)
|
||||
if problems:
|
||||
print("\n".join("FAIL " + p for p in problems))
|
||||
return 1
|
||||
print(python)
|
||||
return 0
|
||||
if args.cmd == "verify":
|
||||
problems = verify(args.python, args.lock)
|
||||
print("\n".join("FAIL " + p for p in problems) if problems else "OK")
|
||||
return 1 if problems else 0
|
||||
if args.cmd == "fetch":
|
||||
print(json.dumps(fetch(args.work)))
|
||||
return 0
|
||||
if args.cmd == "tag":
|
||||
from invisible_core.seal import active_seal
|
||||
|
||||
print(active_seal().tag)
|
||||
return 0
|
||||
except (ValueError, OSError, RuntimeError, subprocess.CalledProcessError) as e:
|
||||
print("ERROR %s: %s" % (type(e).__name__, e))
|
||||
return 2
|
||||
return 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,227 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extracts, from Mozilla's own sources at a release tag, the names a chrome-scope script of a test may call, into ci/mozilla-chrome-api.json.
|
||||
|
||||
A twin of the retail Firefox runs chrome JS (through Marionette) on a Firefox that is NOT ours. A call to a name that this Firefox does not have fails there only, at the run:
|
||||
``win.windowUtils.sendMouseEvent`` is not in Firefox 159 (its chrome input is ``Window.synthesizeMouseEvent``), and nothing red said so before the twins ran. The names are therefore read
|
||||
from the source of the release the twins use, never typed:
|
||||
|
||||
* ``dom/interfaces/base/nsIDOMWindowUtils.idl``: the methods, attributes and constants of ``nsIDOMWindowUtils`` (what ``win.windowUtils.<name>`` reaches);
|
||||
* ``dom/webidl/Window.webidl``: the members of ``interface Window`` and ``partial interface Window`` (with the parameter types and whether the member is ``ChromeOnly``), and every
|
||||
dictionary with its fields, parents included (what the options of ``win.synthesizeMouseEvent`` may carry).
|
||||
|
||||
The same two files of OUR engine tree are read the same way, and what they carry that Mozilla's do not is written apart, under ``ours``: ``jugglerSendMouseEvent``, the fields of the
|
||||
latency line. A call to one of those from code that runs on retail Firefox is red (tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py).
|
||||
|
||||
The file records, for every source, its path, the tag or commit and the sha256 of the bytes read. The wrapper's CI has no Firefox source, so the test reads the committed file and this
|
||||
module's functions are tested on a small sample (tests/test_the_extractor_of_the_chrome_names_reads_idl_and_webidl.py). One command regenerates the file:
|
||||
|
||||
python scripts/extract_mozilla_chrome_api.py --mozilla-repo <git repository with the Mozilla tag> --tag FIREFOX_159_0_RELEASE --ours-repo <our engine tree> --ours-ref <commit> --write
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
DATA_PATH = ROOT / "ci" / "mozilla-chrome-api.json"
|
||||
|
||||
WINDOW_UTILS_IDL = "dom/interfaces/base/nsIDOMWindowUtils.idl"
|
||||
WINDOW_WEBIDL = "dom/webidl/Window.webidl"
|
||||
SOURCES = (WINDOW_UTILS_IDL, WINDOW_WEBIDL)
|
||||
|
||||
_BLOCK_COMMENT = re.compile(r"/\*.*?\*/", re.S)
|
||||
_LINE_COMMENT = re.compile(r"//[^\n]*")
|
||||
_LEADING_ATTRS = re.compile(r"^\s*(?:\[[^\]]*\]\s*)*")
|
||||
_WORD = re.compile(r"[A-Za-z_]\w*")
|
||||
|
||||
|
||||
def strip_comments(text: str) -> str:
|
||||
"""The text without comments and without preprocessor lines."""
|
||||
text = _BLOCK_COMMENT.sub(" ", text)
|
||||
text = _LINE_COMMENT.sub("", text)
|
||||
return "\n".join(line for line in text.splitlines() if not line.lstrip().startswith("#"))
|
||||
|
||||
|
||||
def _bodies(text: str, header: "re.Pattern[str]") -> List[Tuple[re.Match, str]]:
|
||||
"""Every ``header { body }`` of ``text`` (braces matched), with the header's match."""
|
||||
out: List[Tuple[re.Match, str]] = []
|
||||
for m in header.finditer(text):
|
||||
depth, i = 1, m.end()
|
||||
while i < len(text) and depth:
|
||||
depth += {"{": 1, "}": -1}.get(text[i], 0)
|
||||
i += 1
|
||||
out.append((m, text[m.end():i - 1]))
|
||||
return out
|
||||
|
||||
|
||||
def _statements(body: str) -> List[str]:
|
||||
"""The ``;``-terminated statements at the top level of ``body`` (a nested ``{}`` or ``()`` does not end one)."""
|
||||
out, depth, cur = [], 0, []
|
||||
for ch in body:
|
||||
if ch in "{(":
|
||||
depth += 1
|
||||
elif ch in "})":
|
||||
depth -= 1
|
||||
if ch == ";" and depth == 0:
|
||||
out.append("".join(cur).strip())
|
||||
cur = []
|
||||
else:
|
||||
cur.append(ch)
|
||||
return [s for s in out if s]
|
||||
|
||||
|
||||
def _split_params(text: str) -> List[str]:
|
||||
out, depth, cur = [], 0, []
|
||||
for ch in text:
|
||||
if ch in "<([":
|
||||
depth += 1
|
||||
elif ch in ">)]":
|
||||
depth -= 1
|
||||
if ch == "," and depth == 0:
|
||||
out.append("".join(cur).strip())
|
||||
cur = []
|
||||
else:
|
||||
cur.append(ch)
|
||||
tail = "".join(cur).strip()
|
||||
return out + [tail] if tail else out
|
||||
|
||||
|
||||
def _params(signature: str) -> List[List[str]]:
|
||||
"""``[[name, type], ...]`` of the parameters of the call in ``signature`` (``optional`` and defaults dropped, ``in`` of the IDL dropped)."""
|
||||
start = signature.index("(")
|
||||
depth, i = 0, start
|
||||
while i < len(signature):
|
||||
depth += {"(": 1, ")": -1}.get(signature[i], 0)
|
||||
if depth == 0:
|
||||
break
|
||||
i += 1
|
||||
out = []
|
||||
for raw in _split_params(signature[start + 1:i]):
|
||||
raw = re.sub(r"\[[^\]]*\]", " ", raw.split("=")[0])
|
||||
words = [w for w in raw.replace("<", " < ").replace(">", " > ").split() if w not in ("optional", "in", "out", "inout", "required")]
|
||||
text = " ".join(words).replace(" < ", "<").replace(" > ", ">").replace(" ,", ",")
|
||||
if not text:
|
||||
continue
|
||||
m = re.search(r"(\w+)$", text)
|
||||
out.append([m.group(1), text[:m.start()].strip()])
|
||||
return out
|
||||
|
||||
|
||||
def window_utils(idl_text: str) -> Dict[str, List[str]]:
|
||||
"""The methods, attributes and constants of ``nsIDOMWindowUtils`` in the text of its IDL file."""
|
||||
text = strip_comments(idl_text)
|
||||
methods, attributes, constants = set(), set(), set()
|
||||
for _m, body in _bodies(text, re.compile(r"interface\s+nsIDOMWindowUtils\b[^{;]*\{")):
|
||||
for statement in _statements(body):
|
||||
rest = _LEADING_ATTRS.sub("", statement).strip()
|
||||
if rest.startswith("const "):
|
||||
constants.add(_WORD.findall(rest.split("=")[0])[-1])
|
||||
elif re.search(r"\battribute\b", rest):
|
||||
attributes.add(_WORD.findall(rest.split("=")[0])[-1])
|
||||
elif "(" in rest:
|
||||
methods.add(_WORD.findall(rest.split("(")[0])[-1])
|
||||
return {"methods": sorted(methods), "attributes": sorted(attributes), "constants": sorted(constants)}
|
||||
|
||||
|
||||
def window(webidl_text: str) -> Dict[str, Any]:
|
||||
"""The members of ``Window`` (``interface`` and ``partial interface``) and every dictionary, parents folded in, from the text of a WebIDL file."""
|
||||
text = strip_comments(webidl_text)
|
||||
methods: Dict[str, Dict[str, Any]] = {}
|
||||
attributes: Dict[str, Dict[str, Any]] = {}
|
||||
for _m, body in _bodies(text, re.compile(r"(?:partial\s+)?interface\s+Window\b[^{;]*\{")):
|
||||
for statement in _statements(body):
|
||||
attrs = re.match(r"^\s*((?:\[[^\]]*\]\s*)*)", statement).group(1)
|
||||
rest = _LEADING_ATTRS.sub("", statement).strip()
|
||||
chrome_only = bool(re.search(r"\bChromeOnly\b", attrs))
|
||||
if re.search(r"\battribute\b", rest):
|
||||
attributes[_WORD.findall(rest.split("=")[0])[-1]] = {"chrome_only": chrome_only}
|
||||
elif "(" in rest and not rest.startswith("constructor"):
|
||||
name = _WORD.findall(rest.split("(")[0])[-1]
|
||||
methods[name] = {"chrome_only": chrome_only, "params": _params(rest)}
|
||||
own: Dict[str, Tuple[Optional[str], List[str]]] = {}
|
||||
for m, body in _bodies(text, re.compile(r"dictionary\s+(\w+)\s*(?::\s*(\w+))?\s*\{")):
|
||||
fields = []
|
||||
for statement in _statements(body):
|
||||
rest = _LEADING_ATTRS.sub("", statement.split("=")[0]).strip()
|
||||
if rest:
|
||||
fields.append(_WORD.findall(rest)[-1])
|
||||
own[m.group(1)] = (m.group(2), fields)
|
||||
|
||||
def flat(name: str) -> List[str]:
|
||||
parent, fields = own[name]
|
||||
return sorted(set(fields) | (set(flat(parent)) if parent in own else set()))
|
||||
|
||||
return {
|
||||
"methods": {k: methods[k] for k in sorted(methods)},
|
||||
"attributes": {k: attributes[k] for k in sorted(attributes)},
|
||||
"dictionaries": {k: flat(k) for k in sorted(own)},
|
||||
}
|
||||
|
||||
|
||||
def extract(idl_text: str, webidl_text: str) -> Dict[str, Any]:
|
||||
return {"window_utils": window_utils(idl_text), "window": window(webidl_text)}
|
||||
|
||||
|
||||
def only_in_ours(mozilla: Dict[str, Any], ours: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""What the extraction of our tree carries and Mozilla's does not."""
|
||||
out: Dict[str, Any] = {"window_utils": {}, "window": {"methods": [], "attributes": [], "dictionaries": {}}}
|
||||
for kind in ("methods", "attributes", "constants"):
|
||||
out["window_utils"][kind] = sorted(set(ours["window_utils"][kind]) - set(mozilla["window_utils"][kind]))
|
||||
for kind in ("methods", "attributes"):
|
||||
out["window"][kind] = sorted(set(ours["window"][kind]) - set(mozilla["window"][kind]))
|
||||
for name, fields in ours["window"]["dictionaries"].items():
|
||||
extra = sorted(set(fields) - set(mozilla["window"]["dictionaries"].get(name, [])))
|
||||
if extra:
|
||||
out["window"]["dictionaries"][name] = extra
|
||||
return out
|
||||
|
||||
|
||||
def _git_show(repo: Path, ref: str, path: str) -> bytes:
|
||||
return subprocess.run(["git", "-C", str(repo), "show", "%s:%s" % (ref, path)], check=True, capture_output=True).stdout
|
||||
|
||||
|
||||
def _read_source(repo: Path, ref: str) -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
||||
blobs = {path: _git_show(repo, ref, path) for path in SOURCES}
|
||||
parsed = extract(blobs[WINDOW_UTILS_IDL].decode("utf-8"), blobs[WINDOW_WEBIDL].decode("utf-8"))
|
||||
sources = [{"path": path, "sha256": hashlib.sha256(blobs[path]).hexdigest()} for path in SOURCES]
|
||||
commit = subprocess.run(["git", "-C", str(repo), "rev-parse", "%s^{commit}" % ref], check=True, capture_output=True, text=True).stdout.strip()
|
||||
return parsed, {"ref": ref, "commit": commit, "files": sources}
|
||||
|
||||
|
||||
def build(mozilla_repo: Path, tag: str, ours_repo: Path, ours_ref: str) -> Dict[str, Any]:
|
||||
mozilla, mozilla_source = _read_source(mozilla_repo, tag)
|
||||
ours, ours_source = _read_source(ours_repo, ours_ref)
|
||||
return {
|
||||
"about": "Names a chrome-scope script of a test may call on the retail Firefox of the twins, extracted by scripts/extract_mozilla_chrome_api.py. Never edited by hand.",
|
||||
"mozilla": dict(mozilla_source, **mozilla),
|
||||
"ours": dict(ours_source, **only_in_ours(mozilla, ours)),
|
||||
}
|
||||
|
||||
|
||||
def main(argv: Optional[List[str]] = None) -> int:
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||
ap.add_argument("--mozilla-repo", type=Path, required=True)
|
||||
ap.add_argument("--tag", required=True)
|
||||
ap.add_argument("--ours-repo", type=Path, required=True)
|
||||
ap.add_argument("--ours-ref", required=True)
|
||||
ap.add_argument("--write", action="store_true", help="write ci/mozilla-chrome-api.json; without it the file is compared and the exit is 1 when it differs")
|
||||
args = ap.parse_args(argv)
|
||||
data = build(args.mozilla_repo, args.tag, args.ours_repo, args.ours_ref)
|
||||
text = json.dumps(data, indent=2, sort_keys=True) + "\n"
|
||||
if args.write:
|
||||
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
|
||||
print("wrote %s" % DATA_PATH)
|
||||
return 0
|
||||
same = DATA_PATH.read_text(encoding="utf-8") == text
|
||||
print("%s %s" % (DATA_PATH, "is what the sources give" if same else "DIFFERS from what the sources give: regenerate it with --write"))
|
||||
return 0 if same else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,134 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extracts, from the retail capture of the password-mask probe, the width retail Firefox on Windows gives a password field, into ci/retail-password-mask.json.
|
||||
|
||||
The e2e test ``tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py`` compares the width a page reads on a password field of our engine with the width RETAIL Firefox 159 on
|
||||
Windows read in the same page. That number is typed nowhere: it is read here from the capture,
|
||||
|
||||
``captures/firefox-159.0/windows-server-2025/password-mask/<date>/result.json``: the page's whole reading (``fonts.arial16.password["40"].scrollWidth``, the ``scrollWidth`` of an
|
||||
``<input type=password>`` of 40 x "a" in Arial 16px, the number a page reads) and ``meta.json`` (the sha256 of every file of the capture, of the page, of the binaries).
|
||||
|
||||
What is refused rather than filled in: a ``result.json`` whose sha256 is not the one ``meta.json`` lists; a page that is not the page of the capture (the sha256 of
|
||||
``tests/data/password_mask_page.html`` must be ``meta.json``'s ``page.sha256``); a result with an ``error``, another ``n``, or no ``arial16`` reading; a reading that disagrees with itself (the width of
|
||||
the password field in its own box and in the box of the 1, 10, 40 series; the verdict of the page, which must name U+25CF alone, the character Windows masks with).
|
||||
|
||||
The file records the capture's commit and run, the browser (version, build id, installer, ``firefox.exe`` and ``xul.dll`` sha256) and the sha256 of every file read. The wrapper's CI has no capture, so the
|
||||
tests read the committed file and this module's functions are tested on a small sample (tests/test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py). One command regenerates it:
|
||||
|
||||
python scripts/extract_retail_password_mask.py --capture <RetailCaptures>/captures/firefox-159.0/windows-server-2025/password-mask/2026-12-02 --commit <RetailCaptures commit> --write
|
||||
|
||||
and the same without ``--write`` compares the committed file with what the capture gives (the check).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
DATA_PATH = ROOT / "ci" / "retail-password-mask.json"
|
||||
PAGE_PATH = ROOT / "tests" / "data" / "password_mask_page.html"
|
||||
|
||||
#: The characters of the field: ``N`` copies of "a", read in the font case ``arial16`` (``font-family:Arial;font-size:16px``).
|
||||
N = 40
|
||||
FONT_CASE = "arial16"
|
||||
#: What Windows masks a password field with, and what the page's verdict must therefore name.
|
||||
MASK = "U+25CF"
|
||||
FORMAT = "password-mask/1"
|
||||
|
||||
|
||||
class ExtractError(Exception):
|
||||
"""What the capture does not give, or gives two ways: nothing is invented in its place."""
|
||||
|
||||
|
||||
def sha256_of(path: Path) -> str:
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def reading(result: Dict[str, Any], where: str) -> Dict[str, Any]:
|
||||
"""The width of the password field in ``arial16``, after the checks of the reading against itself."""
|
||||
if "error" in result:
|
||||
raise ExtractError("%s: the page recorded an error: %s" % (where, str(result["error"])[:200]))
|
||||
if result.get("format") != FORMAT or result.get("n") != N:
|
||||
raise ExtractError("%s: format %r and n %r, not %r and %r" % (where, result.get("format"), result.get("n"), FORMAT, N))
|
||||
try:
|
||||
font = result["fonts"][FONT_CASE]
|
||||
width = font["password"][str(N)]["scrollWidth"]
|
||||
main = font["password"][str(N)]["scrollWidth_main"]
|
||||
mask_width = font["refs"][MASK]["text_input"][str(N)]["scrollWidth"]
|
||||
verdict = font["verdict"]["by_text_input_scrollWidth"]
|
||||
platform, dpr = result["env"]["platform"], result["env"]["devicePixelRatio"]
|
||||
except (KeyError, TypeError) as exc:
|
||||
raise ExtractError("%s: the reading lacks %s: no retail value, none invented" % (where, exc))
|
||||
if not isinstance(width, int) or width <= 0:
|
||||
raise ExtractError("%s: the width %r is not a positive integer" % (where, width))
|
||||
if main != width:
|
||||
raise ExtractError("%s: the password field reads %r in its own box and %r in the series box" % (where, main, width))
|
||||
if mask_width != width or verdict != [MASK]:
|
||||
raise ExtractError("%s: the password field is %r wide, %s in a text input is %r and the page's verdict is %r: not the mask character of Windows" % (where, width, MASK, mask_width, verdict))
|
||||
if platform != "Win32":
|
||||
raise ExtractError("%s: navigator.platform is %r, not Win32: not a Windows capture" % (where, platform))
|
||||
return {"password_scrollWidth": width, "mask": MASK, "devicePixelRatio": dpr, "platform": platform}
|
||||
|
||||
|
||||
def build(capture: Path, commit: str, page: Path = PAGE_PATH) -> Dict[str, Any]:
|
||||
result_path, meta_path = capture / "result.json", capture / "meta.json"
|
||||
for path in (result_path, meta_path, page):
|
||||
if not path.is_file():
|
||||
raise ExtractError("missing %s" % path)
|
||||
meta = json.loads(meta_path.read_text(encoding="utf-8"))
|
||||
listed = meta.get("files", {}).get("result.json", {}).get("sha256")
|
||||
if listed != sha256_of(result_path):
|
||||
raise ExtractError("%s is %s and meta.json lists %r: not the file the capture recorded" % (result_path, sha256_of(result_path), listed))
|
||||
page_sha = sha256_of(page)
|
||||
if page_sha != meta.get("page", {}).get("sha256"):
|
||||
raise ExtractError("%s is %s and the capture's page is %r: the test would not read the page retail read" % (page, page_sha, meta.get("page", {}).get("sha256")))
|
||||
got = reading(json.loads(result_path.read_text(encoding="utf-8")), str(result_path))
|
||||
binaries = meta.get("binaries", {})
|
||||
return {
|
||||
"about": "What retail Firefox on Windows reads on a password field in the page tests/data/password_mask_page.html (the width of 40 x 'a' in Arial 16px, which is 40 times the advance of the mask character), extracted by scripts/extract_retail_password_mask.py. Never edited by hand.",
|
||||
"capture": {
|
||||
"folder": "captures/firefox-159.0/windows-server-2025/password-mask/%s" % capture.name,
|
||||
"retail_captures_commit": commit,
|
||||
"run": "https://github.com/%s/actions/runs/%s" % (meta["source_run"]["repo"], meta["source_run"]["run_id"]),
|
||||
"browser": {"firefox_version": meta["firefox_version"], "build_id": meta["build_id"], "installer_sha256": binaries.get("installer_sha256"),
|
||||
"firefox_exe_sha256": binaries.get("firefox_exe_sha256"), "xul_dll_sha256": binaries.get("xul_dll_sha256")},
|
||||
"host": {"runner_image": meta["host"]["runner_image"], "os_version": meta["host"]["os_version"], "os_ubr": meta["host"]["os_ubr"]},
|
||||
},
|
||||
"files": [{"path": "result.json", "sha256": sha256_of(result_path)}, {"path": "meta.json", "sha256": sha256_of(meta_path)}],
|
||||
"page": {"path": "tests/data/password_mask_page.html", "sha256": page_sha},
|
||||
"n": N,
|
||||
"cases": {FONT_CASE: got},
|
||||
}
|
||||
|
||||
|
||||
def dumps(data: Dict[str, Any]) -> str:
|
||||
return json.dumps(data, indent=2, sort_keys=False) + "\n"
|
||||
|
||||
|
||||
def main(argv: Optional[List[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
|
||||
parser.add_argument("--capture", required=True, type=Path, help="the folder of the capture in RetailCaptures (result.json and meta.json)")
|
||||
parser.add_argument("--commit", required=True, help="the RetailCaptures commit the capture is in")
|
||||
parser.add_argument("--write", action="store_true", help="write ci/retail-password-mask.json; without it the committed file is compared with the capture")
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
text = dumps(build(args.capture.resolve(), args.commit))
|
||||
except ExtractError as exc:
|
||||
print("EXTRACTION FAILED: %s" % exc, file=sys.stderr)
|
||||
return 2
|
||||
if args.write:
|
||||
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
|
||||
print("wrote %s" % DATA_PATH)
|
||||
return 0
|
||||
if DATA_PATH.read_text(encoding="utf-8") != text:
|
||||
print("%s is not what the capture gives" % DATA_PATH, file=sys.stderr)
|
||||
return 1
|
||||
print("%s is what the capture gives" % DATA_PATH)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,337 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extracts, from the retail capture ``popup-move-to``, what a popup of the maximized window reads after ``resizeBy(0, 0)``, ``moveBy(10, 10)`` and ``moveTo(99999, 0)``, per display case, per phase of the wrapper test and
|
||||
per POSITION in the browser's life, into ci/retail-popup-move-resize.json.
|
||||
|
||||
The e2e test ``tests/test_a_popup_moves_and_resizes_as_declared_e2e.py`` compares a popup of ours with what RETAIL Firefox 159 on Windows read. An expected value comes from a capture of the SAME sequence,
|
||||
position in the browser's life included: at a real 150% retail opens the FIRST popup of a browser one device pixel narrower (inner width 499, outer 514) than every popup after it (500, 515), ``resizeBy(0, 0)``
|
||||
leaves the first at 499 and takes a later one to 501, and ``moveTo(99999, 0)`` stops at 766 for the first and 765 for a later one. The numbers are read from the capture, never typed:
|
||||
|
||||
* ``popup-move-to/<date>/<dpr>/<panel>/<launch>/raw.json`` (format ``retail-popup-move-to/1``), four launches per display case, each popup opened by a real click with ``width=500,height=400`` and closed before the next:
|
||||
``a`` the test's order (phase 1 ``resizeBy(0, 0)``, phase 2 ``moveBy(10, 10)``, phase 3 ``moveBy(10, 10)`` then ``moveTo(99999, 0)``: phase 1 is the first popup of the browser), ``b`` phase 3 alone, ``c`` a throwaway
|
||||
popup (no call) and then the three phases, ``d`` phase 2 alone. Every phase is thus read as the first popup of a browser (``first``: a, d, b) and as a later popup (``later``: c; a and c; a and c). Each step carries
|
||||
its ordinal; the plan of every launch, the calls, the features, the close of every popup and the order of the moments are checked, and popups of the same phase and position must read the same, or the extraction fails.
|
||||
* The sha256 of every raw.json is checked against the ``meta.json`` of its scale before it is read, and the run id, the browser (version, build id, installer sha256) and the sha256 of ``firefox.exe`` and
|
||||
``xul.dll`` (``run-info.json``) are recorded.
|
||||
* The window-geometry rounds named on the command line (``--rounds``; step ``popup_move_resize``: ``initial`` and ``resized`` as a later popup after many steps) are cross-checked: what they read after
|
||||
``resizeBy(0, 0)`` must be what some position of the capture reads (at 1.5: 500 then 501, the ``later`` popup), or the extraction fails, an anomaly reported and not chosen. They must agree with each other
|
||||
(all rounds, launches ``a`` and ``b``). The test does not read them.
|
||||
|
||||
Each phase of the test asserts against the position it has in the test: phase 1 is the first popup of its browser (``first``), phases 2 and 3 are later ones.
|
||||
|
||||
The wrapper's CI has no capture, so the tests read the committed file and this module's functions are tested on a small sample (tests/test_the_retail_popup_moves_and_resizes_are_extracted_from_the_capture_not_typed.py).
|
||||
One command regenerates the file:
|
||||
|
||||
python scripts/extract_retail_popup_move_resize.py --captures <RetailCaptures>/captures --rounds 2026-11-29-window-geometry-r8 2026-11-30-window-geometry-r9 2026-11-30-window-geometry-r11 2026-12-01-window-geometry-r12 --commit <RetailCaptures commit> --move-to-capture <RetailCaptures>/captures/firefox-159.0/windows-server-2025/popup-move-to/2026-12-02 --move-to-run-id <id of the run> --move-to-commit <RetailCaptures commit> --write
|
||||
|
||||
and the same without ``--write`` compares the committed file with what the captures give (the check).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
|
||||
from extract_retail_popup_sizes import BROWSER_DIR, DISPLAYS, ExtractError, case_id, sha256_of # noqa: E402
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
DATA_PATH = ROOT / "ci" / "retail-popup-move-resize.json"
|
||||
MOMENTS = ("initial", "resized", "moved", "moved_to")
|
||||
FEATURES = "width=500,height=400"
|
||||
#: ``popup-move-to`` capture: the format of its raw.json and meta.json, the phase, and the order of phases of launch ``a`` (the test's order: phase 3 is the third popup).
|
||||
MOVE_TO_FORMAT = "retail-popup-move-to/1"
|
||||
MOVE_TO_META_FORMAT = "retail-popup-move-to-meta/1"
|
||||
POSITION_FIRST = "first"
|
||||
POSITION_LATER = "later"
|
||||
MOVE_TO_PHASES = ["resize_by_zero", "move_by", "move_to_far_right"]
|
||||
#: The launches of the capture and the popups each opens in order (``scripts/popup_move_to/run.py``, LAUNCHES): a is the test's order (phase 1 is the first popup of the browser); b phase 3 alone; c a throwaway
|
||||
#: popup opened and closed first (no call), then the three phases; d phase 2 alone. Every phase is thus read as the first popup of a browser and as a later one.
|
||||
MOVE_TO_LAUNCHES = {
|
||||
"a": ["resize_by_zero", "move_by", "move_to_far_right"],
|
||||
"b": ["move_to_far_right"],
|
||||
"c": ["throwaway", "resize_by_zero", "move_by", "move_to_far_right"],
|
||||
"d": ["move_by"],
|
||||
}
|
||||
MOVE_TO_MOMENTS = {
|
||||
"throwaway": ("initial",),
|
||||
"resize_by_zero": ("initial", "resized"),
|
||||
"move_by": ("initial", "moved"),
|
||||
"move_to_far_right": ("initial", "moved", "moved_to"),
|
||||
}
|
||||
MOVE_TO_CALLS = {
|
||||
"throwaway": {},
|
||||
"resize_by_zero": {"resized": "window.resizeBy(0, 0)"},
|
||||
"move_by": {"moved": "window.moveBy(10, 10)"},
|
||||
"move_to_far_right": {"moved": "window.moveBy(10, 10)", "moved_to": "window.moveTo(99999, 0)"},
|
||||
}
|
||||
MOVE_TO_BINARIES = ("firefox.exe", "xul.dll")
|
||||
|
||||
|
||||
def moment_reading(moment: Dict[str, Any], where: str) -> Dict[str, Any]:
|
||||
try:
|
||||
return {
|
||||
"inner": [moment["innerWidth"], moment["innerHeight"]],
|
||||
"outer": [moment["outerWidth"], moment["outerHeight"]],
|
||||
"screen": [moment["screenX"], moment["screenY"]],
|
||||
"avail": [moment["availLeft"], moment["availWidth"]],
|
||||
}
|
||||
except (KeyError, TypeError) as exc:
|
||||
raise ExtractError("%s: the moment lacks %s" % (where, exc))
|
||||
|
||||
|
||||
def read_step(raw: Dict[str, Any], where: str) -> Dict[str, Dict[str, Any]]:
|
||||
try:
|
||||
step = raw["steps"]["popup_move_resize"]
|
||||
moments = step["moments"]
|
||||
except (KeyError, TypeError):
|
||||
raise ExtractError("%s has no step popup_move_resize with moments" % where)
|
||||
if step.get("features") != FEATURES:
|
||||
raise ExtractError("%s: the popup was opened with %r, not %r" % (where, step.get("features"), FEATURES))
|
||||
missing = [m for m in MOMENTS if m not in moments]
|
||||
if missing:
|
||||
raise ExtractError("%s lacks the moments %r: no retail value, none invented" % (where, missing))
|
||||
readings = {m: moment_reading(moments[m], "%s %s" % (where, m)) for m in MOMENTS}
|
||||
opened, resized, moved, moved_to = (readings[m]["screen"] for m in MOMENTS)
|
||||
if not (opened == resized and moved != opened and moved_to != moved):
|
||||
raise ExtractError("%s: the positions %r do not follow the order initial, resized, moved, moved_to" % (where, {m: readings[m]["screen"] for m in MOMENTS}))
|
||||
return readings
|
||||
|
||||
|
||||
def build(captures: Path, rounds: List[str], commit: str) -> Dict[str, Any]:
|
||||
if len(rounds) < 2:
|
||||
raise ExtractError("at least two rounds are needed to say that rounds agree")
|
||||
cases: Dict[str, Dict[str, Any]] = {}
|
||||
files: List[Dict[str, str]] = []
|
||||
browser: Optional[Dict[str, Any]] = None
|
||||
for dpr_dir, panel, scale in DISPLAYS:
|
||||
first: Optional[Dict[str, Any]] = None
|
||||
for round_name in rounds:
|
||||
for launch in ("a", "b"):
|
||||
path = captures / BROWSER_DIR / round_name / dpr_dir / panel / launch / "raw.json"
|
||||
if not path.is_file():
|
||||
raise ExtractError("missing %s" % path)
|
||||
raw = json.loads(path.read_text(encoding="utf-8"))
|
||||
if raw.get("dpr_asked") != scale:
|
||||
raise ExtractError("%s asks scale %r, not %r" % (path, raw.get("dpr_asked"), scale))
|
||||
meta = {"firefox_version": raw["firefox_version"], "build_id": raw["build_id"], "installer_sha256": raw["installer_sha256"]}
|
||||
if browser not in (None, meta):
|
||||
raise ExtractError("%s is not the same browser as the others: %r and %r" % (path, meta, browser))
|
||||
browser = meta
|
||||
readings = read_step(raw, str(path))
|
||||
if first is None:
|
||||
first = readings
|
||||
elif readings != first:
|
||||
raise ExtractError("%s %s: round %s launch %s reads %r, the first one read %r" % (dpr_dir, panel, round_name, launch, readings, first))
|
||||
files.append({"path": "%s/%s/%s/%s/raw.json" % (round_name, dpr_dir, panel, launch), "sha256": sha256_of(path)})
|
||||
cases[case_id(panel, scale)] = first or {}
|
||||
return {
|
||||
"about": "What retail Firefox reads in a popup of the maximized window after resizeBy(0, 0), moveBy(10, 10) and moveTo(99999, 0), per display case, extracted by scripts/extract_retail_popup_move_resize.py. Never edited by hand.",
|
||||
"capture": {"rounds": rounds, "retail_captures_commit": commit, "popup_features": FEATURES, "moments_in_order": list(MOMENTS), "browser": browser},
|
||||
"files": files,
|
||||
"cases": cases,
|
||||
}
|
||||
|
||||
|
||||
def move_to_reading(moment: Dict[str, Any], where: str) -> Dict[str, Any]:
|
||||
"""One moment of the ``popup-move-to`` format (short keys: ``iw``, ``ih``, ``ow``, ``oh``, ``sx``, ``sy``, ``availL``, ``availW``), in the shape of ``moment_reading``."""
|
||||
try:
|
||||
return {
|
||||
"inner": [moment["iw"], moment["ih"]],
|
||||
"outer": [moment["ow"], moment["oh"]],
|
||||
"screen": [moment["sx"], moment["sy"]],
|
||||
"avail": [moment["availL"], moment["availW"]],
|
||||
}
|
||||
except (KeyError, TypeError) as exc:
|
||||
raise ExtractError("%s: the moment lacks %s" % (where, exc))
|
||||
|
||||
|
||||
def position_of(ordinal: int) -> str:
|
||||
"""``first``: the first popup the browser opens; ``later``: any popup after it (a throwaway popup counts)."""
|
||||
return POSITION_FIRST if ordinal == 1 else POSITION_LATER
|
||||
|
||||
|
||||
def read_launch(raw: Dict[str, Any], launch: str, where: str) -> List[Tuple[str, int, Dict[str, Dict[str, Any]]]]:
|
||||
"""``[(phase, ordinal, readings)]`` of one launch of the ``popup-move-to`` capture, each phase checked against the plan of the launch, its calls and the order of its moments."""
|
||||
if raw.get("format") != MOVE_TO_FORMAT:
|
||||
raise ExtractError("%s has the format %r, not %r" % (where, raw.get("format"), MOVE_TO_FORMAT))
|
||||
if raw.get("error") is not None:
|
||||
raise ExtractError("%s ends with the error %r" % (where, raw.get("error")))
|
||||
if raw.get("launch") != launch:
|
||||
raise ExtractError("%s is launch %r, not %r" % (where, raw.get("launch"), launch))
|
||||
if raw.get("phases_planned") != MOVE_TO_LAUNCHES[launch]:
|
||||
raise ExtractError("%s ran the popups %r, not %r: the position of a phase in the browser's life is not the one this launch is for" % (
|
||||
where, raw.get("phases_planned"), MOVE_TO_LAUNCHES[launch]))
|
||||
found = []
|
||||
for ordinal, phase in enumerate(MOVE_TO_LAUNCHES[launch], 1):
|
||||
label = "%s step phase_%s" % (where, phase)
|
||||
try:
|
||||
step = raw["steps"]["phase_" + phase]
|
||||
moments = step["moments"]
|
||||
except (KeyError, TypeError):
|
||||
raise ExtractError("%s is missing: no retail value, none invented" % label)
|
||||
if step.get("ordinal") != ordinal:
|
||||
raise ExtractError("%s is popup number %r of the browser, the plan says %r" % (label, step.get("ordinal"), ordinal))
|
||||
if step.get("features") != FEATURES:
|
||||
raise ExtractError("%s: the popup was opened with %r, not %r" % (label, step.get("features"), FEATURES))
|
||||
if step.get("closed") is not True:
|
||||
raise ExtractError("%s: the popup was not closed (%r), the next popup would not be the next one of a test that closes each" % (label, step.get("closed")))
|
||||
if step.get("calls") != MOVE_TO_CALLS[phase]:
|
||||
raise ExtractError("%s: the calls are %r, not %r" % (label, step.get("calls"), MOVE_TO_CALLS[phase]))
|
||||
wanted = MOVE_TO_MOMENTS[phase]
|
||||
missing = [m for m in wanted if m not in moments]
|
||||
if missing:
|
||||
raise ExtractError("%s lacks the moments %r: no retail value, none invented" % (label, missing))
|
||||
readings = {m: move_to_reading(moments[m], "%s %s" % (label, m)) for m in wanted}
|
||||
at = {m: readings[m]["screen"] for m in wanted}
|
||||
if phase == "resize_by_zero":
|
||||
in_order = at["resized"] == at["initial"]
|
||||
elif phase == "move_by":
|
||||
in_order = at["moved"] != at["initial"]
|
||||
elif phase == "move_to_far_right":
|
||||
in_order = at["moved"] != at["initial"] and at["moved_to"] != at["moved"]
|
||||
else:
|
||||
in_order = True
|
||||
if not in_order:
|
||||
raise ExtractError("%s: the positions %r do not follow the order %r" % (label, at, list(wanted)))
|
||||
if phase != "throwaway":
|
||||
found.append((phase, ordinal, readings))
|
||||
return found
|
||||
|
||||
|
||||
def build_move_to(capture: Path, run_id: str, commit: str) -> Dict[str, Any]:
|
||||
"""The readings of every phase as the first popup of a browser and as a later popup: the four launches of the four display cases of one ``popup-move-to`` capture folder (the date folder), each
|
||||
raw.json checked against the sha256 of its ``meta.json``. Popups of the same phase and the same position (``first``, ``later``) must read the same, or the extraction fails."""
|
||||
run_info_path = capture / "run-info.json"
|
||||
if not run_info_path.is_file():
|
||||
raise ExtractError("missing %s" % run_info_path)
|
||||
run_info = json.loads(run_info_path.read_text(encoding="utf-8"))
|
||||
try:
|
||||
binaries = {name: run_info["binaries"][name]["sha256"] for name in MOVE_TO_BINARIES}
|
||||
except (KeyError, TypeError) as exc:
|
||||
raise ExtractError("%s lacks the sha256 of %s" % (run_info_path, exc))
|
||||
cases: Dict[str, Dict[str, Dict[str, Dict[str, Any]]]] = {}
|
||||
sources: Dict[str, Dict[str, Dict[str, List[str]]]] = {}
|
||||
files: List[Dict[str, str]] = []
|
||||
browser: Optional[Dict[str, Any]] = None
|
||||
for dpr_dir, panel, scale in DISPLAYS:
|
||||
meta_path = capture / dpr_dir / "meta.json"
|
||||
if not meta_path.is_file():
|
||||
raise ExtractError("missing %s" % meta_path)
|
||||
meta_file = json.loads(meta_path.read_text(encoding="utf-8"))
|
||||
if meta_file.get("format") != MOVE_TO_META_FORMAT:
|
||||
raise ExtractError("%s has the format %r, not %r" % (meta_path, meta_file.get("format"), MOVE_TO_META_FORMAT))
|
||||
groups: Dict[Tuple[str, str], List[Tuple[str, int, Dict[str, Dict[str, Any]]]]] = {}
|
||||
for launch in MOVE_TO_LAUNCHES:
|
||||
path = capture / dpr_dir / panel / launch / "raw.json"
|
||||
if not path.is_file():
|
||||
raise ExtractError("missing %s" % path)
|
||||
want = (meta_file.get("raw_sha256") or {}).get("%s/%s/raw.json" % (panel, launch))
|
||||
have = sha256_of(path)
|
||||
if want != have:
|
||||
raise ExtractError("%s has the sha256 %s, its meta.json says %s: the file is not the one the capture wrote" % (path, have, want))
|
||||
raw = json.loads(path.read_text(encoding="utf-8"))
|
||||
if raw.get("dpr_asked") != scale:
|
||||
raise ExtractError("%s asks scale %r, not %r" % (path, raw.get("dpr_asked"), scale))
|
||||
found = {"firefox_version": raw["firefox_version"], "build_id": raw["build_id"], "installer_sha256": raw["installer_sha256"]}
|
||||
if found != {k: meta_file.get(k) for k in found}:
|
||||
raise ExtractError("%s is not the browser its meta.json names: %r" % (path, found))
|
||||
if browser not in (None, found):
|
||||
raise ExtractError("%s is not the same browser as the others: %r and %r" % (path, found, browser))
|
||||
browser = found
|
||||
for phase, ordinal, readings in read_launch(raw, launch, str(path)):
|
||||
groups.setdefault((phase, position_of(ordinal)), []).append((launch, ordinal, readings))
|
||||
files.append({"path": "%s/%s/%s/raw.json" % (dpr_dir, panel, launch), "sha256": have})
|
||||
case: Dict[str, Dict[str, Dict[str, Any]]] = {}
|
||||
origin: Dict[str, Dict[str, List[str]]] = {}
|
||||
for phase in MOVE_TO_PHASES:
|
||||
for position in (POSITION_FIRST, POSITION_LATER):
|
||||
group = groups.get((phase, position))
|
||||
if not group:
|
||||
raise ExtractError("%s %s: no capture of %s as the %s popup of a browser: no retail value, none invented" % (dpr_dir, panel, phase, position))
|
||||
first_launch, first_ordinal, first_readings = group[0]
|
||||
for launch, ordinal, readings in group[1:]:
|
||||
if readings != first_readings:
|
||||
raise ExtractError("%s %s %s: the %s popup number %d of launch %s reads %r, popup number %d of launch %s read %r: popups of one position must agree" % (
|
||||
dpr_dir, panel, phase, position, ordinal, launch, readings, first_ordinal, first_launch, first_readings))
|
||||
case.setdefault(phase, {})[position] = first_readings
|
||||
origin.setdefault(phase, {})[position] = ["%s#%d" % (launch, ordinal) for launch, ordinal, _ in group]
|
||||
cases[case_id(panel, scale)] = case
|
||||
sources[case_id(panel, scale)] = origin
|
||||
named = (run_info.get("build") or {}).get("build_id")
|
||||
if named != (browser or {}).get("build_id"):
|
||||
raise ExtractError("%s names the build %r, the raw files %r" % (run_info_path, named, (browser or {}).get("build_id")))
|
||||
return {
|
||||
"about": "What retail Firefox reads in a popup of the maximized window, per display case, per phase of the wrapper test (resize_by_zero, move_by, move_to_far_right) and per position in the browser's life "
|
||||
"(first: the first popup the browser opens; later: any popup after it), from the popup-move-to capture; a test phase asserts against the position it has in the test. Extracted by "
|
||||
"scripts/extract_retail_popup_move_resize.py. Never edited by hand.",
|
||||
"capture": {
|
||||
"run_id": run_id,
|
||||
"retail_captures_commit": commit,
|
||||
"folder": capture.name,
|
||||
"format": MOVE_TO_FORMAT,
|
||||
"popup_features": FEATURES,
|
||||
"launches": MOVE_TO_LAUNCHES,
|
||||
"browser": browser,
|
||||
"binaries_sha256": binaries,
|
||||
},
|
||||
"files": files,
|
||||
"sources": sources,
|
||||
"cases": cases,
|
||||
}
|
||||
|
||||
|
||||
def cross_check(rounds: Dict[str, Any], cases: Dict[str, Any]) -> Dict[str, List[str]]:
|
||||
"""What the window-geometry rounds read for a popup after ``resizeBy(0, 0)`` (``initial``, ``resized``) must be what SOME position of the popup-move-to capture reads (the rounds ran it as a later popup,
|
||||
after other popups): a value no position reproduces is an anomaly, reported, not chosen. Returns, per case, the positions that reproduce it."""
|
||||
reproduced_by: Dict[str, List[str]] = {}
|
||||
for case, moments in rounds["cases"].items():
|
||||
reproduced_by[case] = [pos for pos, got in cases[case]["resize_by_zero"].items() if all(got[m] == moments[m] for m in ("initial", "resized"))]
|
||||
if not reproduced_by[case]:
|
||||
raise ExtractError("%s: the rounds read %r after resizeBy(0, 0), no position of the popup-move-to capture reads that (%r)" % (
|
||||
case, {m: moments[m] for m in ("initial", "resized")}, cases[case]["resize_by_zero"]))
|
||||
return reproduced_by
|
||||
|
||||
|
||||
def dumps(data: Dict[str, Any]) -> str:
|
||||
return json.dumps(data, indent=2) + "\n"
|
||||
|
||||
|
||||
def main(argv: Optional[List[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
|
||||
parser.add_argument("--captures", required=True, type=Path, help="the captures folder of RetailCaptures")
|
||||
parser.add_argument("--rounds", required=True, nargs="+")
|
||||
parser.add_argument("--commit", required=True, help="the RetailCaptures commit the rounds are in")
|
||||
parser.add_argument("--move-to-capture", required=True, type=Path, help="the date folder of the popup-move-to capture (with run-info.json and the dpr folders)")
|
||||
parser.add_argument("--move-to-run-id", required=True, help="the id of the run that made the popup-move-to capture")
|
||||
parser.add_argument("--move-to-commit", required=True, help="the RetailCaptures commit the popup-move-to capture is in")
|
||||
parser.add_argument("--write", action="store_true", help="write ci/retail-popup-move-resize.json; without it the committed file is compared with the captures")
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
rounds = build(args.captures, args.rounds, args.commit)
|
||||
data = build_move_to(args.move_to_capture, args.move_to_run_id, args.move_to_commit)
|
||||
data["rounds_cross_check"] = {
|
||||
"about": "The window-geometry rounds (a popup after resizeBy(0, 0) as a later popup of a long browser life) read what the positions listed in reproduced_by read in the popup-move-to capture; they are not read by the test.",
|
||||
"capture": rounds["capture"],
|
||||
"files": rounds["files"],
|
||||
"reproduced_by": cross_check(rounds, data["cases"]),
|
||||
}
|
||||
text = dumps(data)
|
||||
except ExtractError as exc:
|
||||
print("EXTRACTION FAILED: %s" % exc, file=sys.stderr)
|
||||
return 2
|
||||
if args.write:
|
||||
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
|
||||
print("wrote %s" % DATA_PATH)
|
||||
return 0
|
||||
if DATA_PATH.read_text(encoding="utf-8") != text:
|
||||
print("%s is not what the captures give" % DATA_PATH, file=sys.stderr)
|
||||
return 1
|
||||
print("%s is what the captures give" % DATA_PATH)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,175 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extracts, from a retail capture of the window geometry, the sizes retail Firefox gives a popup opened from a maximized main window, into ci/retail-popup-sizes.json.
|
||||
|
||||
The e2e test ``tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py`` compares what a popup reads with what RETAIL Firefox 159 on Windows read. Those numbers were a table typed
|
||||
by hand, and one was wrong (outer width 514 at scale 1.5, the value of 1.25; retail read 515). They are therefore read from the capture, never typed:
|
||||
|
||||
* ``<round>/<dpr>/<panel>/<launch>/raw.json``, step ``popup_sizes``, variant by variant (one variant per feature string; the variant says which string it is in ``features``): the popup at
|
||||
one second after its load (``at_1s``: inner, outer, ``screenX``/``screenY``) and the visual viewport at ``load`` (``early.load``). Launch ``a`` is the one extracted; launch ``b`` (a second
|
||||
launch of the same display case) must give the same values, or the extraction fails: a value the two launches disagree on is not a value.
|
||||
* ``captures/WINDOW_GEOMETRY_POPUP_FRAME.csv`` (when given): its rows of step ``popup`` (``width=500,height=400``, launch ``a``, every round) must give the inner, outer and screen position that
|
||||
``popup_sizes`` gives for the same string, or the extraction fails.
|
||||
|
||||
The file records the round, the browser (version, build id, installer sha256), the sha256 of every raw.json and of the CSV that were read. The wrapper's CI has no capture, so the tests read the
|
||||
committed file and this module's functions are tested on a small sample (tests/test_the_retail_popup_sizes_are_extracted_from_the_capture_not_typed.py). One command regenerates the file:
|
||||
|
||||
python scripts/extract_retail_popup_sizes.py --captures <RetailCaptures>/captures --round 2026-12-01-window-geometry-r12 --run-url <url of the run> --commit <RetailCaptures commit> --write
|
||||
|
||||
and the same without ``--write`` compares the committed file with what the capture gives (the check).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import csv
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
DATA_PATH = ROOT / "ci" / "retail-popup-sizes.json"
|
||||
|
||||
BROWSER_DIR = "firefox-159.0/github-runner"
|
||||
CSV_NAME = "WINDOW_GEOMETRY_POPUP_FRAME.csv"
|
||||
#: The four display cases, in the order of their scale: (folder of the dpr, panel, scale).
|
||||
DISPLAYS = (("dpr1", "1920x1080", 1.0), ("dpr1.25", "1920x1080", 1.25), ("dpr1.5", "1920x1080", 1.5), ("dpr2", "1600x1200", 2.0))
|
||||
#: The feature strings the e2e test opens popups with (the tab, ``''``, is not a popup).
|
||||
FEATURES = ("width=500,height=400", "popup", "width=500", "height=400", "width=300,height=200", "width=800,height=600", "left=100,top=100", "left=5000,top=5000")
|
||||
|
||||
|
||||
class ExtractError(Exception):
|
||||
"""What the capture does not give, or gives two ways: nothing is invented in its place."""
|
||||
|
||||
|
||||
def case_id(panel: str, scale: float) -> str:
|
||||
return "%s-dpr%s" % (panel, scale)
|
||||
|
||||
|
||||
def sha256_of(path: Path) -> str:
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def variants_of(raw: Dict[str, Any], where: str) -> Dict[str, Dict[str, Any]]:
|
||||
"""``{features: variant}`` of the step ``popup_sizes`` of one raw.json."""
|
||||
try:
|
||||
found = raw["steps"]["popup_sizes"]["variants"]
|
||||
except (KeyError, TypeError):
|
||||
raise ExtractError("%s has no step popup_sizes with variants" % where)
|
||||
return {v["features"]: v for v in found.values() if isinstance(v, dict) and "features" in v}
|
||||
|
||||
|
||||
def reading(variant: Dict[str, Any], where: str) -> Dict[str, Any]:
|
||||
"""What retail read for one variant: inner, outer, screen (one second after the load) and the visual viewport height (at ``load``)."""
|
||||
try:
|
||||
at, load = variant["at_1s"], variant["early"]["load"]
|
||||
return {
|
||||
"inner": [at["innerWidth"], at["innerHeight"]],
|
||||
"outer": [at["outerWidth"], at["outerHeight"]],
|
||||
"screen": [at["screenX"], at["screenY"]],
|
||||
"vv_height": load["visualViewportHeight"],
|
||||
}
|
||||
except (KeyError, TypeError) as exc:
|
||||
raise ExtractError("%s: the variant lacks %s" % (where, exc))
|
||||
|
||||
|
||||
def extract_display(capture: Path, dpr_dir: str, panel: str, scale: float) -> Tuple[Dict[str, Dict[str, Any]], List[Dict[str, str]], Dict[str, Any]]:
|
||||
"""The readings of one display case, from launch ``a``, checked against launch ``b``; the files read; the browser they come from."""
|
||||
files, per_launch, meta = [], {}, {}
|
||||
for launch in ("a", "b"):
|
||||
path = capture / dpr_dir / panel / launch / "raw.json"
|
||||
if not path.is_file():
|
||||
raise ExtractError("missing %s" % path)
|
||||
raw = json.loads(path.read_text(encoding="utf-8"))
|
||||
if raw.get("dpr_asked") != scale:
|
||||
raise ExtractError("%s asks scale %r, not %r" % (path, raw.get("dpr_asked"), scale))
|
||||
found = variants_of(raw, str(path))
|
||||
per_launch[launch] = {}
|
||||
for features in FEATURES:
|
||||
if features not in found:
|
||||
raise ExtractError("%s has no popup_sizes variant for %r: no retail value, none invented" % (path, features))
|
||||
per_launch[launch][features] = reading(found[features], "%s %r" % (path, features))
|
||||
files.append({"path": "%s/%s/%s/raw.json" % (dpr_dir, panel, launch), "sha256": sha256_of(path)})
|
||||
meta[launch] = {"firefox_version": raw["firefox_version"], "build_id": raw["build_id"], "installer_sha256": raw["installer_sha256"]}
|
||||
for features in FEATURES:
|
||||
if per_launch["a"][features] != per_launch["b"][features]:
|
||||
raise ExtractError("%s %s %r: launch a reads %r and launch b reads %r" % (dpr_dir, panel, features, per_launch["a"][features], per_launch["b"][features]))
|
||||
if meta["a"] != meta["b"]:
|
||||
raise ExtractError("%s %s: the two launches are not the same browser: %r" % (dpr_dir, panel, meta))
|
||||
return per_launch["a"], files, meta["a"]
|
||||
|
||||
|
||||
def check_csv(csv_path: Path, cases: Dict[str, Dict[str, Dict[str, Any]]]) -> None:
|
||||
"""Every ``popup`` row of launch ``a`` of the CSV (``width=500,height=400``, every round) agrees with the extracted reading of the same display case."""
|
||||
seen = 0
|
||||
with csv_path.open(encoding="utf-8", newline="") as handle:
|
||||
for number, row in enumerate(csv.DictReader(handle), start=2):
|
||||
if row["step"] != "popup" or row["launch"] != "a":
|
||||
continue
|
||||
panel = row["path"].split("/")[-3]
|
||||
case = case_id(panel, float(row["dpr_asked"]))
|
||||
got = cases.get(case, {}).get(row["features"])
|
||||
if got is None:
|
||||
raise ExtractError("%s row %d: no extracted reading for %s, %r" % (csv_path.name, number, case, row["features"]))
|
||||
seen += 1
|
||||
have = {"inner": [int(row["innerWidth"]), int(row["innerHeight"])], "outer": [int(row["outerWidth"]), int(row["outerHeight"])], "screen": [int(row["screenX"]), int(row["screenY"])]}
|
||||
for key, value in have.items():
|
||||
if got[key] != value:
|
||||
raise ExtractError("%s row %d (%s, %r): %s is %r in the CSV and %r in popup_sizes" % (csv_path.name, number, case, row["features"], key, value, got[key]))
|
||||
if not seen:
|
||||
raise ExtractError("%s has no popup row of launch a" % csv_path.name)
|
||||
|
||||
|
||||
def build(captures: Path, round_name: str, run_url: str, commit: str) -> Dict[str, Any]:
|
||||
capture = captures / BROWSER_DIR / round_name
|
||||
cases: Dict[str, Dict[str, Dict[str, Any]]] = {}
|
||||
files: List[Dict[str, str]] = []
|
||||
browser: Optional[Dict[str, Any]] = None
|
||||
for dpr_dir, panel, scale in DISPLAYS:
|
||||
readings, read, meta = extract_display(capture, dpr_dir, panel, scale)
|
||||
if browser not in (None, meta):
|
||||
raise ExtractError("the display cases come from two browsers: %r and %r" % (browser, meta))
|
||||
browser = meta
|
||||
cases[case_id(panel, scale)] = readings
|
||||
files.extend(read)
|
||||
csv_path = captures / CSV_NAME
|
||||
check_csv(csv_path, cases)
|
||||
return {
|
||||
"about": "What retail Firefox reads in a popup opened from a maximized main window, per display case and feature string, extracted by scripts/extract_retail_popup_sizes.py. Never edited by hand.",
|
||||
"capture": {"round": round_name, "run": run_url, "retail_captures_commit": commit, "browser": browser},
|
||||
"files": files,
|
||||
"csv_checked": {"path": CSV_NAME, "sha256": sha256_of(csv_path)},
|
||||
"cases": cases,
|
||||
}
|
||||
|
||||
|
||||
def dumps(data: Dict[str, Any]) -> str:
|
||||
return json.dumps(data, indent=2, sort_keys=False) + "\n"
|
||||
|
||||
|
||||
def main(argv: Optional[List[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
|
||||
parser.add_argument("--captures", required=True, type=Path, help="the captures folder of RetailCaptures")
|
||||
parser.add_argument("--round", required=True)
|
||||
parser.add_argument("--run-url", required=True)
|
||||
parser.add_argument("--commit", required=True, help="the RetailCaptures commit the round is in")
|
||||
parser.add_argument("--write", action="store_true", help="write ci/retail-popup-sizes.json; without it the committed file is compared with the capture")
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
text = dumps(build(args.captures, args.round, args.run_url, args.commit))
|
||||
except ExtractError as exc:
|
||||
print("EXTRACTION FAILED: %s" % exc, file=sys.stderr)
|
||||
return 2
|
||||
if args.write:
|
||||
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
|
||||
print("wrote %s" % DATA_PATH)
|
||||
return 0
|
||||
if DATA_PATH.read_text(encoding="utf-8") != text:
|
||||
print("%s is not what the capture gives" % DATA_PATH, file=sys.stderr)
|
||||
return 1
|
||||
print("%s is what the capture gives" % DATA_PATH)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -81,8 +81,15 @@ EXCLUDED = {
|
||||
#: fine: it is the pref of a core that comes later than the one in use (or earlier than the one that added it), and the pair
|
||||
#: of cores must give the same file. maximized_ui is of the panel because the core declares the bar from the work area's
|
||||
#: height as well as from the scale (declared_maximized_ui: compact when the work area is short in CSS px).
|
||||
#: The screen's size in device pixels is of the panel too: the core declares it as the whole panel (device_width and
|
||||
#: device_height of ScreenProfile, invisible_core/_fpforge/profile.py:121 and :126; the prefs, invisible_core/prefs.py:1293-1294)
|
||||
#: and the work area as the screen minus the taskbar (profile.py:131-145). So, from the panel's own prefs, the width is
|
||||
#: avail_device_width and the height is avail_device_height plus the taskbar in device pixels. The test compares the prefs with
|
||||
#: the core's own ScreenProfile for each seed: no copy of the taskbar or of the formula lives here.
|
||||
DERIVED = {
|
||||
P + "screen.maximized_ui": "screen_panel",
|
||||
P + "screen.device_width": "screen_panel",
|
||||
P + "screen.device_height": "screen_panel",
|
||||
}
|
||||
#: What the candidate run visits: the smallest set that reaches every one of these dimensions' values.
|
||||
CANDIDATE_DIMENSIONS = ("webgl_renderer", "dpr")
|
||||
|
||||
@@ -109,6 +109,57 @@ class ExpectNotMet(ProtocolException):
|
||||
self.log = list(log or [])
|
||||
|
||||
|
||||
class Deferred:
|
||||
"""An answer that comes LATER: what a command returns when it has to wait for something long and must not hold the worker that
|
||||
took it.
|
||||
|
||||
⛔ THE TRANSPORT'S WORKERS ARE FEW (`InProcessTransport.WORKERS` is 4, the remote server's 8) and shared by every command of a
|
||||
client. A command that waits (a proxied `newContext` waits for the final UDP verdict of its proxy: ~11 s for a first endpoint)
|
||||
held one for the whole wait, and four of them left no worker for a `page.evaluate`. A command that answers LATER hands its work to a
|
||||
thread of its own (started by the server's one starter, like the engine reader's adoptions) and returns this object at once; the
|
||||
worker is free, and the transport posts the reply when the work ends, the way a worker posts it (`begin`). Nothing else changes:
|
||||
the object that answers is still the one the client addressed, and the reply is still the one with the client's id.
|
||||
|
||||
The work runs in the context the call had (`contextvars`: the call's log, the remote server's client), and the thread ends with
|
||||
the work. It is counted by the server, and `Server.shutdown` waits for it (bounded) after the engine's connection is closed, so
|
||||
a session that ends leaves none behind."""
|
||||
|
||||
def __init__(self, server: "Server", work: Callable[[], Any]) -> None:
|
||||
self._server = server
|
||||
self._work = work
|
||||
self._context = contextvars.copy_context()
|
||||
#: Set when the work has ended and its answer has been handed over (or when it could never begin).
|
||||
self.finished = threading.Event()
|
||||
|
||||
def begin(self, done: Callable[[Any, Optional[BaseException]], None]) -> None:
|
||||
"""Run the work on its own thread and hand `done(result, failure)` its end. Called by the worker that took the command: it
|
||||
returns at once (the thread is only queued to the starter)."""
|
||||
server = self._server
|
||||
|
||||
def run() -> None:
|
||||
try:
|
||||
try:
|
||||
result = self._context.run(self._work)
|
||||
except Exception as failure: # noqa: BLE001 - the client is told, as for a command answered at once
|
||||
done(None, failure)
|
||||
else:
|
||||
done(result, None)
|
||||
finally:
|
||||
server._deferred_ended(self)
|
||||
|
||||
def could_not_begin(why: str) -> None:
|
||||
try:
|
||||
done(None, ProtocolException("the answer could not be started: %s" % why))
|
||||
finally:
|
||||
server._deferred_ended(self)
|
||||
|
||||
if not server._deferred_begun(self):
|
||||
self.finished.set() # the session is ending: there is nobody to answer
|
||||
return
|
||||
server.thread_starter.start_built(
|
||||
threading.Thread(target=run, name="invpw-answer-later", daemon=True), could_not_begin)
|
||||
|
||||
|
||||
class CallLog:
|
||||
"""What one call did, line by line: the log Playwright's server keeps per
|
||||
call (its progress, `metadata.log`) and sends with a failure, where the
|
||||
@@ -229,6 +280,8 @@ class Dispatcher:
|
||||
# ── routing ─────────────────────────────────────────────────────────────
|
||||
def call(self, method: str, params: Dict) -> Any:
|
||||
name = self.METHODS.get(method)
|
||||
if name is not None and self.answers_later(method, params):
|
||||
return self.server.later(lambda: getattr(self, name)(params))
|
||||
if name is None:
|
||||
# ⛔ NAME THE FEATURE, not just the missing method. "Page has no
|
||||
# method X" reads like a bug in this package; "X is part of HAR,
|
||||
@@ -245,6 +298,12 @@ class Dispatcher:
|
||||
return getattr(self, name)(params)
|
||||
|
||||
|
||||
def answers_later(self, method: str, params: Dict) -> bool:
|
||||
"""Whether this call waits for something long and must be answered from a thread of its own (`Deferred`), not by the worker
|
||||
that took it. Nothing does, unless an object says so."""
|
||||
return False
|
||||
|
||||
|
||||
class Server:
|
||||
"""The guid registry, and the entry point the transport calls."""
|
||||
|
||||
@@ -281,6 +340,8 @@ class Server:
|
||||
self._starter: Optional[ThreadStarter] = None
|
||||
self._starter_lock = threading.Lock()
|
||||
self._is_shut_down = False
|
||||
#: The answers that are being worked out on a thread of their own (`later`), until each ends.
|
||||
self._deferred: set = set()
|
||||
#: Why a thread the starter was handed could not be started (the last few).
|
||||
self.start_errors: list = []
|
||||
|
||||
@@ -302,6 +363,35 @@ class Server:
|
||||
if len(self.start_errors) < 32:
|
||||
self.start_errors.append(why)
|
||||
|
||||
#: How long `shutdown` waits for the answers still being worked out (`later`) once the engine's connection is closed: the longest wait of
|
||||
#: a command (a proxy's UDP verdict ends at nICEr's schedule, ~11 s after the TCP exit is known) with a margin. Their threads are daemons:
|
||||
#: past this the process is not held.
|
||||
DEFERRED_WAIT_S = 15.0
|
||||
|
||||
def later(self, work: Callable[[], Any]) -> Deferred:
|
||||
"""The answer of a command whose `work` takes long: a call returns this instead of its result and the transport posts the reply
|
||||
when `work` ends (see `Deferred`). Called from the worker that took the command."""
|
||||
return Deferred(self, work)
|
||||
|
||||
def _deferred_begun(self, deferred: Deferred) -> bool:
|
||||
with self._starter_lock:
|
||||
if self._is_shut_down:
|
||||
return False
|
||||
self._deferred.add(deferred)
|
||||
return True
|
||||
|
||||
def _deferred_ended(self, deferred: Deferred) -> None:
|
||||
with self._starter_lock:
|
||||
self._deferred.discard(deferred)
|
||||
deferred.finished.set()
|
||||
|
||||
def _wait_for_deferred(self) -> None:
|
||||
deadline = time.monotonic() + self.DEFERRED_WAIT_S
|
||||
with self._starter_lock:
|
||||
pending = list(self._deferred)
|
||||
for deferred in pending:
|
||||
deferred.finished.wait(max(0.0, deadline - time.monotonic()))
|
||||
|
||||
def attach(self, transport: Any) -> None:
|
||||
self._transport = transport
|
||||
|
||||
@@ -477,6 +567,9 @@ class Server:
|
||||
except Exception:
|
||||
pass
|
||||
self._after_shutdown.clear()
|
||||
# The engine's connection is closed (the hooks above): an answer still being worked out fails at its next command, and the wait
|
||||
# of its own (a measurement) is the only thing left to wait for.
|
||||
self._wait_for_deferred()
|
||||
with self._starter_lock:
|
||||
self._is_shut_down = True
|
||||
starter = self._starter
|
||||
|
||||
@@ -70,9 +70,9 @@ from typing import Any, Callable, Dict, List, Optional
|
||||
from urllib.parse import parse_qs, urlsplit
|
||||
|
||||
from . import memprobe, wire
|
||||
from .dispatcher import ProtocolException
|
||||
from .dispatcher import Deferred, ProtocolException
|
||||
from .server import (BrowserDispatcher, BrowserTypeDispatcher, JugglerServer,
|
||||
LocalUtilsDispatcher, RefusingDispatcher)
|
||||
LocalUtilsDispatcher, RefusingDispatcher, context_defaults_for)
|
||||
from .transport import _error_payload
|
||||
|
||||
#: The client whose call a worker thread is answering.
|
||||
@@ -450,7 +450,16 @@ class RemoteEndpoint:
|
||||
except Exception as failure: # noqa: BLE001
|
||||
self._reply_error(client, msg_id, failure)
|
||||
else:
|
||||
self._reply(client, msg_id, result)
|
||||
if isinstance(result, Deferred):
|
||||
# The answer comes later (see `Deferred`): this worker is free at once, the thread that works it out posts the reply.
|
||||
def done(value: Any, failure: Optional[BaseException]) -> None:
|
||||
if failure is not None:
|
||||
self._reply_error(client, msg_id, failure)
|
||||
else:
|
||||
self._reply(client, msg_id, value)
|
||||
result.begin(done)
|
||||
else:
|
||||
self._reply(client, msg_id, result)
|
||||
|
||||
def _dispatch(self, client: RemoteClient, message: Dict) -> Any:
|
||||
guid = message.get("guid")
|
||||
@@ -475,9 +484,7 @@ class RemoteEndpoint:
|
||||
if method == "newPage" and "pageNumber" not in params:
|
||||
params["pageNumber"] = next(self._pages)
|
||||
if message.get("guid") == self.browser.guid:
|
||||
for key, value in self.context_defaults.items():
|
||||
if key in ("viewport", "screen") and params.get("noDefaultViewport"):
|
||||
continue
|
||||
for key, value in context_defaults_for(self.context_defaults, params.get("noDefaultViewport")).items():
|
||||
if self.context_options_override or key not in params:
|
||||
params[key] = value
|
||||
return dict(message, params=params)
|
||||
@@ -733,8 +740,16 @@ def _launch_params(session: Any, *, virtual_display: bool, headless: bool,
|
||||
session._geolocation = geo.geolocation_override()
|
||||
session._udp_exit = geo.udp_exit
|
||||
executable = resolve_executable(session._binary_path)
|
||||
pw_headless = bool(headless)
|
||||
if not headless and virtual_display:
|
||||
# The engine is never told `-headless`: the browser always has a real window. `headless=True` puts that window on the hidden
|
||||
# display, by the one decision every entry point shares (`_resolve_headless`); `headless=False` keeps the window where the caller
|
||||
# is, or on a private display when `virtual_display` asks for one.
|
||||
pw_headless = False
|
||||
if headless:
|
||||
session._resolve_headless()
|
||||
if session._virtual_display is None:
|
||||
notes.append("headless: no hidden display to make on this platform "
|
||||
"(the browser runs on the caller's desktop)")
|
||||
elif virtual_display:
|
||||
if sys.platform == "win32":
|
||||
notes.append("virtual_display ignored: Windows has no virtual "
|
||||
"display in this server (the browser runs on the "
|
||||
@@ -799,7 +814,8 @@ def launch_server(host: str = DEFAULT_HOST, port: int = 0, *,
|
||||
launch; the egress (exit IP -> timezone, locale
|
||||
"auto"; the GeoIP database offline from
|
||||
STEALTHFOX_GEOIP_MMDB) is measured here through it.
|
||||
headless True = true headless; False = headed.
|
||||
headless True = a real window on a hidden display (the browser is never
|
||||
started with -headless); False = the window is shown.
|
||||
virtual_display with headless=False: a private virtual display (Xvfb
|
||||
with its own launch env). Windows: ignored, with the
|
||||
reason in `server.notes`.
|
||||
@@ -821,8 +837,12 @@ def launch_server(host: str = DEFAULT_HOST, port: int = 0, *,
|
||||
and the launch FAILS if the version it reports is not the seal's.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright import _session
|
||||
from invisible_playwright._engine import assert_wire_version
|
||||
|
||||
# A retired variable is refused before anything starts (the network, a display, a process).
|
||||
_session.refuse_retired_true_headless()
|
||||
|
||||
if humanize and motion_budget_s:
|
||||
humanize = float(motion_budget_s)
|
||||
session = InvisiblePlaywright(
|
||||
|
||||
@@ -77,7 +77,7 @@ from ._marshal import (_js_number, _as_script, _button, _caller_timeout,
|
||||
# the same duplication that produced the defect, one layer down.
|
||||
from invisible_core import SessionLocale, parse_proxy
|
||||
from invisible_core._proxy import UDP_EXIT_VALUES
|
||||
from invisible_core._udp_exit import context_proxy_command, launch_proxy_command, stun_servers
|
||||
from invisible_core._udp_exit import UdpExitCache, context_proxy_command, launch_proxy_command, stun_servers
|
||||
|
||||
from invisible_core import write_user_js
|
||||
from invisible_core.juggler import (SessionFiles, domain_matches, host_of,
|
||||
@@ -3154,6 +3154,55 @@ def _with_trace(failure: BaseException, trace: str) -> BaseException:
|
||||
return RuntimeError("%s [%s]" % (failure, trace))
|
||||
|
||||
|
||||
#: The key of a context's `viewport` that says the size is only the one the core declares for the main window (`context_geometry`), not one
|
||||
#: the user chose. The session puts it on its default context options (`_default_context_kwargs`); a viewport the user passes has no such
|
||||
#: key, so it replaces the declared one whole. It travels to the engine as `isDeclaredDefault` of `Browser.setDefaultViewport`, where a popup
|
||||
#: that names no size is then left to its own window; it never reaches the client (`_viewport_as_told`).
|
||||
DECLARED_VIEWPORT_KEY = "isDeclaredDefault"
|
||||
|
||||
|
||||
def declared_viewport(viewport: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""`viewport` (the core's `{"width", "height"}`) marked as the declared default of the session."""
|
||||
return dict(viewport, **{DECLARED_VIEWPORT_KEY: True})
|
||||
|
||||
|
||||
def _viewport_is_declared(viewport: Optional[Dict[str, Any]]) -> bool:
|
||||
return bool(viewport and viewport.get(DECLARED_VIEWPORT_KEY))
|
||||
|
||||
|
||||
#: The keys of a context's declared geometry that a context with NO viewport emulation does not get: in Playwright `no_viewport=True` means no pin, so the
|
||||
#: window keeps its own size (the engine gives the real window the declared frame and maximizes it). The ONE list of the three paths that merge the
|
||||
#: declared defaults into a context: the in-process launchers (`merged_context_kwargs`), the served browser (`remote.py`) and the engine commands
|
||||
#: (`_apply_context_options`).
|
||||
NO_VIEWPORT_DROPS = ("viewport", "screen")
|
||||
|
||||
|
||||
def context_defaults_for(defaults: Dict[str, Any], no_viewport: Any) -> Dict[str, Any]:
|
||||
"""The session's declared context defaults for a context that asks for `no_viewport` (Playwright's `noViewport` / `noDefaultViewport`) or not."""
|
||||
if not no_viewport:
|
||||
return dict(defaults)
|
||||
return {key: value for key, value in defaults.items() if key not in NO_VIEWPORT_DROPS}
|
||||
|
||||
|
||||
def merged_context_kwargs(defaults: Dict[str, Any], user: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""The keywords a `new_context` / `new_page` is made with: the declared defaults (none of the pinned geometry under `no_viewport=True`), then the user's."""
|
||||
merged = context_defaults_for(defaults, user.get("no_viewport"))
|
||||
merged.update(user)
|
||||
return merged
|
||||
|
||||
|
||||
def _context_has_no_viewport(options: Dict[str, Any]) -> bool:
|
||||
"""Whether the context was made with `no_viewport=True` (the client says it as `noDefaultViewport`): its pages are not pinned."""
|
||||
return bool(options.get("noDefaultViewport"))
|
||||
|
||||
|
||||
def _viewport_as_told(viewport: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:
|
||||
"""The size the client is told: the width and the height, never the mark."""
|
||||
if not viewport:
|
||||
return None
|
||||
return {"width": viewport["width"], "height": viewport["height"]}
|
||||
|
||||
|
||||
def _target_is_gone(error: BaseException) -> bool:
|
||||
"""Whether a failed command failed because the target or its session no longer exists (the engine closed the tab under it)."""
|
||||
if isinstance(error, juggler.TargetClosedError):
|
||||
@@ -3422,16 +3471,22 @@ class PageDispatcher(Dispatcher):
|
||||
self.actions = context.browser.actions_for_page(
|
||||
session, self.lifecycle, self.injected, self.number)
|
||||
#: The viewport as the client was told it (the initializer's, then
|
||||
#: `setViewportSize`): the hand plans inside it.
|
||||
self.viewport_size = context.options.get("viewport") or {
|
||||
#: `setViewportSize`): the hand plans inside it, unless the page is not pinned (`planning_viewport`).
|
||||
self.viewport_size = _viewport_as_told(context.options.get("viewport")) or {
|
||||
"width": 1280, "height": 720}
|
||||
#: ⛔ A POPUP THE ENGINE DID NOT PIN has no viewport of its own: its size is its window's, which can still change after its first
|
||||
#: script, so the client is told none (`viewport_size` None, Playwright's meaning of a page whose viewport is not emulated) and
|
||||
#: the wrapper reads the size when it needs it (`planning_viewport`). True from birth for a popup under the declared default;
|
||||
#: `setViewportSize` pins the page and ends it.
|
||||
self.viewport_unpinned = self._is_unpinned(context, opener)
|
||||
self._last_window_size: Optional[Dict[str, int]] = None
|
||||
#: ⛔ THE HAND, built where the page's number and the session's seed
|
||||
#: meet: one stream per page, the seed the client's cursor drew from
|
||||
#: (`_cursor.page_motion_seed`). See `pointer.py`.
|
||||
self.pointer = Pointer(
|
||||
self.actions, self.injected, self.number,
|
||||
context.browser.session_seed, context.browser.motion_budget_s,
|
||||
lambda: self.viewport_size,
|
||||
self.planning_viewport,
|
||||
draws=context.browser.pointer_draws)
|
||||
self._frames: Dict[str, Any] = {}
|
||||
#: The child frames the client was told of (`frameAttached`), to tell it of the ones born before the hook was in.
|
||||
@@ -3481,14 +3536,15 @@ class PageDispatcher(Dispatcher):
|
||||
name=getattr(known, "name", "") or "",
|
||||
load_states=sorted(getattr(known, "states", []) or []) or None,
|
||||
told_commit=self._last_commit(known))
|
||||
viewport = self.viewport_size
|
||||
viewport = self.told_viewport()
|
||||
# `pageNumber` is ours, not Playwright's: the number the page's
|
||||
# rhythms are drawn under (`pointer.py` and the actions' nonce read it
|
||||
# from `self.number`), told to the client so that it can name the page
|
||||
# the way the server does.
|
||||
initializer = {"mainFrame": self.frame.channel,
|
||||
"viewportSize": viewport, "isClosed": False,
|
||||
initializer = {"mainFrame": self.frame.channel, "isClosed": False,
|
||||
"pageNumber": self.number}
|
||||
if viewport is not None:
|
||||
initializer["viewportSize"] = viewport
|
||||
if opener is not None:
|
||||
# ⛔ THE OPENER TRAVELS IN THE INITIALIZER, and nowhere else. The
|
||||
# client resolves `page.opener()` from it and emits `popup` on the
|
||||
@@ -4437,11 +4493,46 @@ class PageDispatcher(Dispatcher):
|
||||
return None
|
||||
|
||||
# ── viewport, media, capture ────────────────────────────────────────────
|
||||
@staticmethod
|
||||
def _is_unpinned(context: "BrowserContextDispatcher", opener: Optional["PageDispatcher"]) -> bool:
|
||||
"""Whether the engine did not pin this page: any page of a context made with `no_viewport=True`, or a popup whose context viewport is only the
|
||||
declared default."""
|
||||
return _context_has_no_viewport(context.options) or (opener is not None and _viewport_is_declared(context.options.get("viewport")))
|
||||
|
||||
def told_viewport(self) -> Optional[Dict[str, int]]:
|
||||
"""The viewport the client is told (`page.viewport_size`): none for a popup the engine did not pin."""
|
||||
return None if self.viewport_unpinned else self.viewport_size
|
||||
|
||||
def planning_viewport(self) -> Dict[str, int]:
|
||||
"""The size the hand plans inside and the bounds checks use, at the time of use: the window's own for a popup the engine did not
|
||||
pin (the last one read when the window cannot be read now), else the viewport the client was told."""
|
||||
if not self.viewport_unpinned:
|
||||
return self.viewport_size
|
||||
size = self._window_size()
|
||||
if size is not None:
|
||||
self._last_window_size = size
|
||||
return self._last_window_size or self.viewport_size
|
||||
|
||||
def _window_size(self) -> Optional[Dict[str, int]]:
|
||||
"""The content size of this page's window, as the page reads it (`innerWidth`, `innerHeight`), or None when it cannot be read."""
|
||||
try:
|
||||
box = self.injected.evaluate(
|
||||
self.main_frame_id,
|
||||
"({width: window.innerWidth, height: window.innerHeight})")
|
||||
except Exception:
|
||||
return None
|
||||
if (isinstance(box, dict) and isinstance(box.get("width"), (int, float))
|
||||
and isinstance(box.get("height"), (int, float))
|
||||
and box["width"] > 0 and box["height"] > 0):
|
||||
return {"width": int(box["width"]), "height": int(box["height"])}
|
||||
return None
|
||||
|
||||
def op_set_viewport_size(self, params: Dict) -> Any:
|
||||
self.send("Page.setViewportSize", only_set(
|
||||
{"viewportSize": params.get("viewportSize")}))
|
||||
if params.get("viewportSize"):
|
||||
self.viewport_size = params["viewportSize"]
|
||||
self.viewport_unpinned = False # a size the client set pins the page
|
||||
return None
|
||||
|
||||
def op_emulate_media(self, params: Dict) -> Any:
|
||||
@@ -5613,6 +5704,18 @@ class BrowserDispatcher(Dispatcher):
|
||||
METHODS = {"newContext": "op_new_context", "close": "op_close",
|
||||
"newPage": "op_new_page"}
|
||||
|
||||
def answers_later(self, method: str, params: Dict) -> bool:
|
||||
"""A context given a SOCKS5 proxy waits for the final UDP verdict of that endpoint (the core measures it before the proxy is
|
||||
declared: ~11 s for a first endpoint), so `newContext` and `newPage` with one are answered from a thread of their own (`Deferred`),
|
||||
never by the transport worker that took them. The context's guid reaches the client in the reply, so nothing can name it before
|
||||
its proxy is applied."""
|
||||
if method not in ("newContext", "newPage"):
|
||||
return False
|
||||
try:
|
||||
return UdpExitCache.key(params.get("proxy")) is not None
|
||||
except ValueError:
|
||||
return False # a proxy that cannot be read is refused at once, by the command itself
|
||||
|
||||
#: How long the engine's reader waits for the gate of the events before it delivers the event anyway (see `events_gate`).
|
||||
GATE_WAIT_S = 5.0
|
||||
#: How long a page that is being built waits for the gate before it is built without it.
|
||||
@@ -5680,6 +5783,10 @@ class BrowserDispatcher(Dispatcher):
|
||||
#: Where this session measures a proxy's UDP exit from (the launch's `udp_stun_servers`, "ip:port"
|
||||
#: strings; None = the two public defaults): the launch and every context proxy use the same list.
|
||||
self.udp_stun_servers = udp_stun_servers
|
||||
#: The final UDP verdicts this served browser has measured, per proxy endpoint (the core's `UdpExitCache`, kept the way
|
||||
#: the core's own `Browser` keeps one): the first context given an endpoint waits for its measurement, the later ones
|
||||
#: reuse it. ONE per browser, never shared with another one, and it dies with it.
|
||||
self.udp_exit_cache = UdpExitCache()
|
||||
#: Chosen for this browser: the prefix of the native names of its exposed functions (see `_bindings`), and the
|
||||
#: directory of its engine (set by `launch`), which says whether the engine has what they need.
|
||||
self.binding_token = secrets.token_hex(6)
|
||||
@@ -6466,8 +6573,10 @@ class BrowserDispatcher(Dispatcher):
|
||||
# proxy. The core discovers the TCP exit through the proxy and measures the UDP beside it, once per
|
||||
# proxy (cached by endpoint, a hash of the credentials and the servers), from the STUN servers the
|
||||
# SESSION was launched with: this is the ONE place a context's proxy is applied, for the sync and
|
||||
# async clients and for a remote one alike. A `udp` key in what the caller wrote is not read.
|
||||
proxy = context_proxy_command(params["proxy"], self.udp_stun_servers)
|
||||
# async clients and for a remote one alike. A `udp` key in what the caller wrote is not read. The core WAITS for
|
||||
# the final verdict before it returns, and this browser's cache keeps it: only the first context given an
|
||||
# endpoint pays the wait.
|
||||
proxy = context_proxy_command(params["proxy"], self.udp_stun_servers, self.udp_exit_cache)
|
||||
except ValueError as exc:
|
||||
raise ProtocolException(
|
||||
"new_context(proxy=...) cannot be applied: %s" % exc)
|
||||
@@ -6522,7 +6631,7 @@ class BrowserDispatcher(Dispatcher):
|
||||
self._context_send("Browser.grantPermissions",
|
||||
{"browserContextId": context_id, "origin": "*",
|
||||
"permissions": _engine_permissions(permissions)})
|
||||
viewport = params.get("viewport")
|
||||
viewport = None if _context_has_no_viewport(params) else params.get("viewport")
|
||||
if viewport:
|
||||
# ⛔ `screen` is a SEPARATE option from `viewport` and rides in
|
||||
# the same command. Without it the page reports a screen the size
|
||||
@@ -6530,6 +6639,10 @@ class BrowserDispatcher(Dispatcher):
|
||||
# this project spends a pref on getting right.
|
||||
wanted: Dict[str, Any] = {"viewportSize": {
|
||||
"width": viewport["width"], "height": viewport["height"]}}
|
||||
# ⛔ ONE BIT: the size is the core's declaration for the main window, not the user's. The engine pins a tab to it either way;
|
||||
# a popup that names no size is pinned only to a size the user chose, as upstream does.
|
||||
if _viewport_is_declared(viewport):
|
||||
wanted["isDeclaredDefault"] = True
|
||||
screen = params.get("screen")
|
||||
if screen:
|
||||
wanted["screenSize"] = {"width": screen["width"],
|
||||
@@ -6902,6 +7015,10 @@ class BrowserTypeDispatcher(Dispatcher):
|
||||
except BaseException:
|
||||
conn.close()
|
||||
raise
|
||||
# The verdict the launch's geo step measured for the session's proxy is the browser's first one, as the core's `launch`
|
||||
# keeps it: a context given the same endpoint does not measure it again.
|
||||
if params.get("proxy"):
|
||||
browser.udp_exit_cache.remember(params["proxy"], udp_exit)
|
||||
browser.engine_dir = os.path.dirname(str(executable))
|
||||
return {"browser": browser.channel}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ from invisible_playwright._pw._impl._helper import parse_error
|
||||
from invisible_playwright._pw._impl._transport import Transport
|
||||
|
||||
from . import wire
|
||||
from .dispatcher import Deferred
|
||||
|
||||
|
||||
def _error_payload(failure: BaseException) -> Dict[str, str]:
|
||||
@@ -222,7 +223,20 @@ class InProcessTransport(Transport):
|
||||
except Exception as failure:
|
||||
self.reply_error(message.get("id"), failure)
|
||||
else:
|
||||
self.reply(message.get("id"), result)
|
||||
if isinstance(result, Deferred):
|
||||
# ⛔ THE ANSWER COMES LATER: this worker goes back to the queue at once, and the reply is posted from the thread that
|
||||
# works it out, the same way (`reply`/`reply_error` hand it to the loop with `call_soon_threadsafe`).
|
||||
result.begin(self._reply_later(message.get("id")))
|
||||
else:
|
||||
self.reply(message.get("id"), result)
|
||||
|
||||
def _reply_later(self, msg_id: Optional[int]) -> Any:
|
||||
def done(result: Any, failure: Optional[BaseException]) -> None:
|
||||
if failure is not None:
|
||||
self.reply_error(msg_id, failure)
|
||||
else:
|
||||
self.reply(msg_id, result)
|
||||
return done
|
||||
|
||||
# ── what the server calls back ──────────────────────────────────────────
|
||||
def emit_message(self, message: Dict) -> None:
|
||||
|
||||
@@ -11,7 +11,7 @@ That is a defect GENERATOR, and it has already produced three:
|
||||
|
||||
* the 0.4.0 process-leak fix reached the sync class only, and shipped to the
|
||||
other half of the users under a release note saying it was fixed;
|
||||
* `INVPW_TRUE_HEADLESS`, a documented env var, worked on the async API alone;
|
||||
* `INVPW_TRUE_HEADLESS`, a documented env var, worked on the async API alone (it is retired now: see below);
|
||||
* `_build_prefs` was a method on one side and twenty inline lines on the other.
|
||||
|
||||
Anything here must stay free of Playwright imports: it is the part that has
|
||||
@@ -26,7 +26,8 @@ from ._cursor import (ENGINE_PYTHON,
|
||||
enable_for as _enable_cursor_engine,
|
||||
max_seconds_for as _cursor_max_seconds)
|
||||
from ._engine import resolve_executable
|
||||
from ._juggler.server import COMPOSED_PREF, MOTION_BUDGET_PREF, POINTER_PREF, SESSION_SEED_PREF, UDP_EXIT_PREF, UDP_STUN_PREF
|
||||
from ._juggler.server import (COMPOSED_PREF, MOTION_BUDGET_PREF, POINTER_PREF, SESSION_SEED_PREF, UDP_EXIT_PREF, UDP_STUN_PREF,
|
||||
declared_viewport, merged_context_kwargs)
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from invisible_core import compose_session_prefs, context_geometry, make_virtual_display
|
||||
@@ -35,33 +36,14 @@ from invisible_core.launch import (FontManifestMismatch,
|
||||
cached_font_manifest_path,
|
||||
verify_font_manifest)
|
||||
|
||||
__all__ = ["build_prefs", "true_headless_requested", "TRUE_HEADLESS_ENV",
|
||||
__all__ = ["build_prefs", "refuse_retired_true_headless", "TRUE_HEADLESS_ENV",
|
||||
"ProxyEgressDrifted", "egress_ancora_valido"]
|
||||
|
||||
#: Opt-in to real headless. Read HERE rather than in one of the two classes,
|
||||
#: because reading it in one of them is exactly how it came to work on the async
|
||||
#: API only.
|
||||
#:
|
||||
#: ⛔ THE REASON THIS USED TO BE A WORKAROUND IS NOW KNOWN, AND FIXED. This
|
||||
#: comment said: "the default headful+cloak path intermittently hangs
|
||||
#: launch_persistent_context on Windows (~40%, a window/compositor race with a
|
||||
#: persistent profile); true headless ... is reliable". It had the right
|
||||
#: neighbourhood - window and compositor - and no mechanism, so it stood as an
|
||||
#: escape hatch for months.
|
||||
#:
|
||||
#: The mechanism, measured 2026-08-14: Windows declared the chrome window FULLY
|
||||
#: OCCLUDED and in the hanging runs the verdict was never revoked
|
||||
#: (`nsWindow::NotifyOcclusionState() mIsFullyOccluded 1` with no later 0). An
|
||||
#: inactive BrowsingContext never paints, so delayed startup never finishes,
|
||||
#: `browser-delayed-startup-finished` never fires, no target is created and the
|
||||
#: launch times out at 180 s. True headless was reliable for a reason nobody had
|
||||
#: named: there is no window to occlude.
|
||||
#:
|
||||
#: Fixed by `widget.windows.window_occlusion_tracking.enabled=false`, applied to
|
||||
#: EVERY session by invisible_core - 24 relaunches out of 24 against 6 hangs in 9.
|
||||
#: So this variable is no longer a workaround for that hang; it remains as a
|
||||
#: deliberate choice of a different rendering path. Full account:
|
||||
#: `71-bug-archive.md` [B150].
|
||||
#: The name of a retired variable. This product runs ONE path, the tested one: a real browser window on a hidden display. The
|
||||
#: variable used to opt into a different rendering path (Firefox `-headless`, no window at all); that path is gone, and a variable
|
||||
#: that is set and no longer does anything is a setting that does nothing while the caller believes it does something, so it is
|
||||
#: refused at launch (`refuse_retired_true_headless`), never ignored. Read HERE rather than in one of the two classes: reading it
|
||||
#: in one of them is exactly how it once came to work on the async API only.
|
||||
TRUE_HEADLESS_ENV = "INVPW_TRUE_HEADLESS"
|
||||
|
||||
|
||||
@@ -112,8 +94,16 @@ def declared_network(session: Any) -> str:
|
||||
return network_to_declare(session.seed)
|
||||
|
||||
|
||||
def true_headless_requested(env: Optional[Dict[str, str]] = None) -> bool:
|
||||
return (env if env is not None else os.environ).get(TRUE_HEADLESS_ENV) == "1"
|
||||
def refuse_retired_true_headless(env: Optional[Dict[str, str]] = None) -> None:
|
||||
"""Raise ValueError when the retired `INVPW_TRUE_HEADLESS` is set to anything but empty.
|
||||
|
||||
Called first by every entry point (sync, async, the server's launch), before the network, a display or a process is
|
||||
started, so the refusal costs nothing and leaves nothing behind."""
|
||||
if (env if env is not None else os.environ).get(TRUE_HEADLESS_ENV):
|
||||
raise ValueError(
|
||||
"invisible_playwright: %s is set, but it was retired in this version. This product always runs a real "
|
||||
"browser window on a hidden display; there is no other mode to choose. Unset %s."
|
||||
% (TRUE_HEADLESS_ENV, TRUE_HEADLESS_ENV))
|
||||
|
||||
|
||||
#: The IANA -> POSIX conversion comes from the core, which is where the table
|
||||
@@ -387,7 +377,7 @@ class CommonLaunch:
|
||||
⛔ THE DUPLICATION THIS CLOSES IS THE ONE THIS FILE WAS CREATED FOR, and it
|
||||
survived the file's own creation. `_session` was written on 2026-07-27 to
|
||||
hold what the sync and async classes share, and it did extract the
|
||||
functions - `build_env`, `build_prefs`, `true_headless_requested`. What it
|
||||
functions - `build_env`, `build_prefs`. What it
|
||||
left behind were the METHODS that call them: six of them, in both classes,
|
||||
with bodies that are identical byte for byte once the docstrings are
|
||||
removed. 222 lines saying the same thing twice.
|
||||
@@ -398,10 +388,8 @@ class CommonLaunch:
|
||||
ratios between 32% and 69% - was entirely comments worded differently.
|
||||
|
||||
⛔ AND THE COST OF THE SPLIT IS NOT HYPOTHETICAL. The three defects listed
|
||||
at the top of this file all have the same shape, and one of them is in the
|
||||
code that moved here: `INVPW_TRUE_HEADLESS` was honoured by the async class
|
||||
alone, so a documented environment variable worked or not depending on
|
||||
which entry point the caller had picked.
|
||||
at the top of this file all have the same shape: a documented knob that
|
||||
worked or not depending on which entry point the caller had picked.
|
||||
|
||||
⛔ WHAT THIS CLASS EXPECTS, said out loud because a mixin's contract is
|
||||
otherwise invisible: both subclasses set `seed`, `_binary_path`,
|
||||
@@ -454,19 +442,13 @@ class CommonLaunch:
|
||||
``pw_headless`` is what Playwright is told; ``display`` is the hidden
|
||||
surface the caller must START (and then record in
|
||||
``self._virtual_display``, which `_build_prefs` reads), or None when
|
||||
none is wanted: headless off, true headless asked for, or a platform
|
||||
none is wanted: headless off, or a platform
|
||||
with no display to make. The two callers only decide WHERE the start
|
||||
runs - inline in the sync client, in a worker in the async one - so
|
||||
the decision cannot drift between them (B172 was one such drift).
|
||||
"""
|
||||
if not self._headless:
|
||||
return False, None
|
||||
# Opt-in TRUE headless, shared with the async class. It existed on the
|
||||
# async API ONLY until 2026-07-27: a documented env var that worked
|
||||
# depending on which entry point the caller happened to pick, which is
|
||||
# the same drift that shipped the process-leak fix to half the users.
|
||||
if true_headless_requested():
|
||||
return True, None
|
||||
return False, make_virtual_display()
|
||||
|
||||
async def _resolve_headless_async(self) -> bool:
|
||||
@@ -514,8 +496,13 @@ class CommonLaunch:
|
||||
# the profile's screen is the PANEL, and until wrapper 0.28.0 the
|
||||
# panel's device pixels went out here as CSS (screen.width 1920 at
|
||||
# DPR 1.25).
|
||||
geometry = context_geometry(self._profile)
|
||||
kwargs: Dict[str, Any] = {
|
||||
**context_geometry(self._profile),
|
||||
**geometry,
|
||||
# ⛔ THE VIEWPORT IS MARKED AS THE CORE'S, not the user's: a viewport the user passes to `new_context` / `new_page` replaces
|
||||
# this one whole, mark included, so what reaches the server without the mark is a choice. A popup that names no size is
|
||||
# pinned to a chosen viewport as in Playwright and left to its own window under this one (`declared_viewport`).
|
||||
"viewport": declared_viewport(geometry["viewport"]),
|
||||
# ⛔ device_scale_factor and color_scheme are NO LONGER passed.
|
||||
# They were a second source for two facts invisible_core already
|
||||
# declares (layout.css.devPixelsPerPx and, since 2026-08-24,
|
||||
|
||||
@@ -109,6 +109,8 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
self._uscite_non_misurabili: int = 0
|
||||
|
||||
async def __aenter__(self) -> Union[Browser, BrowserContext]:
|
||||
# A retired variable is refused before anything starts (the network, a display, a process).
|
||||
_session.refuse_retired_true_headless()
|
||||
# Resolve timezone="auto" AND discover the proxy egress IP in one
|
||||
# round-trip, off the event loop, before anything reads self._timezone
|
||||
# or builds prefs/env. Fail-early if a proxy is set but the egress
|
||||
@@ -257,8 +259,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
|
||||
async def patched(**kw):
|
||||
await self._assert_uscita_invariata()
|
||||
merged = dict(defaults)
|
||||
merged.update(kw)
|
||||
merged = _session.merged_context_kwargs(defaults, kw)
|
||||
ctx = await original(**merged)
|
||||
if prep:
|
||||
await seed_cookies(ctx)
|
||||
@@ -295,8 +296,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
# Reserved before the check, for `_new_page_guarded`'s reason.
|
||||
with page_number_reserved(browser._impl_obj):
|
||||
await self._assert_uscita_invariata()
|
||||
merged = dict(defaults)
|
||||
merged.update(kw) # user-supplied wins, same rule as new_context
|
||||
merged = _session.merged_context_kwargs(defaults, kw)
|
||||
page = await original_page(**merged)
|
||||
ctx = page.context
|
||||
if prep:
|
||||
|
||||
@@ -264,6 +264,8 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
self._uscite_non_misurabili: int = 0
|
||||
|
||||
def __enter__(self) -> Union[Browser, BrowserContext]:
|
||||
# A retired variable is refused before anything starts (the network, a display, a process).
|
||||
_session.refuse_retired_true_headless()
|
||||
# Resolve timezone="auto" (and the proxy-set-but-unset default) to a
|
||||
# concrete IANA zone AND discover the proxy egress IP - one round-trip,
|
||||
# before anything reads self._timezone or builds prefs/env. Fail-early
|
||||
@@ -501,8 +503,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
|
||||
def patched(**kw):
|
||||
self._assert_uscita_invariata()
|
||||
merged = dict(defaults)
|
||||
merged.update(kw) # user-supplied wins
|
||||
merged = _session.merged_context_kwargs(defaults, kw)
|
||||
ctx = original(**merged)
|
||||
if prep:
|
||||
seed_cookies(ctx)
|
||||
@@ -536,8 +537,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
|
||||
def patched_page(**kw):
|
||||
self._assert_uscita_invariata()
|
||||
merged = dict(defaults)
|
||||
merged.update(kw) # user-supplied wins, same rule as new_context
|
||||
merged = _session.merged_context_kwargs(defaults, kw)
|
||||
page = original_page(**merged)
|
||||
ctx = page.context
|
||||
if prep:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""The row the host oracle's declared list carried while the published engine was the 68 or the 69 and the candidate no longer spawned the graphics probe.
|
||||
|
||||
ci/ab-host-expected.json declares what the published engine of today and the candidate differ by, which is nothing now (the published engine is the 70, which does not spawn
|
||||
gfxtest either, so the row would be stale in every run). The mechanism of a declared `proc` difference (the kind and the paths only that process touched, the A/B only, the stale
|
||||
check) is tested with this row, as a row of the tests' own.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
|
||||
GFXTEST_ROW = {
|
||||
"id": "gfxtest-69",
|
||||
"os": "linux",
|
||||
"category": "proc",
|
||||
"name": "gfxtest",
|
||||
"published": "present",
|
||||
"candidate": "absent",
|
||||
"reason": "the 69 no longer spawns the graphics probe gfxtest (GFX_PROBE_BINARY, widget/gtk/GfxInfo.cpp:55; commit 0e896e4ee1, the probe never reads the host); the paths only that process touched go with it",
|
||||
}
|
||||
|
||||
|
||||
def gfxtest_rows() -> list:
|
||||
return [copy.deepcopy(GFXTEST_ROW)]
|
||||
@@ -0,0 +1,101 @@
|
||||
"""What the browser writes to its output, read by every e2e test that launches the engine, and the lines that fail the test.
|
||||
|
||||
The core reads the browser's stdout and stderr (one pipe) through ``invisible_core.juggler.connection.ProcessOutput``, one reader for the whole life of the process, and keeps the last 200 lines. Nothing in the e2e suites looked at those
|
||||
lines: a line the engine writes to say that it did something it should not have done passed in silence. The check is here: while an e2e test runs, a tee in front of that reader (the bytes are the ones the reader gets, and the browser cannot
|
||||
tell) matches every line against ``FAILING_LINES``; the test fails, at its teardown, naming each line it saw.
|
||||
|
||||
``tests/conftest.py`` installs it for every test marked ``e2e`` (``_the_browser_log_holds_no_line_that_fails_the_test``). A browser that a test starts in a child process of its own (the A/B oracles) is not seen from here: its output is
|
||||
kept by ``scripts/ci_crash_evidence.py`` and judged by the oracle.
|
||||
|
||||
THE LINES.
|
||||
|
||||
* An expired wait for ``popupshown``. The engine's Juggler (``juggler/protocol/PageHandler.js``, ``_waitForPopupOfPress``) holds the release of a click until the popup its press opened (a select dropdown) says ``popupshown``, at most one
|
||||
second, and when the second passes it goes on and writes ``WARNING: popup <id> did not say popupshown within <ms> ms of its press, the release goes on``. The release that goes on is one the dropdown may drop, so a click that a test saw
|
||||
pass can have lost its ``mouseup``. The text here is the engine's, character for character; the id is the popup's element id (or its tag name) and the number is ``POPUP_SHOWN_WAIT_MS``.
|
||||
* An expired wait for the press of a release. The same handler holds a click's release at its gate until the page has handled the press (``_holdReleaseForItsPress``), at most five seconds, and then writes ``WARNING: the press of
|
||||
this release was not handled by the page within 5 s, the release goes on``: the release may reach a page that never saw its press.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import threading
|
||||
from typing import List
|
||||
|
||||
import pytest
|
||||
|
||||
#: The lines of the browser's output that fail an e2e test, each with what it means (the message names both the line and this).
|
||||
FAILING_LINES = (
|
||||
(re.compile(r"WARNING: popup \S+ did not say popupshown within \d+ ms of its press, the release goes on"),
|
||||
"a release waited for the popup its press opened to say popupshown, and went on without it (the engine's bound passed)"),
|
||||
(re.compile(r"WARNING: the press of this release was not handled by the page within \d+ s, the release goes on"),
|
||||
"a release waited for its press to be handled by the page, and went on without it (the engine's bound passed)"),
|
||||
)
|
||||
|
||||
|
||||
def failing(text: str) -> List[str]:
|
||||
"""The lines of ``text`` that fail a test, each as ``line <- what it means``."""
|
||||
found = []
|
||||
for line in text.splitlines():
|
||||
for pattern, meaning in FAILING_LINES:
|
||||
hit = pattern.search(line)
|
||||
if hit:
|
||||
found.append("%s <- %s" % (hit.group(0), meaning))
|
||||
return found
|
||||
|
||||
|
||||
class Sink:
|
||||
"""What the browsers of one test wrote that fails it, and the readers that were tee'd."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.lines: List[str] = []
|
||||
self.outputs: list = []
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def add(self, text: str) -> None:
|
||||
found = failing(text)
|
||||
if found:
|
||||
with self._lock:
|
||||
self.lines.extend(found)
|
||||
|
||||
def fail_if_any(self, wait: float = 0.5) -> None:
|
||||
"""Fail the test, naming every line, when a browser of the test wrote one. A browser that has just closed has its last lines still in the pipe: its reader is given ``wait`` seconds to reach the end."""
|
||||
for output in self.outputs:
|
||||
thread = getattr(output, "_thread", None)
|
||||
if thread is not None and thread.is_alive():
|
||||
thread.join(wait)
|
||||
with self._lock:
|
||||
lines = list(self.lines)
|
||||
if lines:
|
||||
pytest.fail("the browser's output holds %d line(s) that fail an e2e test:\n %s" % (len(lines), "\n ".join(lines)), pytrace=False)
|
||||
|
||||
|
||||
class ScanStream:
|
||||
"""The stream the core's reader reads, with every line it reads matched against ``FAILING_LINES``: the same lines in the same order to the same reader, and nothing written to the browser."""
|
||||
|
||||
def __init__(self, stream, sink: Sink) -> None:
|
||||
self._stream, self._sink = stream, sink
|
||||
|
||||
def readline(self, *args):
|
||||
line = self._stream.readline(*args)
|
||||
if line:
|
||||
try:
|
||||
self._sink.add(line.decode("utf-8", "replace") if isinstance(line, bytes) else str(line))
|
||||
except Exception: # noqa: BLE001 - a check never breaks a launch
|
||||
pass
|
||||
return line
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self._stream, name)
|
||||
|
||||
|
||||
def install(monkeypatch, sink: Sink) -> None:
|
||||
"""Put the tee in front of the reader of every browser the process launches through the core, until ``monkeypatch`` undoes it."""
|
||||
from invisible_core.juggler.connection import ProcessOutput
|
||||
|
||||
original = ProcessOutput.__init__
|
||||
|
||||
def init(self, stream, *args, **kwargs):
|
||||
original(self, ScanStream(stream, sink), *args, **kwargs)
|
||||
sink.outputs.append(self)
|
||||
|
||||
monkeypatch.setattr(ProcessOutput, "__init__", init)
|
||||
@@ -0,0 +1,187 @@
|
||||
"""What the drag twin records of a drag, and how two records are compared: every drag event the page hears, in the top document and in the frame, never a number of ours.
|
||||
|
||||
``RECORDER_JS`` is the script both pages run: for each of ``dragstart``, ``drag``, ``dragenter``, ``dragover``, ``dragleave``, ``drop`` and ``dragend`` (heard at the document, after the
|
||||
page's own handlers, so ``dataTransfer.types`` is what the page has set by then) it keeps, in ``window.__events``, the fields of ``FIELDS``:
|
||||
|
||||
type, at (the id of the event's target), under (the id of ``document.elementFromPoint`` at the event's client point), cx/cy (clientX/Y), sx/sy (screenX/Y), buttons, input (mozInputSource),
|
||||
types (dataTransfer.types), allowed (effectAllowed), effect (dropEffect), cancelled (mozUserCancelled), source_null (whether mozSourceNode is null), trusted (isTrusted).
|
||||
|
||||
``record(top_events, frame_events)`` is what one browser leaves: for each document (the top one, where the drag starts and ends and a drop can land, and the frame) the events that happen once
|
||||
or a few times (``once``: dragstart, dragenter, dragleave, drop, dragend, in the order the page heard them) whole, and for ``drag`` and ``dragover``, which repeat as often as the mouse moves
|
||||
and as a timer fires, their count, their first and last event and the ids they were dispatched at. ``end_minus_last`` is ``dragend``'s client point less the last ``drag``'s, in the top
|
||||
document.
|
||||
|
||||
HOW TWO RECORDS ARE COMPARED (``compare``): with stock, only what stock decides the same way on every machine and in either process model: the routing and the targets (the event sequence, the
|
||||
type, the target, what is under the point), the client points, ``rel``, the data transfer's types, trusted, the input source, and, in the top document, the effects (the same process on both
|
||||
sides) of every event but the one the frame's process decides (see the twin rule). In a CSS pixel for the client points (``TOLERANCES``: the point of a drag is a device pixel that crosses a process and is rounded to CSS, the tolerance the twin has always had for the
|
||||
drop point); and through the relation for the screen points. ``screenX/Y`` is where the window stands on the screen: stock's is the real place of its window and ours is the declared one, so the
|
||||
two are not the same number and no number of ours is the expected one. What the page reads is the same in both: where a point is on the screen relative to where the top document's first event is
|
||||
(``rel``: ``screen - client`` of the event, less that of the first event of the top document). It is 0 for every event of the top document and the frame's place in it for a frame's event, in a
|
||||
browser whose window stands anywhere. The absolute screen points and the origin are in the record, printed when the two differ, and not in the comparison. The count of ``dragover`` events is in
|
||||
the record and not in the comparison: it is timer-driven.
|
||||
|
||||
THE TWIN RULE (``DECLARED``): a field that depends on stock's frame being in the top's process, or on stock's drag being Juggler's synthetic one, is in the record and NOT compared with stock; the
|
||||
list says which and why, and ``recorded`` returns what differs there, for the report. Retail decides those fields, through the capture of the round ``drag`` of the core's window-geometry workflow.
|
||||
They are ``buttons`` (stock's synthetic drag has no OLE loop: 0), ``drag`` at the source (count and presence: no OLE loop, no timer-driven ``drag``), the ``dragend`` point less the last ``drag``
|
||||
(no ``drag`` to be less of), and in the frame ``effectAllowed``, ``dropEffect`` and ``mozSourceNode`` (stock's frame is in-process and reads the source's own DataTransfer; ours is in another
|
||||
process, where Mozilla's cross-process DataTransfer starts with effectAllowed ``uninitialized`` and the dropEffect is the action, nsContentUtils FilterDropEffect).
|
||||
For the drop in the frame (``kind`` ``frame``), two more fields of the TOP document depend on the frame's process, and ``comparable`` moves them out of ``top.once`` before the comparison: every top
|
||||
``dragleave`` whose ``under`` is the frame (``top.into_frame``: stock's frame is in its own process model, so the top's event manager fires a leave at the body when the cursor enters the
|
||||
subdocument; retail with the frame out of process has none, and ours has none) and the ``dropEffect`` of the top ``dragend`` (``top.dragend_effect``: it is the frame's drop result, which crosses
|
||||
processes). In the drop in the top document (``kind`` ``top``) the record is compared whole, ``dragend``'s effect included.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import json
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from _stock_twin import IN_PROCESS_FRAME, SYNTHETIC_DRAG, both, split_differences
|
||||
|
||||
#: The events of a drag, in the order a drag starts, goes over and ends.
|
||||
TYPES = ("dragstart", "drag", "dragenter", "dragover", "dragleave", "drop", "dragend")
|
||||
#: Events that repeat (every mouse move, every timer tick): the record keeps their count, their first and last event.
|
||||
REPEATED = ("drag", "dragover")
|
||||
#: What the page keeps of each event, and so what the record has of it.
|
||||
FIELDS = ("type", "at", "under", "cx", "cy", "sx", "sy", "buttons", "input", "types", "allowed", "effect", "cancelled", "source_null", "trusted")
|
||||
#: A CSS pixel for a client point and for the relation of the screen point to the client one; every other number exactly.
|
||||
TOLERANCES: Dict[str, float] = {"cx": 1.0, "cy": 1.0, "rel": 1.0}
|
||||
#: Keys of the record that are in it and not in the comparison, and why (the count of ``drag`` and of ``dragover`` is left out in ``_comparable``: a timer fires them, so it depends on the speed of the machine).
|
||||
NOT_COMPARED = {
|
||||
"sx": "the real place of stock's window and the declared one of ours: compared through rel",
|
||||
"sy": "the real place of stock's window and the declared one of ours: compared through rel",
|
||||
"screen_origin": "screen minus client of the first event of the top document: where the window stands",
|
||||
}
|
||||
|
||||
#: THE TWIN RULE. Stock Playwright's Firefox sets ``fission.webContentIsolationStrategy=0``: its cross-site frame is in the top's process, ours is in another process, and stock's drag is Juggler's
|
||||
#: synthetic one (no OLE drag loop). A field that depends on either is RECORDED, not compared with stock: the retail capture decides it (round ``drag`` of the core's window-geometry workflow, which
|
||||
#: drives a real drag on retail). Each key is a pattern of canonical paths of the record (``top.once[].buttons``; ``*`` is any run of characters), each value is the reason.
|
||||
#: What is compared with stock is the routing and the targets (the event sequence, ``type``, ``at``, ``under``), the client points and ``rel``, ``types``, ``trusted`` and ``input`` (mozInputSource),
|
||||
#: in both documents, and ``effectAllowed`` and ``dropEffect`` of the top document, except, in the drop in the frame, the top's leave into the frame and the top ``dragend``'s ``dropEffect``.
|
||||
DECLARED: Dict[str, str] = {
|
||||
# stock's synthetic Juggler drag: no OLE loop, so the mouse buttons are 0 in its events and ``drag`` never fires at the source (and the dragend point less the last drag has no drag to be less of)
|
||||
"*.buttons": SYNTHETIC_DRAG,
|
||||
"top.repeated.drag.*": SYNTHETIC_DRAG,
|
||||
"end_minus_last*": SYNTHETIC_DRAG,
|
||||
# stock's frame is in-process: it reads the source's own DataTransfer; ours is in another process, where Mozilla's cross-process DataTransfer starts with effectAllowed 'uninitialized' and
|
||||
# dropEffect is the action (nsContentUtils FilterDropEffect), and mozSourceNode is not reachable
|
||||
"frame.*.allowed": IN_PROCESS_FRAME,
|
||||
"frame.*.effect": IN_PROCESS_FRAME,
|
||||
"frame.*.source_null": IN_PROCESS_FRAME,
|
||||
# the frame drop only (``comparable`` makes these keys): stock's top hears a leave at the body when the cursor enters its in-process-model subdocument, and the top dragend's dropEffect is the
|
||||
# frame's drop result, which crosses processes
|
||||
"top.into_frame*": IN_PROCESS_FRAME,
|
||||
"top.dragend_effect*": IN_PROCESS_FRAME,
|
||||
}
|
||||
|
||||
RECORDER_JS = """
|
||||
window.__events = [];
|
||||
(function () {
|
||||
const name = n => n ? (n.id || n.nodeName.toLowerCase()) : null;
|
||||
for (const type of %s) {
|
||||
document.addEventListener(type, e => {
|
||||
const dt = e.dataTransfer;
|
||||
window.__events.push({
|
||||
type: e.type, at: name(e.target), under: name(document.elementFromPoint(e.clientX, e.clientY)),
|
||||
cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY, buttons: e.buttons, input: e.mozInputSource,
|
||||
types: dt ? Array.from(dt.types) : null, allowed: dt ? dt.effectAllowed : null, effect: dt ? dt.dropEffect : null,
|
||||
cancelled: dt ? dt.mozUserCancelled : null, source_null: dt ? dt.mozSourceNode === null : null, trusted: e.isTrusted,
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
""" % json.dumps(list(TYPES))
|
||||
|
||||
READ_JS = "() => window.__events"
|
||||
|
||||
|
||||
def read_events(document) -> List[Dict[str, Any]]:
|
||||
"""The raw events a page or frame heard (``document`` is a Playwright page or frame)."""
|
||||
return document.evaluate(READ_JS)
|
||||
|
||||
|
||||
def _event(raw: Dict[str, Any], origin: Optional[List[float]]) -> Dict[str, Any]:
|
||||
missing = [f for f in FIELDS if f not in raw]
|
||||
if missing:
|
||||
raise ValueError("a drag event the page recorded has no %s (an absent field is a difference, never an agreement): %r" % (", ".join(missing), raw))
|
||||
out = {f: raw[f] for f in FIELDS}
|
||||
out["rel"] = None if origin is None else [raw["sx"] - raw["cx"] - origin[0], raw["sy"] - raw["cy"] - origin[1]]
|
||||
return out
|
||||
|
||||
|
||||
def _document(events: List[Dict[str, Any]], origin: Optional[List[float]]) -> Dict[str, Any]:
|
||||
once = [_event(e, origin) for e in events if e.get("type") not in REPEATED]
|
||||
repeated: Dict[str, Any] = {}
|
||||
for kind in REPEATED:
|
||||
of_kind = [_event(e, origin) for e in events if e.get("type") == kind]
|
||||
repeated[kind] = ({"count": len(of_kind), "first": of_kind[0], "last": of_kind[-1], "at": sorted({str(e["at"]) for e in of_kind})}
|
||||
if of_kind else {"count": 0})
|
||||
return {"once": once, "repeated": repeated}
|
||||
|
||||
|
||||
def record(top_events: List[Dict[str, Any]], frame_events: List[Dict[str, Any]]) -> Dict[str, Any]:
|
||||
"""What one browser leaves of one drag: both documents' events, the end point less the last drag point, and the origin of the screen points."""
|
||||
origin = [top_events[0]["sx"] - top_events[0]["cx"], top_events[0]["sy"] - top_events[0]["cy"]] if top_events else None
|
||||
top = _document(top_events, origin)
|
||||
drags = [e for e in top_events if e.get("type") == "drag"]
|
||||
ends = [e for e in top_events if e.get("type") == "dragend"]
|
||||
last, end = (drags[-1] if drags else None), (ends[-1] if ends else None)
|
||||
return {"top": top, "frame": _document(frame_events, origin),
|
||||
"end_minus_last": [end["cx"] - last["cx"], end["cy"] - last["cy"]] if (end and last) else None,
|
||||
"screen_origin": origin}
|
||||
|
||||
|
||||
def read_record(page, frame) -> Dict[str, Any]:
|
||||
"""The record of a drag, read from the top page and from the frame."""
|
||||
return record(read_events(page), read_events(frame))
|
||||
|
||||
|
||||
def _comparable(node: Any, key: str = "") -> Any:
|
||||
if isinstance(node, dict):
|
||||
return {k: _comparable(v, k) for k, v in node.items() if k not in NOT_COMPARED and not (key in REPEATED and k == "count")}
|
||||
if isinstance(node, list):
|
||||
return [_comparable(v, key) for v in node]
|
||||
return copy.deepcopy(node)
|
||||
|
||||
|
||||
#: The id of the frame in the top page (``f``): the ``under`` of the top's leave into it.
|
||||
FRAME_ID = "f"
|
||||
|
||||
|
||||
def comparable(record: Dict[str, Any], kind: str) -> Dict[str, Any]:
|
||||
"""The record as it is compared: for the drop in the frame (``kind`` ``frame``) the top's ``dragleave`` events under the frame leave ``top.once`` for ``top.into_frame`` and the top ``dragend``'s
|
||||
``effect`` leaves its event for ``top.dragend_effect``; both keys are in ``DECLARED``. For the drop in the top document (``top``) the record is unchanged."""
|
||||
if kind not in ("top", "frame"):
|
||||
raise ValueError("the drop is in the 'top' document or in the 'frame', not %r" % (kind,))
|
||||
out = _comparable(record)
|
||||
if kind == "frame":
|
||||
top = out["top"]
|
||||
into_frame = [e for e in top["once"] if e["type"] == "dragleave" and e["under"] == FRAME_ID]
|
||||
top["once"] = [e for e in top["once"] if not (e["type"] == "dragleave" and e["under"] == FRAME_ID)]
|
||||
top["into_frame"] = into_frame
|
||||
top["dragend_effect"] = [e.pop("effect") for e in top["once"] if e["type"] == "dragend"]
|
||||
return out
|
||||
|
||||
|
||||
def split(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> Tuple[List[str], List[str]]:
|
||||
"""``(red, recorded)``: the differences that decide, and those of the declared fields (``DECLARED``), kept for the report. ``kind`` is where the drop ended: ``top`` or ``frame``."""
|
||||
return split_differences(comparable(stock, kind), comparable(ours, kind), DECLARED, TOLERANCES, path)
|
||||
|
||||
|
||||
def compare(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> List[str]:
|
||||
"""Every place where ours is not what stock is in a field that is compared, as ``path: stock X, ours Y``; empty when the page reads the same there."""
|
||||
return split(stock, ours, kind, path)[0]
|
||||
|
||||
|
||||
def recorded(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> List[str]:
|
||||
"""The differences in the fields of ``DECLARED``: in the report, never in the verdict."""
|
||||
return split(stock, ours, kind, path)[1]
|
||||
|
||||
|
||||
def verdict(case: str, kind: str, stock: Dict[str, Any], ours: Dict[str, Any]) -> str:
|
||||
"""The message of a red drag twin, with both records whole; empty when ours is what stock is."""
|
||||
differing = compare(stock, ours, kind, "%s drop" % kind)
|
||||
if not differing:
|
||||
return ""
|
||||
return ("%s: the drag that ends in the %s of ours does not read what stock's does (every event, that drag fired at the source, dragend less the last drag):\n %s%s"
|
||||
% (case, "frame of another site" if kind == "frame" else "top document", "\n ".join(differing), both(case, stock, ours)))
|
||||
@@ -0,0 +1,58 @@
|
||||
"""A stock Playwright client that launches nothing and records what ``p.firefox.launch`` was called with, for the unit tests of the stock twins (no browser, no display)."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
|
||||
import _stock_twin
|
||||
|
||||
|
||||
class _Page:
|
||||
pass
|
||||
|
||||
|
||||
class _Context:
|
||||
def new_page(self) -> _Page:
|
||||
return _Page()
|
||||
|
||||
|
||||
class _Browser:
|
||||
def __init__(self, events: List[str]) -> None:
|
||||
self._events = events
|
||||
|
||||
def new_context(self, **kwargs: Any) -> _Context:
|
||||
return _Context()
|
||||
|
||||
def close(self) -> None:
|
||||
self._events.append("browser closed")
|
||||
|
||||
|
||||
class _Firefox:
|
||||
def __init__(self, launches: List[Dict[str, Any]], events: List[str], fail: bool) -> None:
|
||||
self._launches, self._events, self._fail = launches, events, fail
|
||||
|
||||
def launch(self, **kwargs: Any) -> _Browser:
|
||||
self._events.append("launch")
|
||||
self._launches.append(kwargs)
|
||||
if self._fail:
|
||||
raise RuntimeError("the launch fails")
|
||||
return _Browser(self._events)
|
||||
|
||||
|
||||
class _Playwright:
|
||||
def __init__(self, launches: List[Dict[str, Any]], events: List[str], fail: bool) -> None:
|
||||
self.firefox = _Firefox(launches, events, fail)
|
||||
|
||||
def __enter__(self) -> "_Playwright":
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc: Any) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def install(monkeypatch, events: List[str] = None, fail: bool = False) -> List[Dict[str, Any]]:
|
||||
"""``_stock_twin._on_stock`` on a client that records its launches (the keywords of each) in the list returned, and its steps in ``events``."""
|
||||
launches: List[Dict[str, Any]] = []
|
||||
events = [] if events is None else events
|
||||
monkeypatch.setattr(_stock_twin, "stock_client", lambda: (lambda: _Playwright(launches, events, fail)))
|
||||
monkeypatch.setattr(_stock_twin, "Chrome", type("FakeChrome", (), {"__init__": lambda self, page: None, "close": lambda self: None}))
|
||||
return launches
|
||||
@@ -0,0 +1,151 @@
|
||||
"""What a popup twin records about each element it clicks, so that a red run says what the click and the geometry were, and a green run leaves the numbers to compare.
|
||||
|
||||
A twin that clicks an element and waits for a popup (the select dropdown) used to say "the dropdown did not open" and nothing about the click: where it was sent, at which scale, what the
|
||||
element's box was in its document and in the window, and what the popup was doing. This module is what the twin keeps for each element, and writes:
|
||||
|
||||
* ``click``: the point in CSS pixels, and the point the driver sent (the unit it is in and the device point it makes: CSS times the scale the driver knows);
|
||||
* ``scales``: the record of ``Driver.scales()`` (the page's and the chrome's ``devicePixelRatio`` and the real scale of the screen), once per browser;
|
||||
* ``select_rect``: ``getBoundingClientRect`` of the element inside its own document, and, for an element of a frame, ``iframe_rect``: the frame element's box in the top document;
|
||||
* ``mozInnerScreen``: ``window.mozInnerScreenX/Y`` of the top document and, for a frame, of the frame's document;
|
||||
* ``activation_at_click`` and ``activation_after_click``: whether the window was the active one, and had the focus, when the click was sent and right after (``look_at_activation``): chrome
|
||||
``Services.focus.activeWindow === win``, ``win.document.hasFocus()``, the browsing context's ``isActive`` (``win.gBrowser.selectedBrowser.browsingContext.isActive``), the top content document's
|
||||
``hasFocus()`` and ``visibilityState``, and the driver's ack of the click when it has one (``last_click_ack``); a popup that does not open for a window that was not active is not a popup that is at the wrong place;
|
||||
* ``popup``: the state after the click (the first look), the last look of the wait (at the deadline) and, when the popup did not reach the state, a second look (the select test: a short wait on the same condition, so that a popup that comes late is seen to come late).
|
||||
|
||||
A read that fails is recorded in ``errors`` and never raised: the diagnosis must not replace the finding. The record is in the message of the failure and, on a runner (``RUNNER_TEMP`` set), in
|
||||
``$RUNNER_TEMP/invpw-evidence/popup-diagnostics/<case>-<browser>.json``, the folder every e2e job uploads (see ``_watchdog_log``), whatever the result.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Mapping, Optional, Sequence
|
||||
|
||||
from _watchdog_log import EVIDENCE_FOLDER
|
||||
|
||||
#: The folder of this evidence inside ``$RUNNER_TEMP/invpw-evidence``.
|
||||
SUBFOLDER = "popup-diagnostics"
|
||||
|
||||
#: The top document: the element's box, the frame element's box, the window's place on the screen. Both ids are given by the page of the twin.
|
||||
TOP_GEOMETRY_JS = """(() => {
|
||||
const box = id => { const e = document.getElementById(id); if (!e) { return null; } const b = e.getBoundingClientRect(); return {x: b.x, y: b.y, w: b.width, h: b.height}; };
|
||||
return {select: box(%(select)s), iframe: box(%(iframe)s), mozInnerScreen: [window.mozInnerScreenX, window.mozInnerScreenY], scroll: [window.scrollX, window.scrollY]};
|
||||
})()"""
|
||||
|
||||
#: The document of a frame: the element's box inside it and its own place on the screen.
|
||||
FRAME_GEOMETRY_JS = """(() => {
|
||||
const e = document.getElementById(%(select)s); const b = e ? e.getBoundingClientRect() : null;
|
||||
return {select: b && {x: b.x, y: b.y, w: b.width, h: b.height}, mozInnerScreen: [window.mozInnerScreenX, window.mozInnerScreenY], scroll: [window.scrollX, window.scrollY]};
|
||||
})()"""
|
||||
|
||||
|
||||
#: Chrome scope: the window's activation and focus, and the browsing context of the selected tab. ``win`` is the most recent browser window, as every chrome script of the twins reads it.
|
||||
ACTIVATION_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
return JSON.stringify({
|
||||
active_window: Services.focus.activeWindow === win,
|
||||
window_has_focus: win.document.hasFocus(),
|
||||
browsing_context_is_active: win.gBrowser.selectedBrowser.browsingContext.isActive,
|
||||
});
|
||||
"""
|
||||
|
||||
#: The top content document, read through the driver (``driver.eval``): the same expression on every driver.
|
||||
CONTENT_ACTIVATION_JS = """(() => ({hasFocus: document.hasFocus(), visibilityState: document.visibilityState}))()"""
|
||||
|
||||
|
||||
def _failed(exc: BaseException) -> str:
|
||||
return "%s: %s" % (type(exc).__name__, str(exc)[:300])
|
||||
|
||||
|
||||
def look_at_geometry(driver: Any, in_frame: bool, select_id: str = "s", frame_id: str = "f") -> Dict[str, Any]:
|
||||
"""The boxes and the window's place for one element, read before the click. ``driver.eval`` reads the top document, ``driver.eval_in_frame`` the frame's.
|
||||
A read that fails leaves its field out and says why in ``errors``."""
|
||||
ids = {"select": json.dumps(select_id), "iframe": json.dumps(frame_id)}
|
||||
out: Dict[str, Any] = {"errors": {}}
|
||||
top: Optional[Dict[str, Any]] = None
|
||||
try:
|
||||
top = driver.eval(TOP_GEOMETRY_JS % ids)
|
||||
except Exception as exc: # noqa: BLE001 the diagnosis never replaces the finding
|
||||
out["errors"]["top_document"] = _failed(exc)
|
||||
top = top or {}
|
||||
out["mozInnerScreen"] = {"top": top.get("mozInnerScreen")}
|
||||
if not in_frame:
|
||||
out["select_rect"] = top.get("select")
|
||||
out["iframe_rect"] = None
|
||||
else:
|
||||
out["iframe_rect"] = top.get("iframe")
|
||||
try:
|
||||
inner = driver.eval_in_frame(FRAME_GEOMETRY_JS % ids)
|
||||
out["select_rect"] = inner.get("select")
|
||||
out["mozInnerScreen"]["frame"] = inner.get("mozInnerScreen")
|
||||
except Exception as exc: # noqa: BLE001
|
||||
out["errors"]["frame_document"] = _failed(exc)
|
||||
out["select_rect"] = None
|
||||
out["mozInnerScreen"]["frame"] = None
|
||||
if not out["errors"]:
|
||||
del out["errors"]
|
||||
return out
|
||||
|
||||
|
||||
def look_at_activation(driver: Any) -> Dict[str, Any]:
|
||||
"""The window's activation and focus now: the chrome's (``ACTIVATION_JS``), the top content document's (``CONTENT_ACTIVATION_JS``) and the driver's ack of the click, when it keeps one
|
||||
(``last_click_ack``, None otherwise). A read that fails leaves its part out and says why in ``errors``; the diagnosis never replaces the finding."""
|
||||
out: Dict[str, Any] = {"errors": {}}
|
||||
try:
|
||||
out["chrome"] = driver.chrome.script(ACTIVATION_JS)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
out["errors"]["chrome"] = _failed(exc)
|
||||
try:
|
||||
out["content"] = driver.eval(CONTENT_ACTIVATION_JS)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
out["errors"]["content"] = _failed(exc)
|
||||
out["click_ack"] = getattr(driver, "last_click_ack", None)
|
||||
if not out["errors"]:
|
||||
del out["errors"]
|
||||
return out
|
||||
|
||||
|
||||
def click_record(driver: Any, css: Sequence[float]) -> Dict[str, Any]:
|
||||
"""The click as asked (CSS pixels) and as the driver sent it (``driver.last_click``: the point, its unit, the device point), as the driver wrote it."""
|
||||
return {"css": list(css), "sent": getattr(driver, "last_click", None)}
|
||||
|
||||
|
||||
class Diagnostics:
|
||||
"""The record of one browser on one case: its scales and one entry per element."""
|
||||
|
||||
def __init__(self, case: str, browser: str) -> None:
|
||||
self.case, self.browser = case, browser
|
||||
self.scales: Optional[Dict[str, Any]] = None
|
||||
self.entries: Dict[str, Dict[str, Any]] = {}
|
||||
self.save_error: Optional[str] = None
|
||||
|
||||
def entry(self, name: str) -> Dict[str, Any]:
|
||||
return self.entries.setdefault(name, {})
|
||||
|
||||
def record(self) -> Dict[str, Any]:
|
||||
return {"case": self.case, "browser": self.browser, "scales": self.scales, "elements": self.entries}
|
||||
|
||||
def message(self, headline: str, name: str) -> str:
|
||||
"""``headline``, then everything known about the element ``name`` and the scales, as one JSON line a reader can paste."""
|
||||
body = {"case": self.case, "browser": self.browser, "element": name, "scales": self.scales, **self.entries.get(name, {})}
|
||||
return "%s\n diagnostics: %s" % (headline, json.dumps(body, sort_keys=True))
|
||||
|
||||
def path(self, environ: Mapping[str, str]) -> Optional[Path]:
|
||||
runner = environ.get("RUNNER_TEMP")
|
||||
if not runner:
|
||||
return None
|
||||
return Path(runner) / EVIDENCE_FOLDER / SUBFOLDER / ("%s-%s.json" % (self.case, self.browser))
|
||||
|
||||
def save(self, environ: Optional[Mapping[str, str]] = None) -> Optional[Path]:
|
||||
"""Writes the record where the jobs upload it; None off a runner. A failed write is kept in ``save_error`` and never raised: this runs while a finding may be on its way up."""
|
||||
path = self.path(os.environ if environ is None else environ)
|
||||
if path is None:
|
||||
return None
|
||||
try:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(json.dumps(self.record(), indent=1, sort_keys=True) + "\n", encoding="utf-8")
|
||||
except OSError as exc:
|
||||
self.save_error = _failed(exc)
|
||||
return None
|
||||
return path
|
||||
+144
-30
@@ -1,4 +1,4 @@
|
||||
"""The retail reference of the chrome-scope twins: RETAIL Firefox 159, driven by Marionette alone (no Playwright), headed on the job's display; and one driver for it and for ours.
|
||||
"""The retail reference of the chrome-scope twins: RETAIL Firefox 159, driven by Marionette alone (no Playwright), headed on a display of its own (the wrapper's mechanism); and one driver for it and for ours.
|
||||
|
||||
Playwright's own Firefox is not a reference for the popups the browser chrome opens (a select dropdown, a tooltip): nothing says its build takes ``-marionette``, and it is not the
|
||||
browser a user runs. The reference of these twins is the official retail build, the one the capture rounds of RetailCaptures measured. The chrome-scope relations (the popup against its
|
||||
@@ -6,8 +6,8 @@ element, the tooltip against the pointer) are read in the same way on both sides
|
||||
``goto``, ``eval`` (a JavaScript expression of the top document, as JSON), ``move``, ``click`` (the point of the top document, CSS pixels), ``wait_for_timeout`` and ``chrome``.
|
||||
|
||||
WHERE THE RETAIL BINARY COMES FROM. The file named by the environment variable ``INVPW_RETAIL_FIREFOX`` (the path of ``firefox.exe`` on Windows, of ``firefox`` on Linux, where the reference is Mozilla's own Linux 159 build, fetched and verified the same way
|
||||
and extracted to ``<work>/extracted/firefox/firefox``): a missing variable or file is RED ("MISSING REFERENCE, reference unavailable"), never a skip. The launcher is the same on both: no ``.exe``, the display is the job's (xvfb-run on Linux).
|
||||
The leg of the row ``wrapper.e2e.stock_twin`` puts it there with the mechanism the retail captures already use, in the repository oss-invisible/core: ``scripts/retail/firefox_build.py fetch
|
||||
and extracted to ``<work>/extracted/firefox/firefox``): a missing variable or file is RED ("MISSING REFERENCE, reference unavailable"), never a skip. The launcher is the same on both: no ``.exe``, the display is one of its own, made as the wrapper makes ours (``_stock_twin.OwnDisplay``: ``make_virtual_display()``, an Xvfb on Linux, the desktop of the job on Windows), not the job's: the rows run pytest without xvfb-run.
|
||||
The legs of the rows ``wrapper.e2e.stock_twin.select`` and ``wrapper.e2e.stock_twin.tooltip`` put it there with the mechanism the retail captures already use, in the repository oss-invisible/core: ``scripts/retail/firefox_build.py fetch
|
||||
--version 159.0 --work DIR`` (it downloads ``Firefox Setup 159.0.exe`` and SHA256SUMS and SHA256SUMS.asc from archive.mozilla.org, checks the signature against the release key committed in
|
||||
``captures/runner/``, checks the installer's sha256 against SHA256SUMS, extracts it with 7z and writes DIR/build.json with the path of firefox.exe).
|
||||
|
||||
@@ -26,7 +26,7 @@ import time
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
|
||||
from _stock_twin import MARIONETTE_ARGS, SCALES_JS, BrokenControl, Chrome
|
||||
from _stock_twin import MARIONETTE_ARGS, SCALES_JS, BrokenControl, Chrome, OwnDisplay
|
||||
from _waits import wait_until
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case
|
||||
|
||||
@@ -59,7 +59,7 @@ class MissingReference(AssertionError):
|
||||
def retail_executable() -> str:
|
||||
path = os.environ.get(ENV_VARIABLE, "")
|
||||
if not path or not Path(path).is_file():
|
||||
raise MissingReference("MISSING REFERENCE, no finding about ours: %s names no retail Firefox 159 (%r). The leg of the row wrapper.e2e.stock_twin installs it with "
|
||||
raise MissingReference("MISSING REFERENCE, no finding about ours: %s names no retail Firefox 159 (%r). The leg of the rows wrapper.e2e.stock_twin.select and wrapper.e2e.stock_twin.tooltip installs it with "
|
||||
"oss-invisible/core scripts/retail/firefox_build.py fetch --version 159.0 and sets the variable to the path of firefox.exe" % (ENV_VARIABLE, path))
|
||||
return path
|
||||
|
||||
@@ -72,6 +72,10 @@ class Driver:
|
||||
"""What a twin does with a page, on any browser. ``chrome.script(js, args)`` is chrome scope through Marionette."""
|
||||
|
||||
chrome: Any
|
||||
#: Which browser this is, in the names of a record and of its evidence file.
|
||||
kind = "driver"
|
||||
#: The last ``click``, as the driver sent it: ``{"point": [x, y], "unit": ..., "device": [x, y]}`` (None before the first click).
|
||||
last_click: Optional[Dict[str, Any]] = None
|
||||
|
||||
def goto(self, url: str) -> None:
|
||||
raise NotImplementedError
|
||||
@@ -80,6 +84,10 @@ class Driver:
|
||||
"""The value of a JavaScript expression in the top document (a JSON-able value)."""
|
||||
raise NotImplementedError
|
||||
|
||||
def eval_in_frame(self, expression: str) -> Any:
|
||||
"""The value of a JavaScript expression in the document of the first frame of the top document (a JSON-able value)."""
|
||||
raise NotImplementedError
|
||||
|
||||
def move(self, x: float, y: float, steps: int = 1) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -99,6 +107,8 @@ class Driver:
|
||||
class PlaywrightDriver(Driver):
|
||||
"""Ours: a page of the wrapper's client, and the chrome of the engine through Marionette."""
|
||||
|
||||
kind = "ours"
|
||||
|
||||
def __init__(self, page, chrome: Chrome) -> None:
|
||||
self.page, self.chrome = page, chrome
|
||||
|
||||
@@ -108,10 +118,21 @@ class PlaywrightDriver(Driver):
|
||||
def eval(self, expression: str) -> Any:
|
||||
return self.page.evaluate("() => (%s)" % expression)
|
||||
|
||||
def eval_in_frame(self, expression: str) -> Any:
|
||||
frames = [frame for frame in self.page.frames if frame != self.page.main_frame]
|
||||
return frames[0].evaluate("() => (%s)" % expression)
|
||||
|
||||
def move(self, x: float, y: float, steps: int = 1) -> None:
|
||||
self.page.mouse.move(x, y, steps=steps)
|
||||
|
||||
def click(self, x: float, y: float) -> None:
|
||||
# the client sends the point in CSS pixels of the page; the device point is that times the page's (declared) scale
|
||||
try:
|
||||
scale = self.page.evaluate("() => window.devicePixelRatio")
|
||||
device: Optional[list] = [x * scale, y * scale]
|
||||
except Exception: # noqa: BLE001 a record of the click never stops the click
|
||||
device = None
|
||||
self.last_click = {"point": [x, y], "unit": "CSS pixels of the page, as page.mouse.click sends them", "device": device}
|
||||
self.page.mouse.click(x, y)
|
||||
|
||||
def wait_for_timeout(self, ms: int) -> None:
|
||||
@@ -126,14 +147,20 @@ class RetailChrome:
|
||||
return json.loads(self._session.call("chrome", "WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
|
||||
|
||||
|
||||
#: Moves and presses at a point of the browser's content, from chrome, through the widget: a point of the top document (CSS pixels) plus the content area's own place in the window.
|
||||
#: Moves and presses at a point of the browser's content, from chrome, through the widget: a point of the top document (CSS pixels) plus the content area's own place in the window. Firefox 159's chrome
|
||||
#: input is ``Window.synthesizeMouseEvent`` (offsets in CSS pixels of that window, a dictionary of Mozilla's fields for the event and one for the options); ``nsIDOMWindowUtils`` has no ``sendMouseEvent``
|
||||
#: in 159 (tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py reads the names from Mozilla's sources). ``inputSource: 1`` is a mouse, as a user's.
|
||||
#: ``isAsyncEnabled: true`` is the field of Mozilla's SynthesizeMouseEventOptions that Mozilla's own EventUtils.js sets when a test asks for ``asyncEnabled`` (EventUtils.js, synthesizeMouse, around
|
||||
#: lines 784-851, passes it as ``isAsyncEnabled``). Without it (the webidl default is false) nsContentUtils::SendMouseEvent dispatches through ``widget->DispatchEvent`` and never through APZ
|
||||
#: (nsContentUtils.cpp 10552-10560 at FIREFOX_159_0_RELEASE), the event has no valid layers id, and EventStateManager::DispatchCrossProcessEvent falls back to the TOP process
|
||||
#: (EventStateManager.cpp 2199): a frame in another process never gets the move or the click, and the tooltip and the select of that frame fail on retail for a reason that is the driver's.
|
||||
SEND_JS = """
|
||||
const [type, x, y, button, clicks] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
|
||||
win.focus();
|
||||
win.windowUtils.sendMouseEvent(type, b.left + x, b.top + y, button, clicks, 0, false, 0, 0, true);
|
||||
return JSON.stringify({ok: true});
|
||||
win.synthesizeMouseEvent(type, b.left + x, b.top + y, {button, clickCount: clicks, modifiers: 0, inputSource: 1}, {ignoreRootScrollFrame: false, isDOMEventSynthesized: true, isAsyncEnabled: true});
|
||||
return JSON.stringify({ok: true, at: [b.left + x, b.top + y], dpr: win.devicePixelRatio});
|
||||
"""
|
||||
|
||||
|
||||
@@ -143,6 +170,36 @@ return JSON.stringify({outer: [win.outerWidth, win.outerHeight], inner: [win.inn
|
||||
"""
|
||||
|
||||
|
||||
#: Sets the outer size of the window in DEVICE pixels, from chrome scope: ``WebDriver:SetWindowRect`` takes whole CSS pixels only, and at a display scale of 2 the content area that ours declares
|
||||
#: (``innerHeight`` 558.5 at 2.0) is an odd number of device pixels, which no whole CSS size of the outer window gives. ``resizeTo`` is this call after the conversion of CSS pixels to device pixels
|
||||
#: (nsGlobalWindowOuter::SetOuterSize -> nsIBaseWindow.setSize), so the window is the same one.
|
||||
RESIZE_JS = """
|
||||
const [width, height] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const scale = win.devicePixelRatio;
|
||||
win.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow).setSize(Math.round(width * scale), Math.round(height * scale), true);
|
||||
return JSON.stringify({ok: true});
|
||||
"""
|
||||
|
||||
|
||||
#: Sizes the window so that its content area (``innerWidth`` x ``innerHeight`` of the chrome window, fractional CSS pixels) is the one asked, and reads the window's own frame in DEVICE pixels in the same
|
||||
#: chrome read: frame = ``nsIBaseWindow.getSize`` (the whole window, device pixels) less the content area in device pixels (``inner * devicePixelRatio``, whole device pixels as the widget gives them).
|
||||
#: The window is then set to the asked content area plus that frame, all in device pixels, so an odd number of device pixels (558.5 CSS = 1117 device at a scale of 2) is reachable, which no whole CSS
|
||||
#: ``outerHeight`` is: ``outerWidth`` and ``outerHeight`` are whole CSS pixels (nsGlobalWindowOuter::GetOuterSize rounds, nsGlobalWindowOuter.cpp:3573), ``innerWidth`` and ``innerHeight`` are not.
|
||||
CONTENT_JS = """
|
||||
const [width, height] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const scale = win.devicePixelRatio;
|
||||
const base = win.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
|
||||
const w = {}, h = {};
|
||||
base.getSize(w, h);
|
||||
const frame = [w.value - Math.round(win.innerWidth * scale), h.value - Math.round(win.innerHeight * scale)];
|
||||
const asked = [Math.round(width * scale) + frame[0], Math.round(height * scale) + frame[1]];
|
||||
base.setSize(asked[0], asked[1], true);
|
||||
return JSON.stringify({frame, asked, scale});
|
||||
"""
|
||||
|
||||
|
||||
class RetailSession:
|
||||
"""Retail Firefox 159 with Marionette, headed, one profile; closed with its whole tree."""
|
||||
|
||||
@@ -152,18 +209,20 @@ class RetailSession:
|
||||
self._process: Optional[subprocess.Popen] = None
|
||||
self._profile: Optional[str] = None
|
||||
self._marionette = None
|
||||
self._display: Optional[OwnDisplay] = None
|
||||
|
||||
def __enter__(self) -> "RetailSession":
|
||||
import webfont_probe
|
||||
|
||||
self._profile = tempfile.mkdtemp(prefix="invpw-retail-")
|
||||
prefs = dict(PROFILE_PREFS)
|
||||
prefs["layout.css.devPixelsPerPx"] = str(self.dpr)
|
||||
Path(self._profile, "user.js").write_text(_user_js(prefs), encoding="utf-8")
|
||||
env = dict(os.environ, MOZ_REMOTE_ALLOW_SYSTEM_ACCESS="1", MOZ_CRASHREPORTER_DISABLE="1")
|
||||
self._process = subprocess.Popen([self.executable, "-no-remote", "-profile", self._profile] + MARIONETTE_ARGS + ["about:blank"], env=env,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
try:
|
||||
self._profile = tempfile.mkdtemp(prefix="invpw-retail-")
|
||||
prefs = dict(PROFILE_PREFS)
|
||||
prefs["layout.css.devPixelsPerPx"] = str(self.dpr)
|
||||
Path(self._profile, "user.js").write_text(_user_js(prefs), encoding="utf-8")
|
||||
self._display = OwnDisplay().__enter__()
|
||||
env = self._display.environ(dict(os.environ, MOZ_REMOTE_ALLOW_SYSTEM_ACCESS="1", MOZ_CRASHREPORTER_DISABLE="1"))
|
||||
self._process = subprocess.Popen([self.executable, "-no-remote", "-profile", self._profile] + MARIONETTE_ARGS + ["about:blank"], env=env,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
port = webfont_probe.marionette_active_port(Path(self._profile), timeout=120)
|
||||
self._marionette = webfont_probe._Marionette(port)
|
||||
self._marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
@@ -179,8 +238,14 @@ class RetailSession:
|
||||
return self._marionette.call(command, params)
|
||||
|
||||
def set_window_size(self, outer: Tuple[float, float]) -> Dict[str, Any]:
|
||||
"""Sets the window's outer size to ``outer`` (CSS pixels of the chrome), at the origin of the screen, and reads back the sizes the chrome window answers."""
|
||||
self.call("content", "WebDriver:SetWindowRect", {"x": 0, "y": 0, "width": int(outer[0]), "height": int(outer[1])})
|
||||
"""Sets the window's outer size to ``outer`` (CSS pixels of the chrome) and reads back the sizes the chrome window answers. The first call also puts it at the origin of the screen.
|
||||
|
||||
Whole numbers go through Marionette (``WebDriver:SetWindowRect``, which takes only those); a size with a fraction (a content area of an odd number of device pixels at a scale of 2) is set
|
||||
from chrome scope in device pixels (``RESIZE_JS``)."""
|
||||
if all(float(v).is_integer() for v in outer):
|
||||
self.call("content", "WebDriver:SetWindowRect", {"x": 0, "y": 0, "width": int(outer[0]), "height": int(outer[1])})
|
||||
else:
|
||||
self.call("chrome", "WebDriver:ExecuteScript", {"script": RESIZE_JS, "args": [outer[0], outer[1]]})
|
||||
read = SIZE_JS
|
||||
out: Dict[str, Any] = {}
|
||||
for _ in range(int(DEADLINE_S * 10)):
|
||||
@@ -190,6 +255,22 @@ class RetailSession:
|
||||
time.sleep(0.1)
|
||||
return out
|
||||
|
||||
def set_inner_size(self, inner: Tuple[float, float]) -> Dict[str, Any]:
|
||||
"""Sets the window so that its content area is ``inner`` (CSS pixels of the chrome, fractions allowed) and reads back what the chrome window answers. The window is put at the origin of the screen.
|
||||
|
||||
The frame is read in device pixels through the chrome (``CONTENT_JS``) and the window is set to ``inner`` plus that frame in device pixels. The answer has ``outer`` and ``inner`` (CSS pixels, as
|
||||
the window reads them: ``outer`` is whole), ``frame_device`` and ``asked_outer`` (device pixels, and the same in CSS pixels, the last fractional)."""
|
||||
self.call("content", "WebDriver:SetWindowRect", {"x": 0, "y": 0})
|
||||
asked = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": CONTENT_JS, "args": [inner[0], inner[1]]})["value"])
|
||||
out: Dict[str, Any] = {}
|
||||
for _ in range(int(DEADLINE_S * 10)):
|
||||
out = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": SIZE_JS, "args": []})["value"])
|
||||
if out["inner"] == [inner[0], inner[1]]:
|
||||
break
|
||||
time.sleep(0.1)
|
||||
out.update({"frame_device": asked["frame"], "asked_outer_device": asked["asked"], "asked_outer": [asked["asked"][i] / asked["scale"] for i in range(2)]})
|
||||
return out
|
||||
|
||||
def __exit__(self, *exc) -> None:
|
||||
if self._marionette is not None:
|
||||
self._marionette.close()
|
||||
@@ -210,11 +291,16 @@ class RetailSession:
|
||||
self._process.wait(30)
|
||||
except Exception:
|
||||
pass
|
||||
if self._display is not None:
|
||||
self._display.__exit__(None, None, None)
|
||||
self._display = None
|
||||
if self._profile is not None:
|
||||
shutil.rmtree(self._profile, ignore_errors=True)
|
||||
|
||||
|
||||
class RetailDriver(Driver):
|
||||
kind = "retail"
|
||||
|
||||
def __init__(self, session: RetailSession) -> None:
|
||||
self.session = session
|
||||
self.chrome = RetailChrome(session)
|
||||
@@ -227,8 +313,18 @@ class RetailDriver(Driver):
|
||||
value = self.session.call("content", "WebDriver:ExecuteScript", {"script": "return JSON.stringify(%s);" % expression, "args": []})["value"]
|
||||
return json.loads(value) if value is not None else None
|
||||
|
||||
def _send(self, kind: str, x: float, y: float, button: int = 0, clicks: int = 0) -> None:
|
||||
self.chrome.script(SEND_JS, (kind, x, y, button, clicks))
|
||||
def eval_in_frame(self, expression: str) -> Any:
|
||||
"""Through Marionette: the first frame element becomes the context of the script, and the top document is the context again when the read ends."""
|
||||
found = self.session.call("content", "WebDriver:FindElement", {"using": "css selector", "value": "iframe"})["value"]
|
||||
self.session.call("content", "WebDriver:SwitchToFrame", {"id": found})
|
||||
try:
|
||||
value = self.session.call("content", "WebDriver:ExecuteScript", {"script": "return JSON.stringify(%s);" % expression, "args": []})["value"]
|
||||
finally:
|
||||
self.session.call("content", "WebDriver:SwitchToParentFrame", {})
|
||||
return json.loads(value) if value is not None else None
|
||||
|
||||
def _send(self, kind: str, x: float, y: float, button: int = 0, clicks: int = 0) -> Dict[str, Any]:
|
||||
return self.chrome.script(SEND_JS, (kind, x, y, button, clicks))
|
||||
|
||||
def move(self, x: float, y: float, steps: int = 1) -> None:
|
||||
# the pointer comes to the point in ``steps`` moves from the last one it made (a move to the point it is on makes no event, as on every browser)
|
||||
@@ -239,32 +335,50 @@ class RetailDriver(Driver):
|
||||
|
||||
def click(self, x: float, y: float) -> None:
|
||||
self.move(x, y)
|
||||
self._send("mousedown", x, y, 0, 1)
|
||||
down = self._send("mousedown", x, y, 0, 1)
|
||||
self._send("mouseup", x, y, 0, 1)
|
||||
# the point goes to the window's widget in CSS pixels of the chrome (the content area's place added); the device point is that times the chrome's scale
|
||||
at, scale = down.get("at"), down.get("dpr")
|
||||
self.last_click = {"point": at, "unit": "CSS pixels of the chrome window, as Window.synthesizeMouseEvent takes them",
|
||||
"device": [at[0] * scale, at[1] * scale] if at and scale else None}
|
||||
|
||||
def wait_for_timeout(self, ms: int) -> None:
|
||||
time.sleep(ms / 1000.0)
|
||||
|
||||
|
||||
def size_by_content(session: Any, ours_inner: Any) -> Tuple[list, Dict[str, Any]]:
|
||||
"""``(asked, got)``: the retail window sized so that its content area (``inner``) is the one of ours, whatever its frame is.
|
||||
|
||||
Ours declares a frame of its own (the one of a Windows window), and the retail window has the one of its system and display (none on Xvfb without a window manager, 8x4 CSS pixels at a scale of 2 on
|
||||
a Windows runner), so the same OUTER size is not the same content area. The frame is read in exact device pixels through the chrome (``RetailSession.set_inner_size``) and the window is asked
|
||||
ours' inner size plus that frame. ``asked`` is the outer size asked (CSS pixels, fractional when the device pixels are odd at the scale), ``got`` what the window answers to it. The outer size the
|
||||
window reads back is not compared with ``asked``: ``outerWidth`` and ``outerHeight`` are whole CSS pixels (nsGlobalWindowOuter::GetOuterSize rounds, nsGlobalWindowOuter.cpp:3573), ``innerWidth``
|
||||
and ``innerHeight`` are fractional, so a content area of an odd number of device pixels at a scale of 2 has no outer size that reads back as asked."""
|
||||
got = session.set_inner_size((ours_inner[0], ours_inner[1]))
|
||||
return list(got["asked_outer"]), got
|
||||
|
||||
|
||||
def run_retail_twin(case: str, firefox_binary: str, measure: Callable[[Driver], Dict[str, Any]]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
||||
"""(retail's record, ours): the same ``measure(driver)`` on our engine and on the retail reference, one browser at a time. Needs MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 for ours.
|
||||
|
||||
Ours goes first, for its window: the retail window is given the SAME outer size as ours (the maximized window of the case's declared screen, as ``launch_case`` makes it, read from the
|
||||
chrome window's ``outerWidth`` and ``outerHeight``), and the inner sizes both chrome windows answer are compared before anything is measured: when they differ the verdict is BROKEN CONTROL,
|
||||
not a finding about ours. Both sizes are in each record (``scales.chrome_outer``, ``scales.chrome_inner``), with the size the retail window was asked (``scales.window_asked_outer``)."""
|
||||
Ours goes first, for its window: the retail window is given the SAME content area as ours (the maximized window of the case's declared screen, as ``launch_case`` makes it, read from the chrome
|
||||
window's ``innerWidth`` and ``innerHeight``) by ``size_by_content``: ours' inner size plus the frame the retail window shows, read in device pixels. The inner sizes both chrome windows answer are
|
||||
compared before anything is measured: when they differ the verdict is BROKEN CONTROL, not a finding about ours. The outer size the retail window reads back is not a condition (it is whole CSS
|
||||
pixels). Both sizes are in each record (``scales.chrome_outer``, ``scales.chrome_inner``), with the outer size the retail window was asked (``scales.window_asked_outer``)."""
|
||||
executable = retail_executable()
|
||||
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
chrome = Chrome()
|
||||
page = browser.new_page() # first: the window the session below waits for
|
||||
chrome = Chrome(page)
|
||||
try:
|
||||
ours = measure(PlaywrightDriver(browser.new_page(), chrome))
|
||||
ours = measure(PlaywrightDriver(page, chrome))
|
||||
finally:
|
||||
chrome.close()
|
||||
asked = ours["scales"]["chrome_outer"]
|
||||
with RetailSession(executable, CASES[case][0]) as session:
|
||||
got = session.set_window_size((asked[0], asked[1]))
|
||||
if got.get("outer") != asked or got.get("inner") != ours["scales"]["chrome_inner"]:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the retail window was asked the outer size of ours %r and answers outer %r and inner %r; ours has inner %r (case %s)"
|
||||
% (asked, got.get("outer"), got.get("inner"), ours["scales"]["chrome_inner"], case))
|
||||
asked, got = size_by_content(session, ours["scales"]["chrome_inner"])
|
||||
if got.get("inner") != ours["scales"]["chrome_inner"]:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the retail window was asked the outer size %r (the content area of ours %r plus its own frame; the outer size of ours is %r) and answers outer %r and inner %r; "
|
||||
"ours has inner %r (case %s)"
|
||||
% (asked, ours["scales"]["chrome_inner"], ours["scales"]["chrome_outer"], got.get("outer"), got.get("inner"), ours["scales"]["chrome_inner"], case))
|
||||
retail = measure(RetailDriver(session))
|
||||
retail["scales"]["window_asked_outer"] = asked
|
||||
return retail, ours
|
||||
@@ -0,0 +1,111 @@
|
||||
"""The stack watchdog of the e2e tests: a Python thread that writes the stack of every thread of the process, holding the GIL.
|
||||
|
||||
``tests/conftest.py`` arms it for each e2e test and cancels it in the teardown. Once the threshold of a test is passed, and then every period until the
|
||||
test ends, it appends one dump to the file it was given: ``Timeout (h:mm:ss)!`` (the time since the arming) and then, for every thread, ``Thread 0x... (most
|
||||
recent call first):`` and its frames as `` File "...", line N in name``. Two identical dumps mean a stuck test, two different ones a slow test.
|
||||
|
||||
Why a Python thread and not ``faulthandler.dump_traceback_later``: that watchdog is a C thread, and it copies the frames of every thread WITHOUT the GIL
|
||||
(``_Py_DumpTracebackThreads``, which CPython documents as "for debug purpose only ... after a segmentation fault, at fatal error") while the other threads
|
||||
keep running and keep changing their frames. On Windows two full dumps of a pytest worker show it dead inside ``dump_frame`` of ``faulthandler_thread``,
|
||||
reading a frame another thread was freeing. This thread takes ``sys._current_frames()`` with the GIL held, so a frame it reads cannot change under it.
|
||||
|
||||
One thread per process, started by the first ``arm`` and reused by every later test. It writes nothing to stdout or stderr. After ``cancel`` returns, nothing
|
||||
more is written for that test: the dump is written under the lock that ``cancel`` takes.
|
||||
|
||||
Known limit: a thread that holds the GIL and never releases it (a C call that does not let go) keeps this thread from running, so it cannot write. That case
|
||||
is pytest's ``faulthandler.enable()``, which writes only when the process dies. The 420 s limit of the run (``--timeout-method thread``) still names the test.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
def _clock(seconds: float) -> str:
|
||||
whole = int(seconds)
|
||||
return "%d:%02d:%02d" % (whole // 3600, whole % 3600 // 60, whole % 60)
|
||||
|
||||
|
||||
class StackWatchdog:
|
||||
def __init__(self) -> None:
|
||||
self._cond = threading.Condition()
|
||||
self._thread: threading.Thread | None = None
|
||||
self._armed = False
|
||||
self._file = None
|
||||
self._started = 0.0
|
||||
self._period = 0.0
|
||||
self._due = 0.0
|
||||
|
||||
@property
|
||||
def thread(self) -> threading.Thread | None:
|
||||
"""The one thread of the process (None until the first ``arm``)."""
|
||||
return self._thread
|
||||
|
||||
def arm(self, nodeid: str, threshold_s: float, period_s: float | None = None, file=None) -> None:
|
||||
"""From ``threshold_s`` seconds on, and then every ``period_s`` (the threshold by default), write the stacks of all threads to ``file`` until ``cancel``."""
|
||||
period = threshold_s if period_s is None else period_s
|
||||
with self._cond:
|
||||
self._file = file
|
||||
self._started = time.monotonic()
|
||||
self._period = max(period, 0.0005)
|
||||
self._due = self._started + threshold_s
|
||||
self._armed = True
|
||||
try:
|
||||
file.write("\n--- %s ---\n" % nodeid)
|
||||
file.flush()
|
||||
except Exception:
|
||||
pass
|
||||
if self._thread is None or not self._thread.is_alive():
|
||||
self._thread = threading.Thread(target=self._run, name="invpw-stack-watchdog", daemon=True)
|
||||
self._thread.start()
|
||||
self._cond.notify_all()
|
||||
|
||||
def cancel(self) -> None:
|
||||
"""Nothing more is written for the armed test once this returns: a dump in progress finishes first, because it is written under the same lock."""
|
||||
with self._cond:
|
||||
self._armed = False
|
||||
self._file = None
|
||||
self._cond.notify_all()
|
||||
|
||||
def _run(self) -> None:
|
||||
with self._cond:
|
||||
while True:
|
||||
if not self._armed:
|
||||
self._cond.wait()
|
||||
continue
|
||||
left = self._due - time.monotonic()
|
||||
if left > 0:
|
||||
# Waiting lets go of the lock, so that a cancel or a new arm is never kept out by a watchdog with a short period.
|
||||
self._cond.wait(left)
|
||||
continue
|
||||
self._write_one_dump()
|
||||
self._due = time.monotonic() + self._period
|
||||
|
||||
def _write_one_dump(self) -> None:
|
||||
mine = threading.get_ident()
|
||||
names = {t.ident: t.name for t in threading.enumerate()}
|
||||
out = ["Timeout (%s)!\n" % _clock(time.monotonic() - self._started)]
|
||||
for ident, frame in sys._current_frames().items():
|
||||
if ident == mine:
|
||||
continue
|
||||
name = names.get(ident)
|
||||
out.append("\nThread 0x%016x%s (most recent call first):\n" % (ident, " [%s]" % name if name else ""))
|
||||
while frame is not None:
|
||||
out.append(' File "%s", line %d in %s\n' % (frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name))
|
||||
frame = frame.f_back
|
||||
try:
|
||||
self._file.write("".join(out))
|
||||
self._file.flush()
|
||||
except Exception:
|
||||
# A watchdog that fails the suite over its OWN problem is worse than the defect it is watching for.
|
||||
pass
|
||||
|
||||
|
||||
_the_watchdog = StackWatchdog()
|
||||
arm = _the_watchdog.arm
|
||||
cancel = _the_watchdog.cancel
|
||||
|
||||
|
||||
def the_thread() -> threading.Thread | None:
|
||||
return _the_watchdog.thread
|
||||
+119
-13
@@ -9,7 +9,7 @@ HOW STOCK RUNS. The mechanism is the one of the fake web (``scripts/run_fakeweb.
|
||||
archives, checked against ``ci/py-lock/playwright-browsers.json``. Stock goes FIRST and is closed before ours starts (ci-release-18: one browser at a time). The stock
|
||||
part runs in a thread of its own (a sync client keeps its loop marked as running in its thread, and ours is a sync client too).
|
||||
|
||||
THE SAME WINDOW. Stock is launched HEADED (``headless=False``: a real window on the display of the job, Xvfb on Linux and the desktop on Windows), as ours is (``launch_case``: the wrapper gives the engine a display of its own, so its windows are real ones; Firefox's ``-headless`` mode is on neither, because popups, drag and drop and window geometry behave differently in it), with the display scale of the case as ``layout.css.devPixelsPerPx`` (the pref ours is launched with for the same case: the scale
|
||||
THE SAME WINDOW. Stock is launched HEADED (``headless=False``: a real window, on a display of its own that ``OwnDisplay`` makes the way the wrapper makes ours: ``invisible_core.make_virtual_display()``, an Xvfb of 1920x1080x24 on Linux; on Windows the desktop of the job, a stock client cannot be put on another desktop), as ours is (``launch_case``: the wrapper gives the engine a display of its own, so its windows are real ones; Firefox's ``-headless`` mode is on neither, because popups, drag and drop and window geometry behave differently in it), with the display scale of the case as ``layout.css.devPixelsPerPx`` (the pref ours is launched with for the same case: the scale
|
||||
is then the one of the page AND of the browser chrome) and a context viewport of the inner size retail reads at that case (``RETAIL_CASES``: the maximized window's
|
||||
``innerWidth`` x ``innerHeight``). Ours is the maximized window of the same case (``_window_origin.launch_case``).
|
||||
|
||||
@@ -20,12 +20,18 @@ prints both records whole. A stock browser that cannot be driven (no Marionette,
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import fnmatch
|
||||
import importlib
|
||||
import json
|
||||
from typing import Any, Callable, Dict, List, Tuple
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple
|
||||
|
||||
from invisible_core import make_virtual_display
|
||||
|
||||
from _popup_geometry import in_a_thread_of_its_own
|
||||
from _window_origin import CASES, launch_case
|
||||
from _window_origin import launch_case, scale_pref
|
||||
from test_the_maximized_window_frames_and_popups_read_retail_e2e import CASES as RETAIL_CASES
|
||||
|
||||
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
|
||||
@@ -45,16 +51,61 @@ return JSON.stringify({
|
||||
PAGE_SCALES = """() => ({devicePixelRatio: window.devicePixelRatio, inner: [innerWidth, innerHeight], screen: [screen.width, screen.height]})"""
|
||||
|
||||
|
||||
def on_linux() -> bool:
|
||||
return sys.platform.startswith("linux")
|
||||
|
||||
|
||||
class OwnDisplay:
|
||||
"""The display a browser that is not ours is launched on: the wrapper's own mechanism (``make_virtual_display``, what ``InvisiblePlaywright`` starts for ours), never the job's.
|
||||
|
||||
On Linux a fresh Xvfb (the core's: 1920x1080x24, access control on, its cookie in ``XAUTHORITY``), one per launch, started before the browser and stopped after it; the browser's environment
|
||||
gets ``DISPLAY`` and ``XAUTHORITY`` from it and loses the Wayland variables, so a job that runs pytest without ``xvfb-run`` (the rows of the stock twins) still has a screen. On Windows there is
|
||||
nothing to make: a stock client cannot spawn its browser on another desktop, so it is on the one of the job, and ``environ`` is the environment as it is."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._display: Any = None
|
||||
|
||||
def __enter__(self) -> "OwnDisplay":
|
||||
if on_linux():
|
||||
display = make_virtual_display()
|
||||
display.start()
|
||||
self._display = display
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc: Any) -> None:
|
||||
display, self._display = self._display, None
|
||||
if display is not None:
|
||||
display.stop()
|
||||
|
||||
def environ(self, base: Optional[Mapping[str, str]] = None) -> Dict[str, str]:
|
||||
"""``base`` (the process's environment by default) as the browser is launched with it: what the display names set, what it names ``None`` removed."""
|
||||
env = dict(os.environ if base is None else base)
|
||||
for name, value in (self._display.launch_env() if self._display is not None else {}).items():
|
||||
if value is None:
|
||||
env.pop(name, None)
|
||||
else:
|
||||
env[name] = value
|
||||
return env
|
||||
|
||||
|
||||
class BrokenControl(AssertionError):
|
||||
"""Stock Firefox could not be driven through the steps: not a finding about ours."""
|
||||
|
||||
|
||||
class Chrome:
|
||||
"""Chrome scope of the browser below this process, through Marionette (the route of ``test_software_compositing_is_declared_e2e.py``)."""
|
||||
"""Chrome scope of the browser below this process, through Marionette (the route of ``test_software_compositing_is_declared_e2e.py``).
|
||||
|
||||
def __init__(self) -> None:
|
||||
``page`` is the page the browser of this launch already opened, and it is required on purpose: ``WebDriver:NewSession`` waits for the end of the browser's start-up, which only a window
|
||||
ends, and the wrapper launches with ``-silent`` (no window at start-up). A session asked before the first page never gets its answer (the socket times out after 300 s). With the page
|
||||
as an argument the wrong order cannot be written."""
|
||||
|
||||
def __init__(self, page) -> None:
|
||||
if page is None:
|
||||
raise TypeError("Chrome needs the page this launch opened first: Marionette's NewSession is answered only once a window exists")
|
||||
import webfont_probe
|
||||
|
||||
self._page = page
|
||||
|
||||
self._m = webfont_probe._Marionette(webfont_probe.marionette_active_port())
|
||||
self._m.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
self._m.call("Marionette:SetContext", {"value": "chrome"})
|
||||
@@ -62,9 +113,9 @@ class Chrome:
|
||||
def script(self, script: str, args: Tuple[Any, ...] = ()) -> Dict[str, Any]:
|
||||
return json.loads(self._m.call("WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
|
||||
|
||||
def scales(self, page) -> Dict[str, Any]:
|
||||
def scales(self) -> Dict[str, Any]:
|
||||
"""The record of the scales: the page's (declared) and the chrome's, with the real ones of the screen."""
|
||||
out = {"page": page.evaluate(PAGE_SCALES)}
|
||||
out = {"page": self._page.evaluate(PAGE_SCALES)}
|
||||
out.update(self.script(SCALES_JS))
|
||||
return out
|
||||
|
||||
@@ -86,16 +137,23 @@ def viewport(case: str) -> Dict[str, int]:
|
||||
return {"width": int(maximized["iw"]), "height": int(maximized["ih"])}
|
||||
|
||||
|
||||
def stock_user_prefs(case: str) -> Dict[str, Any]:
|
||||
"""The user prefs stock Playwright's Firefox is launched with for ``case``: the display scale as the STRING ours is launched with (``scale_pref``), and a free Marionette port.
|
||||
|
||||
A number would be set with ``setIntPref`` by the Juggler of Playwright's build, and ``layout.css.devPixelsPerPx`` is a string pref: ``Browser.enable`` fails and no case launches."""
|
||||
return {"layout.css.devPixelsPerPx": scale_pref(case), "marionette.port": 0}
|
||||
|
||||
|
||||
def _on_stock(case: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Dict[str, Any]:
|
||||
def run() -> Dict[str, Any]:
|
||||
sync_playwright = stock_client()
|
||||
with sync_playwright() as p:
|
||||
browser = p.firefox.launch(headless=False, args=MARIONETTE_ARGS,
|
||||
firefox_user_prefs={"layout.css.devPixelsPerPx": CASES[case][0], "marionette.port": 0})
|
||||
with sync_playwright() as p, OwnDisplay() as display:
|
||||
browser = p.firefox.launch(headless=False, args=MARIONETTE_ARGS, env=display.environ(),
|
||||
firefox_user_prefs=stock_user_prefs(case))
|
||||
chrome = None
|
||||
try:
|
||||
page = browser.new_context(viewport=viewport(case)).new_page()
|
||||
chrome = Chrome()
|
||||
chrome = Chrome(page)
|
||||
return measure(page, chrome)
|
||||
finally:
|
||||
if chrome is not None:
|
||||
@@ -113,9 +171,10 @@ def _on_stock(case: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Di
|
||||
|
||||
def _on_ours(case: str, firefox_binary: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Dict[str, Any]:
|
||||
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
chrome = Chrome()
|
||||
page = browser.new_page() # first: the window the session below waits for
|
||||
chrome = Chrome(page)
|
||||
try:
|
||||
return measure(browser.new_page(), chrome)
|
||||
return measure(page, chrome)
|
||||
finally:
|
||||
chrome.close()
|
||||
|
||||
@@ -153,3 +212,50 @@ def differences(stock: Any, ours: Any, tolerances: Dict[str, float] = None, path
|
||||
elif stock != ours:
|
||||
out.append("%s: stock %r, ours %r" % (path, stock, ours))
|
||||
return out
|
||||
|
||||
|
||||
#: The two reasons a field of a stock twin's record can be left out of the comparison with stock (the retail capture of the case decides it instead).
|
||||
IN_PROCESS_FRAME = "in-process frame in stock"
|
||||
SYNTHETIC_DRAG = "synthetic drag in stock"
|
||||
REASONS = {
|
||||
IN_PROCESS_FRAME: "stock Playwright's Firefox sets fission.webContentIsolationStrategy=0, so its cross-site frame shares the top's process and ours is in another process: a field that depends on "
|
||||
"the frame being in another process is not what stock reads",
|
||||
SYNTHETIC_DRAG: "stock's drag is Juggler's synthetic one: no OLE drag loop, so no timer-driven drag event and no buttons held, and nothing a real drag has beyond the events themselves",
|
||||
}
|
||||
|
||||
|
||||
def canonical(path: str, root: str) -> str:
|
||||
"""``path`` of a difference less its root, with every list index as ``[]``: ``drag drop.top.once[3].buttons`` is ``top.once[].buttons`` for the root ``drag drop``."""
|
||||
rest = path[len(root):].lstrip(".") if path.startswith(root) else path
|
||||
return re.sub(r"\[\d+\]", "[]", rest)
|
||||
|
||||
|
||||
def leaf_paths(node: Any, prefix: str = "") -> List[str]:
|
||||
"""The canonical path of every leaf of a record (what a declared field has to name to exist in it)."""
|
||||
if isinstance(node, dict):
|
||||
return [p for k, v in node.items() for p in leaf_paths(v, "%s.%s" % (prefix, k) if prefix else str(k))] or [prefix]
|
||||
if isinstance(node, list):
|
||||
return [p for v in node for p in leaf_paths(v, prefix + "[]")] or [prefix + "[]"]
|
||||
return [prefix]
|
||||
|
||||
|
||||
def stale_entries(declared: Mapping[str, str], *records: Any) -> List[str]:
|
||||
"""The declared fields (a pattern of canonical paths, ``*`` for any run of characters) that name nothing in any of ``records``, and the reasons that are not one of ``REASONS``."""
|
||||
paths = [p for record in records for p in leaf_paths(record)]
|
||||
out = ["%s names no field of the record" % field for field in declared if not any(fnmatch.fnmatchcase(p, field) for p in paths)]
|
||||
return out + ["%s has the reason %r, which is not one of %s" % (field, why, sorted(REASONS)) for field, why in declared.items() if why not in REASONS]
|
||||
|
||||
|
||||
def split_differences(stock: Any, ours: Any, declared: Mapping[str, str], tolerances: Dict[str, float] = None, path: str = "") -> Tuple[List[str], List[str]]:
|
||||
"""``(red, recorded)``: the differences of ``differences`` split by the declared list of the twin. A difference at a declared field is recorded (with its reason, for the report) and does not
|
||||
decide the verdict; every other one is red. ``declared`` maps a pattern of canonical paths (``canonical``) to one of ``REASONS``."""
|
||||
red: List[str] = []
|
||||
recorded: List[str] = []
|
||||
for difference in differences(stock, ours, tolerances, path):
|
||||
where = canonical(difference.split(": ", 1)[0], path)
|
||||
why = next((reason for field, reason in declared.items() if fnmatch.fnmatchcase(where, field)), None)
|
||||
if why is None:
|
||||
red.append(difference)
|
||||
else:
|
||||
recorded.append("%s [recorded, not compared: %s]" % (difference, why))
|
||||
return red, recorded
|
||||
@@ -1,7 +1,7 @@
|
||||
"""The strace stand-in of the Linux font tests: the engine's directory as links, whose executable runs the real one under ``strace`` in the
|
||||
engine's place (same pid, same process group), and what reads its log (who is the parent and who a content process) and cleans its group.
|
||||
|
||||
Used by tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py. No test of its own, no browser."""
|
||||
Used by tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py and tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py. No test of its own, no browser."""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""Where the e2e stack watchdog (``tests/_stack_watchdog.py``, armed by ``tests/conftest.py``) writes its stacks."""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Mapping
|
||||
|
||||
#: The folder under ``$RUNNER_TEMP`` that every e2e job uploads whatever the result ("Keep what the tests saved", ``invpw-evidence-*``).
|
||||
EVIDENCE_FOLDER = "invpw-evidence"
|
||||
LOG_NAME = "e2e-watchdog.log"
|
||||
|
||||
|
||||
def default_log_path(environ: Mapping[str, str], tempdir: str) -> str:
|
||||
"""The file the stacks go to.
|
||||
|
||||
``INVPW_TEST_WATCHDOG_FILE`` when it is set (the workflows of the wrapper name their own file). On a runner (``RUNNER_TEMP`` set) the evidence folder, which the gate uploads with
|
||||
the result of the leg, so that the stack of a hung test is in the artifact of the run that hung. Elsewhere ``invpw-e2e-watchdog.log`` in the temporary folder."""
|
||||
named = environ.get("INVPW_TEST_WATCHDOG_FILE")
|
||||
if named:
|
||||
return named
|
||||
runner = environ.get("RUNNER_TEMP")
|
||||
if runner:
|
||||
return os.path.join(runner, EVIDENCE_FOLDER, "watchdog", LOG_NAME)
|
||||
return os.path.join(tempdir, "invpw-e2e-watchdog.log")
|
||||
@@ -0,0 +1,56 @@
|
||||
"""Every pytest process of a Windows job that keeps WER dumps lets Windows Error Reporting see its crash: the bit SEM_NOGPFAULTERRORBOX of its error mode is cleared.
|
||||
|
||||
A process whose error mode carries SEM_NOGPFAULTERRORBOX (0x0002) never invokes Windows Error Reporting when it dies from an unhandled exception, so the
|
||||
LocalDumps key of python.exe that e2e.yml sets (a full dump into ``$RUNNER_TEMP/invpw-evidence/dumps/python``) is never read: the pytest controllers of the
|
||||
runner are born with 0x0003 (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX), and every child inherits the mode of its parent, so every xdist worker is born
|
||||
with it too and a worker that crashes leaves no dump.
|
||||
https://learn.microsoft.com/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode
|
||||
|
||||
``clear_for_wer_dumps()``: tests/conftest.py calls it in ``pytest_configure``, which the controller and every xdist worker run. It acts only when ALL of this
|
||||
holds, so nothing changes on a developer's machine, on Linux, or in a job that did not set LocalDumps:
|
||||
|
||||
* the system is Windows;
|
||||
* ``$INVPW_WER_DUMPS`` (the one variable the "Windows Error Reporting keeps a full dump..." step of each Windows job of e2e.yml exports to ``$GITHUB_ENV``) names an
|
||||
existing folder: the folder the dumps go to.
|
||||
|
||||
It clears bit 0x0002 and keeps every other bit of the mode, and appends one line to ``error-mode.log`` in the parent of that folder (``invpw-evidence/dumps``, inside the evidence the job
|
||||
uploads): ``pid <n> error mode born 0x<hex>, now 0x<hex>``, so the evidence shows the bit was cleared in every process. It writes nothing to stdout or stderr, and it
|
||||
never raises: a failure is a line of that log, not a failed test.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
#: The variable the Windows jobs export: the folder LocalDumps of python.exe writes to.
|
||||
ENV_VAR = "INVPW_WER_DUMPS"
|
||||
LOG_NAME = "error-mode.log"
|
||||
#: SEM_NOGPFAULTERRORBOX: the process is not reported to Windows Error Reporting.
|
||||
SEM_NOGPFAULTERRORBOX = 0x0002
|
||||
|
||||
|
||||
def clear_for_wer_dumps(environ=None) -> None:
|
||||
environ = os.environ if environ is None else environ
|
||||
if sys.platform != "win32":
|
||||
return
|
||||
folder = environ.get(ENV_VAR)
|
||||
if not folder or not os.path.isdir(folder):
|
||||
return
|
||||
log = Path(folder).resolve().parent / LOG_NAME
|
||||
try:
|
||||
import ctypes
|
||||
kernel32 = ctypes.WinDLL("kernel32")
|
||||
kernel32.GetErrorMode.restype = ctypes.c_uint
|
||||
kernel32.SetErrorMode.argtypes = [ctypes.c_uint]
|
||||
kernel32.SetErrorMode.restype = ctypes.c_uint
|
||||
born = kernel32.GetErrorMode()
|
||||
kernel32.SetErrorMode(born & ~SEM_NOGPFAULTERRORBOX)
|
||||
line = "pid %d error mode born 0x%04x, now 0x%04x\n" % (os.getpid(), born, kernel32.GetErrorMode())
|
||||
except Exception as exc: # best effort: the evidence says what went wrong, the test run goes on
|
||||
line = "pid %d error mode not cleared: %s: %s\n" % (os.getpid(), type(exc).__name__, exc)
|
||||
try:
|
||||
with open(log, "a", encoding="utf-8") as handle:
|
||||
handle.write(line)
|
||||
except OSError:
|
||||
pass
|
||||
@@ -26,6 +26,14 @@ CASES: Dict[str, Tuple[float, Tuple[int, int]]] = {
|
||||
}
|
||||
|
||||
|
||||
def scale_pref(case: str) -> str:
|
||||
"""``layout.css.devPixelsPerPx`` of a case, as the core declares it for ours (``str(profile.screen.dpr)``: "1.0", "1.25", "1.5", "2.0").
|
||||
|
||||
The pref is a STRING pref of Firefox. A client that sends a number (stock Playwright puts a number through ``Browser.enable`` as ``setIntPref``) makes the browser refuse
|
||||
the launch with NS_ERROR_UNEXPECTED, so every browser that is not ours gets the scale in this form, from here."""
|
||||
return str(CASES[case][0])
|
||||
|
||||
|
||||
def launch_case(firefox_binary: str, case: str, **extra: Any):
|
||||
"""The product on one case: seed 42, the panel and the scale pinned, headless, no humanizing. ``extra`` is for the keywords a test needs on top
|
||||
(``extra_args``, ``extra_prefs``)."""
|
||||
|
||||
+26
-8
@@ -1,4 +1,3 @@
|
||||
import faulthandler
|
||||
import http.server
|
||||
import os
|
||||
import random
|
||||
@@ -10,6 +9,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
import _stack_watchdog
|
||||
import _watchdog_log
|
||||
from _servers import LocalServer
|
||||
from _browser_census import _a_module_leaves_no_browser_open, _the_connections_a_test_made_are_closed_with_it # noqa: F401 (autouse)
|
||||
|
||||
@@ -42,9 +43,7 @@ from _browser_census import _a_module_leaves_no_browser_open, _the_connections_a
|
||||
# under pytest. A file survives the kill and gets uploaded as an artifact on
|
||||
# CI.
|
||||
_WATCHDOG_S = float(os.environ.get("INVPW_TEST_WATCHDOG_S", "150"))
|
||||
_WATCHDOG_FILE = os.environ.get(
|
||||
"INVPW_TEST_WATCHDOG_FILE",
|
||||
str(Path(tempfile.gettempdir()) / "invpw-e2e-watchdog.log"))
|
||||
_WATCHDOG_FILE = _watchdog_log.default_log_path(os.environ, tempfile.gettempdir())
|
||||
_watchdog_handle = None
|
||||
|
||||
|
||||
@@ -60,6 +59,7 @@ def _watchdog_open():
|
||||
if _watchdog_handle is not None or _WATCHDOG_S <= 0:
|
||||
return _watchdog_handle
|
||||
try:
|
||||
os.makedirs(os.path.dirname(_WATCHDOG_FILE) or ".", exist_ok=True)
|
||||
_watchdog_handle = open(_WATCHDOG_FILE, "a", buffering=1, encoding="utf-8")
|
||||
except OSError:
|
||||
# A watchdog that fails the suite over its OWN problem is worse than
|
||||
@@ -71,6 +71,10 @@ def _watchdog_open():
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
# Windows jobs that keep WER dumps (INVPW_WER_DUMPS, exported by the job): the controller and every xdist worker clear SEM_NOGPFAULTERRORBOX of their error mode,
|
||||
# which the runner gives them (0x0003) and which keeps a crashing worker from ever reaching Windows Error Reporting (tests/_wer_error_mode.py).
|
||||
import _wer_error_mode
|
||||
_wer_error_mode.clear_for_wer_dumps()
|
||||
# TEMPORARY, with tests/_crash_cores.py (the -11 at the exit of the security state's generate): on Linux every engine of the run, the core's launches
|
||||
# included, inherits a core limit equal to the hard one, so a crash leaves a core in $INVPW_CORE_DIR (kernel.core_pattern on the e2e jobs).
|
||||
import _crash_cores
|
||||
@@ -91,13 +95,13 @@ def pytest_runtest_setup(item):
|
||||
return
|
||||
handle = _watchdog_open()
|
||||
if handle is not None:
|
||||
handle.write("\n--- %s ---\n" % item.nodeid)
|
||||
faulthandler.dump_traceback_later(_WATCHDOG_S, repeat=True, file=handle)
|
||||
# A Python thread that holds the GIL, not faulthandler.dump_traceback_later: that one copies the frames of every thread without the GIL and crashed a worker (tests/_stack_watchdog.py).
|
||||
_stack_watchdog.arm(item.nodeid, _WATCHDOG_S, file=handle)
|
||||
|
||||
|
||||
def pytest_runtest_teardown(item, nextitem):
|
||||
if _watchdog_handle is not None:
|
||||
faulthandler.cancel_dump_traceback_later()
|
||||
_stack_watchdog.cancel()
|
||||
|
||||
|
||||
@pytest.hookimpl(wrapper=True)
|
||||
@@ -125,7 +129,7 @@ def pytest_collection_modifyitems(config, items):
|
||||
def pytest_unconfigure(config):
|
||||
global _watchdog_handle
|
||||
if _watchdog_handle is not None:
|
||||
faulthandler.cancel_dump_traceback_later()
|
||||
_stack_watchdog.cancel()
|
||||
_watchdog_handle.close()
|
||||
_watchdog_handle = None
|
||||
|
||||
@@ -270,6 +274,20 @@ def _no_test_asks_the_world_where_it_leaves_from():
|
||||
pytest.fail("the question of the exit went toward the internet: " + "; ".join(asked), pytrace=False)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _the_browser_log_holds_no_line_that_fails_the_test(request, monkeypatch):
|
||||
"""An e2e test fails when a browser it launched wrote a line that fails it (``tests/_browser_log.py``: the engine's expired wait for ``popupshown`` among them), and the failure names the line."""
|
||||
if request.node.get_closest_marker("e2e") is None:
|
||||
yield
|
||||
return
|
||||
import _browser_log
|
||||
|
||||
sink = _browser_log.Sink()
|
||||
_browser_log.install(monkeypatch, sink)
|
||||
yield
|
||||
sink.fail_if_any()
|
||||
|
||||
|
||||
def _park_the_os_cursor():
|
||||
"""Windows: the OS cursor goes where no window of the browsers below the test process covers (the bottom-right corner while none is open), read back."""
|
||||
if sys.platform == "win32":
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
#!/usr/bin/env python3
|
||||
"""CI known Mozilla defects - the list of crashes a test may meet and the matcher that reads it (stdlib only, Python >= 3.11).
|
||||
|
||||
A crash that comes from a defect of Mozilla's own Firefox (one the stock browser has too) is not fixed by a patch of ours (see the
|
||||
engine's rule on Mozilla defects); the tests that meet it still have to say so by name and not by a threshold, a skip or a rerun.
|
||||
That is this file's job. Each repository that judges crashes keeps a list (the core and the wrapper: ci/mozilla-defects.json; the series:
|
||||
tools/mozilla-defects.json), a JSON array with one row per known defect. The matcher is shared: every repository reads it from the
|
||||
core's main, so the judge is never the branch being judged (the way scripts/ci_regressions.py is read).
|
||||
|
||||
THE RULE, as a question every verdict asks of every crash:
|
||||
|
||||
Does the crash match exactly an entry of ci/mozilla-defects.json (D<n>, bug, signature: process type, thread or frame, exit phase),
|
||||
and does the entry hold for the Firefox version of the engine under test?
|
||||
|
||||
A row:
|
||||
|
||||
{"id": "D<n>", "bug": "<https://bugzilla.mozilla.org/show_bug.cgi?id=N, or empty until the bug is filed>",
|
||||
"firefox": {"from": "<major.minor>", "to": "<major.minor or major.*>"},
|
||||
"signature": {"process": "<parent|tab|gpu|rdd|socket|utility|backgroundtask|...>", "phase": "startup|run|exit",
|
||||
"thread": "<thread name, optional>", "frames": ["<top frame>", "..."], "reason": "<optional>"},
|
||||
"seen": "<owner>/<repo>/actions/runs/<digits>[/job/<digits>]", "why": "<one line>"}
|
||||
|
||||
`frames` is optional: an ordered prefix of the top frames of the crashing thread. `reason` is optional: the MOZ_CRASH text, the signal or
|
||||
the NTSTATUS. A signature must declare `process`, `phase` and at least one of `thread` or `frames`. Ids are unique. `firefox` is the range
|
||||
of Firefox releases the row was seen on and still holds for, both ends included: `from` is a major.minor, `to` is a major.minor or
|
||||
`<major>.*` (every minor of that major). The engine under test is a version string such as 159.0 or 159.0.1; only major.minor decides.
|
||||
|
||||
The crash record `C` is the one record a judge builds from its evidence:
|
||||
|
||||
{"process": "...", "phase": "...", "thread": "...", "frames": ["<top frame first>", "..."], "reason": "..."}
|
||||
|
||||
EXACT means exactly that: every field the row's signature declares is equal to the crash's field (frames: the row's list equals the first
|
||||
len(row frames) frames of the crash, in order, so a crash with fewer frames than the row misses). No regular expression, no wildcard, no
|
||||
case folding, no substring. A field the row does not declare is not compared. A row whose range does not contain the engine cannot match.
|
||||
|
||||
ci_mozilla_defects.py check --file F --engine-version V
|
||||
the schema of every row, every id once, and every row's range contains V. A row whose range does not contain V is RED: the port
|
||||
that moved the engine to V re-justifies the row for this version (a new range and a new `seen`) or drops it.
|
||||
ci_mozilla_defects.py match --file F --engine-version V --crash C.json
|
||||
the crash record C against the rows of F that hold for V. Exit 0 and one line `MATCHED D<n> (<bug or 'not filed'>): <why>`, which
|
||||
the caller prints and counts. Exit 1 and `no known defect matches: the crash stays red` with the record printed.
|
||||
|
||||
Exit codes: 0 ok (or matched); 1 red (a problem in the file, or no match); 2 the checker cannot run (a file that cannot be read or is
|
||||
not JSON, a version that is not major.minor[.patch], a crash record that is not a record) - the caller treats 2 as red, never as a pass;
|
||||
3 usage. Every problem prints one line:
|
||||
|
||||
FAIL <where>: <what>. Fix: <how>. Rule: <the rule, short>
|
||||
|
||||
A Python API for the callers in other repositories (they import this file by path, from the core's main): `load(path)`,
|
||||
`problems(rows, version, name=...)`, `match(rows, version, crash) -> row | None` and
|
||||
`verdict(rows, version, crashes, measurements_complete) -> (red, lines)`. `load` and the version parsing raise `CannotRun`.
|
||||
|
||||
THE VERDICT RULE (`verdict`). A match excuses ONLY the crash itself. The test's own assertions still have to pass, and every measurement
|
||||
must be present, compared and equal; a crash that cost a measurement (a visit that has no result, a dump that was not written) stays red
|
||||
as a missing result, even when the defect matched. So the verdict is RED when any crash has no match; RED when `measurements_complete`
|
||||
is False (even if every crash matched: the line names the defect that matched and says what is missing is the caller's to print); RED
|
||||
when the file has any problem (including a range that does not contain the engine). Otherwise it is not red and has one line per matched
|
||||
crash, naming its D<n>. Never a skip, never a threshold, never a rerun.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
RULE = ("Does the crash match exactly an entry of ci/mozilla-defects.json (D<n>, bug, signature: process type, thread or frame, "
|
||||
"exit phase), and does the entry hold for the Firefox version of the engine under test?")
|
||||
SHORT_RULE = "known Mozilla defect, exact match and range (ci/mozilla-defects.json)"
|
||||
DEFAULT_NAME = "ci/mozilla-defects.json"
|
||||
|
||||
PHASES = ("startup", "run", "exit")
|
||||
ROW_KEYS = {"id", "bug", "firefox", "signature", "seen", "why"}
|
||||
SIGNATURE_KEYS = {"process", "phase", "thread", "frames", "reason"}
|
||||
CRASH_KEYS = {"process", "phase", "thread", "frames", "reason"}
|
||||
_ID = re.compile(r"^D\d+$")
|
||||
_BUG = re.compile(r"^https://bugzilla\.mozilla\.org/show_bug\.cgi\?id=\d+$")
|
||||
_RUN = re.compile(r"^[\w.-]+/[\w.-]+/actions/runs/\d+(/job/\d+)?$")
|
||||
_VERSION = re.compile(r"^(\d+)\.(\d+)(\.\d+)*$")
|
||||
_FROM = re.compile(r"^(\d+)\.(\d+)$")
|
||||
_TO = re.compile(r"^(\d+)\.(\d+|\*)$")
|
||||
_ANY_MINOR = 10 ** 9
|
||||
|
||||
|
||||
class CannotRun(Exception):
|
||||
"""The checker cannot run (exit 2): unreadable file, not JSON, a bad version string or a bad crash record."""
|
||||
|
||||
|
||||
def _line(where: str, what: str, fix: str) -> str:
|
||||
return "FAIL %s: %s. Fix: %s. Rule: %s" % (where, what, fix, SHORT_RULE)
|
||||
|
||||
|
||||
def _text(value: object) -> bool:
|
||||
return isinstance(value, str) and bool(value.strip()) and "\n" not in value
|
||||
|
||||
|
||||
def parse_version(version: object) -> tuple[int, int]:
|
||||
"""major.minor of an engine version such as 159.0 or 159.0.1; CannotRun for anything else."""
|
||||
m = _VERSION.match(version) if isinstance(version, str) else None
|
||||
if not m:
|
||||
raise CannotRun("the engine version %r is not major.minor[.patch] (such as 159.0 or 159.0.1)" % (version,))
|
||||
return int(m.group(1)), int(m.group(2))
|
||||
|
||||
|
||||
def load(path: "str | Path") -> list:
|
||||
"""The rows of a defects file; CannotRun when it cannot be read or is not JSON. Not being an array is a schema problem, not here."""
|
||||
try:
|
||||
raw = Path(path).read_bytes()
|
||||
except OSError as exc:
|
||||
raise CannotRun("the file %s cannot be read (%s)" % (path, exc)) from exc
|
||||
try:
|
||||
return json.loads(raw.decode("utf-8"))
|
||||
except (UnicodeDecodeError, ValueError) as exc:
|
||||
raise CannotRun("the file %s is not JSON (%s)" % (path, exc)) from exc
|
||||
|
||||
|
||||
def _range(row: object) -> "tuple[tuple[int, int], tuple[int, int]] | None":
|
||||
"""((from major, minor), (to major, minor or _ANY_MINOR)) of a well-formed range, else None."""
|
||||
rng = row.get("firefox") if isinstance(row, dict) else None
|
||||
if not isinstance(rng, dict):
|
||||
return None
|
||||
lo, hi = rng.get("from"), rng.get("to")
|
||||
ml = _FROM.match(lo) if isinstance(lo, str) else None
|
||||
mh = _TO.match(hi) if isinstance(hi, str) else None
|
||||
if not ml or not mh:
|
||||
return None
|
||||
low = (int(ml.group(1)), int(ml.group(2)))
|
||||
high = (int(mh.group(1)), _ANY_MINOR if mh.group(2) == "*" else int(mh.group(2)))
|
||||
return (low, high) if low <= high else None
|
||||
|
||||
|
||||
def _where(name: str, row: object, index: int) -> str:
|
||||
rid = row.get("id") if isinstance(row, dict) else None
|
||||
if isinstance(rid, str) and _ID.match(rid):
|
||||
return "%s row %s" % (name, rid)
|
||||
return "%s row #%d" % (name, index)
|
||||
|
||||
|
||||
def _row_problems(row: object, where: str) -> list[str]:
|
||||
if not isinstance(row, dict):
|
||||
return [_line(where, "the row is not an object", "write the row as a JSON object with the fields of the format")]
|
||||
out: list[str] = []
|
||||
for key in sorted(set(row) - ROW_KEYS):
|
||||
out.append(_line(where, "unknown field %r" % key, "remove it; the format has only %s" % ", ".join(sorted(ROW_KEYS))))
|
||||
for key in sorted(ROW_KEYS - set(row)):
|
||||
out.append(_line(where, "field %r is missing" % key, "add it (`bug` may be an empty string until the bug is filed)"))
|
||||
if "id" in row and not (isinstance(row["id"], str) and _ID.match(row["id"])):
|
||||
out.append(_line(where, "field 'id' is not D<n> (%r)" % (row["id"],), "write it as D followed by digits, such as D31"))
|
||||
if "bug" in row and not (row["bug"] == "" or (isinstance(row["bug"], str) and _BUG.match(row["bug"]))):
|
||||
out.append(_line(where, "field 'bug' is neither empty nor a Bugzilla URL (%r)" % (row["bug"],),
|
||||
"write https://bugzilla.mozilla.org/show_bug.cgi?id=<digits>, or an empty string until the bug is filed"))
|
||||
if "seen" in row and not (isinstance(row["seen"], str) and _RUN.match(row["seen"])):
|
||||
out.append(_line(where, "field 'seen' is not a run (%r)" % (row["seen"],),
|
||||
"write <owner>/<repo>/actions/runs/<digits>[/job/<digits>]"))
|
||||
if "why" in row and not _text(row["why"]):
|
||||
out.append(_line(where, "field 'why' is empty or not one line", "write why this crash is Mozilla's in one line"))
|
||||
if "firefox" in row and _range(row) is None:
|
||||
out.append(_line(where, "field 'firefox' is not {\"from\": \"<major.minor>\", \"to\": \"<major.minor or major.*>\"} with from <= to (%r)"
|
||||
% (row["firefox"],), "write the range of Firefox releases, both ends included, such as 159.0 to 159.*"))
|
||||
if "signature" in row:
|
||||
out.extend(_signature_problems(row["signature"], where))
|
||||
return out
|
||||
|
||||
|
||||
def _signature_problems(sig: object, where: str) -> list[str]:
|
||||
if not isinstance(sig, dict):
|
||||
return [_line(where, "field 'signature' is not an object", "write {\"process\": ..., \"phase\": ..., \"thread\": ... or \"frames\": ...}")]
|
||||
out: list[str] = []
|
||||
for key in sorted(set(sig) - SIGNATURE_KEYS):
|
||||
out.append(_line(where, "unknown signature field %r" % key,
|
||||
"remove it; a signature has only %s" % ", ".join(sorted(SIGNATURE_KEYS))))
|
||||
for key in ("process", "phase"):
|
||||
if key not in sig:
|
||||
out.append(_line(where, "signature field %r is missing" % key, "declare it: a signature names the process type and the phase"))
|
||||
if "thread" not in sig and "frames" not in sig:
|
||||
out.append(_line(where, "the signature declares neither 'thread' nor 'frames'",
|
||||
"declare the crashing thread's name or the top frames (an ordered prefix): the process and the phase alone match too much"))
|
||||
if "process" in sig and not _text(sig["process"]):
|
||||
out.append(_line(where, "signature field 'process' is empty or not one line", "write the process type, such as parent or gpu"))
|
||||
if "phase" in sig and sig["phase"] not in PHASES:
|
||||
out.append(_line(where, "signature field 'phase' is %r" % (sig["phase"],), "use one of %s" % ", ".join(PHASES)))
|
||||
for key in ("thread", "reason"):
|
||||
if key in sig and not _text(sig[key]):
|
||||
out.append(_line(where, "signature field %r is empty or not one line" % key, "write the exact text, or remove the field"))
|
||||
if "frames" in sig and not (isinstance(sig["frames"], list) and sig["frames"] and all(_text(f) for f in sig["frames"])):
|
||||
out.append(_line(where, "signature field 'frames' is not a non-empty list of frame names",
|
||||
"write the top frames of the crashing thread, top first, one string each"))
|
||||
return out
|
||||
|
||||
|
||||
def problems(rows: object, version: str, name: str = DEFAULT_NAME) -> list[str]:
|
||||
"""Every problem of the file for the engine `version`: schema, duplicate ids, and a range that does not contain the engine."""
|
||||
ver = parse_version(version)
|
||||
if not isinstance(rows, list):
|
||||
return [_line(name, "the file is not a JSON array of rows", "write the file as an array, [] when no defect is known")]
|
||||
out: list[str] = []
|
||||
seen_ids: dict[str, int] = {}
|
||||
for index, row in enumerate(rows):
|
||||
where = _where(name, row, index)
|
||||
out.extend(_row_problems(row, where))
|
||||
rid = row.get("id") if isinstance(row, dict) else None
|
||||
if isinstance(rid, str) and _ID.match(rid):
|
||||
if rid in seen_ids:
|
||||
out.append(_line(where, "the id %s is also row #%d" % (rid, seen_ids[rid]),
|
||||
"give every defect its own D<n>; one row per defect"))
|
||||
else:
|
||||
seen_ids[rid] = index
|
||||
rng = _range(row)
|
||||
if rng is not None and not rng[0] <= ver <= rng[1]:
|
||||
out.append(_line(where, "its range %s to %s does not contain the engine under test (%s)"
|
||||
% (row["firefox"]["from"], row["firefox"]["to"], version),
|
||||
"the port re-justifies the row for this version (a new range and a new `seen`) or drops it"))
|
||||
return out
|
||||
|
||||
|
||||
def _crash_problem(crash: object) -> "str | None":
|
||||
if not isinstance(crash, dict):
|
||||
return "the crash record is not an object"
|
||||
extra = sorted(set(crash) - CRASH_KEYS)
|
||||
if extra:
|
||||
return "the crash record has unknown fields %s" % ", ".join(extra)
|
||||
for key in ("process", "phase"):
|
||||
if not isinstance(crash.get(key), str):
|
||||
return "the crash record has no string %r" % key
|
||||
for key in ("thread", "reason"):
|
||||
if key in crash and not isinstance(crash[key], str):
|
||||
return "the crash record field %r is not a string" % key
|
||||
frames = crash.get("frames", [])
|
||||
if not (isinstance(frames, list) and all(isinstance(f, str) for f in frames)):
|
||||
return "the crash record field 'frames' is not a list of strings"
|
||||
return None
|
||||
|
||||
|
||||
def _equal(row: dict, crash: dict) -> bool:
|
||||
sig = row["signature"]
|
||||
for key in ("process", "phase", "thread", "reason"):
|
||||
if key in sig and sig[key] != crash.get(key):
|
||||
return False
|
||||
if "frames" in sig:
|
||||
frames = crash.get("frames", [])
|
||||
if frames[:len(sig["frames"])] != sig["frames"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def match(rows: object, version: str, crash: object) -> "dict | None":
|
||||
"""The first row that holds for `version` and whose signature equals the crash field by field; None otherwise. CannotRun on a bad record."""
|
||||
ver = parse_version(version)
|
||||
bad = _crash_problem(crash)
|
||||
if bad:
|
||||
raise CannotRun(bad)
|
||||
if not isinstance(rows, list):
|
||||
return None
|
||||
for row in rows:
|
||||
if not isinstance(row, dict) or _row_problems(row, "x"):
|
||||
continue # a malformed row never matches; `problems` is what says so
|
||||
rng = _range(row)
|
||||
if rng is None or not rng[0] <= ver <= rng[1]:
|
||||
continue
|
||||
if _equal(row, crash):
|
||||
return row
|
||||
return None
|
||||
|
||||
|
||||
def _matched_line(row: dict) -> str:
|
||||
return "MATCHED %s (%s): %s" % (row["id"], row["bug"] or "not filed", row["why"])
|
||||
|
||||
|
||||
def verdict(rows: object, version: str, crashes: list, measurements_complete: bool,
|
||||
name: str = DEFAULT_NAME) -> "tuple[bool, list[str]]":
|
||||
"""(red, lines) of a test that met `crashes` (the crash records it found, possibly none).
|
||||
|
||||
A match excuses only the crash itself. Red when any crash has no match; red when `measurements_complete` is False even if every crash
|
||||
matched; red when the file has any problem. Otherwise not red, with one MATCHED line per matched crash. No skip, no threshold, no rerun."""
|
||||
lines = problems(rows, version, name)
|
||||
red = bool(lines)
|
||||
matched: list[dict] = []
|
||||
for index, crash in enumerate(crashes):
|
||||
where = "crash #%d" % index
|
||||
try:
|
||||
row = match(rows, version, crash)
|
||||
except CannotRun as exc:
|
||||
lines.append(_line(where, "%s" % exc, "build the record {process, phase, thread, frames, reason} from the crash evidence"))
|
||||
red = True
|
||||
continue
|
||||
if row is None:
|
||||
lines.append(_line(where, "no known defect matches: the crash stays red (%s)" % json.dumps(crash, sort_keys=True),
|
||||
"fix the product, or declare the crash as a Mozilla defect with its bug and an exact signature in %s" % name))
|
||||
red = True
|
||||
else:
|
||||
matched.append(row)
|
||||
lines.append(_matched_line(row))
|
||||
if not measurements_complete:
|
||||
red = True
|
||||
names = ", ".join(r["id"] for r in matched)
|
||||
what = ("the crash matched %s, which excuses the crash only, and a measurement is missing" % names
|
||||
if matched else "a measurement is missing")
|
||||
lines.append(_line("measurements", what,
|
||||
"a missing result stays red: the test's own assertions and every measurement must still pass; the caller "
|
||||
"prints which measurement is missing"))
|
||||
return red, lines
|
||||
|
||||
|
||||
class _Parser(argparse.ArgumentParser):
|
||||
def error(self, message: str) -> None: # usage is exit 3, as the rule of exit codes says
|
||||
self.print_usage(sys.stderr)
|
||||
sys.stderr.write("%s: error: %s\n" % (self.prog, message))
|
||||
raise SystemExit(3)
|
||||
|
||||
|
||||
def _build_parser() -> argparse.ArgumentParser:
|
||||
ap = _Parser(prog="ci_mozilla_defects.py", description=__doc__.split("\n", 1)[0])
|
||||
sub = ap.add_subparsers(dest="mode", required=True, parser_class=_Parser)
|
||||
for mode in ("check", "match"):
|
||||
p = sub.add_parser(mode)
|
||||
p.add_argument("--file", required=True)
|
||||
p.add_argument("--engine-version", required=True)
|
||||
if mode == "match":
|
||||
p.add_argument("--crash", required=True)
|
||||
return ap
|
||||
|
||||
|
||||
def main(argv: "list[str] | None" = None) -> int:
|
||||
args = _build_parser().parse_args(argv)
|
||||
try:
|
||||
rows = load(args.file)
|
||||
version = args.engine_version
|
||||
parse_version(version)
|
||||
found = problems(rows, version, str(args.file))
|
||||
if args.mode == "check":
|
||||
for line in found:
|
||||
print(line)
|
||||
if found:
|
||||
return 1
|
||||
print("OK ci_mozilla_defects check: %d known defect(s), every range contains the engine %s" % (len(rows), version))
|
||||
return 0
|
||||
try:
|
||||
crash = json.loads(Path(args.crash).read_text(encoding="utf-8"))
|
||||
except (OSError, ValueError) as exc:
|
||||
raise CannotRun("the crash record %s cannot be read as JSON (%s)" % (args.crash, exc)) from exc
|
||||
row = match(rows, version, crash) if not found else None
|
||||
for line in found:
|
||||
print(line)
|
||||
if row is None:
|
||||
print("no known defect matches: the crash stays red")
|
||||
print(json.dumps(crash, sort_keys=True))
|
||||
return 1
|
||||
print(_matched_line(row))
|
||||
return 0
|
||||
except CannotRun as exc:
|
||||
print(_line("ci_mozilla_defects", "cannot run: %s" % exc,
|
||||
"give a readable JSON file, an engine version such as 159.0 and a crash record"))
|
||||
return 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,216 @@
|
||||
[New LWP 14305]
|
||||
[New LWP 14187]
|
||||
[New LWP 14246]
|
||||
[New LWP 14202]
|
||||
[New LWP 14233]
|
||||
[New LWP 14241]
|
||||
[New LWP 14242]
|
||||
[New LWP 14244]
|
||||
[New LWP 14201]
|
||||
[New LWP 14452]
|
||||
[Thread debugging using libthread_db enabled]
|
||||
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
|
||||
Core was generated by `/tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/firefox --backg'.
|
||||
Program terminated with signal SIGSEGV, Segmentation fault.
|
||||
#0 0x00007fd9cb69ebec in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
[Current thread is 1 (Thread 0x7fd9a5b896c0 (LWP 14305))]
|
||||
|
||||
Thread 10 (Thread 0x7fd9ab6ff6c0 (LWP 14452)):
|
||||
#0 0x00007fd9cb6ecb9f in clock_nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9cb6f9ae7 in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#2 0x00007fd9cb72997c in usleep () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#3 0x00007fd9bca783f7 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#4 0x00007fd9cbcbc2e8 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libnspr4.so
|
||||
#5 0x0000559e12f6d3d4 in ?? ()
|
||||
#6 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#7 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 9 (Thread 0x7fd9b42ff6c0 (LWP 14201)):
|
||||
#0 0x00007fd9cb7274ed in syscall () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9c0d6d7ad in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#2 0x00007fd9c0cde58b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#3 0x00007fd9c0d43ec3 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#4 0x00007fd9c0d430e2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#5 0x0000559e12f6d3d4 in ?? ()
|
||||
#6 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#7 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 8 (Thread 0x7fd9aa6fe6c0 (LWP 14244)):
|
||||
#0 0x00007fd9cb7274ed in syscall () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9c0d6e0a0 in g_cond_wait_until () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#2 0x00007fd9c0cde553 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#3 0x00007fd9c0cde6a6 in g_async_queue_timeout_pop () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#4 0x00007fd9c0d4853f in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#5 0x00007fd9c0d430e2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#6 0x0000559e12f6d3d4 in ?? ()
|
||||
#7 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#8 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 7 (Thread 0x7fd9ab9be6c0 (LWP 14242)):
|
||||
#0 0x00007fd9cb7274ed in syscall () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9ba2d2525 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#2 0x00007fd9b968aef2 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#3 0x00007fd9b9688973 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#4 0x00007fd9b96887ee in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#5 0x00007fd9b9688450 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#6 0x00007fd9ba6286af in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#7 0x0000559e12f6d3d4 in ?? ()
|
||||
#8 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#9 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 6 (Thread 0x7fd9ab9ff6c0 (LWP 14241)):
|
||||
#0 0x00007fd9cb7274ed in syscall () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9ba2d2525 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#2 0x00007fd9b968aef2 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#3 0x00007fd9b9688973 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#4 0x00007fd9b96887ee in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#5 0x00007fd9b9688450 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#6 0x00007fd9ba6286af in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#7 0x0000559e12f6d3d4 in ?? ()
|
||||
#8 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#9 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 5 (Thread 0x7fd9b22fd6c0 (LWP 14233)):
|
||||
#0 0x00007fd9cb7274ed in syscall () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9b9698227 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#2 0x00007fd9ba4cff9a in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#3 0x00007fd9b96923e7 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#4 0x00007fd9b96883a4 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#5 0x00007fd9ba6286af in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#6 0x0000559e12f6d3d4 in ?? ()
|
||||
#7 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#8 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 4 (Thread 0x7fd9b32fe6c0 (LWP 14202)):
|
||||
#0 0x00007fd9cb71b75d in poll () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9c0d73b4e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#2 0x00007fd9c0d13ad3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#3 0x00007fd9c0d13b29 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#4 0x00007fd9c0d430e2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#5 0x0000559e12f6d3d4 in ?? ()
|
||||
#6 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#7 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 3 (Thread 0x7fd9a96fd6c0 (LWP 14246)):
|
||||
#0 0x00007fd9cb71b75d in poll () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9c0d73b4e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#2 0x00007fd9c0d14ff7 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#3 0x00007fd9c0c016c2 in ?? () from /lib/x86_64-linux-gnu/libgio-2.0.so.0
|
||||
#4 0x00007fd9c0d430e2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
#5 0x0000559e12f6d3d4 in ?? ()
|
||||
#6 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#7 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
Thread 2 (Thread 0x7fd9cbccdbc0 (LWP 14187)):
|
||||
#0 0x00007fd9c04012fc in ?? () from /lib/x86_64-linux-gnu/libz.so.1
|
||||
#1 0x00007fffa5a6b3d0 in ?? ()
|
||||
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
|
||||
|
||||
Thread 1 (Thread 0x7fd9a5b896c0 (LWP 14305)):
|
||||
#0 0x00007fd9cb69ebec in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#1 0x00007fd9cb64527e in raise () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#2 0x00007fd9bc1c2f71 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#3 <signal handler called>
|
||||
#4 0x0000559e12fc4d26 in mozilla::detail::MutexImpl::lock() ()
|
||||
#5 0x00007fd9b98cc564 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#6 0x00007fd9b9a54b99 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#7 0x00007fd9b98cae67 in ?? () from /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
#8 0x0000559e12f6d3d4 in ?? ()
|
||||
#9 0x00007fd9cb69cb64 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
#10 0x00007fd9cb729e8c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
|
||||
0x559e12f3ccce: "MOZ_CRASH(mozilla::detail::MutexImpl::mutexLock: pthread_mutex_lock failed)"
|
||||
From To Syms Read Shared Object Library
|
||||
0x00007fd9cbd05040 0x00007fd9cbd05105 Yes (*) /lib/x86_64-linux-gnu/libdl.so.2
|
||||
0x00007fd9cbaa55c0 0x00007fd9cbbe4ce2 Yes (*) /lib/x86_64-linux-gnu/libstdc++.so.6
|
||||
0x00007fd9cb927420 0x00007fd9cb9a53a6 Yes (*) /lib/x86_64-linux-gnu/libm.so.6
|
||||
0x00007fd9cbcda780 0x00007fd9cbcfd745 Yes (*) /lib/x86_64-linux-gnu/libgcc_s.so.1
|
||||
0x00007fd9cbcd2040 0x00007fd9cbcd2105 Yes (*) /lib/x86_64-linux-gnu/libpthread.so.0
|
||||
0x00007fd9cb628800 0x00007fd9cb7b0039 Yes (*) /lib/x86_64-linux-gnu/libc.so.6
|
||||
0x00007fd9cbd1f000 0x00007fd9cbd49175 Yes (*) /lib64/ld-linux-x86-64.so.2
|
||||
0x00007fd9cbca01f0 0x00007fd9cbcc3b5b Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libnspr4.so
|
||||
0x00007fd9cbd0fd70 0x00007fd9cbd1136a Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libplc4.so
|
||||
0x00007fd9cbc8a5b0 0x00007fd9cbc8b4b8 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libplds4.so
|
||||
0x00007fd9cb8ed3d0 0x00007fd9cb9139c6 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libmozsandbox.so
|
||||
0x00007fd9cbc84080 0x00007fd9cbc842b1 Yes (*) /lib/x86_64-linux-gnu/librt.so.1
|
||||
0x00007fd9c19ec7f0 0x00007fd9c20db8c5 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libgkcodecs.so
|
||||
0x00007fd9cb8c73e0 0x00007fd9cb8dcb05 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/liblgpllibs.so
|
||||
0x00007fd9cb89ab70 0x00007fd9cb8b0ffc Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libnssutil3.so
|
||||
0x00007fd9cb46e2a0 0x00007fd9cb4f510b Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libnss3.so
|
||||
0x00007fd9cb868570 0x00007fd9cb8820b8 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libsmime3.so
|
||||
0x00007fd9c218a6e0 0x00007fd9c22f59d4 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libmozsqlite3.so
|
||||
0x00007fd9c17a3760 0x00007fd9c17f6ff8 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libssl3.so
|
||||
0x00007fd9cbd0a6e0 0x00007fd9cbd0a7b3 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libmozgtk.so
|
||||
0x00007fd9c0e94a40 0x00007fd9c1230a2c Yes (*) /lib/x86_64-linux-gnu/libgtk-3.so.0
|
||||
0x00007fd9c16b9320 0x00007fd9c1736cf5 Yes (*) /lib/x86_64-linux-gnu/libgdk-3.so.0
|
||||
0x00007fd9cb849500 0x00007fd9cb84a5d2 Yes (*) /lib/x86_64-linux-gnu/libgmodule-2.0.so.0
|
||||
0x00007fd9c0cd6e90 0x00007fd9c0d74842 Yes (*) /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
0x00007fd9c1636110 0x00007fd9c166b3d0 Yes (*) /lib/x86_64-linux-gnu/libgobject-2.0.so.0
|
||||
0x00007fd9c0b277e0 0x00007fd9c0c36b86 Yes (*) /lib/x86_64-linux-gnu/libgio-2.0.so.0
|
||||
0x00007fd9cb83c680 0x00007fd9cb8427f4 Yes (*) /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
|
||||
0x00007fd9c0a912d0 0x00007fd9c0ac7f97 Yes (*) /lib/x86_64-linux-gnu/libpango-1.0.so.0
|
||||
0x00007fd9c097ae90 0x00007fd9c0a471e2 Yes (*) /lib/x86_64-linux-gnu/libharfbuzz.so.0
|
||||
0x00007fd9c0841f60 0x00007fd9c092f9af Yes (*) /lib/x86_64-linux-gnu/libcairo.so.2
|
||||
0x00007fd9cb8253e0 0x00007fd9cb82f677 Yes (*) /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
|
||||
0x00007fd9c15ddf90 0x00007fd9c160b2ee Yes (*) /lib/x86_64-linux-gnu/libfontconfig.so.1
|
||||
0x00007fd9cb416100 0x00007fd9cb4190b7 Yes (*) /lib/x86_64-linux-gnu/libfribidi.so.0
|
||||
0x00007fd9cb40c100 0x00007fd9cb40d5ba Yes (*) /lib/x86_64-linux-gnu/libcairo-gobject.so.2
|
||||
0x00007fd9c21300a0 0x00007fd9c21489bd Yes (*) /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
|
||||
0x00007fd9c080cd40 0x00007fd9c081b430 Yes (*) /lib/x86_64-linux-gnu/libatk-1.0.so.0
|
||||
0x00007fd9c073e240 0x00007fd9c07a3ca1 Yes (*) /lib/x86_64-linux-gnu/libepoxy.so.0
|
||||
0x00007fd9c06ce4a0 0x00007fd9c06d9e09 Yes (*) /lib/x86_64-linux-gnu/libXi.so.6
|
||||
0x00007fd9c05a7100 0x00007fd9c063610e Yes (*) /lib/x86_64-linux-gnu/libX11.so.6
|
||||
0x00007fd9c05600e0 0x00007fd9c0576cc2 Yes (*) /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
|
||||
0x00007fd9cb815300 0x00007fd9cb817a4a Yes (*) /lib/x86_64-linux-gnu/libXfixes.so.3
|
||||
0x00007fd9c050d5a0 0x00007fd9c052c672 Yes (*) /lib/x86_64-linux-gnu/libxkbcommon.so.0
|
||||
0x00007fd9c04fd580 0x00007fd9c0502b84 Yes (*) /lib/x86_64-linux-gnu/libwayland-client.so.0
|
||||
0x00007fd9c04f04a0 0x00007fd9c04f1d8b Yes (*) /lib/x86_64-linux-gnu/libwayland-cursor.so.0
|
||||
0x00007fd9cbc7f080 0x00007fd9cbc7f249 Yes (*) /lib/x86_64-linux-gnu/libwayland-egl.so.1
|
||||
0x00007fd9c04de600 0x00007fd9c04e8bce Yes (*) /lib/x86_64-linux-gnu/libXext.so.6
|
||||
0x00007fd9c04d0660 0x00007fd9c04d55ec Yes (*) /lib/x86_64-linux-gnu/libXcursor.so.1
|
||||
0x00007fd9cb4041a0 0x00007fd9cb404b59 Yes (*) /lib/x86_64-linux-gnu/libXdamage.so.1
|
||||
0x00007fd9c2122140 0x00007fd9c2122b8b Yes (*) /lib/x86_64-linux-gnu/libXcomposite.so.1
|
||||
0x00007fd9c04c33a0 0x00007fd9c04c9ee9 Yes (*) /lib/x86_64-linux-gnu/libXrandr.so.2
|
||||
0x00007fd9c15d11a0 0x00007fd9c15d1b0e Yes (*) /lib/x86_64-linux-gnu/libXinerama.so.1
|
||||
0x00007fd9c0429300 0x00007fd9c04963b0 Yes (*) /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
||||
0x00007fd9c041d460 0x00007fd9c042307a Yes (*) /lib/x86_64-linux-gnu/libffi.so.8
|
||||
0x00007fd9c0401260 0x00007fd9c0412c80 Yes (*) /lib/x86_64-linux-gnu/libz.so.1
|
||||
0x00007fd9c03bc3a0 0x00007fd9c03ee4fc Yes (*) /lib/x86_64-linux-gnu/libmount.so.1
|
||||
0x00007fd9c038c040 0x00007fd9c03a75bc Yes (*) /lib/x86_64-linux-gnu/libselinux.so.1
|
||||
0x00007fd9c037c340 0x00007fd9c037fd97 Yes (*) /lib/x86_64-linux-gnu/libthai.so.0
|
||||
0x00007fd9c02bb7f0 0x00007fd9c034b6ca Yes (*) /lib/x86_64-linux-gnu/libfreetype.so.6
|
||||
0x00007fd9c028b240 0x00007fd9c02a7f89 Yes (*) /lib/x86_64-linux-gnu/libgraphite2.so.3
|
||||
0x00007fd9c0255510 0x00007fd9c027ccf8 Yes (*) /lib/x86_64-linux-gnu/libpng16.so.16
|
||||
0x00007fd9c0246440 0x00007fd9c024c787 Yes (*) /lib/x86_64-linux-gnu/libXrender.so.1
|
||||
0x00007fd9c0226660 0x00007fd9c0238ebe Yes (*) /lib/x86_64-linux-gnu/libxcb.so.1
|
||||
0x00007fd9c0211120 0x00007fd9c0215ccb Yes (*) /lib/x86_64-linux-gnu/libxcb-render.so.0
|
||||
0x00007fd9c02080e0 0x00007fd9c0208b07 Yes (*) /lib/x86_64-linux-gnu/libxcb-shm.so.0
|
||||
0x00007fd9c0162300 0x00007fd9c01ee85e Yes (*) /lib/x86_64-linux-gnu/libpixman-1.so.0
|
||||
0x00007fd9c012e210 0x00007fd9c014c473 Yes (*) /lib/x86_64-linux-gnu/libexpat.so.1
|
||||
0x00007fd9c00ab580 0x00007fd9c00f7720 Yes (*) /lib/x86_64-linux-gnu/libjpeg.so.8
|
||||
0x00007fd9c007ef80 0x00007fd9c009563d Yes (*) /lib/x86_64-linux-gnu/libatspi.so.0
|
||||
0x00007fd9c002af10 0x00007fd9c00597bb Yes (*) /lib/x86_64-linux-gnu/libdbus-1.so.3
|
||||
0x00007fd9bffead40 0x00007fd9c000d9b7 Yes (*) /lib/x86_64-linux-gnu/libblkid.so.1
|
||||
0x00007fd9bffdc240 0x00007fd9bffdf58d Yes (*) /lib/x86_64-linux-gnu/libdatrie.so.1
|
||||
0x00007fd9bffc8280 0x00007fd9bffd4ff3 Yes (*) /lib/x86_64-linux-gnu/libbz2.so.1.0
|
||||
0x00007fd9bffb91a0 0x00007fd9bffc0bca Yes (*) /lib/x86_64-linux-gnu/libbrotlidec.so.1
|
||||
0x00007fd9bffb3360 0x00007fd9bffb4042 Yes (*) /lib/x86_64-linux-gnu/libXau.so.6
|
||||
0x00007fd9bffac1a0 0x00007fd9bffada89 Yes (*) /lib/x86_64-linux-gnu/libXdmcp.so.6
|
||||
0x00007fd9bfee1e20 0x00007fd9bff6e770 Yes (*) /lib/x86_64-linux-gnu/libsystemd.so.0
|
||||
0x00007fd9bfea80a0 0x00007fd9bfea87be Yes (*) /lib/x86_64-linux-gnu/libbrotlicommon.so.1
|
||||
0x00007fd9bfe95de0 0x00007fd9bfea04f6 Yes (*) /lib/x86_64-linux-gnu/libbsd.so.0
|
||||
0x00007fd9bfe879c0 0x00007fd9bfe8c607 Yes (*) /lib/x86_64-linux-gnu/libcap.so.2
|
||||
0x00007fd9bfd4aac0 0x00007fd9bfe3e91e Yes (*) /lib/x86_64-linux-gnu/libgcrypt.so.20
|
||||
0x00007fd9bfd1c180 0x00007fd9bfd36e8c Yes (*) /lib/x86_64-linux-gnu/liblz4.so.1
|
||||
0x00007fd9bfcea400 0x00007fd9bfd0b66f Yes (*) /lib/x86_64-linux-gnu/liblzma.so.5
|
||||
0x00007fd9bfc31400 0x00007fd9bfcd77b2 Yes (*) /lib/x86_64-linux-gnu/libzstd.so.1
|
||||
0x00007fd9bfc20160 0x00007fd9bfc28a7a Yes (*) /lib/x86_64-linux-gnu/libmd.so.0
|
||||
0x00007fd9bfbfda20 0x00007fd9bfc12d72 Yes (*) /lib/x86_64-linux-gnu/libgpg-error.so.0
|
||||
0x00007fd9cb856500 0x00007fd9cb856a13 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libmozwayland.so
|
||||
0x00007fd9b7776980 0x00007fd9bf392d25 Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libxul.so
|
||||
0x00007fd9bfbdf6e0 0x00007fd9bfbe7f19 Yes (*) /lib/x86_64-linux-gnu/libresolv.so.2
|
||||
0x00007fd9bfafd500 0x00007fd9bfb9b0f8 Yes (*) /lib/x86_64-linux-gnu/libasound.so.2
|
||||
0x00007fd9cb84f040 0x00007fd9cb84f11f Yes (*) /lib/x86_64-linux-gnu/libX11-xcb.so.1
|
||||
0x00007fd9a5c78640 0x00007fd9a5dbc1fd Yes (*) /tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/libfreeblpriv3.so
|
||||
(*): Shared library is missing debugging information.
|
||||
|
||||
warning: Can't open file /memfd:mozilla-ipc (deleted) during file-backed mapping note processing
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"gdb-core.FSBroker14298.14187.1796087906.txt": {
|
||||
"source": "run 46539190316 of oss-invisible/firefox_antidetect_patch, job 142310624770 (wrapper.e2e.ab_oracle), crash/firefox-70-again/09-63-1.5-ab-visit/",
|
||||
"sha256": "a84ad75b5688dd306aed1d4a059d4a51a1117e8497cff0a061090373fab95b08"
|
||||
},
|
||||
"ci_mozilla_defects.py.txt": {
|
||||
"source": "oss-invisible/core scripts/ci_mozilla_defects.py",
|
||||
"core_main_sha": "882eed52ae1776c570053eb772c068206207cac8",
|
||||
"last_commit": "3946b2679d3faee0c6b748d9d941db69945bcada",
|
||||
"sha256": "256908b42bb7ccdfa119eb3d5b57b4ee0c6747fcc646f14dd6f09f0c5af3a98d"
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@
|
||||
"n": 5864
|
||||
},
|
||||
"dom.system_colors": {
|
||||
"s": "[[\"Canvas\",\"rgb(255, 255, 255)\"],[\"CanvasText\",\"rgb(0, 0, 0)\"],[\"ButtonFace\",\"rgb(233, 233, 237)\"],[\"ButtonText\",\"rgb(0, 0, 0)\"],[\"ButtonBorder\",\"rgb(129, 127, 132)\"],[\"Field\",\"rgb(255, 255, 255)\"],[\"FieldText\",\"rgb(0, 0, 0)\"],[\"Highlight\",\"rgb(0, 120, 215)\"],[\"HighlightText\",\"rgb(255, 255, 255)\"],[\"GrayText\",\"rgb(109, 109, 109)\"],[\"LinkText\",\"rgb(0, 0, 238)\"],[\"VisitedText\",\"rgb(85, 26, 139)\"],[\"ActiveText\",\"rgb(238, 0, 0)\"],[\"Mark\",\"rgb(255, 255, 0)\"],[\"MarkText\",\"rgb(0, 0, 0)\"],[\"AccentColor\",\"rgb(0, 96, 223)\"],[\"AccentColorText\",\"rgb(255, 255, 255)\"],[\"SelectedItem\",\"rgb(0, 120, 215)\"],[\"SelectedItemText\",\"rgb(255, 255, 255)\"]]"
|
||||
"s": "[[\"Canvas\",\"rgb(255, 255, 255)\"],[\"CanvasText\",\"rgb(0, 0, 0)\"],[\"ButtonFace\",\"rgb(233, 233, 237)\"],[\"ButtonText\",\"rgb(0, 0, 0)\"],[\"ButtonBorder\",\"rgb(129, 127, 132)\"],[\"Field\",\"rgb(255, 255, 255)\"],[\"FieldText\",\"rgb(0, 0, 0)\"],[\"Highlight\",\"rgb(0, 120, 212)\"],[\"HighlightText\",\"rgb(255, 255, 255)\"],[\"GrayText\",\"rgb(109, 109, 109)\"],[\"LinkText\",\"rgb(0, 0, 238)\"],[\"VisitedText\",\"rgb(85, 26, 139)\"],[\"ActiveText\",\"rgb(238, 0, 0)\"],[\"Mark\",\"rgb(255, 255, 0)\"],[\"MarkText\",\"rgb(0, 0, 0)\"],[\"AccentColor\",\"rgb(0, 96, 223)\"],[\"AccentColorText\",\"rgb(255, 255, 255)\"],[\"SelectedItem\",\"rgb(0, 120, 212)\"],[\"SelectedItemText\",\"rgb(255, 255, 255)\"]]"
|
||||
},
|
||||
"env.dpr": {
|
||||
"s": "1"
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
"n": 5863
|
||||
},
|
||||
"dom.system_colors": {
|
||||
"s": "[[\"Canvas\",\"rgb(255, 255, 255)\"],[\"CanvasText\",\"rgb(0, 0, 0)\"],[\"ButtonFace\",\"rgb(233, 233, 237)\"],[\"ButtonText\",\"rgb(0, 0, 0)\"],[\"ButtonBorder\",\"rgb(129, 127, 132)\"],[\"Field\",\"rgb(255, 255, 255)\"],[\"FieldText\",\"rgb(0, 0, 0)\"],[\"Highlight\",\"rgb(0, 120, 215)\"],[\"HighlightText\",\"rgb(255, 255, 255)\"],[\"GrayText\",\"rgb(109, 109, 109)\"],[\"LinkText\",\"rgb(0, 0, 238)\"],[\"VisitedText\",\"rgb(85, 26, 139)\"],[\"ActiveText\",\"rgb(238, 0, 0)\"],[\"Mark\",\"rgb(255, 255, 0)\"],[\"MarkText\",\"rgb(0, 0, 0)\"],[\"AccentColor\",\"rgb(0, 96, 223)\"],[\"AccentColorText\",\"rgb(255, 255, 255)\"],[\"SelectedItem\",\"rgb(0, 120, 215)\"],[\"SelectedItemText\",\"rgb(255, 255, 255)\"]]"
|
||||
"s": "[[\"Canvas\",\"rgb(255, 255, 255)\"],[\"CanvasText\",\"rgb(0, 0, 0)\"],[\"ButtonFace\",\"rgb(233, 233, 237)\"],[\"ButtonText\",\"rgb(0, 0, 0)\"],[\"ButtonBorder\",\"rgb(129, 127, 132)\"],[\"Field\",\"rgb(255, 255, 255)\"],[\"FieldText\",\"rgb(0, 0, 0)\"],[\"Highlight\",\"rgb(0, 120, 212)\"],[\"HighlightText\",\"rgb(255, 255, 255)\"],[\"GrayText\",\"rgb(109, 109, 109)\"],[\"LinkText\",\"rgb(0, 0, 238)\"],[\"VisitedText\",\"rgb(85, 26, 139)\"],[\"ActiveText\",\"rgb(238, 0, 0)\"],[\"Mark\",\"rgb(255, 255, 0)\"],[\"MarkText\",\"rgb(0, 0, 0)\"],[\"AccentColor\",\"rgb(0, 96, 223)\"],[\"AccentColorText\",\"rgb(255, 255, 255)\"],[\"SelectedItem\",\"rgb(0, 120, 212)\"],[\"SelectedItemText\",\"rgb(255, 255, 255)\"]]"
|
||||
},
|
||||
"env.dpr": {
|
||||
"s": "1"
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>password mask character, read as widths</title>
|
||||
<body style="margin:0;background:#fff">
|
||||
<script>
|
||||
"use strict";
|
||||
// Which character does an <input type=password> mask with? A page cannot read it, but it can read widths: the
|
||||
// scrollWidth of a password field holding N copies of "a" is N times the advance of the mask character in the field's
|
||||
// font. The same box styles hold N copies of each candidate character in a text input (scrollWidth) and in an inline span
|
||||
// (getBoundingClientRect). The mask character is the candidate whose width equals the password width.
|
||||
// Two fonts: Arial 16px, and the default font of an input (only the size is set). Also recorded: measureText of each
|
||||
// candidate in a canvas with the same font, devicePixelRatio, the computed font-family of the input, navigator.platform.
|
||||
const N = 40;
|
||||
const CANDS = [["U+25CF", "●"], ["U+2022", "•"], ["U+2731", "✱"], ["U+273A", "✺"], ["*", "*"]];
|
||||
const FONTS = [["arial16", "font-family:Arial;font-size:16px"], ["default16", "font-size:16px"]];
|
||||
const BOX = "box-sizing:content-box;margin:0;padding:0;border:0;width:20px;height:24px;outline:0;";
|
||||
const SPAN = "display:inline-block;white-space:pre;margin:0;padding:0;border:0;";
|
||||
|
||||
function input(type, value, font) {
|
||||
const el = document.createElement("input");
|
||||
el.type = type;
|
||||
el.value = value;
|
||||
el.setAttribute("style", BOX + font);
|
||||
document.body.appendChild(el);
|
||||
return el;
|
||||
}
|
||||
|
||||
function span(text, familyCss) {
|
||||
const el = document.createElement("span");
|
||||
el.textContent = text;
|
||||
el.setAttribute("style", SPAN + familyCss);
|
||||
document.body.appendChild(el);
|
||||
return el;
|
||||
}
|
||||
|
||||
function measureFont(fontCase, font) {
|
||||
const out = {};
|
||||
const pw = input("password", "a".repeat(N), font);
|
||||
const cs = getComputedStyle(pw);
|
||||
const family = cs.fontFamily;
|
||||
out.input_font_family = family;
|
||||
out.input_font_size = cs.fontSize;
|
||||
out.input_font = cs.font;
|
||||
const spanFont = "font-family:" + family + ";font-size:16px";
|
||||
// password widths with 1, 10 and N characters: per-character advance = (w[N] - w[10]) / (N - 10)
|
||||
out.password = {};
|
||||
for (const n of [1, 10, N]) {
|
||||
const e = input("password", "a".repeat(n), font);
|
||||
out.password[n] = {scrollWidth: e.scrollWidth, clientWidth: e.clientWidth};
|
||||
e.remove();
|
||||
}
|
||||
out.password[N].scrollWidth_main = pw.scrollWidth;
|
||||
out.password.per_char = (out.password[N].scrollWidth - out.password[10].scrollWidth) / (N - 10);
|
||||
out.refs = {};
|
||||
for (const [name, ch] of CANDS) {
|
||||
const r = {};
|
||||
r.text_input = {};
|
||||
for (const n of [1, 10, N]) {
|
||||
const e = input("text", ch.repeat(n), font);
|
||||
r.text_input[n] = {scrollWidth: e.scrollWidth};
|
||||
e.remove();
|
||||
}
|
||||
r.text_input.per_char = (r.text_input[N].scrollWidth - r.text_input[10].scrollWidth) / (N - 10);
|
||||
const sp = span(ch.repeat(N), spanFont);
|
||||
r.span_width = sp.getBoundingClientRect().width;
|
||||
r.span_width_1 = (() => { const s1 = span(ch, spanFont); const w = s1.getBoundingClientRect().width; s1.remove(); return w; })();
|
||||
sp.remove();
|
||||
const c = document.createElement("canvas").getContext("2d");
|
||||
c.font = (fontCase === "arial16" ? "16px Arial" : "16px " + family);
|
||||
r.canvas_measureText = c.measureText(ch).width;
|
||||
r.canvas_font = c.font;
|
||||
out.refs[name] = r;
|
||||
}
|
||||
const pwWidth = out.password[N].scrollWidth;
|
||||
out.verdict = {
|
||||
by_text_input_scrollWidth: CANDS.map(c => c[0]).filter(k => out.refs[k].text_input[N].scrollWidth === pwWidth),
|
||||
by_span_width: CANDS.map(c => c[0]).filter(k => Math.abs(out.refs[k].span_width - pwWidth) < 1),
|
||||
by_per_char: CANDS.map(c => c[0]).filter(k => out.refs[k].text_input.per_char === out.password.per_char),
|
||||
};
|
||||
pw.remove();
|
||||
return out;
|
||||
}
|
||||
|
||||
(async () => {
|
||||
let result;
|
||||
try {
|
||||
result = {format: "password-mask/1", n: N,
|
||||
env: {userAgent: navigator.userAgent, platform: navigator.platform, devicePixelRatio: window.devicePixelRatio,
|
||||
width: screen.width, height: screen.height},
|
||||
fonts: {}};
|
||||
for (const [fontCase, font] of FONTS) result.fonts[fontCase] = measureFont(fontCase, font);
|
||||
} catch (e) {
|
||||
result = {format: "password-mask/1", error: String(e && e.stack || e)};
|
||||
}
|
||||
window.__result = result;
|
||||
const label = location.search.slice(1) || "result";
|
||||
try { await fetch("/result?" + label, {method: "POST", body: JSON.stringify(result)}); } catch (e) { /* recorded in window.__result */ }
|
||||
document.title = "done";
|
||||
})();
|
||||
</script>
|
||||
@@ -21,6 +21,7 @@
|
||||
{"file": "test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "scope": "<module>.READ", "rule": "js-timer", "nth": 1, "kind": "hang-detector", "reason": "The timer of 30 s only ends a read of the position that never answers: the answer is a position or an error as soon as the engine gives one, and no verdict reads when the timer fired."},
|
||||
{"file": "test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "scope": "<module>._START_JS", "rule": "js-timer", "nth": 1, "kind": "hang-detector", "reason": "The 5 ms step of the page's two waits, each with a deadline of 30 s: for the host UDP candidate of the first connection, and for the data channel to open and echo; the second loop keeps the longest time it did not run, so the time the connection took is judged only when the page itself was not stopped by the machine (`_e2e_verdicts.opened_at_the_retry_problem`)."},
|
||||
{"file": "test_a_page_cannot_probe_the_juggler_e2e.py", "scope": "<module>._CHANNELS", "rule": "js-timer", "nth": 1, "kind": "hang-detector", "reason": "The 30 s of each channel are the deadline of its wait (`no answer` is a channel that stays silent). Every channel of a URL is asked at once and a name that is nowhere answers all of them, so on a healthy run no silence is waited for, and a stall of the machine cannot make one URL answer and the other not."},
|
||||
{"file": "test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "scope": "test_a_timer_callback_the_client_started_has_only_its_own_frame_and_no_caller", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "The timer the client's evaluate starts is the subject of the test (the stack and the caller of its callback are what it asserts); the test waits for the callback to have run with a deadline of 30 s, and no verdict reads when the timer fired."},
|
||||
{"file": "test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "scope": "<module>._GATHER_JS", "rule": "js-timer", "nth": 1, "kind": "hang-detector", "reason": "The timer of 30 s is the deadline of the wait for the end of the ICE gathering: the wait ends when the page says `complete`, a gathering that never completes returns what it has and fails the assertions on the candidates, and no verdict reads when the timer fired."},
|
||||
{"file": "test_a_page_that_moves_on_e2e.py", "scope": "_replace_after_load", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "The page's own timer moves the page 0, 50 or 300 ms after the load, and the reads made while it moves accept both states (the page before the move or the page it moved to) and never an engine error; nothing reads when the timer fired, and the waits that lead up to the reads have a deadline of 30 s."},
|
||||
{"file": "test_a_page_that_moves_on_e2e.py", "scope": "test_reads_wait_as_playwright_s_do", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "The page's own timer adds the element 500 ms after the call; the read waits for it with a deadline of 30 s, and the verdict is the text read, never when the timer fired."},
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
"""A click on the password field of a login form, with the login autocomplete list open over it, reaches the page: the page hears the click and no tab opens, as with stock Firefox and Playwright.
|
||||
|
||||
Firefox opens the autocomplete list (``#PopupAutoComplete``, a panel of the browser's own UI) by itself when a login field takes the focus. On a form whose first row is the insecure-login warning
|
||||
(the form's action is an ``http`` address that is not local, so the form is not secure whatever the page is) the list opens under ``#user`` and covers the field below it. Stock Playwright sends a press
|
||||
to the page through such a panel, as through the password doorhanger, so the page hears the whole click on ``#pass`` and the focus goes to it. An engine whose door sent the press to the popup
|
||||
widget put it on the warning row, which opens a tab of the support site: the page heard nothing, and a page appeared.
|
||||
|
||||
Per scale (1, 1.25 and 1.5), the client's own mouse: a click on ``#user`` (the list must be open, read from the chrome: without it the case would pass for nothing), then a click on ``#pass``. The page records
|
||||
``pointerdown``, ``mousedown``, ``pointerup``, ``mouseup`` and ``click`` in the capture phase. The test waits (a condition with a deadline) until the page has heard the click on ``#pass`` and the focus is
|
||||
there, and then watches the number of pages of the context for one second (``observe``): it must stay what it was.
|
||||
|
||||
Needs ``MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1`` for the chrome reads. Red on an engine whose door lets the autocomplete list take part in the input path: the page hears nothing of the click on ``#pass`` and a page
|
||||
opens.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
from typing import Any, Iterator, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _stock_twin import MARIONETTE_ARGS, BrokenControl, Chrome
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, observe, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The display scales of the cases: 1, 1.25 and 1.5.
|
||||
SCALES = sorted(case for case, (scale, _panel) in CASES.items() if scale <= 1.5)
|
||||
#: How long the number of pages is watched once the page has heard the click.
|
||||
WATCH_S = 1.0
|
||||
|
||||
#: The two fields, one under the other (CSS pixels of the viewport): ``#user`` at (20, 20, 200 x 30), ``#pass`` at (20, 60, 200 x 30). The list opens under ``#user`` and covers ``#pass``.
|
||||
USER_CENTRE = (120, 35)
|
||||
PASS_CENTRE = (120, 75)
|
||||
#: What the page hears on ``#pass``, in the order of a click.
|
||||
PASS_CLICK = [["pointerdown", "pass"], ["mousedown", "pass"], ["pointerup", "pass"], ["mouseup", "pass"], ["click", "pass"]]
|
||||
|
||||
#: The login form. Its action is an ``http`` address that is not local and is never visited (nothing submits it): it makes the form insecure, so the list that opens on ``#user`` holds the warning row.
|
||||
PAGE = """<!doctype html><meta charset=utf-8><title>login</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}input{position:absolute;left:20px;width:200px;height:30px;box-sizing:border-box}#user{top:20px}#pass{top:60px}</style>
|
||||
<body><form method=post action="http://login-target.example/signin">
|
||||
<input id=user name=user type=text><input id=pass name=password type=password></form>
|
||||
<script>
|
||||
window.__events = [];
|
||||
for (const type of ['pointerdown', 'mousedown', 'pointerup', 'mouseup', 'click'])
|
||||
window.addEventListener(type, e => window.__events.push([e.type, e.target.id || e.target.nodeName.toLowerCase()]), true);
|
||||
window.__read = () => ({events: window.__events.slice(), active: document.activeElement && document.activeElement.id});
|
||||
window.__reset = () => { window.__events.length = 0; };
|
||||
</script>"""
|
||||
|
||||
#: The prefs of the launch. ``-marionette`` applies Marionette's recommended preferences, which set ``signon.rememberSignons`` to false on the default branch, and a real user's Firefox has it true (the default):
|
||||
#: the user branch, which wins over the default one, gets it back, so the login manager marks the field and the list opens.
|
||||
EXTRA_PREFS = {"marionette.port": 0, "signon.rememberSignons": True}
|
||||
|
||||
#: The state of the autocomplete list, read in the chrome (``absent`` where the element is not there).
|
||||
STATE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.getElementById("PopupAutoComplete");
|
||||
return JSON.stringify({autocomplete: popup && typeof popup.state === "string" ? popup.state : "absent"});
|
||||
"""
|
||||
#: The pref that lets the login manager mark a field as autocompletable (``LoginHelper.enabled``).
|
||||
PREF_JS = """
|
||||
return JSON.stringify({rememberSignons: Services.prefs.getBoolPref("signon.rememberSignons", null)});
|
||||
"""
|
||||
#: Closes the list, so the page closes clean.
|
||||
HIDE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.getElementById("PopupAutoComplete");
|
||||
if (popup && typeof popup.hidePopup === "function" && popup.state !== "closed") popup.hidePopup();
|
||||
return JSON.stringify({});
|
||||
"""
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _session(firefox_binary: str, monkeypatch, case: str) -> Iterator[Tuple[Any, Any, Chrome, Sites]]:
|
||||
"""Our browser on ``case`` with the login page served: ``(page, context, chrome, sites)``. The first page is kept open (the window the chrome session waits for)."""
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites, launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs=EXTRA_PREFS) as browser:
|
||||
sites.route("A", "/login", PAGE)
|
||||
holder = browser.new_page()
|
||||
chrome = Chrome(holder)
|
||||
page = browser.new_page()
|
||||
try:
|
||||
page.goto(sites.url("A", "/login"))
|
||||
yield page, page.context, chrome, sites
|
||||
finally:
|
||||
chrome.script(HIDE_JS)
|
||||
chrome.close()
|
||||
|
||||
|
||||
def _list_state(chrome: Chrome) -> str:
|
||||
return chrome.script(STATE_JS)["autocomplete"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_click_on_the_password_field_under_the_login_list_reaches_the_page(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (page, context, chrome, _sites):
|
||||
page.mouse.click(*USER_CENTRE)
|
||||
opened = wait_for(page, lambda: _list_state(chrome) == "open", DEADLINE_S)
|
||||
if not opened:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: a click on #user did not open the login autocomplete list (state %r, signon.rememberSignons %r): the case would pass for nothing"
|
||||
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
|
||||
# The release of the first click is heard by the page after the click returned: wait for it, then start from an empty record.
|
||||
assert wait_for(page, lambda: ["click", "user"] in page.evaluate("() => window.__read()")["events"], DEADLINE_S), "the page never heard the click on #user"
|
||||
page.evaluate("() => window.__reset()")
|
||||
pages_before = len(context.pages)
|
||||
if _list_state(chrome) != "open":
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the login autocomplete list is not open right before the press on #pass (state %r, signon.rememberSignons %r)"
|
||||
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
|
||||
|
||||
page.mouse.click(*PASS_CENTRE)
|
||||
|
||||
def heard() -> bool:
|
||||
reading = page.evaluate("() => window.__read()")
|
||||
return reading["events"] == PASS_CLICK and reading["active"] == "pass"
|
||||
|
||||
arrived = wait_for(page, heard, DEADLINE_S)
|
||||
reading = page.evaluate("() => window.__read()")
|
||||
assert arrived, ("the page did not hear the whole click on #pass with the focus on it (waited %s s; the list was %r): it heard %r, the active element is %r"
|
||||
% (DEADLINE_S, _list_state(chrome), reading["events"], reading["active"]))
|
||||
counts: List[int] = observe(page, lambda: len(context.pages), WATCH_S)
|
||||
assert counts == [pages_before], "a click on #pass opened a page (the pages of the context over %s s: %r, before it %d)" % (WATCH_S, counts, pages_before)
|
||||
@@ -114,14 +114,6 @@ def test_the_caller_never_declares_udp_on_a_context_proxy():
|
||||
assert _context_proxy(_apply({"proxy": dict(gw.proxy, udp="coherent")}, [gw]))[1]["udp"] == "no"
|
||||
|
||||
|
||||
def test_a_proxy_is_measured_again_for_every_context_given_it():
|
||||
"""Nothing is kept by the core: three contexts given one proxy are three measurements."""
|
||||
with coherent() as gw:
|
||||
for n in range(1, 4):
|
||||
assert _context_proxy(_apply({"proxy": dict(gw.proxy)}, [gw]))[1]["udp"] == "coherent"
|
||||
assert gw.associates == n
|
||||
|
||||
|
||||
def test_the_credentials_are_used_on_the_socket_and_nowhere_else(caplog):
|
||||
user, password = "u-7c1e4b9a02", "p-3d5f8a6e41"
|
||||
env_before = dict(os.environ)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""A real drag from the top document into a frame of another site ends as it does on stock Firefox with stock Playwright.
|
||||
"""A real drag from the top document ends as it does on stock Firefox with stock Playwright, in a frame of another site and in the top document.
|
||||
|
||||
The drag-and-drop points cross the process boundary as whole numbers: the parent sends the drop point to the frame's process, and the end point of the drag
|
||||
to the source's. If either one is off by the offset between the window's real chrome and its declared chrome, the frame's element under the cursor is not the
|
||||
@@ -7,30 +7,36 @@ element that gets the drop, and ``dragend`` carries a point that is not the last
|
||||
THE VERDICT IS "THE SAME AS STOCK" (``_stock_twin``): Playwright's own Firefox, driven by the stock Playwright client, does the same drag first, on the same local pages, at the same
|
||||
window size and scale, and ours must read what stock reads. What the page reads is the relation, and no number of ours is its expected value.
|
||||
|
||||
What it does, per display case (the four of the window tests), on each browser, with the client's own mouse (``page.mouse.move``, ``down``, ``move`` in steps, ``up``): a page of the top
|
||||
site holds a draggable box at its top left and, lower right, a frame of another site, 400x300 at (200, 100). The frame holds two boxes, 120x120, at (40, 60) (``target``) and (220, 60)
|
||||
(``other``). The mouse goes down on the box, moves in twelve steps to the centre of ``target`` (300, 220 in the top document) and goes up. The record, from the page's own events:
|
||||
What it does, per display case (the four of the window tests), on each browser, with the client's own mouse (``page.mouse.move``, ``down``, ``move`` in steps, ``up``), twice: a page of the top
|
||||
site holds a draggable box at its top left, a drop box in the top document (120x120 at (20, 200)) and, lower right, a frame of another site, 400x300 at (200, 100). The frame holds two boxes,
|
||||
120x120, at (40, 60) (``target``) and (220, 60) (``other``). The mouse goes down on the dragged box and moves in twelve steps to the centre of ``target`` (300, 220 in the top document), and then,
|
||||
on a fresh load of the page, to the centre of the drop box of the top document (80, 260). Both pages record every drag event they hear (``_drag_record``): for ``dragstart`` and ``drag``
|
||||
at the source, ``dragenter``, ``dragover``, ``dragleave`` and ``drop`` where the drag goes, and ``dragend`` at the source, the type, the target's id, the id of the element under the cursor, the
|
||||
client and screen points, ``buttons``, ``mozInputSource``, ``dataTransfer.types``, ``effectAllowed``, ``dropEffect``, ``mozUserCancelled``, whether ``mozSourceNode`` is null and ``isTrusted``;
|
||||
the ``dragend`` point; and ``dragend``'s client point less the last ``drag``'s.
|
||||
|
||||
* ``dragstarts``: how many ``dragstart`` the top document heard;
|
||||
* ``drops``: how many ``drop`` events the frame heard, the id of the element each was dispatched at, the id of ``document.elementFromPoint`` at the event's ``clientX/Y`` (the element
|
||||
under the cursor), and the client point it carries;
|
||||
* ``dragover``: whether the frame heard any (a count of them depends on the speed of the machine, so it is a yes or no in the verdict, and the count is in the record);
|
||||
* ``end_minus_last``: ``dragend``'s ``clientX/Y`` less the last ``drag`` event's, in the top document (a drag whose end point is moved by the offset reads a ``dragend`` that is not where
|
||||
the drag was last seen: stock's difference is whatever it is, and ours is the same, exactly).
|
||||
THE TWIN RULE (``_drag_record.DECLARED``): stock's frame is in-process (stock Playwright's Firefox sets ``fission.webContentIsolationStrategy=0``) and its drag is Juggler's synthetic one, so
|
||||
the buttons, ``drag`` at the source (count and presence), the ``dragend`` point less the last ``drag`` and, in the frame, ``effectAllowed``, ``dropEffect`` and ``mozSourceNode`` are in the record
|
||||
and NOT compared with stock; so are, for the drop in the frame only, the top document's ``dragleave`` into the frame (stock's top hears one at the body when the cursor enters the subdocument;
|
||||
retail with the frame out of process has none) and the ``dropEffect`` of the top ``dragend`` (the frame's drop result, which crosses processes). The report of the test lists what differs there
|
||||
(``recorded_differences``), and the retail capture (the round ``drag`` of the core's window-geometry workflow) decides them. Routing and targets, client points, ``rel``, types, trusted, the input
|
||||
source, and the effects of the top document (``dragend``'s too, in the drop in the top document) are compared.
|
||||
|
||||
Ours equals stock in the dragstart count, the drop count and the element each drop reaches and the one under the cursor, within one CSS pixel in the client point of the drop, exactly in
|
||||
``end_minus_last``. The record also has the scales of each browser (page and chrome ``devicePixelRatio``, and the real scale of the screen from chrome scope), printed when it differs.
|
||||
Ours equals stock in every compared field, within one CSS pixel in a client point, and through the relation of the screen point to the client point (stock's window
|
||||
stands where it stands and ours where it declares, so the screen numbers themselves are in the record and not in the verdict; ``_drag_record`` says why, field by field). The record also has
|
||||
the scales of each browser (page and chrome ``devicePixelRatio``, and the real scale of the screen from chrome scope), printed when it differs.
|
||||
|
||||
The engine that answers these values is not released yet: with the real chrome offset in the points the drop target or ``dragend`` is off, so this test is RED on the engine of the pin
|
||||
where they differ, on purpose. It enters the suite with the engine release.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any, Dict, Tuple
|
||||
|
||||
import pytest
|
||||
from _drag_record import RECORDER_JS, read_events, read_record, recorded, verdict
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _stock_twin import Chrome, both, differences, run_twin
|
||||
from _stock_twin import Chrome, run_twin
|
||||
from _window_origin import CASES, DEADLINE_S, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
@@ -40,83 +46,78 @@ SOURCE = (60, 45)
|
||||
#: The frame: 400x300 at (200, 100). The centre of ``target`` in the frame is (100, 120), so (300, 220) in the top document.
|
||||
FRAME_AT = (200, 100)
|
||||
TARGET_IN_FRAME = (100, 120)
|
||||
#: The drop box of the top document: 120x120 at (20, 200); its centre.
|
||||
TOP_DROP = (80, 260)
|
||||
STEPS = 12
|
||||
#: The two drops, in this order: the one the engine's fission path serves and the one that must keep working. kind -> where the mouse goes up.
|
||||
DROPS: Dict[str, Tuple[int, int]] = {"frame": (FRAME_AT[0] + TARGET_IN_FRAME[0], FRAME_AT[1] + TARGET_IN_FRAME[1]), "top": TOP_DROP}
|
||||
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>drag</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%%}
|
||||
#src{position:absolute;left:20px;top:20px;width:80px;height:50px;background:#9bd}
|
||||
#top_target{position:absolute;left:20px;top:200px;width:120px;height:120px;background:#bd9}
|
||||
#f{position:absolute;left:200px;top:100px;width:400px;height:300px;border:0}</style>
|
||||
<body><div id=src draggable=true>drag</div><iframe id=f src="%s"></iframe><script>
|
||||
window.__drag = {starts: 0, drags: [], end: null};
|
||||
const point = e => ({cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY});
|
||||
<body><div id=src draggable=true>drag</div><div id=top_target>drop</div><iframe id=f src="%s"></iframe><script>
|
||||
document.getElementById('src').addEventListener('dragstart', e => {
|
||||
window.__drag.starts++;
|
||||
e.dataTransfer.setData('text/plain', 'x');
|
||||
e.dataTransfer.effectAllowed = 'copy';
|
||||
});
|
||||
document.addEventListener('drag', e => { window.__drag.drags.push(point(e)); }, true);
|
||||
document.addEventListener('dragend', e => { window.__drag.end = point(e); }, true);
|
||||
</script>"""
|
||||
document.getElementById('top_target').addEventListener('dragover', e => e.preventDefault());
|
||||
document.getElementById('top_target').addEventListener('drop', e => e.preventDefault());
|
||||
</script><script>""" + RECORDER_JS + """</script>"""
|
||||
|
||||
FRAME = """<!doctype html><meta charset=utf-8><title>drop</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}
|
||||
.box{position:absolute;top:60px;width:120px;height:120px}
|
||||
#target{left:40px;background:#bd9}#other{left:220px;background:#db9}</style>
|
||||
<body><div id=target class=box>target</div><div id=other class=box>other</div><script>
|
||||
window.__drop = {drops: [], overs: 0};
|
||||
document.addEventListener('dragover', e => { e.preventDefault(); window.__drop.overs++; }, true);
|
||||
document.addEventListener('drop', e => {
|
||||
e.preventDefault();
|
||||
const under = document.elementFromPoint(e.clientX, e.clientY);
|
||||
window.__drop.drops.push({at: e.target.id, under: under && under.id, cx: e.clientX, cy: e.clientY});
|
||||
}, true);
|
||||
</script>"""
|
||||
document.addEventListener('dragover', e => e.preventDefault(), true);
|
||||
document.addEventListener('drop', e => e.preventDefault(), true);
|
||||
</script><script>""" + RECORDER_JS + """</script>"""
|
||||
|
||||
|
||||
def _drag(page) -> None:
|
||||
def _drag(page, to: Tuple[int, int]) -> None:
|
||||
page.mouse.move(*SOURCE)
|
||||
page.mouse.down()
|
||||
page.mouse.move(FRAME_AT[0] + TARGET_IN_FRAME[0], FRAME_AT[1] + TARGET_IN_FRAME[1], steps=STEPS)
|
||||
page.mouse.move(to[0], to[1], steps=STEPS)
|
||||
page.mouse.up()
|
||||
|
||||
|
||||
def _steps(sites, page, chrome: Chrome) -> Dict[str, Any]:
|
||||
"""What one browser does and what the page reads of it. {"scales": ..., "measured": {...}}."""
|
||||
def _heard(document, kind: str) -> bool:
|
||||
return any(e["type"] == kind for e in read_events(document))
|
||||
|
||||
|
||||
def _one_drop(sites, page, kind: str) -> Dict[str, Any]:
|
||||
"""A fresh load of the page, one drag that ends at ``kind``'s point, and the record of what both documents heard."""
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
frame = wait_frame(page, sites.origin["B"], "/drop", seconds=DEADLINE_S)
|
||||
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
|
||||
origin = page.evaluate("() => { const r = document.getElementById('f').getBoundingClientRect(); return [r.left, r.top]; }")
|
||||
assert tuple(origin) == FRAME_AT, "the frame is at %r in the top document, the test placed it at %r" % (origin, FRAME_AT)
|
||||
scales = chrome.scales(page)
|
||||
|
||||
_drag(page)
|
||||
_drag(page, DROPS[kind])
|
||||
|
||||
wait_for(page, lambda: page.evaluate("() => window.__drag.end") is not None or page.evaluate("() => window.__drag.starts") == 0, 10)
|
||||
wait_for(page, lambda: len(frame.evaluate("() => window.__drop.drops")) >= 1, 5) # stock may drop nothing: then the wait ends and the record says so
|
||||
drag: Dict[str, Any] = page.evaluate("() => window.__drag")
|
||||
drops: List[Dict[str, Any]] = frame.evaluate("() => window.__drop.drops")
|
||||
overs = frame.evaluate("() => window.__drop.overs")
|
||||
last = drag["drags"][-1] if drag["drags"] else None
|
||||
end = drag["end"]
|
||||
return {"scales": scales,
|
||||
"measured": {"dragstarts": drag["starts"], "drops": len(drops), "drop_at": [d["at"] for d in drops], "drop_under": [d["under"] for d in drops],
|
||||
"drop_client": [[d["cx"], d["cy"]] for d in drops], "dragover": overs > 0, "dragovers": overs,
|
||||
"end_minus_last": [end["cx"] - last["cx"], end["cy"] - last["cy"]] if (end and last) else None, "drag_events": len(drag["drags"])}}
|
||||
wait_for(page, lambda: _heard(page, "dragend") or not _heard(page, "dragstart"), 10)
|
||||
receiver = frame if kind == "frame" else page
|
||||
wait_for(page, lambda: _heard(receiver, "drop"), 5) # stock may drop nothing: then the wait ends and the record says so
|
||||
return read_record(page, frame)
|
||||
|
||||
|
||||
def _steps(sites, page, chrome: Chrome) -> Dict[str, Any]:
|
||||
"""What one browser does and what the page reads of it. {"scales": ..., "measured": {"frame": record, "top": record}}."""
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
scales = chrome.scales()
|
||||
return {"scales": scales, "measured": {kind: _one_drop(sites, page, kind) for kind in DROPS}}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_drag_from_the_top_into_a_frame_of_another_site_ends_as_on_stock(firefox_binary, monkeypatch, case):
|
||||
def test_a_drag_from_the_top_into_a_frame_of_another_site_ends_as_on_stock(firefox_binary, monkeypatch, case, record_property):
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads of the record
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/drop"))
|
||||
sites.route("B", "/drop", FRAME)
|
||||
stock, ours = run_twin(case, firefox_binary, lambda page, chrome: _steps(sites, page, chrome))
|
||||
# the count of dragovers and of drag events depends on the machine's speed: they are in the record, not in the verdict
|
||||
left_out = ("dragovers", "drag_events")
|
||||
stock_m = {k: v for k, v in stock["measured"].items() if k not in left_out}
|
||||
ours_m = {k: v for k, v in ours["measured"].items() if k not in left_out}
|
||||
# the point of a drop is a device pixel, rounded to CSS: one CSS pixel; everything else exactly
|
||||
differing = differences(stock_m, ours_m, {"drop_client": 1.0}, "measured")
|
||||
assert not differing, (
|
||||
"%s: the drag of ours does not end as stock's does (dragend less the last drag event, the drop target, the drop count):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, stock, ours)))
|
||||
for kind in DROPS:
|
||||
record_property("recorded_differences_%s" % kind, "\n".join(recorded(stock["measured"][kind], ours["measured"][kind], kind, "%s drop" % kind)))
|
||||
message = verdict(case, kind, stock["measured"][kind], ours["measured"][kind])
|
||||
assert not message, message
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
"""faulthandler's thread dump crashes a process whose threads churn frames, and the e2e stack watchdog does not: the hazard behind the Windows part 3 deaths.
|
||||
|
||||
Both halves run the same load in a child python: 32 threads that call a recursive function and start and join a short thread, over and over, so that frames
|
||||
are created and freed all the time, while a watchdog dumps the stacks of every thread every millisecond.
|
||||
|
||||
* The old mechanism, ``faulthandler.dump_traceback_later(0.001, repeat=True)``, copies the frames of every thread without the GIL. The child must die with a
|
||||
crash status (a signal on Linux, an NT status such as 0xC0000005 on Windows), never end well and never end with an exception (status 1). It dies in under 100 ms
|
||||
on CPython 3.11 and 3.12, and the child gets 60 s before the test says that this Python did not show the hazard. This is the proof that the hazard is real.
|
||||
* The new watchdog (``tests/_stack_watchdog.py``) at a period of 1 ms, on the same load, must let the child run for SURVIVAL_S = 6 s (sixty times what the old
|
||||
one lasts) and end with status 0, with the file holding a dump of the threads for at least 20 dumps.
|
||||
|
||||
The child sets itself up not to leave a trace of its crash: on Windows the error mode without the crash box (no Windows Error Reporting dialog and no dump
|
||||
in the LocalDumps folder of a job that keeps them), on Linux a core limit of 0.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
TESTS = Path(__file__).resolve().parent
|
||||
SURVIVAL_S = 6.0
|
||||
THREADS = 32
|
||||
HAZARD_DEADLINE_S = 60.0
|
||||
|
||||
CHILD = '''
|
||||
import json, os, sys, threading, time
|
||||
|
||||
mode, seconds, threads, tests_dir, log_path = sys.argv[1], float(sys.argv[2]), int(sys.argv[3]), sys.argv[4], sys.argv[5]
|
||||
if sys.platform == "win32":
|
||||
import ctypes
|
||||
ctypes.windll.kernel32.SetErrorMode(0x8003)
|
||||
else:
|
||||
import resource
|
||||
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
|
||||
sys.path.insert(0, tests_dir)
|
||||
|
||||
stop = threading.Event()
|
||||
|
||||
|
||||
def deep(n):
|
||||
if n == 0:
|
||||
return sum(i for i in range(5))
|
||||
return deep(n - 1) + 1
|
||||
|
||||
|
||||
def churn():
|
||||
while not stop.is_set():
|
||||
deep(30)
|
||||
t = threading.Thread(target=deep, args=(10,))
|
||||
t.start()
|
||||
t.join()
|
||||
|
||||
|
||||
class Sink:
|
||||
"""Counts the dumps and keeps the first megabyte of them in the file: a dump every millisecond would fill a disk."""
|
||||
|
||||
def __init__(self, path):
|
||||
self.file = open(path, "w", encoding="utf-8")
|
||||
self.kept = 0
|
||||
self.dumps = 0
|
||||
|
||||
def write(self, text):
|
||||
self.dumps += text.count("Timeout (")
|
||||
if self.kept < 1000000:
|
||||
self.kept += self.file.write(text)
|
||||
|
||||
def flush(self):
|
||||
self.file.flush()
|
||||
|
||||
|
||||
if mode == "old":
|
||||
import faulthandler
|
||||
faulthandler.dump_traceback_later(0.001, repeat=True, file=open(os.devnull, "w"))
|
||||
else:
|
||||
import _stack_watchdog as dog
|
||||
sink = Sink(log_path)
|
||||
dog.arm("stress", 0.001, 0.001, file=sink)
|
||||
|
||||
workers = [threading.Thread(target=churn, daemon=True) for _ in range(threads)]
|
||||
for w in workers:
|
||||
w.start()
|
||||
time.sleep(seconds)
|
||||
stop.set()
|
||||
if mode == "old":
|
||||
faulthandler.cancel_dump_traceback_later()
|
||||
else:
|
||||
dog.cancel()
|
||||
for w in workers:
|
||||
w.join()
|
||||
print(json.dumps({"survived": True, "dumps": 0 if mode == "old" else sink.dumps}))
|
||||
'''
|
||||
|
||||
|
||||
def _run(tmp_path: Path, mode: str, seconds: float, timeout: float):
|
||||
script = tmp_path / ("child_%s.py" % mode)
|
||||
script.write_text(CHILD, encoding="utf-8")
|
||||
log = tmp_path / "dumps.log"
|
||||
done = subprocess.run([sys.executable, str(script), mode, str(seconds), str(THREADS), str(TESTS), str(log)], capture_output=True, text=True, timeout=timeout)
|
||||
return done, log
|
||||
|
||||
|
||||
def _crashed(returncode: int) -> bool:
|
||||
"""A signal on POSIX (negative), an NT status (0xC0000005 and the like, from 0x80000000) on Windows. An exception of Python is 1, a good end is 0."""
|
||||
return returncode < 0 or returncode >= 0x80000000
|
||||
|
||||
|
||||
def test_the_dump_of_faulthandler_kills_a_process_that_churns_frames(tmp_path):
|
||||
done, _ = _run(tmp_path, "old", HAZARD_DEADLINE_S, HAZARD_DEADLINE_S + 60)
|
||||
assert _crashed(done.returncode), (
|
||||
"faulthandler.dump_traceback_later(0.001, repeat=True) did not crash the child on this Python (%s, status %s): the GIL-free copy of the frames "
|
||||
"did not show on %d threads in %d s. stdout %r, stderr %r" % (sys.version.split()[0], done.returncode, THREADS, HAZARD_DEADLINE_S, done.stdout[-200:], done.stderr[-500:]))
|
||||
|
||||
|
||||
def test_the_stack_watchdog_survives_the_same_load_for_sixty_times_as_long(tmp_path):
|
||||
done, log = _run(tmp_path, "new", SURVIVAL_S, SURVIVAL_S + 120)
|
||||
assert done.returncode == 0, "the child ended with status %s after at most %s s, stderr %r" % (done.returncode, SURVIVAL_S, done.stderr[-800:])
|
||||
result = json.loads(done.stdout)
|
||||
assert result["survived"] and result["dumps"] >= 20, result
|
||||
text = log.read_text(encoding="utf-8", errors="replace")
|
||||
assert "Timeout (" in text and "Thread 0x" in text and "in churn" in text
|
||||
@@ -0,0 +1,274 @@
|
||||
"""A Marionette session is asked for only after the launch has a window: the twins no longer wait 300 s for an answer that cannot come.
|
||||
|
||||
The wrapper launches the engine with ``-silent``: there is no window at start-up. Marionette's ``WebDriver:NewSession`` waits for the end of the browser's start-up, which only a window ends,
|
||||
so a test that asked for the session before its first ``new_page()`` never got its answer and the socket gave up after 300 s (the twins ``run_retail_twin`` and ``_on_ours``: every
|
||||
stock twin and every retail twin of the engine candidate, both systems). Two checks, no browser:
|
||||
|
||||
1. The order is written in the signature and the call sites. ``Chrome`` takes the page of the launch as a required argument, and a scan of every test and script (ast) refuses a function that
|
||||
makes a session (``_Marionette(...)``, ``marionette_active_port(...)``, ``WebDriver:NewSession``, or a helper or class that does, found by name across the files) before the
|
||||
first ``new_page()`` of the same function, or a ``Popen`` that opens ``about:blank``. A helper that opens no window of its own is checked at its callers.
|
||||
2. The behaviour, on a Marionette that answers ``NewSession`` only once a window exists, as the engine does: ``_on_ours`` and ``run_retail_twin`` get their answer, and the same fake
|
||||
times out for a session asked first.
|
||||
|
||||
Known-bad input: ``chrome = Chrome()`` before ``browser.new_page()`` (both twins, the old files), and the synthetic old order below. Green: the page first, then ``Chrome(page)``.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import contextlib
|
||||
import inspect
|
||||
import pathlib
|
||||
from typing import Dict, List, Optional, Set, Tuple
|
||||
|
||||
import pytest
|
||||
|
||||
import _retail_reference
|
||||
import _stock_twin
|
||||
import webfont_probe
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
HERE = pathlib.Path(__file__).resolve().parent
|
||||
ROOT = HERE.parent
|
||||
|
||||
NEW_SESSION = "WebDriver:NewSession"
|
||||
#: The names that open a Marionette connection; a function that calls one is a session helper or a launcher with a session, and the names it carries join the set.
|
||||
PRIMITIVES = {"_Marionette", "marionette_active_port"}
|
||||
#: What starts a browser: a function that calls one of these is a launcher, and every session it asks for needs a window before it.
|
||||
LAUNCHERS = {"InvisiblePlaywright", "launch_case", "launch", "Popen"}
|
||||
|
||||
|
||||
def _name(call: ast.Call) -> Optional[str]:
|
||||
target = call.func
|
||||
return target.id if isinstance(target, ast.Name) else target.attr if isinstance(target, ast.Attribute) else None
|
||||
|
||||
|
||||
def _own_calls(function: ast.AST) -> List[ast.Call]:
|
||||
"""The calls in the body of ``function`` itself, not in a function, lambda or class defined inside it."""
|
||||
calls: List[ast.Call] = []
|
||||
stack = list(function.body)
|
||||
while stack:
|
||||
node = stack.pop()
|
||||
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.Lambda, ast.ClassDef)):
|
||||
continue
|
||||
if isinstance(node, ast.Call):
|
||||
calls.append(node)
|
||||
stack.extend(ast.iter_child_nodes(node))
|
||||
return calls
|
||||
|
||||
|
||||
def _opens_a_window(call: ast.Call) -> bool:
|
||||
if _name(call) == "new_page":
|
||||
return True
|
||||
if _name(call) == "Popen":
|
||||
return any(isinstance(x, ast.Constant) and x.value == "about:blank" for arg in call.args for x in ast.walk(arg))
|
||||
return False
|
||||
|
||||
|
||||
def _functions(tree: ast.AST) -> List[Tuple[ast.AST, Optional[str]]]:
|
||||
"""Every function with the class it is a method of (None for the others), nested ones too."""
|
||||
found: List[Tuple[ast.AST, Optional[str]]] = []
|
||||
|
||||
def visit(node: ast.AST, owner: Optional[str]) -> None:
|
||||
for child in ast.iter_child_nodes(node):
|
||||
if isinstance(child, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
||||
found.append((child, owner))
|
||||
visit(child, None)
|
||||
elif isinstance(child, ast.ClassDef):
|
||||
visit(child, child.name)
|
||||
else:
|
||||
visit(child, owner)
|
||||
|
||||
visit(tree, None)
|
||||
return found
|
||||
|
||||
|
||||
def sessions_before_a_window(sources: Dict[str, str]) -> List[str]:
|
||||
"""Where a session is asked for before the first window of its function: one line per place, ``file:line``, what and how to correct it."""
|
||||
functions = [(path, function, owner, _own_calls(function)) for path, source in sources.items() for function, owner in _functions(ast.parse(source))]
|
||||
creators: Set[str] = set(PRIMITIVES)
|
||||
|
||||
def asks(call: ast.Call) -> bool:
|
||||
return _name(call) in creators or (bool(call.args) and isinstance(call.args[0], ast.Constant) and call.args[0].value == NEW_SESSION)
|
||||
|
||||
helpers: Set[int] = set()
|
||||
grew = True
|
||||
while grew:
|
||||
grew = False
|
||||
for index, (_, function, owner, calls) in enumerate(functions):
|
||||
if index in helpers or not any(asks(c) for c in calls):
|
||||
continue
|
||||
if not any(_opens_a_window(c) or _name(c) in LAUNCHERS for c in calls):
|
||||
helpers.add(index)
|
||||
creators.add(owner if function.name == "__init__" and owner else function.name)
|
||||
grew = True
|
||||
out: List[str] = []
|
||||
for index, (path, function, _, calls) in enumerate(functions):
|
||||
if index in helpers:
|
||||
continue
|
||||
windows = [(c.lineno, c.col_offset) for c in calls if _opens_a_window(c)]
|
||||
for call in calls:
|
||||
if asks(call) and not any(at < (call.lineno, call.col_offset) for at in windows):
|
||||
out.append("%s:%d: %s asks for a Marionette session before any page of %s() is open (NewSession is answered only once a window exists, and the wrapper launches "
|
||||
"with -silent: the socket times out after 300 s); open the page first (page = browser.new_page()), then ask for the session" % (path, call.lineno, _name(call) or NEW_SESSION, function.name))
|
||||
return out
|
||||
|
||||
|
||||
def _sources() -> Dict[str, str]:
|
||||
files: Dict[str, str] = {}
|
||||
for folder in ("tests", "scripts"):
|
||||
for path in sorted((ROOT / folder).rglob("*.py")):
|
||||
if "vendor" in path.parts or "__pycache__" in path.parts:
|
||||
continue
|
||||
files[path.relative_to(ROOT).as_posix()] = path.read_text(encoding="utf-8")
|
||||
return files
|
||||
|
||||
|
||||
def test_no_test_or_script_asks_for_a_session_before_its_first_page():
|
||||
found = sessions_before_a_window(_sources())
|
||||
assert not found, "\n".join(found)
|
||||
|
||||
|
||||
OLD_ORDER = """
|
||||
def run(firefox_binary, case):
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
chrome = Chrome()
|
||||
return measure(browser.new_page(), chrome)
|
||||
"""
|
||||
OLD_ORDER_THROUGH_A_HELPER = """
|
||||
def open_chrome(port):
|
||||
m = _Marionette(port)
|
||||
m.call("WebDriver:NewSession", {})
|
||||
return m
|
||||
|
||||
def test_it(firefox_binary):
|
||||
with InvisiblePlaywright(binary_path=firefox_binary) as browser:
|
||||
m = open_chrome(1)
|
||||
browser.new_page()
|
||||
"""
|
||||
OLD_ORDER_RAW = """
|
||||
def test_it(firefox_binary):
|
||||
with InvisiblePlaywright(binary_path=firefox_binary) as browser:
|
||||
m = _Marionette(marionette_active_port())
|
||||
m.call("WebDriver:NewSession", {})
|
||||
page = browser.new_page()
|
||||
"""
|
||||
NEW_ORDER = """
|
||||
class Chrome:
|
||||
def __init__(self, page):
|
||||
self._m = _Marionette(marionette_active_port())
|
||||
|
||||
def run(firefox_binary, case):
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
page = browser.new_page()
|
||||
chrome = Chrome(page)
|
||||
return measure(page, chrome)
|
||||
|
||||
def retail():
|
||||
process = subprocess.Popen([exe, "-no-remote", "about:blank"])
|
||||
m = _Marionette(marionette_active_port())
|
||||
m.call("WebDriver:NewSession", {})
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source", [OLD_ORDER, OLD_ORDER_THROUGH_A_HELPER, OLD_ORDER_RAW], ids=["class", "helper", "raw"])
|
||||
def test_the_scan_sees_the_old_order(source):
|
||||
sources = {"synthetic.py": source + "\nclass Chrome:\n def __init__(self):\n self._m = _Marionette(marionette_active_port())\n"}
|
||||
assert sessions_before_a_window(sources), "the scan does not see a session asked for before the first page:\n" + source
|
||||
|
||||
|
||||
def test_the_scan_lets_the_page_first_through():
|
||||
assert sessions_before_a_window({"synthetic.py": NEW_ORDER}) == []
|
||||
|
||||
|
||||
def test_chrome_takes_the_page_and_nothing_makes_it_without():
|
||||
parameters = list(inspect.signature(_stock_twin.Chrome).parameters.values())
|
||||
assert [p.name for p in parameters] == ["page"] and parameters[0].default is inspect.Parameter.empty, (
|
||||
"Chrome must take the page of the launch as its one required argument (found %r): without it the session can be asked before the window exists" % (parameters,))
|
||||
with pytest.raises(TypeError):
|
||||
_stock_twin.Chrome(None)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------- the behaviour, on a Marionette that waits for a window
|
||||
|
||||
class World:
|
||||
"""The engine started with ``-silent``: no window until a page is opened. ``NewSession`` is answered then, and times out as the socket does before it."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.window = False
|
||||
self.sessions = 0
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def world(monkeypatch):
|
||||
state = World()
|
||||
|
||||
class FakeMarionette:
|
||||
def __init__(self, port, timeout=120.0):
|
||||
self.closed = False
|
||||
|
||||
def call(self, name, params=None):
|
||||
if name == NEW_SESSION:
|
||||
if not state.window:
|
||||
raise TimeoutError("timed out: no answer to WebDriver:NewSession (the engine has no window)")
|
||||
state.sessions += 1
|
||||
return {"value": "{}"}
|
||||
|
||||
def close(self):
|
||||
self.closed = True
|
||||
|
||||
class FakePage:
|
||||
def evaluate(self, expression):
|
||||
return {}
|
||||
|
||||
class FakeBrowser:
|
||||
def new_page(self):
|
||||
state.window = True
|
||||
return FakePage()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def launch_case(binary, case, **kwargs):
|
||||
state.window = False
|
||||
yield FakeBrowser()
|
||||
|
||||
monkeypatch.setattr(webfont_probe, "_Marionette", FakeMarionette)
|
||||
monkeypatch.setattr(webfont_probe, "marionette_active_port", lambda *a, **k: 1)
|
||||
monkeypatch.setattr(_stock_twin, "launch_case", launch_case)
|
||||
monkeypatch.setattr(_retail_reference, "launch_case", launch_case)
|
||||
return state
|
||||
|
||||
|
||||
def test_the_fake_engine_does_not_answer_a_session_asked_before_its_first_page(world):
|
||||
marionette = webfont_probe._Marionette(webfont_probe.marionette_active_port())
|
||||
with pytest.raises(TimeoutError):
|
||||
marionette.call(NEW_SESSION, {"capabilities": {"alwaysMatch": {}}})
|
||||
|
||||
|
||||
def test_ours_gets_the_answer_of_its_session_in_a_twin(world):
|
||||
record = _stock_twin._on_ours("1920x1080-dpr1.0", "not-launched", lambda page, chrome: {"scales": chrome.scales()})
|
||||
assert world.sessions == 1
|
||||
assert record["scales"]["page"] == {}
|
||||
|
||||
|
||||
def test_ours_gets_the_answer_of_its_session_in_a_retail_twin(world, monkeypatch):
|
||||
scales = {"scales": {"chrome_outer": [800, 600], "chrome_inner": [790, 500]}}
|
||||
|
||||
class FakeRetail:
|
||||
def __init__(self, executable, dpr):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc):
|
||||
return False
|
||||
|
||||
def set_inner_size(self, inner):
|
||||
return {"outer": [800, 600], "inner": [790, 500], "asked_outer": [800, 600]}
|
||||
|
||||
monkeypatch.setattr(_retail_reference, "retail_executable", lambda: "retail")
|
||||
monkeypatch.setattr(_retail_reference, "RetailSession", FakeRetail)
|
||||
monkeypatch.setattr(_retail_reference, "RetailDriver", lambda session: object())
|
||||
retail, ours = _retail_reference.run_retail_twin("1920x1080-dpr1.0", "not-launched", lambda driver: {"scales": dict(scales["scales"])})
|
||||
assert world.sessions == 1
|
||||
assert ours["scales"]["chrome_outer"] == [800, 600] and retail["scales"]["window_asked_outer"] == [800, 600]
|
||||
@@ -0,0 +1,406 @@
|
||||
"""A page function that the client's call reaches sees only the page's own frames: no eval code, no debugger code, no function of the client.
|
||||
|
||||
A page can read `new Error().stack` and `fn.caller` inside any function of its own. When the client runs `page.evaluate("() => probe()")` the page function is called by
|
||||
a function the automation compiled, and a page that looks sees it: an `eval code` / `debugger eval code` line below its own frame and a `probe.caller` that is the
|
||||
client's function. Retail Firefox, where the page is called by an extension content script or by the browser itself, shows page frames only and `caller` is null
|
||||
(a function called from native code or from privileged code has no content caller).
|
||||
|
||||
Ten cases, each says what it saw in its message:
|
||||
1. `page.evaluate("() => probe()")`: every line of the stack names the page's script (`name@URL:line:col`), the first one is `probe`, and `probe.caller` is null;
|
||||
2. `page.evaluate("() => a()")` with `a` calling `b` calling `probe`: exactly three lines, `probe`, `b`, `a`, in this order, and nothing else (`probe.caller` is the page's own `b`);
|
||||
3. `page.evaluate("() => { setTimeout(probe2, 0) }")`: the stack of the timer callback is read later from `window.__timer`: one page frame, `probe2`, and a null caller;
|
||||
4. a click listener of the page records its stack and `arguments.callee.caller`, the client does `page.click('#btn')`: the listener is the only frame and the caller is null;
|
||||
5. `page.evaluate("() => { throw new Error('x') }")` still raises in the client, with the message;
|
||||
6. the atoms (`Page.elementAtom`, `isElementDisplayed` and `getVisibleText`, sent raw: no client call reaches them) run in the engine's own sandbox over Xrays: the page wrapped
|
||||
`getClientRects`, `getBoundingClientRect`, `checkVisibility`, `getComputedStyle`, the `innerText` and `textContent` getters, and each wrapper was either never called (the
|
||||
expectation, through Xrays) or, if called, saw only page frames and a null caller;
|
||||
7. a `securitypolicyviolation` the client's evaluate causes (an image under `img-src 'none'`) reports a `sourceFile` that is not a location of the client's world;
|
||||
8. an uncaught error thrown by a listener the client's evaluate registered, triggered by the page itself (its own listener, run when the test clicks a trigger button), reaches `window.onerror` with a file, line, column and stack
|
||||
that name no location of the client's world.
|
||||
9. the same as 8 with `throw 5` (not an Error): file, line and column told to `window.onerror` name no location of the client's world;
|
||||
10. `import()` called by the client's evaluate asks the server for the module like the page's own `import()` of an inline script does: the same path base and the same Referer, none of them a
|
||||
location of the client's world (the server records the path and the Referer of every request of the module).
|
||||
Cases 7 to 10 each have a control that the page makes itself (a violation, a throwing listener), which must name the page's own script: it proves the page's record works.
|
||||
What stock gives for 7 to 10 is not known from a measurement (no browser runs here): the expectation asserted is the one that holds on any engine that hides its world, "not a
|
||||
location of the world", and the message says what was seen, so a first run shows the stock value.
|
||||
|
||||
WHAT STOCK GIVES, and how it is derived (nothing was measured here: no browser runs on this machine). In Firefox the stack of an `Error` is the chain of JS frames of the
|
||||
current JS stack that the reader may see, and `Function.prototype.caller` is the JS function below on that same stack, null when the one below is native or privileged.
|
||||
A timer callback (case 3) and an event listener of a trusted event (case 4) are called by the event loop and by the event dispatch, which are native: the listener or the
|
||||
callback is the BOTTOM of the JS stack, so one line and a null caller. Playwright's own click on stock Firefox is a protocol `Input.dispatchMouseEvent`, which reaches the
|
||||
page as a native event and runs no function of the page's world, so the listener is alone. A page function called by the client's `evaluate` (cases 1 and 2) is the bottom of
|
||||
the page's chain when the call comes from privileged code: stock's evaluate runs the function in the page's world through the browser's own call, so `probe` is the bottom of
|
||||
the stack in case 1 and `a` in case 2. The two readings that differ from these are exactly what the cases catch: an extra line that is not the script of the page, or a caller.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import threading
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from _servers import LocalServer
|
||||
from _waits import wait_until
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Far beyond what a healthy run needs; it is the only clock the verdict depends on.
|
||||
DEADLINE = 30.0
|
||||
|
||||
PAGE = b"""<!doctype html><title>frames</title><button id="btn">go</button><script src="/page.js"></script>"""
|
||||
|
||||
SCRIPT = b"""function probe() {
|
||||
return {stack: new Error().stack,
|
||||
caller: probe.caller === null ? null : typeof probe.caller,
|
||||
callerSrc: probe.caller ? String(probe.caller).slice(0, 80) : null};
|
||||
}
|
||||
function a() { return b(); }
|
||||
function b() { return probe(); }
|
||||
function probe2() {
|
||||
window.__timer = {stack: new Error().stack, caller: probe2.caller === null ? null : typeof probe2.caller};
|
||||
}
|
||||
document.getElementById('btn').addEventListener('click', function listener() {
|
||||
var caller = arguments.callee.caller;
|
||||
window.__click = {stack: new Error().stack, caller: caller === null ? null : typeof caller};
|
||||
});
|
||||
"""
|
||||
|
||||
#: The page of the atoms: a visible element and a hidden one, and a script that wraps what the atoms (Marionette's `isElementDisplayed` and `getVisibleText`) could read
|
||||
#: of the page's elements: the methods `getClientRects`, `getBoundingClientRect`, `checkVisibility` of Element, `getComputedStyle` of the window, and the getters
|
||||
#: `innerText` of HTMLElement and `textContent` of Node. Each wrapper counts the call and records `new Error().stack` and the type of its own `caller`; the page calls
|
||||
#: each one once itself at load (the control: a count of 1 proves the wrapper runs when something calls it).
|
||||
ATOMS_PAGE = b"""<!doctype html><title>atoms</title><p id="shown">hello visible world</p><p id="none" style="display:none">secret</p><script src="/atoms.js"></script>"""
|
||||
|
||||
ATOMS_SCRIPT = b"""window.__calls = {}; window.__seen = {}; window.__wrapped = [];
|
||||
function record(key, stack, caller) {
|
||||
window.__calls[key] = (window.__calls[key] || 0) + 1;
|
||||
(window.__seen[key] = window.__seen[key] || []).push({stack: stack, caller: caller});
|
||||
}
|
||||
function wrapMethod(owner, name) {
|
||||
if (typeof owner[name] !== 'function') return;
|
||||
var orig = owner[name];
|
||||
var w = function w() { record(name, new Error().stack, w.caller === null ? null : typeof w.caller); return orig.apply(this, arguments); };
|
||||
Object.defineProperty(owner, name, {value: w, writable: true, configurable: true});
|
||||
window.__wrapped.push(name);
|
||||
}
|
||||
function wrapGetter(owner, name) {
|
||||
var d = Object.getOwnPropertyDescriptor(owner, name);
|
||||
if (!d || !d.get) return;
|
||||
var g = function g() { record(name, new Error().stack, g.caller === null ? null : typeof g.caller); return d.get.call(this); };
|
||||
Object.defineProperty(owner, name, {get: g, set: d.set, configurable: true});
|
||||
window.__wrapped.push(name);
|
||||
}
|
||||
wrapMethod(Element.prototype, 'getClientRects');
|
||||
wrapMethod(Element.prototype, 'getBoundingClientRect');
|
||||
wrapMethod(Element.prototype, 'checkVisibility');
|
||||
wrapMethod(window, 'getComputedStyle');
|
||||
wrapGetter(HTMLElement.prototype, 'innerText');
|
||||
wrapGetter(Node.prototype, 'textContent');
|
||||
window.__reset = function () { window.__calls = {}; window.__seen = {}; };
|
||||
var el = document.getElementById('shown');
|
||||
el.getClientRects(); el.getBoundingClientRect(); if (el.checkVisibility) el.checkVisibility();
|
||||
getComputedStyle(el); void el.innerText; void el.textContent;
|
||||
"""
|
||||
|
||||
#: Case 7: a page under `img-src 'none'` that records every `securitypolicyviolation` (file, line, column, what was blocked); the page causes one itself at load (the control).
|
||||
CSP_PAGE = b"""<!doctype html><title>csp</title><body><script src="/csp.js"></script>"""
|
||||
CSP_SCRIPT = b"""window.__violations = [];
|
||||
document.addEventListener('securitypolicyviolation', function (e) {
|
||||
window.__violations.push({file: e.sourceFile, line: e.lineNumber, column: e.columnNumber, blocked: e.blockedURI});
|
||||
});
|
||||
var img = document.createElement('img'); img.src = '/by-the-page.png'; document.body.appendChild(img);
|
||||
"""
|
||||
|
||||
#: Case 8: a page whose `window.onerror` records what it is told; a listener of the page on #c that throws (the control), a button #b for the client's listener, and
|
||||
#: `fire`, which the page itself runs when the test clicks a trigger button (#go-b, #go-c, #go-d): the page's own listener of the trigger clicks the target.
|
||||
OE_PAGE = b"""<!doctype html><title>oe</title><button id="b">b</button><button id="c">c</button><button id="d">d</button><button id="go-b">go-b</button><button id="go-c">go-c</button><button id="go-d">go-d</button><script src="/oe.js"></script>"""
|
||||
OE_SCRIPT = b"""window.__oe = null;
|
||||
window.onerror = function (msg, file, line, col, err) { window.__oe = {msg: String(msg), file: file, line: line, col: col, stack: err && err.stack}; };
|
||||
document.getElementById('c').addEventListener('click', function () { throw new Error('page-made'); });
|
||||
document.getElementById('d').addEventListener('click', function () { throw 5; });
|
||||
function fire(id) { document.getElementById(id).click(); }
|
||||
['b', 'c', 'd'].forEach(function (id) { document.getElementById('go-' + id).addEventListener('click', function () { fire(id); }); });
|
||||
"""
|
||||
|
||||
#: What identifies the client's world in anything a page reads: the code of an evaluate, the debugger's code, the engine's own URLs.
|
||||
WORLD_MARKERS = ("debugger eval", "eval code", "eval", "chrome://", "resource://", "moz-extension://", "juggler", "about:", "createElement('img')", "=>")
|
||||
|
||||
|
||||
def _world_marks(text):
|
||||
return [m for m in WORLD_MARKERS if m in (text or "")]
|
||||
|
||||
#: Case 10: a page whose own inline script imports a module at load (the control); the server records the path and the Referer of every request of `/mod.js`.
|
||||
#: The control is an INLINE classic script of the document: a dynamic import() takes its referrer and base from the script that runs it, so the inline one has the document's URL
|
||||
#: as the evaluate's import has. `/imp.js` makes a second import (`from=file`), informational only: its referrer is the script file, and nothing is compared with it.
|
||||
IMP_PAGE = b"""<!doctype html><title>imp</title><script>window.__imported = import('/mod.js?from=page').then(function (m) { return m.default; });</script><script src="/imp.js"></script>"""
|
||||
IMP_SCRIPT = b"""window.__file = import('/mod.js?from=file').then(function (m) { return m.default; });"""
|
||||
MOD_SCRIPT = b"export default 1;"
|
||||
|
||||
|
||||
class _Handler(BaseHTTPRequestHandler):
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
path = self.path.split("?", 1)[0]
|
||||
if path == "/mod.js":
|
||||
self.server.requests.append((self.path, self.headers.get("Referer")))
|
||||
body, kind = {
|
||||
"/imp": (IMP_PAGE, "text/html; charset=utf-8"),
|
||||
"/imp.js": (IMP_SCRIPT, "application/javascript"),
|
||||
"/mod.js": (MOD_SCRIPT, "application/javascript"),
|
||||
"/csp": (CSP_PAGE, "text/html; charset=utf-8"),
|
||||
"/csp.js": (CSP_SCRIPT, "application/javascript"),
|
||||
"/oe": (OE_PAGE, "text/html; charset=utf-8"),
|
||||
"/oe.js": (OE_SCRIPT, "application/javascript"),
|
||||
"/page.js": (SCRIPT, "application/javascript"),
|
||||
"/atoms": (ATOMS_PAGE, "text/html; charset=utf-8"),
|
||||
"/atoms.js": (ATOMS_SCRIPT, "application/javascript"),
|
||||
}.get(path, (PAGE, "text/html; charset=utf-8"))
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", kind)
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
if path == "/csp":
|
||||
self.send_header("Content-Security-Policy", "img-src 'none'")
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def site():
|
||||
srv = LocalServer(("127.0.0.1", 0), _Handler)
|
||||
srv.requests = []
|
||||
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
||||
try:
|
||||
yield SimpleNamespace(url="http://127.0.0.1:%d/" % srv.server_address[1], requests=srv.requests)
|
||||
finally:
|
||||
srv.shutdown()
|
||||
srv.server_close()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def invisible(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4275, binary_path=firefox_binary, headless=True) as b:
|
||||
yield b
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def page(invisible, site):
|
||||
context = invisible.new_context()
|
||||
page = context.new_page()
|
||||
page.goto(site.url, wait_until="load")
|
||||
try:
|
||||
yield page
|
||||
finally:
|
||||
context.close()
|
||||
|
||||
|
||||
def _frames(stack):
|
||||
return [line for line in stack.splitlines() if line.strip()]
|
||||
|
||||
|
||||
def _names(stack, site):
|
||||
"""The function names of a stack whose every line is `name@<script of the page>:line:col`; a line that is anything else comes back as itself, so the assertion shows it."""
|
||||
pattern = re.compile(r"([^@\s]*)@" + re.escape(site.url + "page.js") + r":\d+:\d+")
|
||||
names = []
|
||||
for line in _frames(stack):
|
||||
found = pattern.fullmatch(line)
|
||||
names.append(found.group(1) if found else "NOT A FRAME OF THE PAGE'S SCRIPT: %r" % line)
|
||||
return names
|
||||
|
||||
|
||||
def test_a_function_called_by_evaluate_sees_only_its_own_frame_and_no_caller(page, site):
|
||||
seen = page.evaluate("() => probe()")
|
||||
assert _names(seen["stack"], site) == ["probe"], "the page's function called by evaluate saw this stack: %r" % seen["stack"]
|
||||
assert seen["caller"] is None, "the page's function called by evaluate saw a caller of type %r: %r" % (seen["caller"], seen["callerSrc"])
|
||||
|
||||
|
||||
def test_a_chain_of_page_functions_called_by_evaluate_shows_exactly_the_three_page_frames(page, site):
|
||||
seen = page.evaluate("() => a()")
|
||||
assert _names(seen["stack"], site) == ["probe", "b", "a"], "the chain a, b, probe called by evaluate saw this stack: %r" % seen["stack"]
|
||||
assert seen["caller"] == "function" and (seen["callerSrc"] or "").startswith("function b"), (
|
||||
"probe.caller in the chain was %r, %r (expected the page's own b)" % (seen["caller"], seen["callerSrc"]))
|
||||
|
||||
|
||||
def test_a_timer_callback_the_client_started_has_only_its_own_frame_and_no_caller(page, site):
|
||||
page.evaluate("() => { setTimeout(probe2, 0); }")
|
||||
# The client is a sync one: events are delivered while it calls the browser, so the wait is a call.
|
||||
seen = {}
|
||||
|
||||
def read():
|
||||
seen["timer"] = page.evaluate("() => window.__timer || null")
|
||||
return seen["timer"]
|
||||
|
||||
assert wait_until(read, DEADLINE, lambda: page.wait_for_timeout(50)), "the timer callback of the page never ran (after %.0f s)" % DEADLINE
|
||||
timer = seen["timer"]
|
||||
assert _names(timer["stack"], site) == ["probe2"], "the timer callback saw this stack: %r" % timer["stack"]
|
||||
assert timer["caller"] is None, "the timer callback saw a caller of type %r" % timer["caller"]
|
||||
|
||||
|
||||
def test_a_click_listener_of_the_page_has_only_its_own_frame_and_no_caller_when_the_client_clicks(page, site):
|
||||
page.click("#btn")
|
||||
seen = {}
|
||||
|
||||
def read():
|
||||
seen["click"] = page.evaluate("() => window.__click || null")
|
||||
return seen["click"]
|
||||
|
||||
assert wait_until(read, DEADLINE, lambda: page.wait_for_timeout(50)), "the click listener of the page never ran (after %.0f s)" % DEADLINE
|
||||
click = seen["click"]
|
||||
assert _names(click["stack"], site) == ["listener"], "the click listener saw this stack: %r" % click["stack"]
|
||||
assert click["caller"] is None, "the click listener saw a caller of type %r" % click["caller"]
|
||||
|
||||
|
||||
def test_an_error_thrown_by_an_evaluate_still_reaches_the_client_with_its_message(page):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
with pytest.raises(Error) as raised:
|
||||
page.evaluate("() => { throw new Error('x') }")
|
||||
assert "x" in str(raised.value), "the client raised %r for a thrown Error('x'): the message is lost" % str(raised.value)
|
||||
|
||||
|
||||
def _raw_atom(page, handle, atom):
|
||||
"""What `Page.elementAtom` answers for the element of `handle`, sent on the in-process connection of the page's session as tests/test_page_element_atoms_run_in_a_sandbox_e2e.py does."""
|
||||
impl = handle._impl_obj
|
||||
server = impl._connection._transport._server
|
||||
element = server.object(impl._guid)
|
||||
injected = server.object(page._impl_obj._guid).injected
|
||||
return injected.c.send(
|
||||
"Page.elementAtom",
|
||||
{"frameId": element.frame.frame_id, "objectId": element.object_id, "atom": atom},
|
||||
session=injected.session, timeout=None)["result"]
|
||||
|
||||
|
||||
def test_the_atoms_call_nothing_of_the_page_or_are_seen_with_page_frames_only(invisible, site):
|
||||
context = invisible.new_context()
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto(site.url + "atoms", wait_until="load")
|
||||
handles = [page.query_selector("#shown"), page.query_selector("#none")]
|
||||
control = page.evaluate("() => ({calls: {...window.__calls}, wrapped: window.__wrapped})")
|
||||
wrong = {key: control["calls"].get(key) for key in control["wrapped"] if control["calls"].get(key) != 1}
|
||||
assert control["wrapped"] and not wrong, "the page's own call of each wrapper did not count 1 (the wrappers do not work as the test needs): %r of %r" % (wrong, control["wrapped"])
|
||||
page.evaluate("() => window.__reset()")
|
||||
|
||||
for handle in handles:
|
||||
for atom in ("isElementDisplayed", "getVisibleText"):
|
||||
_raw_atom(page, handle, atom)
|
||||
after = page.evaluate("() => ({calls: window.__calls, seen: window.__seen})")
|
||||
finally:
|
||||
context.close()
|
||||
|
||||
pattern = re.compile(r"[^@\s]*@" + re.escape(site.url + "atoms.js") + r":\d+:\d+")
|
||||
bad = []
|
||||
for key, entries in after["seen"].items():
|
||||
for entry in entries:
|
||||
lines = _frames(entry["stack"])
|
||||
if not lines or not all(pattern.fullmatch(line) for line in lines) or entry["caller"] is not None:
|
||||
bad.append("%s: stack %r, caller %r" % (key, entry["stack"], entry["caller"]))
|
||||
assert not bad, "the atoms called %r of the page's wrappers (call counts), and these calls saw more than page frames or a caller: %s" % (after["calls"], "; ".join(bad))
|
||||
|
||||
|
||||
def test_a_violation_the_clients_evaluate_causes_does_not_name_a_location_of_the_clients_world(invisible, site):
|
||||
context = invisible.new_context()
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto(site.url + "csp", wait_until="load")
|
||||
|
||||
def violations():
|
||||
return page.evaluate("() => window.__violations.slice()")
|
||||
|
||||
assert wait_until(lambda: len(violations()) >= 1, DEADLINE, lambda: page.wait_for_timeout(50)), (
|
||||
"the violation the page itself causes was never recorded (after %.0f s)" % DEADLINE)
|
||||
control = violations()[0]
|
||||
assert control["file"].endswith("/csp.js"), "the control (a violation caused by the page's own script) reported the file %r, not the page's script" % control["file"]
|
||||
page.evaluate("() => { const i = document.createElement('img'); i.src = '/by-evaluate.png'; document.body.appendChild(i); }")
|
||||
assert wait_until(lambda: len(violations()) >= 2, DEADLINE, lambda: page.wait_for_timeout(50)), (
|
||||
"the violation the client's evaluate causes was never recorded (after %.0f s): %r" % (DEADLINE, violations()))
|
||||
seen = violations()[1]
|
||||
finally:
|
||||
context.close()
|
||||
assert "by-evaluate" in seen["blocked"], "the second violation was not the evaluate's: %r" % seen
|
||||
marks = _world_marks(seen["file"])
|
||||
assert not marks, "the violation caused by the client's evaluate reported sourceFile %r (line %r, column %r), which names the client's world (%r)" % (
|
||||
seen["file"], seen["line"], seen["column"], marks)
|
||||
|
||||
|
||||
def test_an_error_thrown_by_a_listener_the_clients_evaluate_registered_names_no_location_of_the_clients_world(invisible, site):
|
||||
context = invisible.new_context()
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto(site.url + "oe", wait_until="load")
|
||||
|
||||
def heard():
|
||||
return page.evaluate("() => window.__oe")
|
||||
|
||||
# the control: a listener the page made throws, the page's onerror names the page's script
|
||||
page.click("#go-c")
|
||||
assert wait_until(heard, DEADLINE, lambda: page.wait_for_timeout(50)), "the page's own throwing listener never reached window.onerror (after %.0f s)" % DEADLINE
|
||||
control = heard()
|
||||
assert str(control["file"]).endswith("/oe.js"), "the control (a listener made by the page) reported the file %r, not the page's script: %r" % (control["file"], control)
|
||||
page.evaluate("() => { window.__oe = null; }")
|
||||
|
||||
# the listener is made IN the evaluate; the test clicks the trigger, and the PAGE (its own function `fire`, run by its own listener of the trigger) clicks the button
|
||||
page.evaluate("() => { document.getElementById('b').addEventListener('click', () => { throw new Error('w'); }); }")
|
||||
page.click("#go-b")
|
||||
assert wait_until(heard, DEADLINE, lambda: page.wait_for_timeout(50)), (
|
||||
"the error thrown by the listener of the client's evaluate never reached window.onerror (after %.0f s)" % DEADLINE)
|
||||
seen = heard()
|
||||
finally:
|
||||
context.close()
|
||||
marks = {name: _world_marks(str(seen[name])) for name in ("file", "stack")}
|
||||
assert not any(marks.values()), "window.onerror was told file %r, line %r, column %r, stack %r for the error of the evaluate's listener: it names the client's world (%r)" % (
|
||||
seen["file"], seen["line"], seen["col"], seen["stack"], marks)
|
||||
|
||||
|
||||
def test_a_non_error_thrown_by_a_listener_the_clients_evaluate_registered_names_no_location_of_the_clients_world(invisible, site):
|
||||
context = invisible.new_context()
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto(site.url + "oe", wait_until="load")
|
||||
|
||||
def heard():
|
||||
return page.evaluate("() => window.__oe")
|
||||
|
||||
# the control: a listener the page made does `throw 5`, the page's onerror names the page's script
|
||||
page.click("#go-d")
|
||||
assert wait_until(heard, DEADLINE, lambda: page.wait_for_timeout(50)), "the page's own `throw 5` never reached window.onerror (after %.0f s)" % DEADLINE
|
||||
control = heard()
|
||||
assert str(control["file"]).endswith("/oe.js"), "the control (`throw 5` in a listener made by the page) reported the file %r, not the page's script: %r" % (control["file"], control)
|
||||
page.evaluate("() => { window.__oe = null; }")
|
||||
|
||||
page.evaluate("() => { document.getElementById('b').addEventListener('click', () => { throw 5; }); }")
|
||||
page.click("#go-b")
|
||||
assert wait_until(heard, DEADLINE, lambda: page.wait_for_timeout(50)), (
|
||||
"the `throw 5` of the listener of the client's evaluate never reached window.onerror (after %.0f s)" % DEADLINE)
|
||||
seen = heard()
|
||||
finally:
|
||||
context.close()
|
||||
marks = _world_marks(str(seen["file"]))
|
||||
assert not marks, "window.onerror was told file %r, line %r, column %r (message %r) for the `throw 5` of the evaluate's listener: it names the client's world (%r)" % (
|
||||
seen["file"], seen["line"], seen["col"], seen["msg"], marks)
|
||||
|
||||
|
||||
def test_an_import_called_by_the_clients_evaluate_asks_for_the_module_as_the_pages_own_import_does(invisible, site):
|
||||
context = invisible.new_context()
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto(site.url + "imp", wait_until="load")
|
||||
assert page.evaluate("() => window.__imported") == 1, "the page's own import() did not give the module"
|
||||
assert page.evaluate("() => window.__file") == 1, "the import() of the page's script file did not give the module"
|
||||
# `.then` only so that the answer is a number the client can carry (a module namespace is not serializable); the request is the import's
|
||||
assert page.evaluate("() => import('/mod.js?from=world').then(m => m.default)") == 1, "the import() of the client's evaluate did not give the module"
|
||||
finally:
|
||||
context.close()
|
||||
asked = dict(site.requests)
|
||||
assert "/mod.js?from=page" in asked and "/mod.js?from=world" in asked, "the server heard these requests of the module (path, Referer): %r" % site.requests
|
||||
page_referer, world_referer = asked["/mod.js?from=page"], asked["/mod.js?from=world"]
|
||||
assert world_referer == page_referer, "the import() of the client's evaluate came with the Referer %r, the page's own import() with %r (the import() of the script file had %r; requests: %r)" % (
|
||||
world_referer, page_referer, asked.get("/mod.js?from=file"), site.requests)
|
||||
for who, referer in (("page", page_referer), ("world", world_referer)):
|
||||
assert not _world_marks(referer), "the Referer of the %s's import() is %r, which names the client's world (%r)" % (who, referer, _world_marks(referer))
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
"""With `headless=True` a page sees no pointer or mouse event until the test's own first input.
|
||||
|
||||
What it proves: the engine runs on the core's own hidden display (an Xvfb on Linux, a private desktop on Windows), and
|
||||
the host pointer is not part of it. A page that listens from the first line of its `<head>` hears nothing at all with no
|
||||
input: no `pointerover`, `pointerenter`, `mouseover` or `mouseenter` at the centre of the screen, no move, no wheel. The
|
||||
first thing it hears is what the test's own `page.mouse.move` makes, at the point the test asked for, trusted.
|
||||
|
||||
Why it matters: an event the page hears before any input is an input nobody made. A real user's page gets its first
|
||||
`mouseover` when the pointer enters it, at the place the pointer is, never at the centre of the screen on its birth. The
|
||||
pointer of the host is the one thing the hidden display must not give the page: whatever the machine's cursor is doing
|
||||
(the runner's, a person's at their desk) is not something a page may read.
|
||||
|
||||
Measured on the published engine (run 46840604601 of this repository): every page on Linux got a trusted
|
||||
`pointerover`, `pointerenter`, `mouseover` and `mouseenter` at the centre of the screen with no input at all, 42 to 160 ms
|
||||
after its birth, and Windows got none. The engine makes its window ignore the host pointer on that display, on both systems.
|
||||
|
||||
How the proof is made, with no clock. What must not happen is an event that arrives on its own, and "nothing arrived in
|
||||
some time" would judge the machine. So the proof is an outcome: after `TURNS` frames of the page (a count of the page's own
|
||||
`requestAnimationFrame` turns, never a time) the test makes ONE input, a `page.mouse.move` to a point that is not the centre
|
||||
of the screen, and waits until the page has recorded it. The page must then have recorded, as its very first pointer or
|
||||
mouse event, the one that move made: an over, an enter or a move at that point, trusted. A crossing made by the host pointer
|
||||
is synthesized on layout and paint, within the first frames of a page, so it lands before the move and is the first event
|
||||
the page recorded: the test is red on it, with the event in the message.
|
||||
|
||||
Two tests, one launch each, on Linux and on Windows:
|
||||
|
||||
* the first input, in three situations: the page the test serves on 127.0.0.1 (first document of its tab); a page that
|
||||
stood on `about:blank` (the recorder is put there by the test); and a page that stood on `about:blank` for its frames with
|
||||
no input and was then navigated to the served page. In each, the sentinel move is the first event recorded;
|
||||
* the first input in full: on the served page, the move is the first event, and every event of it is trusted, at (x, y) in
|
||||
client coordinates, and of a kind a move alone makes.
|
||||
|
||||
The listeners are on `window` in the capture phase (a `mouseenter` does not bubble) and on `document`. The humaniser is off:
|
||||
the move is one move, not a stroke from somewhere else.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Every pointer and mouse event a page can be given by a pointer that moves, presses or wheels.
|
||||
TYPES = ["pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup",
|
||||
"mouseover", "mouseout", "mouseenter", "mouseleave", "mousemove", "mousedown", "mouseup", "click", "wheel",
|
||||
"contextmenu"]
|
||||
|
||||
#: Frames of the page (its own `requestAnimationFrame` turns) before the sentinel move is made (see the docstring).
|
||||
TURNS = 30
|
||||
|
||||
#: Where the moves go: inside the default viewport, and not at its centre. One per situation of the first test.
|
||||
X, Y = 211, 137
|
||||
POINTS = [(211, 137), (173, 251), (329, 97)]
|
||||
FIRST_KINDS = ("pointerover", "pointerenter", "mouseover", "mouseenter", "pointermove", "mousemove")
|
||||
|
||||
#: The recorder: the page runs it from the first line of its `<head>`, and the test runs it on `about:blank`.
|
||||
RECORDER = """
|
||||
window.__ev = [];
|
||||
window.__turns = 0;
|
||||
(function () {
|
||||
const types = %s;
|
||||
for (const where of [window, document]) {
|
||||
const name = where === window ? 'window' : 'document';
|
||||
for (const t of types) {
|
||||
where.addEventListener(t, e => {
|
||||
window.__ev.push({t: t, via: name, trusted: e.isTrusted, x: e.clientX, y: e.clientY});
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
const turn = () => { window.__turns++; requestAnimationFrame(turn); };
|
||||
requestAnimationFrame(turn);
|
||||
})();
|
||||
""" % repr(TYPES)
|
||||
|
||||
PAGE = """<!doctype html><html><head><meta charset=utf-8><title>listening</title>
|
||||
<script>%s</script>
|
||||
<style>html,body{margin:0;height:100%%}</style></head><body></body></html>""" % RECORDER
|
||||
|
||||
|
||||
def _frames(page):
|
||||
"""Until the page has run `TURNS` frames of its own (a count of its turns, with a deadline)."""
|
||||
page.wait_for_function("(turns) => window.__turns >= turns", arg=TURNS, timeout=30_000)
|
||||
|
||||
|
||||
def _heard(page):
|
||||
return page.evaluate("() => window.__ev")
|
||||
|
||||
|
||||
def _launch(binary, seed):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
return InvisiblePlaywright(seed=seed, binary_path=binary, headless=True, humanize=False)
|
||||
|
||||
|
||||
def _the_move_is_the_first_event(page, point, where):
|
||||
"""One move after the frames; it must be recorded, and be the first event the page recorded."""
|
||||
_frames(page)
|
||||
page.mouse.move(*point)
|
||||
page.wait_for_function("([x, y]) => window.__ev.some(e => e.t === 'mousemove' && e.x === x && e.y === y)",
|
||||
arg=list(point), timeout=30_000)
|
||||
events = _heard(page)
|
||||
first = events[0]
|
||||
assert first["t"] in FIRST_KINDS and (first["x"], first["y"]) == point and first["trusted"], (
|
||||
"%s: the first event the page recorded is %r, not an over, an enter or a move of the move at %r; all: %r" % (where, first, point, events))
|
||||
|
||||
|
||||
def test_a_page_sees_no_pointer_or_mouse_event_before_the_first_input_on_the_hidden_display(firefox_binary):
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/listening", PAGE)
|
||||
with _launch(firefox_binary, 7201) as browser:
|
||||
# a page served on 127.0.0.1, listened to from the first line of its head
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
|
||||
_the_move_is_the_first_event(page, POINTS[0], "the served page")
|
||||
|
||||
# about:blank itself, with the recorder put there by the test
|
||||
blank = browser.new_page()
|
||||
blank.evaluate("() => { %s }" % RECORDER)
|
||||
_the_move_is_the_first_event(blank, POINTS[1], "about:blank")
|
||||
|
||||
# about:blank first, its frames run with no input, then navigated: the pointer of this tab has not been moved by the
|
||||
# test before its sentinel, so a crossing the page hears first can only be one nobody made
|
||||
later = browser.new_page()
|
||||
later.evaluate("() => { %s }" % RECORDER)
|
||||
_frames(later)
|
||||
later.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
|
||||
_the_move_is_the_first_event(later, POINTS[2], "the page navigated to after about:blank")
|
||||
|
||||
|
||||
def test_the_first_event_a_page_sees_is_the_one_the_first_mouse_move_makes(firefox_binary):
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/listening", PAGE)
|
||||
with _launch(firefox_binary, 7202) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
|
||||
_frames(page)
|
||||
|
||||
page.mouse.move(X, Y)
|
||||
page.wait_for_function("([x, y]) => window.__ev.some(e => e.t === 'mousemove' && e.x === x && e.y === y)",
|
||||
arg=[X, Y], timeout=30_000)
|
||||
events = _heard(page)
|
||||
|
||||
assert events, "the page heard nothing of the move"
|
||||
first = events[0]
|
||||
assert first["t"] in FIRST_KINDS and (first["x"], first["y"]) == (X, Y), (
|
||||
"the first event of the page is %r, not an over, an enter or a move at the move's point %r; all: %r" % (first, (X, Y), events))
|
||||
assert all(e["trusted"] for e in events), "an event of the move is not trusted: %r" % [e for e in events if not e["trusted"]]
|
||||
assert all((e["x"], e["y"]) == (X, Y) for e in events), "an event of the move is not at %r: %r" % ((X, Y), events)
|
||||
assert {e["t"] for e in events} <= set(FIRST_KINDS), (
|
||||
"a move made an event a move does not make: %r" % sorted({e["t"] for e in events} - set(FIRST_KINDS)))
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
"""A page's own `RegExp[Symbol.hasInstance]` and `Date[Symbol.hasInstance]` are never called by the automation while the client listens to console events.
|
||||
|
||||
Retail Firefox never calls them: nothing of the browser asks the page's `RegExp` or `Date` whether a value is an instance of it. The engine's Juggler classifies
|
||||
the arguments of a console message (`rawObj instanceof this._domWindow[className]`, `juggler/content/Runtime.js`, `_createRemoteObject`), and an `instanceof` runs
|
||||
`Symbol.hasInstance` of the constructor on its right: a page that defines it on `RegExp` or `Date` (a plain `Object.defineProperty`, a thing any script can do)
|
||||
counts the calls and learns that something looked at its objects, which no retail Firefox does.
|
||||
|
||||
The page defines the hook on `RegExp` and on `Date` BEFORE any log, and a third one on a class of its own (`Probe`) that the page itself tests once with
|
||||
`instanceof`: that control is 1 when the hook works, so a count of 0 on `RegExp` and `Date` means nothing was called, not that the hook never ran. The client
|
||||
registers `page.on("console")`, the page logs `{}`, `/x/`, `new Date(0)` and `[1]` (an object, a RegExp, a Date, an array: the classification of the engine
|
||||
goes through each of them), the test waits until the client has heard the four, and then reads the counters.
|
||||
|
||||
What the client sees of the two values, and what is checked of it: the wrapper hands the client a console message whose `args` is empty and whose `text` is built
|
||||
from what Juggler sends for each argument (`_console_text`, `_juggler/_marshal.py`; Juggler sends a type and a subtype for an object and no preview). So the client
|
||||
cannot read a "regexp" or a "date" in the message; what it must still see is that the four messages arrive, in the order of the page, each a `log` with a text
|
||||
that is not empty (a classification that threw, or an `instanceof` that was stopped, would lose the message or leave it empty). That is what the last
|
||||
assertions check, for the RegExp and the Date as for the others.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
from collections import namedtuple
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from _servers import LocalServer
|
||||
from _waits import wait_until
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Far beyond what a healthy run needs (a few hundred ms); it is the only clock the verdict depends on.
|
||||
DEADLINE = 30.0
|
||||
|
||||
PAGE = b"""<!doctype html><title>hasinstance</title><script>
|
||||
window.__hits = {re: 0, date: 0, probe: 0};
|
||||
function hook(ctor, key) {
|
||||
Object.defineProperty(ctor, Symbol.hasInstance, {
|
||||
value(o) { window.__hits[key]++; return Function.prototype[Symbol.hasInstance].call(this, o); },
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
hook(RegExp, 're');
|
||||
hook(Date, 'date');
|
||||
class Probe {}
|
||||
hook(Probe, 'probe');
|
||||
// The control: the page itself asks once, so the hook is proved to run when something runs `instanceof`.
|
||||
void ({} instanceof Probe);
|
||||
</script>"""
|
||||
|
||||
#: A page whose `Error.prototype.message` and `Error.prototype.stack` are counting getters (fixed strings, configurable, a no-op setter for `stack`). An error made by
|
||||
#: `new Error('...')` carries its own data property `message`, set by the constructor, so the getter on the prototype is read only by code that reads a
|
||||
#: message the error does not have, and `stack` (an accessor of the prototype in Firefox) only by code that reads the stack of the error.
|
||||
ERRORS_PAGE = b"""<!doctype html><title>errors</title><script>
|
||||
window.__errHits = {message: 0, stack: 0};
|
||||
Object.defineProperty(Error.prototype, 'message', {get() { window.__errHits.message++; return 'page-message'; }, configurable: true});
|
||||
Object.defineProperty(Error.prototype, 'stack', {get() { window.__errHits.stack++; return 'page-stack'; }, set(v) {}, configurable: true});
|
||||
</script>"""
|
||||
|
||||
BLANK_PAGE = b"<!doctype html><title>blank</title>"
|
||||
|
||||
#: The page of the handle reads: an iframe of the same origin (its own document), a visible block, a block far below the fold (a scroll is needed to see it) and a button there.
|
||||
TARGETS_PAGE = b"""<!doctype html><title>targets</title>
|
||||
<style>body {margin: 0} #low {position: absolute; top: 3000px; left: 10px; width: 100px; height: 30px}
|
||||
#btn {position: absolute; top: 3400px; left: 10px; width: 100px; height: 30px}</style>
|
||||
<iframe id="f" srcdoc="<!doctype html><p id=inner>in</p>" style="width: 200px; height: 100px"></iframe>
|
||||
<div id="outer">outer</div><div id="low">low</div><button id="btn">go</button>"""
|
||||
|
||||
#: The four logs of the page, in this order: the classification of Juggler goes through an object, a RegExp, a Date and an array.
|
||||
LOGS = "() => { console.log({}); console.log(/x/); console.log(new Date(0)); console.log([1]); }"
|
||||
KINDS = ["object", "RegExp", "Date", "array"]
|
||||
|
||||
|
||||
class _Handler(BaseHTTPRequestHandler):
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
body = {"/errors": ERRORS_PAGE, "/targets": TARGETS_PAGE, "/blank": BLANK_PAGE}.get(self.path, PAGE)
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/html; charset=utf-8")
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def site():
|
||||
srv = LocalServer(("127.0.0.1", 0), _Handler)
|
||||
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
||||
try:
|
||||
yield SimpleNamespace(url="http://127.0.0.1:%d/" % srv.server_address[1])
|
||||
finally:
|
||||
srv.shutdown()
|
||||
srv.server_close()
|
||||
|
||||
|
||||
def test_the_page_own_regexp_and_date_hasinstance_are_not_called_by_a_console_listener(firefox_binary, site):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
seen = []
|
||||
with InvisiblePlaywright(seed=4271, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.on("console", lambda m: seen.append((m.type, m.text)))
|
||||
page.goto(site.url, wait_until="load")
|
||||
page.evaluate(LOGS)
|
||||
# The client is a sync one: events are delivered while it calls the browser, so the wait is a call.
|
||||
# What is awaited: the client has heard the four console events.
|
||||
wait_until(lambda: len(seen) >= len(KINDS), DEADLINE, lambda: page.wait_for_timeout(50))
|
||||
hits = page.evaluate("() => window.__hits")
|
||||
|
||||
assert len(seen) == len(KINDS), "the client heard %d console events of the 4 the page logged (after %.0f s): %r" % (
|
||||
len(seen), DEADLINE, seen)
|
||||
assert hits["re"] == 0, "the page's RegExp[Symbol.hasInstance] was called %d times while the client listened to console events" % hits["re"]
|
||||
assert hits["date"] == 0, "the page's Date[Symbol.hasInstance] was called %d times while the client listened to console events" % hits["date"]
|
||||
assert hits["probe"] == 1, "the control (the hook of a class of the page, tested once by the page) counted %d, not 1: the hook did not run as the test needs, counters %r" % (
|
||||
hits["probe"], hits)
|
||||
# What the client sees: the four messages, in the order of the page, each a `log` with a text (see the docstring: the wrapper carries no args and no preview).
|
||||
for kind, (type_, text) in zip(KINDS, seen):
|
||||
assert type_ == "log", "the console message of the %s reached the client as type %r, not 'log': %r" % (kind, type_, seen)
|
||||
assert isinstance(text, str) and text.strip(), "the console message of the %s reached the client with the text %r: %r" % (kind, text, seen)
|
||||
|
||||
|
||||
def _raised(page, expression):
|
||||
"""The text of the exception the client raises for `expression`, or None when it raised nothing."""
|
||||
try:
|
||||
page.evaluate(expression)
|
||||
except Exception as exc: # noqa: BLE001 - what the client raises is what is judged
|
||||
return str(exc)
|
||||
return None
|
||||
|
||||
|
||||
def test_the_page_own_error_message_and_stack_getters_are_not_read_when_an_evaluate_fails(firefox_binary, site):
|
||||
"""The page's `Error.prototype.message` and `.stack` are counting getters; an evaluate that throws and one that rejects must not read them, and the client
|
||||
must still get the error's own message: `new Error('boom')` has `message` as its own data property, which the constructor sets and no getter shadows, so
|
||||
the text 'boom' (and 'later') reaches the client in the exception text. The counters are read by a THIRD evaluate that returns a plain object and throws
|
||||
nothing, so the read cannot touch an error itself."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4272, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(site.url + "errors", wait_until="load")
|
||||
thrown = _raised(page, "() => { throw new Error('boom') }")
|
||||
rejected = _raised(page, "() => Promise.reject(new Error('later'))")
|
||||
hits = page.evaluate("() => window.__errHits")
|
||||
|
||||
assert thrown is not None, "the evaluate that throws raised nothing in the client"
|
||||
assert rejected is not None, "the evaluate that returns a rejected promise raised nothing in the client"
|
||||
assert hits == {"message": 0, "stack": 0}, "the page's Error.prototype getters were read while the client evaluated: counters %r (message, stack)" % hits
|
||||
assert "boom" in thrown, "the client's exception for the thrown Error('boom') does not carry its message: %r" % thrown
|
||||
assert "later" in rejected, "the client's exception for the rejected Error('later') does not carry its message: %r" % rejected
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# The arguments of an exposed function cross as the page's own clone would read them
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#: Defines, in the page, a factory of an object whose properties are counting getters (two on the object, one on a nested object), and measures what the PAGE's own
|
||||
#: `structuredClone` reads: the counters of one clone of a fresh object, then reset.
|
||||
CLONE_PROBE = """() => {
|
||||
window.__bp = {a: 0, b: 0, c: 0};
|
||||
window.__make = () => ({
|
||||
get a() { window.__bp.a++; return 1; },
|
||||
get b() { window.__bp.b++; return 2; },
|
||||
nested: {get c() { window.__bp.c++; return 3; }},
|
||||
});
|
||||
structuredClone(window.__make());
|
||||
const clone = {...window.__bp};
|
||||
window.__bp = {a: 0, b: 0, c: 0};
|
||||
return clone;
|
||||
}"""
|
||||
|
||||
|
||||
def test_the_getters_of_an_object_passed_to_an_exposed_function_are_read_as_the_page_s_own_clone_reads_them(firefox_binary, site):
|
||||
"""What a page can count when it calls an exposed function with an object made of getters. `structuredClone` of the same shape reads every own enumerable property
|
||||
ONCE (the two of the object and the one of the nested object), so the page's own clone is 1, 1, 1: that is the count expected here, measured in the page first
|
||||
and not only written as a number. A stock client serializes the arguments of a binding by reading the properties once, to send them, so it is held to the same
|
||||
count. A getter read twice, or a nested one read at another time, is a second reader of the page's objects. What the client receives is what one read of each
|
||||
getter gives: {a: 1, b: 2, nested: {c: 3}}."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
received = []
|
||||
with InvisiblePlaywright(seed=4273, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.expose_function("probe", lambda value: received.append(value))
|
||||
page.goto(site.url + "blank", wait_until="load")
|
||||
cloned = page.evaluate(CLONE_PROBE)
|
||||
page.evaluate("() => window.probe(window.__make())")
|
||||
wait_until(lambda: received, DEADLINE, lambda: page.wait_for_timeout(50))
|
||||
hits = page.evaluate("() => ({...window.__bp})")
|
||||
|
||||
assert cloned == {"a": 1, "b": 1, "c": 1}, "the page's own structuredClone read the getters %r times (expected once each): the measure is not the one this test compares with" % cloned
|
||||
assert received == [{"a": 1, "b": 2, "nested": {"c": 3}}], "the exposed function received %r, not the one read of each getter" % received
|
||||
assert hits == cloned, "the getters of the object passed to the exposed function were read %r times, the page's own structuredClone of the same shape reads them %r" % (hits, cloned)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# A client call on a handle reads nothing the page can count: one case per block of the engine's PageAgent that reads the element it is given
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#: Plants a counting getter on each named property of each target, in the frame it runs in, and returns the reads the PAGE made of each one by reading it once
|
||||
#: (the control: 1 when the getter works, the proof that a count of 0 later is not a plant that never took). The getter hands back what the property gave (the
|
||||
#: native accessor or value found on the prototype chain, nothing for a name the page cannot see) so the page keeps working; the reads are reset to 0 after the control.
|
||||
#: A property shadowed on the INSTANCE is what a chrome script holding the element WITHOUT an Xray would read; an Xray reads the native one and the page counts nothing.
|
||||
PLANT = """(targets) => {
|
||||
window.__reads = {};
|
||||
const control = {};
|
||||
const resolve = of => of === 'window' ? window : of === 'document' ? document : of === 'root' ? document.documentElement : document.querySelector(of);
|
||||
for (const [of, names] of targets) {
|
||||
const target = resolve(of);
|
||||
for (const name of names) {
|
||||
const key = of + '.' + name;
|
||||
let owner = target, found = null;
|
||||
while (owner && !(found = Object.getOwnPropertyDescriptor(owner, name))) owner = Object.getPrototypeOf(owner);
|
||||
window.__reads[key] = 0;
|
||||
try {
|
||||
Object.defineProperty(target, name, {
|
||||
get() { window.__reads[key]++; return found ? (found.get ? found.get.call(this) : found.value) : undefined; },
|
||||
set(v) {}, configurable: true});
|
||||
} catch (e) { control[key] = 'cannot plant: ' + e.message; continue; }
|
||||
void target[name];
|
||||
control[key] = window.__reads[key];
|
||||
window.__reads[key] = 0;
|
||||
}
|
||||
}
|
||||
return control;
|
||||
}"""
|
||||
|
||||
Case = namedtuple("Case", "id block call plants")
|
||||
|
||||
#: `block`: the function of juggler/content/PageAgent.js with its lines and the Juggler command the client's call makes; `plants`: (frame, [(target, [properties])]),
|
||||
#: the properties that block reads off the element it is given (and off the documents and windows it reaches).
|
||||
CASES = [
|
||||
Case("adopt", "_adoptNode :571 and :575 (Page.adoptNode): nodePrincipal of the element and of the document it is adopted into",
|
||||
lambda h, child: child.evaluate("e => e.id", h["#outer"]),
|
||||
[("main", [("#outer", ["nodePrincipal"])]), ("child", [("document", ["nodePrincipal"])])]),
|
||||
Case("quads", "_getFrameQuads :813-:828 (Page.getContentQuads): getBoxQuads of the element, innerWidth and innerHeight of the main window",
|
||||
lambda h, child: h["#outer"].bounding_box(),
|
||||
[("main", [("#outer", ["getBoxQuads"]), ("window", ["innerWidth", "innerHeight"])])]),
|
||||
Case("describe", "_describeNode :833-:848 (Page.describeNode): browsingContext, localName, contentWindow and ownerDocument of the iframe",
|
||||
lambda h, child: h["#f"].content_frame(),
|
||||
[("main", [("#f", ["browsingContext", "localName", "contentWindow", "ownerDocument"])])]),
|
||||
Case("scroll", "_scrollIntoViewIfNeeded :907-:934 (Page.scrollIntoViewIfNeeded): isConnected, nodeType, ownerDocument, getClientRects, getBoundingClientRect, "
|
||||
"scrollIntoView of the element, defaultView of its document, clientWidth and clientHeight of the root, innerWidth, innerHeight and frameElement of the window",
|
||||
lambda h, child: h["#low"].scroll_into_view_if_needed(),
|
||||
[("main", [("#low", ["isConnected", "nodeType", "ownerDocument", "getClientRects", "getBoundingClientRect", "scrollIntoView"]),
|
||||
("document", ["defaultView"]), ("root", ["clientWidth", "clientHeight"]),
|
||||
("window", ["innerWidth", "innerHeight", "frameElement"])])]),
|
||||
Case("click", "_armLanding :1084 (the landing is armed before the event), what it feeds (_pruneArmedLandings :1107-:1112: ownerDocument, defaultView; _landingOn :1160-:1180: "
|
||||
"ownerDocument, contains) and the quads and scroll blocks that a click runs first",
|
||||
lambda h, child: h["#btn"].click(),
|
||||
[("main", [("#btn", ["ownerDocument", "contains", "isConnected", "nodeType", "getClientRects", "getBoundingClientRect", "scrollIntoView", "getBoxQuads"]),
|
||||
("document", ["defaultView"])])]),
|
||||
]
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def invisible(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4274, binary_path=firefox_binary, headless=True) as b:
|
||||
yield b
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", CASES, ids=[c.id for c in CASES])
|
||||
def test_a_client_call_on_a_handle_reads_none_of_the_getters_the_page_planted(invisible, site, case):
|
||||
"""Retail Firefox reads nothing of a page's element for an automation call. The page plants counting getters on the properties the block of PageAgent reads
|
||||
(instance properties, which a chrome script without an Xray would read and which the page can count), the client makes the call on a handle it held BEFORE the
|
||||
plant, and every counter must still be 0. A control first: the page reads each planted property once, and each must have counted 1."""
|
||||
page = invisible.new_context().new_page()
|
||||
page.goto(site.url + "targets", wait_until="load")
|
||||
handles = {sel: page.query_selector(sel) for sel in ("#f", "#outer", "#low", "#btn")}
|
||||
child = handles["#f"].content_frame()
|
||||
child.wait_for_selector("#inner")
|
||||
where = {"main": page, "child": child}
|
||||
|
||||
controls = {}
|
||||
for frame_key, targets in case.plants:
|
||||
for key, count in where[frame_key].evaluate(PLANT, targets).items():
|
||||
controls["%s:%s" % (frame_key, key)] = count
|
||||
assert all(count == 1 for count in controls.values()), "the planted getters did not count one read by the page itself: %r (case %s)" % (controls, case.id)
|
||||
|
||||
failure = None
|
||||
try:
|
||||
case.call(handles, child)
|
||||
except Exception as exc: # noqa: BLE001 - what the call raised is part of what is reported
|
||||
failure = str(exc)
|
||||
called = {}
|
||||
for frame_key in {frame_key for frame_key, _ in case.plants}:
|
||||
for key, count in where[frame_key].evaluate("() => window.__reads").items():
|
||||
if count:
|
||||
called["%s:%s" % (frame_key, key)] = count
|
||||
assert not called, "the client's call read getters of the page: %r (block: %s)%s" % (
|
||||
called, case.block, "; the call itself failed with %s" % failure if failure else "")
|
||||
assert failure is None, "the client's call failed with %s (block: %s)" % (failure, case.block)
|
||||
@@ -0,0 +1,91 @@
|
||||
"""A password field of 40 characters is as wide as on retail Firefox on Windows: the engine masks it with U+25CF, on Linux and on Windows.
|
||||
|
||||
What it fixes: the character an ``<input type=password>`` is masked with. Windows retail masks with U+25CF (``widget/windows/nsLookAndFeel.cpp``), a GTK build with the ``invisible-char`` of a
|
||||
GTK entry, which is ``*`` where the host's GTK picks it from its font list. A page cannot read the character, but it reads widths: the ``scrollWidth`` of a password field holding 40 x "a" is 40 times
|
||||
the advance of the mask character in the field's font (Arial 16px: 387 px for U+25CF, 249 px for ``*``). The declared machine is a Windows one, so a page on it must read what a page reads on
|
||||
retail Windows, whatever the host.
|
||||
|
||||
The page is the page of the retail capture, byte for byte (``tests/data/password_mask_page.html``, its sha256 is the capture's): it reads the width of the password field, and the widths of 40 x
|
||||
each candidate mask character in the same box, in a text input (``scrollWidth``), an inline span and a canvas. The test reads the number the capture's analysis reads, ``fonts.arial16.password["40"].scrollWidth``
|
||||
(a password field of 40 x "a", ``font-family:Arial;font-size:16px``, a box 20 px wide with no padding or border), and compares it with the retail value.
|
||||
|
||||
NO NUMBER OF RETAIL IS TYPED HERE. The retail width is read from ``ci/retail-password-mask.json``, which ``scripts/extract_retail_password_mask.py`` extracts from the retail capture (Firefox 159.0 on a
|
||||
Windows Server 2025 runner, run 46769343558; the file carries the browser's version, build id and installer sha256 and the sha256 of every file read).
|
||||
|
||||
The launch is the product's, ``InvisiblePlaywright(seed=4, binary_path=..., headless=True)``: seed 4 declares a display of scale 1, the scale of the capture, and the test says so if it did not (a
|
||||
reading at another scale is not the reading the capture holds). Linux and Windows run the same assertions.
|
||||
|
||||
Red on an engine whose GTK widget layer answers ``*`` (the width is 249, not 387); green where the widget layer gives U+25CF, as Windows does.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import threading
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from _servers import LocalServer
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
PAGE = (ROOT / "tests" / "data" / "password_mask_page.html").read_bytes()
|
||||
#: The retail reading: the file the extraction script writes from the capture; nothing below is typed.
|
||||
RETAIL = json.loads((ROOT / "ci" / "retail-password-mask.json").read_text(encoding="utf-8"))
|
||||
CASE = RETAIL["cases"]["arial16"]
|
||||
#: The seed that declares a display of scale 1, the scale of the retail capture.
|
||||
SEED = 4
|
||||
DEADLINE_MS = 30_000
|
||||
|
||||
|
||||
class _Page(BaseHTTPRequestHandler):
|
||||
"""Serves the page of the capture; the page posts its result (the test reads ``window.__result``, so the body is only drained)."""
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/html; charset=utf-8")
|
||||
self.send_header("Content-Length", str(len(PAGE)))
|
||||
self.end_headers()
|
||||
self.wfile.write(PAGE)
|
||||
|
||||
def do_POST(self):
|
||||
self.rfile.read(int(self.headers.get("Content-Length") or 0))
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Length", "0")
|
||||
self.end_headers()
|
||||
|
||||
|
||||
def test_a_password_field_of_40_characters_is_as_wide_as_on_retail_windows(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
served = hashlib.sha256(PAGE).hexdigest()
|
||||
assert served == RETAIL["page"]["sha256"], "BROKEN CONTROL, no finding about ours: the page served is %s and the page of the capture is %s" % (served, RETAIL["page"]["sha256"])
|
||||
with LocalServer(("127.0.0.1", 0), _Page) as server:
|
||||
threading.Thread(target=server.serve_forever, daemon=True).start()
|
||||
try:
|
||||
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("http://127.0.0.1:%d/index.html?dpr1" % server.server_address[1], timeout=DEADLINE_MS)
|
||||
page.wait_for_function("window.__result !== undefined && document.title === 'done'", timeout=DEADLINE_MS)
|
||||
result = page.evaluate("window.__result")
|
||||
finally:
|
||||
server.shutdown()
|
||||
assert "error" not in result, "BROKEN CONTROL, no finding about ours: the page recorded an error: %s" % result.get("error")
|
||||
env = result["env"]
|
||||
assert env["devicePixelRatio"] == CASE["devicePixelRatio"], (
|
||||
"BROKEN CONTROL, no finding about ours: the page ran at devicePixelRatio %r and the retail capture at %r (seed %d)" % (env["devicePixelRatio"], CASE["devicePixelRatio"], SEED))
|
||||
font = result["fonts"]["arial16"]
|
||||
width = font["password"][str(RETAIL["n"])]["scrollWidth"]
|
||||
masks = font["verdict"]["by_text_input_scrollWidth"]
|
||||
assert width == CASE["password_scrollWidth"], (
|
||||
"a password field of %d x 'a' in Arial 16px is %r px wide (scrollWidth) on this engine, and %r px on retail Firefox %s on Windows: the mask character the page's widths name is %s here, %s on retail "
|
||||
"(per-character advance %r px here; a text input of 40 x U+25CF reads %r px, 40 x '*' reads %r px). navigator.platform %r, devicePixelRatio %r, computed font-family %r"
|
||||
% (RETAIL["n"], width, CASE["password_scrollWidth"], RETAIL["capture"]["browser"]["firefox_version"], masks, CASE["mask"], font["password"]["per_char"],
|
||||
font["refs"]["U+25CF"]["text_input"][str(RETAIL["n"])]["scrollWidth"], font["refs"]["*"]["text_input"][str(RETAIL["n"])]["scrollWidth"],
|
||||
env["platform"], env["devicePixelRatio"], font["input_font_family"]))
|
||||
@@ -5,14 +5,16 @@ absolute result to the parent, which applies it to the real window. A popup whos
|
||||
puts the popup where it likes, and its frame is the host's) must still answer these calls as the retail window does. Three things, per display case (the four of
|
||||
the window tests), each in a popup of its own opened by a real click, ``window.open(url, '_blank', 'width=500,height=400')``:
|
||||
|
||||
1. ``resizeBy(0, 0)``: ``innerWidth``, ``innerHeight``, ``outerWidth`` and ``outerHeight`` stay what they were. A call that adds nothing must change nothing; if the
|
||||
parent converted the declared outer size into the real one with the wrong frame, the real inner size would move by the difference of the two frames (retail
|
||||
measures nothing here: the call is a no-op in its window). The page is watched for 1.5 s after the call, so a change that arrives late is seen.
|
||||
1. ``resizeBy(0, 0)``: ``innerWidth``, ``innerHeight``, ``outerWidth`` and ``outerHeight`` are what RETAIL read, before and after the same call, in the first popup of a browser (``MOMENTS``, below: this phase
|
||||
runs first, in the first popup the browser opens). At a real 150% the first popup of a browser is a device pixel narrower than a later one (inner 499, outer 514, against 500 and 515), and the call leaves it at
|
||||
499; a later popup is taken from 500 to 501 by the call (the device rounding of the real window, which the call sends back to it), a position this test never has. If the parent converted the declared outer
|
||||
size into the real one with the wrong frame, the real inner size would move by the difference of the two frames. The page is watched for 1.5 s after the call, so a change that arrives late is seen.
|
||||
2. ``moveBy(10, 10)``: ``screenX`` and ``screenY`` grow by exactly 10 CSS pixels, from the position the popup read before. If the parent took the real position of
|
||||
the window as the base, the declared and the real positions would differ by what the host's window manager decided, and the popup would jump.
|
||||
3. ``moveTo(99999, 0)``: ``screenX`` is ``screen.availLeft + screen.availWidth - outerWidth``, the three read by the page. The clamp is the page's
|
||||
(``nsGlobalWindowOuter::CheckSecurityLeftAndTop``: it keeps the window inside the available rectangle of the screen the page reads, with the outer size the page
|
||||
reads), so the page can learn the real outer width of the window from where the popup stops if the clamp reads any of them from the host.
|
||||
3. ``moveBy(10, 10)`` and then ``moveTo(99999, 0)``, the sequence the retail capture ran: ``screenX`` and ``screenY`` after each call are the numbers RETAIL read in a later popup
|
||||
(``MOVE_TO``, below, with the capture and the derivation: this phase runs third). The clamp is the page's (``nsGlobalWindowOuter::CheckSecurityLeftAndTop``: it keeps the window inside
|
||||
the available rectangle of the screen the page reads, with the outer width in CSS pixels that Mozilla rounds by its edges), so the page can learn the real
|
||||
frame of the window from where the popup stops if the clamp reads any of it from the host.
|
||||
|
||||
Why a page reads it: a script that moves a window by ten and sees it move by another number, or that throws a window to the far right and reads where it stops,
|
||||
is reading the host's window manager and its frame.
|
||||
@@ -22,6 +24,8 @@ differ, so this test is RED there, on purpose. It enters the suite with the engi
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Tuple
|
||||
|
||||
import pytest
|
||||
@@ -30,6 +34,30 @@ from _window_origin import CASES, DEADLINE_S, launch_case, observe, settled, wai
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: What RETAIL read: the file ``scripts/extract_retail_popup_move_resize.py`` writes from the ``popup-move-to`` capture (retail Firefox 159.0 on Windows, four launches per display case: the test's order; phase 3 alone; a
|
||||
#: throwaway popup first and then the three phases; phase 2 alone; the file carries the run id, the RetailCaptures commit, the browser's build id and installer sha256, the sha256 of ``firefox.exe`` and ``xul.dll`` and of
|
||||
#: each raw.json, verified against the capture's meta.json). Each phase is read in the POSITION it has in this test: popups opened with ``width=500,height=400``, one per phase, closed before the next, in one browser, in the
|
||||
#: order phase 1, 2, 3 and nothing opened before phase 1, so phase 1 is the FIRST popup of the browser (``first``) and phase 3 the third, a later one (``later``). The numbers are the capture's, never typed or computed here.
|
||||
_RETAIL = json.loads((Path(__file__).resolve().parent.parent / "ci" / "retail-popup-move-resize.json").read_text(encoding="utf-8"))
|
||||
#: Phase 1 (``initial``, ``resized``): the first popup of a browser.
|
||||
MOMENTS = {case: phases["resize_by_zero"]["first"] for case, phases in _RETAIL["cases"].items()}
|
||||
#: Phase 3 (``moved``, ``moved_to``): a later popup (the third).
|
||||
MOVE_TO = {case: phases["move_to_far_right"]["later"] for case, phases in _RETAIL["cases"].items()}
|
||||
#:
|
||||
#: Why ``moveTo(99999, 0)`` stops at 1022 at scale 1.25: Mozilla's ``CheckSecurityLeftAndTop`` (dom/base/nsGlobalWindowOuter.cpp) clamps
|
||||
#: ``x_css = availLeft + availWidth - W``, where ``W`` is the outer width ROUNDED BY ITS EDGES, ``CSSIntRect::Round(deviceRect / scale).width``
|
||||
#: (gfx/2d/BaseRect.h: ``W = round(x_dev / s + w_dev / s) - round(x_dev / s)``), not the ``outerWidth`` the page reads. At 1.25 the window is at x_dev 16 and
|
||||
#: w_dev 643: ``W = round(12.8 + 514.4) - round(12.8) = 527 - 13 = 514``, so ``x_css = 1536 - 514 = 1022`` (availLeft + availWidth is 1920 / 1.25 = 1536).
|
||||
#: The parent then moves to ``devPos = RoundedToInt(1022 * 1.25) = 1278`` (1277.5 rounds up), and the page reads back ``screenX = RoundedToInt(1278 / 1.25) =
|
||||
#: round(1022.4) = 1022``. The stop is a result of the clamp, the device rounding and the read-back, so it is the capture's number and not a formula of the page.
|
||||
|
||||
|
||||
def _retail(case: str) -> Tuple[Tuple[int, int], Tuple[int, int], int]:
|
||||
"""(moved (screenX, screenY), moved_to (screenX, screenY), outerWidth) of retail in phase 3, from the capture made in the test's own order."""
|
||||
m = MOVE_TO[case]
|
||||
return tuple(m["moved"]["screen"]), tuple(m["moved_to"]["screen"]), m["moved_to"]["outer"][0]
|
||||
|
||||
|
||||
#: The button that opens the popup: ``position:fixed`` at (20, 20), 160x40 CSS pixels; its centre is the point of the real click.
|
||||
OPEN = (100, 40)
|
||||
FEATURES = "width=500,height=400"
|
||||
@@ -70,13 +98,17 @@ def _phase_resize_by_zero(page, sites, case: str) -> None:
|
||||
popup = _open(page, sites)
|
||||
try:
|
||||
before = _settled_popup(popup)
|
||||
assert (before["iw"], before["ih"]) == (500, 400), "%s: the popup is %rx%r inside before the call, it was asked 500x400 (%r)" % (
|
||||
case, before["iw"], before["ih"], before)
|
||||
opened = tuple(MOMENTS[case]["initial"]["inner"])
|
||||
assert (before["iw"], before["ih"]) == opened, "%s: the popup is %rx%r inside before the call, retail reads %rx%r (it was asked 500x400) (%r)" % (
|
||||
case, before["iw"], before["ih"], opened[0], opened[1], before)
|
||||
popup.evaluate("() => { window.resizeBy(0, 0); }")
|
||||
after = observe(popup, lambda: tuple(popup.evaluate(SIZE)), WATCH_S)
|
||||
was = (before["iw"], before["ih"], before["ow"], before["oh"])
|
||||
assert after == [was], (
|
||||
"%s: resizeBy(0, 0) changed the window: (innerWidth, innerHeight, outerWidth, outerHeight) was %r and the page then read %r" % (case, was, after))
|
||||
resized = MOMENTS[case]["resized"]
|
||||
expected = (*resized["inner"], *resized["outer"])
|
||||
assert after == [expected], (
|
||||
"%s: after resizeBy(0, 0) the page read (innerWidth, innerHeight, outerWidth, outerHeight) %r; retail reads %r (the window was %r before the call)" % (
|
||||
case, after, expected, was))
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
@@ -96,17 +128,24 @@ def _phase_move_by(page, sites, case: str) -> None:
|
||||
|
||||
|
||||
def _phase_move_to_the_far_right(page, sites, case: str) -> None:
|
||||
"""The retail capture's sequence: the popup, ``moveBy(10, 10)``, ``moveTo(99999, 0)``; where the popup is after each call is what retail read."""
|
||||
moved, moved_to, outer_width = _retail(case)
|
||||
popup = _open(page, sites)
|
||||
try:
|
||||
before = _settled_popup(popup)
|
||||
popup.evaluate("() => { window.moveBy(10, 10); }")
|
||||
wait_for(popup, lambda: tuple(popup.evaluate(POSITION)) == moved, DEADLINE_S)
|
||||
after_by = _settled_popup(popup)
|
||||
assert (after_by["sx"], after_by["sy"]) == moved, (
|
||||
"%s: after moveBy(10, 10) the popup is at (screenX, screenY) = (%r, %r); retail read %r (the popup was %r before the call)"
|
||||
% (case, after_by["sx"], after_by["sy"], moved, before))
|
||||
popup.evaluate("() => { window.moveTo(99999, 0); }")
|
||||
# the clamp's own inputs, read by the page after the call: the declared avail rectangle and the declared outer width
|
||||
wait_for(popup, lambda: popup.evaluate("() => screenX") == popup.evaluate("() => screen.availLeft + screen.availWidth - outerWidth"), DEADLINE_S)
|
||||
after = settled(popup, lambda: popup.evaluate(READ))
|
||||
expected = after["availL"] + after["availW"] - after["ow"]
|
||||
assert after["sx"] == expected, (
|
||||
"%s: after moveTo(99999, 0) screenX is %r; the declared avail right (availLeft %r + availWidth %r) less outerWidth %r is %r (popup was %r before the call)"
|
||||
% (case, after["sx"], after["availL"], after["availW"], after["ow"], expected, before))
|
||||
wait_for(popup, lambda: tuple(popup.evaluate(POSITION)) == moved_to, DEADLINE_S)
|
||||
after = _settled_popup(popup)
|
||||
assert (after["sx"], after["sy"]) == moved_to, (
|
||||
"%s: after moveTo(99999, 0) the popup is at (screenX, screenY) = (%r, %r); retail read %r (availLeft %r, availWidth %r, outerWidth %r; "
|
||||
"the popup was at %r after moveBy)" % (case, after["sx"], after["sy"], moved_to, after["availL"], after["availW"], after["ow"], (after_by["sx"], after_by["sy"])))
|
||||
assert after["ow"] == outer_width, "%s: outerWidth is %r after the moves; retail read %r" % (case, after["ow"], outer_width)
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
"""A popup opened from a maximized main window reads the sizes retail Firefox reads, at every declared scale.
|
||||
|
||||
What it fixes: ``window.open(url, '', features)`` from a window the browser has stored as maximized. The size a popup gets depends on the feature string: a
|
||||
``width`` and a ``height`` give the content size asked for; a popup that names no size (``popup``) or only one of the two takes the rest from the main window (its
|
||||
content area, less the popup's own frame); the screen and the scale decide the numbers. The expectations are retail Firefox 159 on Windows, measured, with a
|
||||
maximized main window whose state the browser has stored, per display case: scale 1.0, 1.25 and 1.5 on a 1920x1080 panel and scale 2.0 on a 1600x1200 one (device
|
||||
pixels), the four cases of ``_window_origin.CASES``.
|
||||
|
||||
NO NUMBER OF RETAIL IS TYPED HERE. Every retail value is read from ``ci/retail-popup-sizes.json``, which ``scripts/extract_retail_popup_sizes.py`` extracts from the retail
|
||||
capture (round 12 of the window-geometry capture: the ``popup_sizes`` step of each raw.json, launch ``a`` checked against launch ``b``, and the ``popup`` rows of
|
||||
``captures/WINDOW_GEOMETRY_POPUP_FRAME.csv`` checked against it; the file carries the round, the run, the browser's version, build id and installer sha256, and the sha256 of every
|
||||
file read). A hand table in this docstring was wrong once (an outer width of 514 at scale 1.5, the value of 1.25; retail read 515), which is why there is none.
|
||||
|
||||
Each popup reads its own window twice: in its first inline script (the moment a page's first script can look) and at ``load``. Both readings are asserted, one test
|
||||
function per feature string, each in a fresh browser and page with ONE popup per case:
|
||||
|
||||
* ``width=500,height=400``, ``popup``: inner size, outer size and ``visualViewport.height`` (the two the capture of the feature string gave and the test has always compared);
|
||||
* ``width=500``, ``height=400``, ``width=300,height=200``, ``width=800,height=600``: inner size.
|
||||
|
||||
A popup that names a position and no size (``left=100,top=100``, ``left=5000,top=5000``) opens normal, not maximized, at the size the main window stored, at the page's
|
||||
position kept inside the work area (the same main window): inner, outer and ``screenX``/``screenY`` are asserted.
|
||||
|
||||
Also read, and named in the failure message but not asserted (the extract carries no value for them): ``visualViewport.width``, and ``screenX``, ``screenY`` for the
|
||||
feature strings that name no position. ``devicePixelRatio`` is asserted equal to the case's scale.
|
||||
|
||||
Why a page reads it: the size of a popup it opened, and the outer size around it, are one line of script; a popup whose sizes are the host window manager's is a
|
||||
browser that does not run on Windows. Linux and Windows run the same assertions: the declaration, not the host, is what is read.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, settled, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The four cases in the order of their scale: 1.0, 1.25, 1.5, 2.0 (the keys of ``_window_origin.CASES``, in the order of their scale).
|
||||
ORDER = ["1920x1080-dpr1.0", "1920x1080-dpr1.25", "1920x1080-dpr1.5", "1600x1200-dpr2.0"]
|
||||
|
||||
#: The button that opens the popup: ``position:fixed`` at (20, 20), 160x40 CSS pixels; its centre is the point of the real click.
|
||||
OPEN = (100, 40)
|
||||
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>main</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}
|
||||
#open{position:fixed;left:20px;top:20px;width:160px;height:40px;margin:0}</style>
|
||||
<body><button id=open>popup</button><script>
|
||||
document.getElementById('open').addEventListener('click', () => { window.open(window.__popupUrl, '', window.__popupFeatures); });
|
||||
</script>"""
|
||||
|
||||
#: The first inline script records the window as it is when the script runs; the load listener records it again at ``load``.
|
||||
POPUP = """<!doctype html><meta charset=utf-8><title>popup</title><body style=margin:0>x<script>
|
||||
function read() {
|
||||
return {iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight, vw: visualViewport.width, vh: visualViewport.height,
|
||||
dpr: devicePixelRatio, sx: screenX, sy: screenY};
|
||||
}
|
||||
window.__first = read();
|
||||
window.addEventListener('load', () => { window.__load = read(); });
|
||||
</script>"""
|
||||
|
||||
READ = "() => ({first: window.__first, load: window.__load || null})"
|
||||
|
||||
#: The retail numbers: the file the extraction script writes from the capture (``scripts/extract_retail_popup_sizes.py``); nothing below is typed.
|
||||
RETAIL = json.loads((Path(__file__).resolve().parent.parent / "ci" / "retail-popup-sizes.json").read_text(encoding="utf-8"))["cases"]
|
||||
|
||||
#: case -> (inner, outer or None, visualViewport.height or None): retail's numbers for a feature string; the outer size and the viewport height are compared for these two strings.
|
||||
Row = Tuple[Tuple[int, int], Optional[Tuple[int, int]], Optional[float]]
|
||||
COMPARES_OUTER_AND_VIEWPORT = ("width=500,height=400", "popup")
|
||||
|
||||
|
||||
def _table(features: str) -> Dict[str, Row]:
|
||||
"""The rows of one feature string, for the four cases, from the extract."""
|
||||
rows: Dict[str, Row] = {}
|
||||
for case in ORDER:
|
||||
r = RETAIL[case][features]
|
||||
both = features in COMPARES_OUTER_AND_VIEWPORT
|
||||
rows[case] = (tuple(r["inner"]), tuple(r["outer"]) if both else None, r["vv_height"] if both else None)
|
||||
return rows
|
||||
|
||||
|
||||
SIZED = _table("width=500,height=400")
|
||||
POPUP_ONLY = _table("popup")
|
||||
WIDTH_ONLY = _table("width=500")
|
||||
HEIGHT_ONLY = _table("height=400")
|
||||
SMALL = _table("width=300,height=200")
|
||||
MEDIUM = _table("width=800,height=600")
|
||||
|
||||
|
||||
def _read_popup(firefox_binary: str, case: str, features: str, viewport: Optional[Dict[str, int]] = None) -> Dict[str, Any]:
|
||||
"""One popup of ``features`` from a real click on a fresh page, read in its first script and at load (the load reading after two equal looks).
|
||||
|
||||
``viewport`` is the one the user gives ``new_page``; without it the page takes the viewport the core declares for the main window."""
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", TOP)
|
||||
sites.route("A", "/popup", POPUP)
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
page = browser.new_page(viewport=viewport) if viewport else browser.new_page()
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
page.evaluate("([url, features]) => { window.__popupUrl = url; window.__popupFeatures = features; }", [sites.url("A", "/popup"), features])
|
||||
with page.expect_popup(timeout=30000) as opened:
|
||||
page.mouse.click(*OPEN) # the client's own click: a trusted event, so window.open is allowed
|
||||
popup = opened.value
|
||||
try:
|
||||
popup.wait_for_load_state("load", timeout=30000)
|
||||
wait_for(popup, lambda: popup.evaluate(READ)["load"] is not None, DEADLINE_S)
|
||||
return settled(popup, lambda: popup.evaluate(READ))
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
#: case -> (inner, outer, screen): retail's numbers for a popup that names a position and no size, with the screen position the page's left and top give.
|
||||
Placed = Tuple[Tuple[int, int], Tuple[int, int], Tuple[int, int]]
|
||||
|
||||
|
||||
def _placed(features: str) -> Dict[str, Placed]:
|
||||
"""The rows of one feature string that names a position and no size, for the four cases, from the extract."""
|
||||
return {case: (tuple(RETAIL[case][features]["inner"]), tuple(RETAIL[case][features]["outer"]), tuple(RETAIL[case][features]["screen"])) for case in ORDER}
|
||||
|
||||
|
||||
NEAR = _placed("left=100,top=100")
|
||||
FAR = _placed("left=5000,top=5000")
|
||||
|
||||
|
||||
def _check_placed(firefox_binary: str, case: str, features: str, table: Dict[str, Placed]) -> None:
|
||||
inner, outer, screen = table[case]
|
||||
reading = _read_popup(firefox_binary, case, features)
|
||||
for when in ("first", "load"):
|
||||
r = reading[when]
|
||||
label = "%s, window.open(url, '', %r), read in the %s" % (case, features, "first inline script" if when == "first" else "load event")
|
||||
assert r is not None, "%s: nothing was read" % label
|
||||
seen = "(inner %rx%r, outer %rx%r, screen %r,%r)" % (r["iw"], r["ih"], r["ow"], r["oh"], r["sx"], r["sy"])
|
||||
assert (r["iw"], r["ih"]) == inner, "%s: the popup is %rx%r inside, retail reads %rx%r %s" % (label, r["iw"], r["ih"], inner[0], inner[1], seen)
|
||||
assert (r["ow"], r["oh"]) == outer, "%s: outerWidth x outerHeight is %rx%r, retail reads %rx%r %s" % (label, r["ow"], r["oh"], outer[0], outer[1], seen)
|
||||
assert (r["sx"], r["sy"]) == screen, "%s: screenX, screenY is %r,%r, retail reads %r,%r %s" % (label, r["sx"], r["sy"], screen[0], screen[1], seen)
|
||||
|
||||
|
||||
def _check(firefox_binary: str, case: str, features: str, table: Dict[str, Row]) -> None:
|
||||
inner, outer, vv_height = table[case]
|
||||
scale = CASES[case][0]
|
||||
reading = _read_popup(firefox_binary, case, features)
|
||||
for when in ("first", "load"):
|
||||
r = reading[when]
|
||||
label = "%s, window.open(url, '', %r), read in the %s" % (case, features, "first inline script" if when == "first" else "load event")
|
||||
assert r is not None, "%s: nothing was read" % label
|
||||
seen = "(inner %rx%r, outer %rx%r, visualViewport %rx%r, devicePixelRatio %r, screen %r,%r)" % (
|
||||
r["iw"], r["ih"], r["ow"], r["oh"], r["vw"], r["vh"], r["dpr"], r["sx"], r["sy"])
|
||||
assert (r["iw"], r["ih"]) == inner, "%s: the popup is %rx%r inside, retail reads %rx%r %s" % (label, r["iw"], r["ih"], inner[0], inner[1], seen)
|
||||
assert r["dpr"] == scale, "%s: devicePixelRatio is %r, the case declares %r %s" % (label, r["dpr"], scale, seen)
|
||||
if outer is not None:
|
||||
assert (r["ow"], r["oh"]) == outer, "%s: outerWidth x outerHeight is %rx%r, retail reads %rx%r %s" % (label, r["ow"], r["oh"], outer[0], outer[1], seen)
|
||||
if vv_height is not None:
|
||||
assert r["vh"] == pytest.approx(vv_height, abs=0.01), "%s: visualViewport.height is %r, retail reads %r %s" % (label, r["vh"], vv_height, seen)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_a_width_and_a_height_reads_the_retail_sizes(firefox_binary, case):
|
||||
_check(firefox_binary, case, "width=500,height=400", SIZED)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_no_size_reads_the_retail_sizes_of_the_main_window(firefox_binary, case):
|
||||
_check(firefox_binary, case, "popup", POPUP_ONLY)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_only_a_width_reads_the_retail_height(firefox_binary, case):
|
||||
_check(firefox_binary, case, "width=500", WIDTH_ONLY)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_only_a_height_reads_the_retail_width(firefox_binary, case):
|
||||
_check(firefox_binary, case, "height=400", HEIGHT_ONLY)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_small_popup_reads_its_size_at_every_scale(firefox_binary, case):
|
||||
_check(firefox_binary, case, "width=300,height=200", SMALL)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_medium_popup_reads_the_retail_size_at_every_scale(firefox_binary, case):
|
||||
_check(firefox_binary, case, "width=800,height=600", MEDIUM)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_a_position_and_no_size_opens_normal_at_the_stored_size_where_asked(firefox_binary, case):
|
||||
_check_placed(firefox_binary, case, "left=100,top=100", NEAR)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", ORDER)
|
||||
def test_a_popup_with_a_position_far_off_screen_opens_normal_at_the_right_edge(firefox_binary, case):
|
||||
_check_placed(firefox_binary, case, "left=5000,top=5000", FAR)
|
||||
|
||||
|
||||
#: A viewport the user sets, and a popup that names no size under it: Playwright's contract, kept. The viewport is the user's choice, so it pins the popup as it
|
||||
#: pins the page, where the viewport only declared for the main window leaves the popup to its own window (the tests above).
|
||||
USER_VIEWPORT = {"width": 1000, "height": 700}
|
||||
|
||||
|
||||
def test_a_popup_with_no_size_reads_the_viewport_the_user_set(firefox_binary):
|
||||
case = ORDER[0]
|
||||
r = _read_popup(firefox_binary, case, "popup", USER_VIEWPORT)["load"]
|
||||
assert r is not None, "%s, viewport %r: nothing was read at load" % (case, USER_VIEWPORT)
|
||||
seen = "(inner %rx%r, outer %rx%r, devicePixelRatio %r)" % (r["iw"], r["ih"], r["ow"], r["oh"], r["dpr"])
|
||||
assert (r["iw"], r["ih"]) == (USER_VIEWPORT["width"], USER_VIEWPORT["height"]), (
|
||||
"%s, new_page(viewport=%r), window.open(url, '', 'popup'): the popup is %rx%r inside, as stock Playwright it reads the viewport %s" % (
|
||||
case, USER_VIEWPORT, r["iw"], r["ih"], seen))
|
||||
@@ -0,0 +1,270 @@
|
||||
"""A popup that names no size is left to its own window under the viewport the core declares, and pinned to one the user chose.
|
||||
|
||||
The core declares a viewport for the main window (`context_geometry`), and the session gives it to every context as the default of
|
||||
`new_context` / `new_page`. Pinned to it, a popup that named no size (`window.open(url, '', 'popup')`) read the cells of a TAB where a real
|
||||
Firefox reads the popup's own window. The wrapper now says, in one bit, whether the viewport of a context is only that declaration:
|
||||
|
||||
* the session marks the viewport of its defaults (`declared_viewport`); a viewport the user passes replaces it, mark included;
|
||||
* the server turns the mark into `isDeclaredDefault` of `Browser.setDefaultViewport`, and never tells it to the client;
|
||||
* a popup the engine did not pin is told no viewport (`page.viewport_size` is None, as for a page whose viewport is not emulated) and the
|
||||
wrapper reads the size of its window each time it plans inside it; a pinned one, and a tab, keep what the context says (Playwright's own
|
||||
contract).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import types
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.juggler.connection import EventListeners
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright._juggler.server import (DECLARED_VIEWPORT_KEY, BrowserDispatcher, PageDispatcher, Server,
|
||||
_viewport_as_told, declared_viewport)
|
||||
from _browser_census import closes_with_the_test
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
USER = {"width": 800, "height": 600}
|
||||
|
||||
|
||||
class _Connection(EventListeners):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
closes_with_the_test(self)
|
||||
self.sent = []
|
||||
|
||||
def startup_send(self, method, params=None):
|
||||
return self.send(method, params, timeout=None)
|
||||
|
||||
def send(self, method, params=None, session=None, timeout=30):
|
||||
self.sent.append((method, params))
|
||||
return {"browserContextId": "CTX"}
|
||||
|
||||
|
||||
def _default_viewport_command(options):
|
||||
conn = _Connection()
|
||||
dispatcher = BrowserDispatcher(Server(), None, conn, "151.0")
|
||||
conn.sent.clear()
|
||||
dispatcher._apply_context_options("CTX", options)
|
||||
found = [p for m, p in conn.sent if m == "Browser.setDefaultViewport"]
|
||||
assert len(found) == 1, conn.sent
|
||||
return found[0]["viewport"]
|
||||
|
||||
|
||||
class _Browser:
|
||||
"""What `_patch_new_context_defaults` wraps: it records the keywords the context is finally made with."""
|
||||
|
||||
def __init__(self):
|
||||
self.context_kwargs = []
|
||||
|
||||
def new_context(self, **kw):
|
||||
self.context_kwargs.append(kw)
|
||||
return types.SimpleNamespace(new_page=lambda **k: None, add_cookies=lambda c: None)
|
||||
|
||||
def new_page(self, **kw):
|
||||
self.context_kwargs.append(kw)
|
||||
return types.SimpleNamespace(context=types.SimpleNamespace(add_cookies=lambda c: None))
|
||||
|
||||
|
||||
def _made_with(**user):
|
||||
ip = InvisiblePlaywright(seed=42)
|
||||
browser = _Browser()
|
||||
ip._patch_new_context_defaults(browser)
|
||||
browser.new_context(**user)
|
||||
return browser.context_kwargs[0]
|
||||
|
||||
|
||||
# ── the session: the mark ────────────────────────────────────────────
|
||||
|
||||
|
||||
def test_the_default_viewport_of_the_session_is_marked_as_the_cores():
|
||||
kw = InvisiblePlaywright(seed=42)._default_context_kwargs()
|
||||
assert kw["viewport"].get(DECLARED_VIEWPORT_KEY) is True
|
||||
assert {"width", "height"} <= set(kw["viewport"])
|
||||
|
||||
|
||||
def test_a_context_that_names_no_viewport_gets_the_marked_default():
|
||||
assert _made_with()["viewport"].get(DECLARED_VIEWPORT_KEY) is True
|
||||
|
||||
|
||||
def test_a_viewport_the_user_names_is_not_marked():
|
||||
assert _made_with(viewport=USER)["viewport"] == USER
|
||||
|
||||
|
||||
# ── the server: Browser.setDefaultViewport ───────────────────────────
|
||||
|
||||
|
||||
def test_a_declared_default_reaches_the_engine_as_the_bit():
|
||||
viewport = _default_viewport_command({"viewport": declared_viewport({"width": 1920, "height": 947})})
|
||||
assert viewport["isDeclaredDefault"] is True
|
||||
assert viewport["viewportSize"] == {"width": 1920, "height": 947}
|
||||
|
||||
|
||||
def test_a_viewport_the_user_chose_reaches_the_engine_with_no_bit():
|
||||
viewport = _default_viewport_command({"viewport": USER})
|
||||
assert "isDeclaredDefault" not in viewport
|
||||
assert viewport["viewportSize"] == USER
|
||||
|
||||
|
||||
# ── the server: the size a popup is told, and the size the wrapper plans inside ──
|
||||
|
||||
|
||||
class _Injected:
|
||||
"""A page whose window can change size between two reads: `boxes` is the answer of each read in turn, the last one stays."""
|
||||
|
||||
def __init__(self, *boxes):
|
||||
self.boxes = list(boxes)
|
||||
self.asked = []
|
||||
|
||||
def evaluate(self, frame_id, expression):
|
||||
self.asked.append((frame_id, expression))
|
||||
box = self.boxes.pop(0) if len(self.boxes) > 1 else self.boxes[0]
|
||||
if isinstance(box, Exception):
|
||||
raise box
|
||||
return box
|
||||
|
||||
|
||||
POPUP = object() # any opener: the page is a popup
|
||||
WINDOW = {"width": 1920, "height": 968}
|
||||
DECLARED = declared_viewport({"width": 1920, "height": 947})
|
||||
|
||||
|
||||
def _page(context_viewport, opener, *boxes, **options):
|
||||
"""A PageDispatcher with what `_build` sets before the hand and the initializer read it (`options`: more options of the context, e.g. `noDefaultViewport`)."""
|
||||
page = PageDispatcher.__new__(PageDispatcher)
|
||||
context = types.SimpleNamespace(options={"viewport": context_viewport, **options})
|
||||
page.injected = _Injected(*(boxes or (WINDOW,)))
|
||||
page.main_frame_id = "F1"
|
||||
page.viewport_size = _viewport_as_told(context_viewport)
|
||||
page.viewport_unpinned = page._is_unpinned(context, opener)
|
||||
page._last_window_size = None
|
||||
return page
|
||||
|
||||
|
||||
def test_a_popup_under_the_declared_default_is_told_no_viewport():
|
||||
page = _page(DECLARED, POPUP)
|
||||
assert page.viewport_unpinned is True
|
||||
assert page.told_viewport() is None
|
||||
|
||||
|
||||
def test_a_popup_under_a_viewport_the_user_chose_is_told_that_viewport():
|
||||
page = _page(USER, POPUP)
|
||||
assert page.viewport_unpinned is False
|
||||
assert page.told_viewport() == USER
|
||||
assert page.planning_viewport() == USER
|
||||
assert page.injected.asked == [], "a pinned popup was measured"
|
||||
|
||||
|
||||
def test_a_tab_under_the_declared_default_is_told_the_declared_viewport_and_not_measured():
|
||||
page = _page(DECLARED, None)
|
||||
assert page.viewport_unpinned is False
|
||||
assert page.told_viewport() == {"width": 1920, "height": 947}
|
||||
assert page.planning_viewport() == {"width": 1920, "height": 947}
|
||||
assert page.injected.asked == []
|
||||
|
||||
|
||||
def test_the_hand_of_an_unpinned_popup_plans_inside_the_live_size_of_its_window():
|
||||
first, second = {"width": 1920, "height": 968}, {"width": 1000, "height": 600}
|
||||
page = _page(DECLARED, POPUP, first, second)
|
||||
assert page.planning_viewport() == first
|
||||
assert page.planning_viewport() == second, "the second read answered the size of the first: the window was measured once"
|
||||
assert "innerWidth" in page.injected.asked[0][1] and page.injected.asked[0][0] == "F1"
|
||||
assert page.told_viewport() is None
|
||||
|
||||
|
||||
def test_the_pointer_of_an_unpinned_popup_reads_the_live_size_through_its_own_viewport_reader():
|
||||
from invisible_playwright._juggler.pointer import Pointer
|
||||
|
||||
first, second = {"width": 1920, "height": 968}, {"width": 800, "height": 500}
|
||||
page = _page(DECLARED, POPUP, first, second)
|
||||
pointer = Pointer.__new__(Pointer)
|
||||
pointer._viewport_of = page.planning_viewport
|
||||
assert pointer._viewport() == (1920, 968)
|
||||
assert pointer._viewport() == (800, 500)
|
||||
|
||||
|
||||
def test_a_window_that_cannot_be_read_now_keeps_the_last_size_read():
|
||||
page = _page(DECLARED, POPUP, WINDOW, RuntimeError("gone"))
|
||||
assert page.planning_viewport() == WINDOW
|
||||
assert page.planning_viewport() == WINDOW
|
||||
never = _page(DECLARED, POPUP, None)
|
||||
assert never.planning_viewport() == {"width": 1920, "height": 947}, "with no reading ever, the hand falls back to the declared default"
|
||||
|
||||
|
||||
def test_a_viewport_set_on_a_popup_pins_it():
|
||||
page = _page(DECLARED, POPUP)
|
||||
page.send = lambda *a, **k: None
|
||||
page.op_set_viewport_size({"viewportSize": USER})
|
||||
assert page.viewport_unpinned is False
|
||||
assert page.told_viewport() == USER
|
||||
assert page.planning_viewport() == USER
|
||||
|
||||
|
||||
def test_the_client_is_never_told_the_mark():
|
||||
from invisible_playwright._juggler import server
|
||||
|
||||
assert server._viewport_as_told(DECLARED) == {"width": 1920, "height": 947}
|
||||
assert server._viewport_as_told(None) is None
|
||||
|
||||
|
||||
# ── no_viewport=True: Playwright's meaning is no pin, for a tab as for a popup ────────────────────────────────
|
||||
|
||||
|
||||
def _made_page_with(**user):
|
||||
ip = InvisiblePlaywright(seed=42)
|
||||
browser = _Browser()
|
||||
ip._patch_new_context_defaults(browser)
|
||||
browser.new_page(**user)
|
||||
return browser.context_kwargs[0]
|
||||
|
||||
|
||||
def test_a_context_that_asks_for_no_viewport_is_made_without_the_declared_viewport_and_screen():
|
||||
made = _made_with(no_viewport=True)
|
||||
assert made["no_viewport"] is True
|
||||
assert "viewport" not in made and "screen" not in made, "the declared geometry pins the page the client asked not to pin: %r" % sorted(made)
|
||||
|
||||
|
||||
def test_a_page_that_asks_for_no_viewport_is_made_without_the_declared_viewport_and_screen():
|
||||
made = _made_page_with(no_viewport=True)
|
||||
assert made["no_viewport"] is True
|
||||
assert "viewport" not in made and "screen" not in made, "the declared geometry pins the page the client asked not to pin: %r" % sorted(made)
|
||||
|
||||
|
||||
def test_a_page_and_a_context_that_do_not_ask_keep_the_declared_viewport_and_screen():
|
||||
for made in (_made_with(), _made_page_with(), _made_with(no_viewport=False), _made_page_with(no_viewport=False)):
|
||||
assert made["viewport"].get(DECLARED_VIEWPORT_KEY) is True and "screen" in made
|
||||
|
||||
|
||||
def test_the_declared_defaults_of_a_served_context_follow_the_same_rule():
|
||||
from invisible_playwright._juggler.server import context_defaults_for
|
||||
|
||||
defaults = InvisiblePlaywright(seed=42)._default_context_kwargs()
|
||||
free = context_defaults_for(defaults, True)
|
||||
assert "viewport" not in free and "screen" not in free
|
||||
assert set(defaults) - set(free) == {"viewport", "screen"}, "only the pinned geometry is dropped"
|
||||
assert context_defaults_for(defaults, None) == defaults
|
||||
|
||||
|
||||
def test_a_context_with_no_viewport_sends_no_default_viewport_to_the_engine():
|
||||
conn = _Connection()
|
||||
dispatcher = BrowserDispatcher(Server(), None, conn, "151.0")
|
||||
conn.sent.clear()
|
||||
dispatcher._apply_context_options("CTX", {"noDefaultViewport": True, "viewport": declared_viewport({"width": 1920, "height": 947})})
|
||||
assert [m for m, _ in conn.sent if m == "Browser.setDefaultViewport"] == []
|
||||
|
||||
|
||||
def test_a_tab_of_a_context_with_no_viewport_is_told_none_and_the_hand_plans_inside_the_live_window():
|
||||
first, second = {"width": 1920, "height": 947}, {"width": 1500, "height": 700}
|
||||
page = _page(None, None, first, second, noDefaultViewport=True)
|
||||
assert page.viewport_unpinned is True
|
||||
assert page.told_viewport() is None
|
||||
assert page.planning_viewport() == first
|
||||
assert page.planning_viewport() == second, "the hand planned inside a stale size"
|
||||
|
||||
|
||||
def test_a_popup_of_a_context_with_no_viewport_is_unpinned_too_and_a_set_viewport_pins_the_tab():
|
||||
assert _page(None, POPUP, noDefaultViewport=True).viewport_unpinned is True
|
||||
tab = _page(None, None, noDefaultViewport=True)
|
||||
tab.send = lambda *a, **k: None
|
||||
tab.op_set_viewport_size({"viewportSize": USER})
|
||||
assert tab.viewport_unpinned is False and tab.told_viewport() == USER
|
||||
@@ -0,0 +1,414 @@
|
||||
"""A press, a release or a wheel turn while a popup is open reaches the page as it does on retail Firefox 159 on Windows, in the top document and in a frame of another site.
|
||||
|
||||
THE SOURCE OF THE EXPECTATIONS is retail Firefox 159 on Windows, measured: round 9 of the retail captures (the ``rollup`` step: the real mouse of the system, a page that records every event it hears in the capture phase,
|
||||
the chrome-scope state of the popups read after each step). The records of the three display scales below are the same in every launch of the round, and the lists here are the events of those records, in the order the page heard them, with the
|
||||
id of each target and whether it was trusted. Nothing here is a number of ours.
|
||||
|
||||
WHAT THE RECORDS SHOW. On Windows a popup that is open is rolled up by the platform before the page hears anything, and a press on the anchor of an open dropdown is a press on a popup's own anchor: the platform closes the dropdown with it and the page does not
|
||||
hear that press. The rules, for a ``<select>`` of six options at (20, 20), 200 x 30, with its dropdown open:
|
||||
|
||||
* a left press on the anchor (its centre, or the last CSS pixel inside it) closes the dropdown and the page hears nothing of that press: its first events are the release's ``pointerup``, ``mouseup`` and ``click`` on the select. The dropdown stays
|
||||
closed, and the select keeps the focus;
|
||||
* a left press outside (a plain box) closes the dropdown too, and the page hears the whole click: ``pointerdown``, ``mousedown``, ``blur`` of the select, ``pointerup``, ``mouseup``, ``click`` on the box; the focus goes to the body;
|
||||
* a right press on the anchor closes the dropdown and the page hears the whole click on the select: ``pointerdown``, ``mousedown``, ``pointerup``, ``mouseup``, ``auxclick``, ``contextmenu``; the page context menu is open after it;
|
||||
* a double click on the anchor: the first press and release close the dropdown (the page hears the release), the second press is a press on a closed select and opens it again (the page hears ``pointerdown`` and ``mousedown``), and the second release,
|
||||
which the dropdown handles, reaches the page as the parent's ``mouseup`` and ``click`` on the select with no ``pointerup``; the dropdown is open at the end;
|
||||
* a press and a release at once on a closed select that has the focus (the second press of the double click above, with nothing between them): the press opens the dropdown and the page hears ``pointerdown`` and ``mousedown``; the release,
|
||||
which the dropdown handles, reaches the page as the parent's ``mouseup`` and ``click`` on the select with no ``pointerup``; the dropdown is open at the end. The release does not wait for the dropdown to be shown, so it is the one the
|
||||
engine has to hold until the dropdown has said it is open;
|
||||
* a left press on the second item of the open dropdown selects it: the page hears ``mousedown`` and ``mouseup`` on the ``option``, ``input`` and ``change`` on the select, ``click`` on the ``option``; the dropdown is closed and ``selectedIndex`` is 1;
|
||||
* a turn of the wheel over the page, over the anchor, or (with the page context menu open instead of the dropdown) over the page reaches the page as nothing at all: no event, the page does not scroll, and the popup is still open;
|
||||
* the datalist list of an ``<input>`` (open after a click and one typed letter): a press on the input reaches the page whole: ``pointerdown``, ``mousedown``, ``pointerup``, ``mouseup``, ``click`` on the input;
|
||||
* a notification panel (the password doorhanger, ``#notification-popup``, an arrow panel) open over the page takes no part in the page's input: a press on a page element under it reaches the page whole, as stock Playwright sends it through
|
||||
the panels of the browser's chrome. Only the popups whose rollup Mozilla consumes on that path (the select dropdown, the menus, the autocomplete list) change where a press goes;
|
||||
* with the select in a frame of another site (an out-of-process iframe at (200, 20), the select at (20, 20) of the frame): a press on the anchor is heard by the frame as ``pointerup``, ``mouseup``, ``click`` and by the top document as nothing.
|
||||
|
||||
HOW IT IS READ. The client's own mouse (``page.mouse``) opens the popup with a real click, and the same mouse does the step. The page records ``pointerdown``, ``mousedown``, ``pointerup``, ``mouseup``, ``click``, ``dblclick``, ``auxclick``,
|
||||
``contextmenu``, ``focus``, ``blur``, ``change``, ``input``, ``wheel`` and ``scroll`` (type, target id, ``isTrusted``) in ``window.__events``. The chrome (Marionette, ``MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1``) reads the state of the dropdown, of
|
||||
the datalist list and of the page context menu. Each case waits (a condition with a deadline) until the page has heard what the record says and the popups are in the state it says, and then watches the same reading for one second (``observe``, the
|
||||
one bounded look of ``_window_origin``): it must not change, so an event or a reopening that comes after the verdict is seen. The events of the click that opened the popup are cleared first, after the page heard its release (that release is answered
|
||||
by the parent and comes to the page later). Every case runs on a fresh page, at the scales 1, 1.25 and 1.5.
|
||||
|
||||
THE POSITIVE CONTROLS. The dropdown is open (read from chrome) before every step. The second item is found from the chrome's own rectangle of the open dropdown, and its press must select it. After the wheel with a popup open, the same
|
||||
turn over the same page with the popup closed from chrome must scroll the page and be heard: the page scrolls and a ``wheel`` is recorded, so a page that does not scroll is not a page that cannot.
|
||||
|
||||
Red on an engine whose door hit-tests an arrow panel (the press over the doorhanger goes to the panel and the page hears nothing), and red on an engine whose input does not roll the popups up the way the platform does (the engine of the first measurements: a press on the anchor of an open dropdown reaches the page as a ``pointerdown`` and a ``mousedown`` and the dropdown opens again).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import json
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, frame_of
|
||||
from _stock_twin import MARIONETTE_ARGS, Chrome
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, observe, wait_for
|
||||
from test_a_select_dropdown_opens_at_its_element_e2e import CLOSE_JS
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The display scales of the cases: 1, 1.25 and 1.5 (the 2.0 case of ``CASES`` has its own panel and no capture of this step).
|
||||
SCALES = sorted(case for case, (scale, _panel) in CASES.items() if scale <= 1.5)
|
||||
#: How long the reading is watched once it is what the record says.
|
||||
WATCH_S = 1.0
|
||||
|
||||
#: The places on the page, CSS pixels of the viewport: the select (20, 20, 200 x 30), the input (20, 80, 200 x 30), a plain box (300, 20, 200 x 100) and a point of the page clear of all of them.
|
||||
ANCHOR_CENTRE = (120, 35)
|
||||
#: The last CSS pixel inside the anchor (the anchor ends at x = 220).
|
||||
ANCHOR_LAST_PIXEL = (219, 35)
|
||||
INPUT_CENTRE = (120, 95)
|
||||
BOX_CENTRE = (400, 70)
|
||||
PAGE_POINT = (800, 300)
|
||||
#: One notch of the wheel, downwards, as the client's ``deltaY`` (the capture's ``SendInput`` of -120 is a notch towards the user, which scrolls the page down).
|
||||
WHEEL_NOTCH = 120
|
||||
#: The select in a frame of another site: the frame is at (200, 20), the select at (20, 20) of it, 200 x 30, so its centre is at (320, 55) of the top viewport; a plain point of the top document is the box at (700, 20).
|
||||
FRAME_ANCHOR_CENTRE = (320, 55)
|
||||
|
||||
#: What every page records, in the capture phase, and what it can say about itself.
|
||||
RECORDER = """<script>
|
||||
window.__events = [];
|
||||
(function () {
|
||||
const name = n => n === window ? 'window' : n === document ? 'document' : n && n.nodeType === 1 ? (n.id || n.nodeName.toLowerCase()) : null;
|
||||
const types = ['pointerdown', 'mousedown', 'pointerup', 'mouseup', 'click', 'dblclick', 'auxclick', 'contextmenu', 'focus', 'blur', 'change', 'input', 'wheel', 'scroll'];
|
||||
for (const type of types) window.addEventListener(type, e => window.__events.push([e.type, name(e.target), e.isTrusted]), true);
|
||||
window.__reset = () => { window.__events.length = 0; };
|
||||
window.__read = () => {
|
||||
const s = document.getElementById('s');
|
||||
return {events: window.__events.slice(), active: name(document.activeElement), scrollY: window.scrollY, selectedIndex: s ? s.selectedIndex : null};
|
||||
};
|
||||
})();
|
||||
</script>"""
|
||||
|
||||
OPTIONS = "<option>one</option><option>two</option><option>three</option><option>four</option><option>five</option><option>six</option>"
|
||||
PAGE = ("<!doctype html><meta charset=utf-8><title>rollup</title>"
|
||||
"<style>html,body{margin:0;padding:0;height:3000px}"
|
||||
"#s{position:absolute;left:20px;top:20px;width:200px;height:30px}"
|
||||
"#i{position:absolute;left:20px;top:80px;width:200px;height:30px;box-sizing:border-box}"
|
||||
"#box{position:absolute;left:300px;top:20px;width:200px;height:100px;background:#bd9}</style>"
|
||||
"<body><select id=s>" + OPTIONS + "</select>"
|
||||
"<input id=i list=d><datalist id=d><option value=apple><option value=apricot><option value=avocado><option value=banana><option value=blueberry></datalist>"
|
||||
"<div id=box>box</div>" + RECORDER)
|
||||
#: A page that is one element over the whole viewport, so that any point of the viewport (also the one under a panel of the chrome) is a point of ``#target``.
|
||||
PANEL_PAGE = ("<!doctype html><meta charset=utf-8><title>panel</title>"
|
||||
"<style>html,body{margin:0;padding:0;height:100%}#target{position:fixed;left:0;top:0;right:0;bottom:0;background:#bd9}</style>"
|
||||
"<body><div id=target>target</div>" + RECORDER)
|
||||
CROSS = ("<!doctype html><meta charset=utf-8><title>rollup cross</title>"
|
||||
"<style>html,body{margin:0;padding:0;height:100%}"
|
||||
"#f{position:absolute;left:200px;top:20px;width:400px;height:300px;border:0}"
|
||||
"#top_box{position:absolute;left:700px;top:20px;width:200px;height:100px;background:#bd9}</style>"
|
||||
'<body><iframe id=f src="@FRAME@"></iframe><div id=top_box>top</div>' + RECORDER)
|
||||
FRAME = ("<!doctype html><meta charset=utf-8><title>rollup frame</title>"
|
||||
"<style>html,body{margin:0;padding:0;height:100%}#s{position:absolute;left:20px;top:20px;width:200px;height:30px}</style>"
|
||||
"<body><select id=s>" + OPTIONS + "</select>" + RECORDER)
|
||||
|
||||
#: The state of the three popups a press can roll up, read in the chrome: the dropdown of a select, the datalist's list and the page context menu (``absent`` where the element is not there).
|
||||
STATES_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const doc = win.document;
|
||||
const state = e => e && typeof e.state === "string" ? e.state : "absent";
|
||||
return JSON.stringify({select: state(doc.querySelector("#ContentSelectDropdown > menupopup")), autocomplete: state(doc.getElementById("PopupAutoComplete")),
|
||||
context: state(doc.getElementById("contentAreaContextMenu"))});
|
||||
"""
|
||||
#: Opens the notification panel as a sign-in's password doorhanger is opened: a popup notification of the selected tab, shown at once (not dismissed to its icon), and kept across a press on the page.
|
||||
SHOW_PANEL_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
win.PopupNotifications.show(win.gBrowser.selectedBrowser, "stealth-test-doorhanger", "Save the password?", null,
|
||||
{label: "Save", accessKey: "S", callback() {}}, [{label: "Not now", accessKey: "N", callback() {}}], {persistent: true});
|
||||
return JSON.stringify({});
|
||||
"""
|
||||
#: The state of the notification panel, and its rectangle in the chrome's CSS pixels from the top left of the content area (the unit of ``ITEM_JS``), with the content area's size.
|
||||
PANEL_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const panel = win.document.getElementById("notification-popup");
|
||||
const outer = panel.getOuterScreenRect();
|
||||
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
|
||||
const origin = win.windowUtils.toScreenRectInCSSUnits(b.left, b.top, 1, 1);
|
||||
return JSON.stringify({state: panel.state, type: panel.getAttribute("type"), dpr: win.devicePixelRatio,
|
||||
left: outer.left - origin.left, top: outer.top - origin.top, width: outer.width, height: outer.height, content: {width: b.width, height: b.height}});
|
||||
"""
|
||||
#: Closes whatever of the three is open, so the next page starts clean.
|
||||
HIDE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const doc = win.document;
|
||||
for (const popup of [doc.querySelector("#ContentSelectDropdown > menupopup"), doc.getElementById("PopupAutoComplete"), doc.getElementById("contentAreaContextMenu"), doc.getElementById("notification-popup")]) {
|
||||
if (popup && typeof popup.hidePopup === "function" && popup.state !== "closed") popup.hidePopup();
|
||||
}
|
||||
return JSON.stringify({});
|
||||
"""
|
||||
#: The middle of item ``arguments[0]`` of the open dropdown, in the chrome's CSS pixels from the top left of the content area: the popup's screen rectangle (``getOuterScreenRect``, the unit of
|
||||
#: ``toScreenRectInCSSUnits``, as ``test_a_select_dropdown_opens_at_its_element_e2e.py`` reads them) plus the item's place in the popup, less the content area's screen origin.
|
||||
ITEM_JS = """
|
||||
const [index] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
|
||||
const items = popup.querySelectorAll("menuitem");
|
||||
if (!items[index]) return JSON.stringify({error: "the dropdown has " + items.length + " items", state: popup.state});
|
||||
const outer = popup.getOuterScreenRect(), client = popup.getBoundingClientRect(), item = items[index].getBoundingClientRect();
|
||||
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
|
||||
const origin = win.windowUtils.toScreenRectInCSSUnits(b.left, b.top, 1, 1);
|
||||
return JSON.stringify({state: popup.state, items: items.length, dpr: win.devicePixelRatio,
|
||||
x: outer.left + (item.x - client.x) + item.width / 2 - origin.left, y: outer.top + (item.y - client.y) + item.height / 2 - origin.top,
|
||||
outer: {left: outer.left, top: outer.top, width: outer.width, height: outer.height}, origin: {left: origin.left, top: origin.top}});
|
||||
"""
|
||||
|
||||
|
||||
def ev(*rows: Tuple[str, str]) -> List[List[Any]]:
|
||||
"""The events a page is expected to hear: ``(type, target id)`` each, all trusted, as ``window.__events`` holds them."""
|
||||
return [[kind, at, True] for kind, at in rows]
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _session(firefox_binary: str, monkeypatch, case: str) -> Iterator[Tuple[Any, Chrome, Sites]]:
|
||||
"""Our browser on ``case`` with the pages served, and the chrome of it: ``(browser, chrome, sites)``. The first page is kept open (the window the chrome session waits for)."""
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites, launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
sites.route("A", "/page", PAGE)
|
||||
sites.route("A", "/cross", lambda handler: CROSS.replace("@FRAME@", sites.url("B", "/frame")))
|
||||
sites.route("B", "/frame", FRAME)
|
||||
holder = browser.new_page()
|
||||
chrome = Chrome(holder)
|
||||
try:
|
||||
yield browser, chrome, sites
|
||||
finally:
|
||||
chrome.close()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _fresh_page(browser: Any, chrome: Chrome, url: str) -> Iterator[Any]:
|
||||
"""A new page on ``url``, closed (with every popup of the browser) when the case is done."""
|
||||
page = browser.new_page()
|
||||
try:
|
||||
page.goto(url)
|
||||
yield page
|
||||
finally:
|
||||
chrome.script(HIDE_JS)
|
||||
page.close()
|
||||
|
||||
|
||||
def _states(chrome: Chrome) -> Dict[str, str]:
|
||||
return chrome.script(STATES_JS)
|
||||
|
||||
|
||||
def _reading(page: Any, chrome: Chrome, keys: Tuple[str, ...]) -> Dict[str, Any]:
|
||||
"""What the page and the chrome say now, reduced to ``keys`` (the page's events, active element, scrollY and selectedIndex, and the three popup states)."""
|
||||
reading = dict(page.evaluate("() => window.__read()"), **_states(chrome))
|
||||
return {key: reading[key] for key in keys}
|
||||
|
||||
|
||||
def _heard(page: Any, want_events: List[List[Any]]) -> bool:
|
||||
return page.evaluate("() => window.__read()")["events"] == want_events
|
||||
|
||||
|
||||
def _open_select(page: Any, chrome: Chrome, at: Tuple[float, float] = ANCHOR_CENTRE) -> None:
|
||||
"""Open the dropdown with a real click, wait for ``open`` in chrome and for the click's release to reach the page, then clear the page's events."""
|
||||
page.mouse.click(*at)
|
||||
assert wait_for(page, lambda: _states(chrome)["select"] == "open", DEADLINE_S), "the real click at %r did not open the dropdown (states %r)" % (at, _states(chrome))
|
||||
assert wait_for(page, lambda: any(row[0] == "click" for row in page.evaluate("() => window.__read()")["events"]), DEADLINE_S), (
|
||||
"the release of the click that opened the dropdown never reached the page (events %r)" % page.evaluate("() => window.__read()")["events"])
|
||||
page.evaluate("() => window.__reset()")
|
||||
|
||||
|
||||
def _open_context_menu(page: Any, chrome: Chrome) -> None:
|
||||
"""Open the page context menu with a real right click on the plain box, wait for ``open`` and for the page's ``contextmenu``, then clear the page's events."""
|
||||
page.mouse.click(*BOX_CENTRE, button="right")
|
||||
assert wait_for(page, lambda: _states(chrome)["context"] == "open", DEADLINE_S), "the real right click did not open the context menu (states %r)" % _states(chrome)
|
||||
assert wait_for(page, lambda: any(row[0] == "contextmenu" for row in page.evaluate("() => window.__read()")["events"]), DEADLINE_S), "the page never heard the contextmenu of the right click"
|
||||
page.evaluate("() => window.__reset()")
|
||||
|
||||
|
||||
def _settled(label: str, read: Callable[[], Dict[str, Any]], page: Any, want: Dict[str, Any]) -> str:
|
||||
"""Empty when the reading becomes ``want`` and then stays it for ``WATCH_S``; else what was seen (every distinct reading, in order). ``want`` names the keys that are read."""
|
||||
arrived = wait_for(page, lambda: read() == want, DEADLINE_S)
|
||||
looks = observe(page, read, WATCH_S)
|
||||
if arrived and looks == [want]:
|
||||
return ""
|
||||
return "%s: wanted %s, the reading %s; the distinct readings over the next %s s, in order: %s" % (
|
||||
label, json.dumps(want), "never came within %s s" % DEADLINE_S if not arrived else "came but did not stay", WATCH_S, json.dumps(looks))
|
||||
|
||||
|
||||
def _press_case(page: Any, chrome: Chrome, label: str, do: Callable[[], None], want: Dict[str, Any]) -> str:
|
||||
keys = tuple(want)
|
||||
do()
|
||||
return _settled(label, lambda: _reading(page, chrome, keys), page, want)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_on_the_anchor_of_an_open_select_is_not_heard_but_its_release_is(firefox_binary, monkeypatch, case):
|
||||
problems: List[str] = []
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
for name, point in (("the centre of the anchor", ANCHOR_CENTRE), ("the last CSS pixel inside the anchor", ANCHOR_LAST_PIXEL)):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
_open_select(page, chrome)
|
||||
want = {"events": ev(("pointerup", "s"), ("mouseup", "s"), ("click", "s")), "select": "closed", "active": "s", "selectedIndex": 0}
|
||||
problems.append(_press_case(page, chrome, "%s, %s" % (case, name), lambda: page.mouse.click(*point), want))
|
||||
assert not [p for p in problems if p], "a press on the anchor of the open dropdown did not roll it up as the platform does:\n " + "\n ".join(p for p in problems if p)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_outside_an_open_select_closes_it_and_is_heard_whole(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
_open_select(page, chrome)
|
||||
want = {"events": ev(("pointerdown", "box"), ("mousedown", "box"), ("blur", "s"), ("pointerup", "box"), ("mouseup", "box"), ("click", "box")),
|
||||
"select": "closed", "active": "body"}
|
||||
problem = _press_case(page, chrome, "%s, a press on a plain box" % case, lambda: page.mouse.click(*BOX_CENTRE), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_on_a_page_element_under_an_open_notification_panel_reaches_the_page(firefox_binary, monkeypatch, case):
|
||||
"""The doorhanger (``#notification-popup``, an arrow panel) is open over the page, and a click lands on the page element under it: the page hears the whole click, as with stock Playwright (its press goes to the page through the panels
|
||||
of the chrome). Red on an engine whose door hit-tests every popup of the rollup chain: the press goes to the panel and the page hears nothing of it."""
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
sites.route("A", "/panel", PANEL_PAGE)
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/panel")) as page:
|
||||
chrome.script(SHOW_PANEL_JS)
|
||||
assert wait_for(page, lambda: chrome.script(PANEL_JS)["state"] == "open", DEADLINE_S), "the notification panel did not open (reading %r)" % chrome.script(PANEL_JS)
|
||||
panel = chrome.script(PANEL_JS)
|
||||
assert panel["type"] == "arrow", "the panel that opened is not an arrow panel: %r" % panel
|
||||
page_scale = page.evaluate("() => window.devicePixelRatio")
|
||||
ratio = panel["dpr"] / page_scale
|
||||
# A point of the panel's body (its bottom, clear of the arrow) that is also a point of the content area: the page element under it is ``#target``.
|
||||
point = ((panel["left"] + panel["width"] / 2) * ratio, (panel["top"] + panel["height"] - 25) * ratio)
|
||||
assert 0 <= point[0] < panel["content"]["width"] and 0 <= point[1] < panel["content"]["height"], "the panel does not cover the content area at %r: %r" % (point, panel)
|
||||
page.evaluate("() => window.__reset()")
|
||||
want = {"events": ev(("pointerdown", "target"), ("mousedown", "target"), ("pointerup", "target"), ("mouseup", "target"), ("click", "target"))}
|
||||
problem = _press_case(page, chrome, "%s, a press at %r under the notification panel %r" % (case, point, panel), lambda: page.mouse.click(*point), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_right_press_on_the_anchor_of_an_open_select_closes_it_and_opens_the_context_menu(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
_open_select(page, chrome)
|
||||
want = {"events": ev(("pointerdown", "s"), ("mousedown", "s"), ("pointerup", "s"), ("mouseup", "s"), ("auxclick", "s"), ("contextmenu", "s")),
|
||||
"select": "closed", "context": "open", "active": "s"}
|
||||
problem = _press_case(page, chrome, "%s, a right click on the anchor" % case, lambda: page.mouse.click(*ANCHOR_CENTRE, button="right"), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_double_click_on_the_anchor_of_an_open_select_closes_it_and_opens_it_again(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
_open_select(page, chrome)
|
||||
want = {"events": ev(("pointerup", "s"), ("mouseup", "s"), ("click", "s"), ("pointerdown", "s"), ("mousedown", "s"), ("mouseup", "s"), ("click", "s")),
|
||||
"select": "open", "active": "s"}
|
||||
problem = _press_case(page, chrome, "%s, a double click on the anchor" % case, lambda: page.mouse.dblclick(*ANCHOR_CENTRE), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_and_a_release_at_once_on_a_select_reach_the_page_as_the_parents_mouseup_and_click(firefox_binary, monkeypatch, case):
|
||||
"""The press opens the dropdown and the release follows with no delay, as a script's ``click`` does: the release is the dropdown's own and the page hears the parent's ``mouseup`` and ``click`` with no ``pointerup``, as retail does for the
|
||||
release of the second press of a double click. Red on an engine that sends the release while the dropdown is still opening: the dropdown drops it, and the page hears ``pointerdown`` and ``mousedown`` and nothing after them."""
|
||||
problems: List[str] = []
|
||||
want = {"events": ev(("pointerdown", "s"), ("mousedown", "s"), ("mouseup", "s"), ("click", "s")), "select": "open", "active": "s"}
|
||||
|
||||
def zero_delay_click(page: Any) -> None:
|
||||
page.mouse.click(*ANCHOR_CENTRE, delay=0)
|
||||
|
||||
def press_then_release(page: Any) -> None:
|
||||
page.mouse.move(*ANCHOR_CENTRE)
|
||||
page.mouse.down()
|
||||
page.mouse.up()
|
||||
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
for name, step in (("click with delay 0", zero_delay_click), ("down then up", press_then_release)):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
# The select has the focus and is closed, as at the second press of the double click: nothing but the click is left to hear.
|
||||
page.evaluate("() => { document.getElementById('s').focus(); window.__reset(); }")
|
||||
assert _states(chrome)["select"] != "open", "the dropdown is open before the click: %r" % _states(chrome)
|
||||
problems.append(_press_case(page, chrome, "%s, %s on the anchor of a closed select" % (case, name), lambda step=step, page=page: step(page), want))
|
||||
assert not [p for p in problems if p], "a press and a release at once on a select did not reach the page as retail does:\n " + "\n ".join(p for p in problems if p)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_on_the_second_item_of_an_open_select_selects_it(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
_open_select(page, chrome)
|
||||
item = chrome.script(ITEM_JS, (1,))
|
||||
assert "error" not in item and item["items"] == 6, "the open dropdown did not give its second item: %r" % item
|
||||
page_scale = page.evaluate("() => window.devicePixelRatio")
|
||||
point = (item["x"] * item["dpr"] / page_scale, item["y"] * item["dpr"] / page_scale)
|
||||
want = {"events": ev(("mousedown", "option"), ("mouseup", "option"), ("input", "s"), ("change", "s"), ("click", "option")),
|
||||
"select": "closed", "selectedIndex": 1, "active": "s"}
|
||||
problem = _press_case(page, chrome, "%s, a press at %r on the second item (chrome read %r, page scale %r)" % (case, point, item, page_scale),
|
||||
lambda: page.mouse.click(*point), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_turn_of_the_wheel_with_a_popup_open_reaches_nothing_and_closes_nothing(firefox_binary, monkeypatch, case):
|
||||
problems: List[str] = []
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
for name, popup, opening, point in (("the dropdown open, over the page", "select", _open_select, PAGE_POINT),
|
||||
("the dropdown open, over the anchor", "select", _open_select, ANCHOR_CENTRE),
|
||||
("the context menu open, over the page", "context", _open_context_menu, PAGE_POINT)):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
opening(page, chrome)
|
||||
before = page.evaluate("() => window.scrollY")
|
||||
want = {"events": [], "scrollY": before, popup: "open"}
|
||||
|
||||
def turn(point=point, page=page) -> None:
|
||||
page.mouse.move(*point)
|
||||
page.mouse.wheel(0, WHEEL_NOTCH)
|
||||
|
||||
problems.append(_press_case(page, chrome, "%s, %s" % (case, name), turn, want))
|
||||
if popup == "select":
|
||||
# The positive control: the same turn over the same page with the popup closed scrolls it and is heard, so "nothing happened" above is not a page that cannot scroll.
|
||||
chrome.script(CLOSE_JS)
|
||||
assert wait_for(page, lambda: _states(chrome)["select"] == "closed", DEADLINE_S), "the dropdown did not close from chrome: %r" % _states(chrome)
|
||||
page.evaluate("() => window.__reset()")
|
||||
page.mouse.move(*PAGE_POINT)
|
||||
page.mouse.wheel(0, WHEEL_NOTCH)
|
||||
scrolled = wait_for(page, lambda: page.evaluate("() => window.scrollY") > before and any(row[0] == "wheel" for row in page.evaluate("() => window.__read()")["events"]), DEADLINE_S)
|
||||
assert scrolled, "the control wheel turn with no popup open did not scroll the page and reach it: %r" % page.evaluate("() => window.__read()")
|
||||
assert not [p for p in problems if p], "a turn of the wheel with a popup open was not swallowed whole by the platform:\n " + "\n ".join(p for p in problems if p)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_on_the_input_of_an_open_datalist_reaches_the_page(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/page")) as page:
|
||||
page.mouse.click(*INPUT_CENTRE)
|
||||
page.keyboard.type("a")
|
||||
assert wait_for(page, lambda: _states(chrome)["autocomplete"] == "open", DEADLINE_S), "a click on the input and a typed letter did not open the datalist list (states %r)" % _states(chrome)
|
||||
page.evaluate("() => window.__reset()")
|
||||
want = {"events": ev(("pointerdown", "i"), ("mousedown", "i"), ("pointerup", "i"), ("mouseup", "i"), ("click", "i")), "active": "i"}
|
||||
problem = _press_case(page, chrome, "%s, a press on the input with the datalist open" % case, lambda: page.mouse.click(*INPUT_CENTRE), want)
|
||||
assert not problem, problem
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", SCALES)
|
||||
def test_a_press_on_the_anchor_of_a_select_in_a_frame_of_another_site_is_heard_only_by_the_frame(firefox_binary, monkeypatch, case):
|
||||
with _session(firefox_binary, monkeypatch, case) as (browser, chrome, sites):
|
||||
with _fresh_page(browser, chrome, sites.url("A", "/cross")) as page:
|
||||
frame = None
|
||||
|
||||
def frame_up() -> bool:
|
||||
nonlocal frame
|
||||
frame = frame_of(page, sites.origin["B"], "/frame")
|
||||
try:
|
||||
return frame is not None and bool(frame.evaluate("() => !!window.__read"))
|
||||
except Exception: # noqa: BLE001 the frame is still loading: the wait goes on, and the deadline names it
|
||||
return False
|
||||
|
||||
assert wait_for(page, frame_up, DEADLINE_S), "the frame of the other site did not load; frames %r" % [f.url for f in page.frames]
|
||||
page.mouse.click(*FRAME_ANCHOR_CENTRE)
|
||||
assert wait_for(page, lambda: _states(chrome)["select"] == "open", DEADLINE_S), "the real click on the select of the frame did not open the dropdown (states %r)" % _states(chrome)
|
||||
assert wait_for(page, lambda: any(row[0] == "click" for row in frame.evaluate("() => window.__read()")["events"]), DEADLINE_S), "the release of the opening click never reached the frame"
|
||||
page.evaluate("() => window.__reset()")
|
||||
frame.evaluate("() => window.__reset()")
|
||||
|
||||
def read() -> Dict[str, Any]:
|
||||
top, inner = page.evaluate("() => window.__read()"), frame.evaluate("() => window.__read()")
|
||||
return {"frame_events": inner["events"], "top_events": top["events"], "select": _states(chrome)["select"], "top_active": top["active"], "frame_active": inner["active"]}
|
||||
|
||||
want = {"frame_events": ev(("pointerup", "s"), ("mouseup", "s"), ("click", "s")), "top_events": [], "select": "closed", "top_active": "f", "frame_active": "s"}
|
||||
page.mouse.click(*FRAME_ANCHOR_CENTRE)
|
||||
problem = _settled("%s, a press on the anchor of the select in the frame" % case, read, page, want)
|
||||
assert not problem, problem
|
||||
@@ -0,0 +1,149 @@
|
||||
"""A press outside the open list of a ``<datalist>`` ends as it does on stock Firefox with stock Playwright: the page hears what stock's page hears, and the list is in the state stock leaves it in.
|
||||
|
||||
WHY THIS TWIN. The engine's door rolls the popups of the chrome up the way the platform does before a press reaches the page (the select dropdown, the menus), and the list of a datalist is NOT one of
|
||||
the popups it rolls up (the page hears a press on the input whole, ``test_a_press_on_the_input_of_an_open_datalist_reaches_the_page`` of the rollup file). What a press OUTSIDE that list does is the
|
||||
other half of that exclusion, and its verdict is not a list of ours: it is what stock Firefox does for the same press, measured in the same run.
|
||||
|
||||
THE VERDICT IS "THE SAME AS STOCK" (``_stock_twin``): Playwright's own Firefox, driven by the stock Playwright client, does the same steps first, on the same local page, at the same window size and scale, and
|
||||
ours must read the same. What stock reads is the expected value; the test has no list of events of its own.
|
||||
|
||||
What it does, per display case (the four of the window tests), on each browser, with the client's own mouse and keyboard: a page of one site holds an ``<input list=dl>`` with a ``<datalist id=dl>`` of three options
|
||||
(``apple``, ``apricot``, ``avocado``) at (20, 20), 200 x 30, and a plain box ``#far`` at (450, 250), 250 x 100, clear of the input and of the list that opens under it. The page records, in the capture phase,
|
||||
``pointerdown``, ``mousedown``, ``pointerup``, ``mouseup``, ``click``, ``focus`` and ``blur`` (type, id of the target, ``isTrusted``) in ``window.__events``.
|
||||
|
||||
1. a click on the input and one typed letter (``a``) open the list;
|
||||
2. THE PRECONDITION, asserted in chrome on each browser: ``#PopupAutoComplete`` is ``open``, and the point of the press is outside its real rectangle (``getOuterScreenRect()`` against the real screen point of
|
||||
the press, as the tooltip twin converts it) and outside the input. A browser that does not reach it is a BROKEN CONTROL (red, no finding about ours), never a pass;
|
||||
3. the events are cleared, and the press and release go to the centre of ``#far``;
|
||||
4. the page's events are read once it has heard the click (or at the deadline, when a browser swallows it: that is a record too), and the state of ``#PopupAutoComplete`` and the focused element are watched for one
|
||||
second (``observe``, the one bounded look of ``_window_origin``); the last look is the record;
|
||||
5. THE POSITIVE CONTROL: with the list closed, the same press and release at the same point must be heard whole on ``#far`` by each browser (a page that heard nothing in step 4 is then a page that could hear,
|
||||
and the recorder works).
|
||||
|
||||
The record of a browser is ``{"press": {"events": [[type, target, trusted], ...], "list": state, "active": id}}``; the scales of each browser (page and chrome ``devicePixelRatio``, the real scale of the screen) are
|
||||
kept apart and printed when the records differ. Ours equals stock in every field of ``press``: no field is left out of the comparison.
|
||||
|
||||
The engine under test is not released yet: a door that rolls the list up with the platform's rule and does not give the page the press, or does not close the list, reads other than stock here and is RED on purpose.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _stock_twin import BrokenControl, Chrome, both, differences, run_twin
|
||||
from _window_origin import CASES, DEADLINE_S, observe, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The input, 200 x 30 at (20, 20); the far box, 250 x 100 at (450, 250), and the point of the press, its centre. The smallest viewport of the cases is 800 x 479 CSS pixels, so every point is inside it.
|
||||
INPUT_CENTRE = (120, 35)
|
||||
FAR_CENTRE = (575, 300)
|
||||
#: How long the list and the focus are watched after the press.
|
||||
WATCH_S = 1.0
|
||||
#: The types the page records.
|
||||
TYPES = ["pointerdown", "mousedown", "pointerup", "mouseup", "click", "focus", "blur"]
|
||||
|
||||
PAGE = """<!doctype html><meta charset=utf-8><title>datalist</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%%}
|
||||
#i{position:absolute;left:20px;top:20px;width:200px;height:30px;box-sizing:border-box}
|
||||
#far{position:absolute;left:450px;top:250px;width:250px;height:100px;background:#bd9}</style>
|
||||
<body><input id=i list=dl><datalist id=dl><option value=apple><option value=apricot><option value=avocado></datalist><div id=far>far</div><script>
|
||||
window.__events = [];
|
||||
(function () {
|
||||
const name = n => n === window ? 'window' : n === document ? 'document' : n && n.nodeType === 1 ? (n.id || n.nodeName.toLowerCase()) : null;
|
||||
for (const type of %s) window.addEventListener(type, e => window.__events.push([e.type, name(e.target), e.isTrusted]), true);
|
||||
window.__reset = () => { window.__events.length = 0; };
|
||||
window.__read = () => ({events: window.__events.slice(), active: name(document.activeElement)});
|
||||
})();
|
||||
</script>""" % repr(TYPES)
|
||||
|
||||
#: The state of the datalist's list in the chrome.
|
||||
LIST_STATE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.getElementById("PopupAutoComplete");
|
||||
return JSON.stringify({state: popup && typeof popup.state === "string" ? popup.state : "absent"});
|
||||
"""
|
||||
#: Where the list really is, and where a point of the page really is, both in CSS pixels of the screen of the chrome: whether the point is inside the list's rectangle.
|
||||
LIST_RECT_JS = """
|
||||
const [point] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.getElementById("PopupAutoComplete");
|
||||
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
|
||||
const p = win.windowUtils.toScreenRectInCSSUnits(b.left + point.x, b.top + point.y, 0, 0);
|
||||
const r = popup.getOuterScreenRect();
|
||||
return JSON.stringify({state: popup.state, pointer: {x: p.left, y: p.top}, list: {left: r.left, top: r.top, right: r.right, bottom: r.bottom},
|
||||
inside: p.left >= r.left && p.left <= r.right && p.top >= r.top && p.top <= r.bottom});
|
||||
"""
|
||||
|
||||
#: Closes the list from chrome, for the control press.
|
||||
HIDE_LIST_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.getElementById("PopupAutoComplete");
|
||||
if (popup && popup.state !== "closed") popup.hidePopup();
|
||||
return JSON.stringify({});
|
||||
"""
|
||||
|
||||
PRESS_EVENTS = [["pointerdown", "far", True], ["mousedown", "far", True], ["pointerup", "far", True], ["mouseup", "far", True], ["click", "far", True]]
|
||||
|
||||
|
||||
def _state(chrome: Chrome) -> str:
|
||||
return chrome.script(LIST_STATE_JS)["state"]
|
||||
|
||||
|
||||
def _read(page) -> Dict[str, Any]:
|
||||
return page.evaluate("() => window.__read()")
|
||||
|
||||
|
||||
def _clicked(page) -> bool:
|
||||
return any(row[0] == "click" for row in _read(page)["events"])
|
||||
|
||||
|
||||
def _steps(sites, page, chrome: Chrome) -> Dict[str, Any]:
|
||||
"""What one browser does and what the page and the chrome read of it. {"scales": ..., "press": {...}}."""
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
scales = chrome.scales()
|
||||
|
||||
page.mouse.click(*INPUT_CENTRE)
|
||||
page.keyboard.type("a")
|
||||
opened = wait_for(page, lambda: _state(chrome) == "open", DEADLINE_S)
|
||||
if not opened:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: a click on the input and a typed letter did not open the list of the datalist (#PopupAutoComplete is %r; page %r)" % (_state(chrome), _read(page)))
|
||||
where = chrome.script(LIST_RECT_JS, ({"x": FAR_CENTRE[0], "y": FAR_CENTRE[1]},))
|
||||
if where["state"] != "open" or where["inside"]:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the point of the press must be outside the open list (state %r, point inside the list: %r; list %r, point %r)"
|
||||
% (where["state"], where["inside"], where["list"], where["pointer"]))
|
||||
active = _read(page)["active"]
|
||||
if active != "i":
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the input must hold the focus while the list is open (focused: %r)" % active)
|
||||
|
||||
page.evaluate("() => window.__reset()")
|
||||
page.mouse.click(*FAR_CENTRE)
|
||||
wait_for(page, lambda: _clicked(page), DEADLINE_S) # at the deadline the browser has swallowed the press: the record says so
|
||||
looks: List[Any] = observe(page, lambda: [_state(chrome), _read(page)["active"]], WATCH_S)
|
||||
read = _read(page)
|
||||
press = {"events": read["events"], "list": looks[-1][0], "active": looks[-1][1]}
|
||||
|
||||
# the positive control: with the list closed, the same press is heard whole at the same point
|
||||
chrome.script(HIDE_LIST_JS)
|
||||
if not wait_for(page, lambda: _state(chrome) == "closed", DEADLINE_S):
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: the list did not close from chrome before the control press (state %r)" % _state(chrome))
|
||||
page.evaluate("() => window.__reset()")
|
||||
page.mouse.click(*FAR_CENTRE)
|
||||
wait_for(page, lambda: _clicked(page), DEADLINE_S)
|
||||
control = _read(page)["events"]
|
||||
if control != PRESS_EVENTS:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: with no popup open, a press at the same point was not heard whole on #far (heard %r, expected %r)" % (control, PRESS_EVENTS))
|
||||
return {"scales": scales, "press": press}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_press_outside_an_open_datalist_list_ends_as_on_stock(firefox_binary, monkeypatch, case):
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", PAGE)
|
||||
stock, ours = run_twin(case, firefox_binary, lambda page, chrome: _steps(sites, page, chrome))
|
||||
differing = differences(stock["press"], ours["press"], None, "press")
|
||||
assert not differing, (
|
||||
"%s: a press outside the open list of a datalist ends otherwise on ours than on stock (the page's events as [type, target, trusted], the state of #PopupAutoComplete after, the focused element):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, stock, ours)))
|
||||
@@ -7,7 +7,7 @@ element. The parent then opens the popup at those numbers, on the REAL screen. U
|
||||
from its element by the difference between the declared window and the real one (and, in a frame of another process, by the declared chrome offset too: the matrix of that process).
|
||||
|
||||
THE VERDICT IS "THE SAME AS RETAIL". The relation that is measured is not a number of ours: retail Firefox 159 (the official build, driven by Marionette alone, no Playwright, headed on
|
||||
the job's display: ``_retail_reference``) does the same steps, one browser at a time, on the same local pages, at the same display scale and in a window of the same outer size as ours (the retail window is set to it, and both inner sizes are compared first: a difference is BROKEN CONTROL), and ours must give the same relation. What retail does with the popup
|
||||
a display of its own: ``_retail_reference``) does the same steps, one browser at a time, on the same local pages, at the same display scale and in a window of the same outer size as ours (the retail window is set to it, and both inner sizes are compared first: a difference is BROKEN CONTROL), and ours must give the same relation. What retail does with the popup
|
||||
(a margin, a flip, a rounding) is then in both, and what differs is ours. Playwright's own Firefox is not the reference here: it is not what a user runs, and it is not known to take Marionette.
|
||||
|
||||
What it does, per display case (the four of the window tests), on each browser, which is launched with Marionette so that the test can read the chrome of the browser. A page of the top site has a
|
||||
@@ -27,6 +27,13 @@ THE RECORD: for each browser, the rectangles, and the scales: the page's ``devic
|
||||
not the chrome's puts the element at the wrong place by their ratio: the record also keeps ``dx_scaled`` and ``dy_scaled``, against the element scaled by page ratio over chrome ratio, so a red twin
|
||||
shows whether a scale mismatch between the page's CSS pixels and the chrome's is what moves the popup.
|
||||
|
||||
THE DIAGNOSIS (``_popup_evidence``): for each select, every failure of the steps and the verdict of the twin carry the click (CSS point, and the point the driver sent with its unit and its device point),
|
||||
the scales, the select's box in its own document and, for the frame, the frame element's box in the top document, ``mozInnerScreenX/Y`` of the top and of the frame, whether the window was the active one and
|
||||
had the focus when the click was sent and after it (chrome ``Services.focus.activeWindow``, ``document.hasFocus()``, the browsing context's ``isActive``, the content document's ``hasFocus()`` and ``visibilityState``, the
|
||||
driver's ack of the click), and the popup's state after the click, at
|
||||
the deadline and at a second look (a short wait on the same condition). The same record is written for every case, green or red, to ``$RUNNER_TEMP/invpw-evidence/popup-diagnostics/<case>-<browser>.json`` (the folder every job uploads), so
|
||||
a green run leaves the numbers to compare with a red one. Without browsers: ``test_the_select_twin_says_what_it_clicked_and_where.py``.
|
||||
|
||||
The engine that answers these values is not released yet: this test is red on an engine that declares the window origin without the map of the popups, on purpose.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -35,6 +42,7 @@ from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _popup_evidence import Diagnostics, click_record, look_at_activation, look_at_geometry
|
||||
from _retail_reference import Driver, run_retail_twin
|
||||
from _stock_twin import both, differences
|
||||
from _window_origin import CASES, DEADLINE_S, wait_for
|
||||
@@ -51,6 +59,9 @@ FRAME = """<!doctype html><meta charset=utf-8><title>select in a frame</title>
|
||||
<style>html,body{margin:0;padding:0}select{position:absolute;box-sizing:border-box;width:160px;height:28px;margin:0;left:40px;top:20px}</style>
|
||||
<body><select id=s><option>one</option><option>two</option><option>three</option></select>"""
|
||||
|
||||
#: How long the second look at a popup that missed its deadline lasts (a diagnosis, after the verdict).
|
||||
SECOND_LOOK_S = 2
|
||||
|
||||
#: The selects' rectangles in the top document's viewport, CSS pixels, as the CSS above gives them: x, y, width, height.
|
||||
SELECTS = {"top": {"x": 30, "y": 20, "w": 160, "h": 28}, "frame": {"x": 30 + 40, "y": 120 + 20, "w": 160, "h": 28}}
|
||||
|
||||
@@ -82,15 +93,30 @@ return JSON.stringify({state: popup.state});
|
||||
|
||||
|
||||
def _wait_state(driver: Driver, state: str) -> Dict[str, Any]:
|
||||
"""The popup's state once it is ``state`` (open or closed), polled; the last reading at the deadline."""
|
||||
seen: Dict[str, Any] = {}
|
||||
"""The popup's state once it is ``state`` (open or closed), polled. ``state`` is the last reading (at the deadline when it never came), ``after_click`` the first one."""
|
||||
reads: list = []
|
||||
|
||||
def look() -> bool:
|
||||
seen.update(driver.chrome.script(POPUP_STATE_JS))
|
||||
return seen["state"] == state
|
||||
reads.append(driver.chrome.script(POPUP_STATE_JS))
|
||||
return reads[-1]["state"] == state
|
||||
|
||||
wait_for(driver, look, DEADLINE_S)
|
||||
return seen
|
||||
return {"state": reads[-1]["state"], "after_click": reads[0], "at_deadline": reads[-1], "looks": len(reads)}
|
||||
|
||||
|
||||
def _second_look(driver: Driver, state: str) -> Dict[str, Any]:
|
||||
"""After a deadline that was missed: the same condition once more for ``SECOND_LOOK_S``, to say whether the popup came late (``reached``) and what it was when it did not. A diagnosis: the verdict is already red."""
|
||||
reads: list = []
|
||||
|
||||
def look() -> bool:
|
||||
try:
|
||||
reads.append(driver.chrome.script(POPUP_STATE_JS))
|
||||
except Exception as exc: # noqa: BLE001 the diagnosis never replaces the finding
|
||||
reads.append({"state": "unreadable: %s: %s" % (type(exc).__name__, str(exc)[:200])})
|
||||
return reads[-1]["state"] == state
|
||||
|
||||
reached = wait_for(driver, look, SECOND_LOOK_S)
|
||||
return {"state": reads[-1]["state"], "reached": reached, "looks": len(reads)}
|
||||
|
||||
|
||||
def _measure(driver: Driver, rect: Dict[str, float]) -> Dict[str, Any]:
|
||||
@@ -117,20 +143,51 @@ def _relation(read: Dict[str, Any], page_dpr: float) -> Dict[str, Any]:
|
||||
"dx_scaled": round((popup["left"] - scaled_left) * chrome_dpr, 3), "dy_scaled": round((popup["top"] - scaled_bottom) * chrome_dpr, 3)}
|
||||
|
||||
|
||||
def _steps(sites, driver: Driver) -> Dict[str, Any]:
|
||||
"""What one browser does: click each select, read the popup against its element, close it. {"scales": ..., "measured": {top, frame}}."""
|
||||
driver.goto(sites.url("A", "/page"))
|
||||
scales = driver.scales()
|
||||
measured: Dict[str, Any] = {}
|
||||
for name, rect in SELECTS.items():
|
||||
driver.click(rect["x"] + rect["w"] / 2, rect["y"] + rect["h"] / 2)
|
||||
opened = _wait_state(driver, "open")
|
||||
assert opened["state"] == "open", "the dropdown did not open after a click on the select of the %s document (popup state %r)" % (name, opened)
|
||||
measured[name] = _relation(_measure(driver, rect), scales["page"]["devicePixelRatio"])
|
||||
driver.chrome.script(CLOSE_JS)
|
||||
closed = _wait_state(driver, "closed")
|
||||
assert closed["state"] == "closed", "the dropdown of the %s document did not close (popup state %r)" % (name, closed)
|
||||
return {"scales": scales, "measured": measured}
|
||||
def _steps(sites, driver: Driver, case: str = "unknown") -> Dict[str, Any]:
|
||||
"""What one browser does: click each select, read the popup against its element, close it. {"scales": ..., "measured": {top, frame}, "diagnostics": the record of each select}.
|
||||
|
||||
Every failure here carries the record of the select it is about (``Diagnostics.message``), and the record is saved whatever the result."""
|
||||
diagnostics = Diagnostics(case, driver.kind)
|
||||
try:
|
||||
driver.goto(sites.url("A", "/page"))
|
||||
scales = driver.scales()
|
||||
diagnostics.scales = scales
|
||||
measured: Dict[str, Any] = {}
|
||||
for name, rect in SELECTS.items():
|
||||
entry = diagnostics.entry(name)
|
||||
entry.update(look_at_geometry(driver, in_frame=name == "frame"))
|
||||
point = (rect["x"] + rect["w"] / 2, rect["y"] + rect["h"] / 2)
|
||||
entry["activation_at_click"] = look_at_activation(driver)
|
||||
driver.click(*point)
|
||||
entry["click"] = click_record(driver, point)
|
||||
entry["activation_after_click"] = look_at_activation(driver)
|
||||
opened = _wait_state(driver, "open")
|
||||
entry["popup"] = {"after_click": opened["after_click"], "at_deadline": opened["at_deadline"], "looks": opened["looks"]}
|
||||
if opened["state"] != "open":
|
||||
entry["popup"]["second_look"] = _second_look(driver, "open")
|
||||
raise AssertionError(diagnostics.message("the dropdown did not open after a click on the select of the %s document (popup state %r)" % (name, opened["state"]), name))
|
||||
measured[name] = _relation(_measure(driver, rect), scales["page"]["devicePixelRatio"])
|
||||
entry["relation"] = measured[name]
|
||||
driver.chrome.script(CLOSE_JS)
|
||||
closed = _wait_state(driver, "closed")
|
||||
entry["popup"]["closed"] = closed["at_deadline"]
|
||||
if closed["state"] != "closed":
|
||||
entry["popup"]["second_look"] = _second_look(driver, "closed")
|
||||
raise AssertionError(diagnostics.message("the dropdown of the %s document did not close (popup state %r)" % (name, closed["state"]), name))
|
||||
finally:
|
||||
diagnostics.save()
|
||||
return {"scales": scales, "measured": measured, "diagnostics": diagnostics.entries}
|
||||
|
||||
|
||||
def _verdict(case: str, retail: Dict[str, Any], ours: Dict[str, Any]) -> str:
|
||||
"""The message of a twin that differs: where the two relations differ, then both records whole (the scales and the diagnostics of each select are in them). Empty when equal."""
|
||||
# one device pixel of the chrome: the popup's position is rounded once, the element's once
|
||||
relation = lambda record: {name: {key: value[key] for key in ("dx", "dy", "dx_scaled", "dy_scaled")} for name, value in record["measured"].items()} # noqa: E731
|
||||
differing = differences(relation(retail), relation(ours), {"dx": 1.0, "dy": 1.0, "dx_scaled": 1.0, "dy_scaled": 1.0}, "measured")
|
||||
if not differing:
|
||||
return ""
|
||||
return ("%s: the dropdown of ours is not where retail's is against its element (dx, dy in device pixels of each chrome, both measured against the element's real rectangle):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, retail, ours, "retail")))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
@@ -139,10 +196,6 @@ def test_a_select_dropdown_opens_at_its_element_as_on_retail(firefox_binary, mon
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/select"))
|
||||
sites.route("B", "/select", FRAME)
|
||||
retail, ours = run_retail_twin(case, firefox_binary, lambda driver: _steps(sites, driver))
|
||||
# one device pixel of the chrome: the popup's position is rounded once, the element's once
|
||||
relation = lambda record: {name: {key: value[key] for key in ("dx", "dy", "dx_scaled", "dy_scaled")} for name, value in record["measured"].items()} # noqa: E731
|
||||
differing = differences(relation(retail), relation(ours), {"dx": 1.0, "dy": 1.0, "dx_scaled": 1.0, "dy_scaled": 1.0}, "measured")
|
||||
assert not differing, (
|
||||
"%s: the dropdown of ours is not where retail's is against its element (dx, dy in device pixels of each chrome, both measured against the element's real rectangle):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, retail, ours, "retail")))
|
||||
retail, ours = run_retail_twin(case, firefox_binary, lambda driver: _steps(sites, driver, case))
|
||||
message = _verdict(case, retail, ours)
|
||||
assert not message, message
|
||||
@@ -0,0 +1,157 @@
|
||||
"""A select's dropdown that a mouse press opened stays open when the button is released and while the pointer sits still, as on every Firefox: only a press elsewhere or the wheel closes a menu.
|
||||
|
||||
A menu popup is closed by the platform on a mouse DOWN outside it and on the wheel (``nsWindow::DealWithPopups``), never on a mouse UP or a mouse MOVE. The automation's input used to close the
|
||||
open menus on the release and on a move too, so a page that pressed the button on a select and let go saw the dropdown vanish: the dropdown of a select that a real user opens with a click is open
|
||||
after the click, and a page can read that from the select's own events (``blur``, a ``change`` that never comes) and from where the next click lands.
|
||||
|
||||
Per case, ``top`` (the select of the top document) and ``frame`` (the select of a frame of another site), on one display case (``CASE``, the 1920x1080 panel at scale 1.0), with the client's own mouse:
|
||||
the pointer moves to the centre of the select, the button goes down, the test waits until the chrome-scope state of ``#ContentSelectDropdown > menupopup`` is ``open`` (the wait of the select twin,
|
||||
a condition with a deadline), the button goes up, and the state is read over the next second (``observe``, the one bounded look of ``_window_origin``) and must have been ``open`` at every look and
|
||||
never anything else. Then the popup is closed from chrome and the wait is for ``closed``.
|
||||
|
||||
The page also sees the release. A release that the parent handles in chrome (the dropdown is open) is answered without waiting for the content process, and on retail the page then gets a trusted ``mouseup`` and
|
||||
``click`` on the ``<select>``, dispatched by ``SelectChild`` after the parent's ``Forms:MouseUp``, asynchronously. The pages record both on the select (``RECORD``), and the test WAITS for them as a page observes them
|
||||
(``wait_for`` on the page's own log, the deadline of the file): they are never assumed to have arrived by the time ``page.mouse.up()`` returned.
|
||||
|
||||
The negative control, per place: the same flow with a chrome ``hidePopup`` between the press and the release must read ``closed`` after the release, so the reader is shown to see a closed popup (a
|
||||
reader that answered ``open`` whatever the popup did would pass the first test for nothing).
|
||||
|
||||
One more test, the case the engine's old unguarded call was there for: a chrome context menu that captures the mouse (on Linux it opens at the press). A right click on the page opens
|
||||
``#contentAreaContextMenu``; then several moves across the page, a left click elsewhere and a move again must each RETURN (no call hangs, none throws the client's ack timeout, the duration of
|
||||
each is in the message of a failure), and the menu is ``closed`` after the press of that click (the platform closes a menu on a press outside it).
|
||||
|
||||
The pages, the reads of the chrome and the wait are those of ``test_a_select_dropdown_opens_at_its_element_e2e.py`` (imported, not copied). Needs ``MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1`` for the chrome reads.
|
||||
Red on an engine whose Juggler closes menus on a release or a move: the dropdown reads ``closed`` after the button went up.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import time
|
||||
from typing import Any, Dict, Iterator, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _retail_reference import PlaywrightDriver
|
||||
from _stock_twin import MARIONETTE_ARGS, Chrome
|
||||
from _window_origin import DEADLINE_S, launch_case, observe, wait_for
|
||||
from test_a_select_dropdown_opens_at_its_element_e2e import CLOSE_JS, FRAME, POPUP_STATE_JS, SELECTS, TOP, _wait_state
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The display case of every test here: the maximized 1920x1080 window at scale 1.0.
|
||||
CASE = "1920x1080-dpr1.0"
|
||||
#: How long the state is watched after the release.
|
||||
WATCH_S = 1.0
|
||||
#: What each page (the top document and the frame) records on its ``<select>``: the events of the release, as the page sees them, in the order they came, with whether they are trusted.
|
||||
RECORD = """<script>window.__log = [];
|
||||
for (const type of ['mouseup', 'click']) document.getElementById('s').addEventListener(type, e => window.__log.push([type, e.isTrusted]));</script>"""
|
||||
|
||||
|
||||
def _centre(name: str) -> Tuple[float, float]:
|
||||
rect = SELECTS[name]
|
||||
return rect["x"] + rect["w"] / 2, rect["y"] + rect["h"] / 2
|
||||
|
||||
|
||||
def _state(driver: PlaywrightDriver) -> str:
|
||||
return driver.chrome.script(POPUP_STATE_JS)["state"]
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _page(firefox_binary: str, monkeypatch) -> Iterator[Tuple[Any, Chrome, PlaywrightDriver, Sites]]:
|
||||
"""Our browser on ``CASE`` with the pages of the select twin served: ``(page, chrome, driver, sites)``, on the A page."""
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites, launch_case(firefox_binary, CASE, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/select") + RECORD)
|
||||
sites.route("B", "/select", FRAME + RECORD)
|
||||
page = browser.new_page() # first: the window the chrome session waits for
|
||||
chrome = Chrome(page)
|
||||
try:
|
||||
driver = PlaywrightDriver(page, chrome)
|
||||
driver.goto(sites.url("A", "/page"))
|
||||
yield page, chrome, driver, sites
|
||||
finally:
|
||||
chrome.close()
|
||||
|
||||
|
||||
def _flow(firefox_binary: str, monkeypatch, name: str, hide_between: bool) -> Dict[str, Any]:
|
||||
"""Press on the select, wait for ``open``, optionally hide the popup from chrome, release, and read the state for ``WATCH_S``. What was seen, step by step."""
|
||||
x, y = _centre(name)
|
||||
with _page(firefox_binary, monkeypatch) as (page, chrome, driver, sites):
|
||||
page.mouse.move(x, y)
|
||||
page.mouse.down()
|
||||
opened = _wait_state(driver, "open")
|
||||
seen: Dict[str, Any] = {"at": [x, y], "after_press": opened["state"], "deadline_s": DEADLINE_S}
|
||||
if hide_between:
|
||||
chrome.script(CLOSE_JS)
|
||||
seen["after_hide"] = _wait_state(driver, "closed")["state"]
|
||||
page.mouse.up()
|
||||
looks: List[Any] = observe(page, lambda: _state(driver), WATCH_S)
|
||||
seen["after_release"] = looks
|
||||
if not hide_between:
|
||||
# The release was answered by the parent alone; the page's mouseup and click come later, from the content process, so they are waited for in the page's own log
|
||||
# (never assumed to be there when the call returned).
|
||||
document = page.main_frame if name == "top" else next(f for f in page.frames if f.url == sites.url("B", "/select"))
|
||||
seen["page_events_arrived"] = wait_for(page, lambda: len(document.evaluate("window.__log")) >= 2, DEADLINE_S)
|
||||
seen["page_events"] = [tuple(row) for row in document.evaluate("window.__log")]
|
||||
if looks[-1] == "open":
|
||||
chrome.script(CLOSE_JS)
|
||||
seen["after_close"] = _wait_state(driver, "closed")["state"]
|
||||
return seen
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", sorted(SELECTS))
|
||||
def test_a_dropdown_opened_by_a_press_stays_open_after_the_release(firefox_binary, monkeypatch, name):
|
||||
seen = _flow(firefox_binary, monkeypatch, name, hide_between=False)
|
||||
assert seen["after_press"] == "open", "the press on the select of the %s document did not open the dropdown: %r" % (name, seen)
|
||||
assert seen["after_release"] == ["open"], (
|
||||
"the dropdown of the %s document did not stay open after the button went up (every look over %s s must read open, in the order seen): %r" % (name, WATCH_S, seen))
|
||||
assert seen["after_close"] == "closed", "the popup did not close when chrome hid it: %r" % seen
|
||||
assert seen["page_events_arrived"] and seen["page_events"] == [("mouseup", True), ("click", True)], (
|
||||
"the page of the %s document did not see a trusted mouseup and click on the select after the release (waited %s s for both): %r" % (name, DEADLINE_S, seen))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", sorted(SELECTS))
|
||||
def test_a_popup_hidden_between_the_press_and_the_release_reads_closed_after_it(firefox_binary, monkeypatch, name):
|
||||
"""The negative control: the reader sees a closed popup, so the first test's ``open`` is not what the reader says whatever happens."""
|
||||
seen = _flow(firefox_binary, monkeypatch, name, hide_between=True)
|
||||
assert seen["after_press"] == "open" and seen["after_hide"] == "closed", "the control did not reach its starting state (open, then hidden): %r" % seen
|
||||
assert seen["after_release"] == ["closed"], "a popup that chrome hid reads %r after the release, not closed: %r" % (seen["after_release"], seen)
|
||||
|
||||
|
||||
#: The chrome context menu of a page (the browser chrome's own element).
|
||||
CONTEXT_MENU_STATE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const menu = win.document.getElementById("contentAreaContextMenu");
|
||||
return JSON.stringify({state: menu ? menu.state : "no menu"});
|
||||
"""
|
||||
|
||||
#: Where the right click opens the menu, the moves across the page, the left click elsewhere and the last move: top-viewport CSS pixels, all on blank page.
|
||||
MENU_AT = (700, 300)
|
||||
MOVES = ((200, 500), (900, 500), (500, 600))
|
||||
CLICK_AT = (900, 200)
|
||||
LAST_MOVE = (500, 450)
|
||||
|
||||
|
||||
def test_a_context_menu_closes_on_the_next_press_and_no_input_call_hangs(firefox_binary, monkeypatch):
|
||||
calls: List[Tuple[str, float]] = []
|
||||
|
||||
def timed(label: str, call, *args, **kwargs):
|
||||
"""One input call: it must return (a hang or the client's ack timeout raises or stalls here); how long it took goes in the message of a failure, never in a bound."""
|
||||
began = time.monotonic()
|
||||
try:
|
||||
return call(*args, **kwargs)
|
||||
finally:
|
||||
calls.append((label, round(time.monotonic() - began, 3)))
|
||||
|
||||
with _page(firefox_binary, monkeypatch) as (page, chrome, _driver, _):
|
||||
menu = lambda: chrome.script(CONTEXT_MENU_STATE_JS)["state"] # noqa: E731
|
||||
timed("right click", page.mouse.click, *MENU_AT, button="right")
|
||||
opened = wait_for(page, lambda: menu() == "open", DEADLINE_S)
|
||||
assert opened, "the right click on the page did not open the chrome context menu (state %r); calls (s): %r" % (menu(), calls)
|
||||
for i, point in enumerate(MOVES):
|
||||
timed("move %d" % i, page.mouse.move, *point)
|
||||
timed("left click", page.mouse.click, *CLICK_AT)
|
||||
closed = wait_for(page, lambda: menu() == "closed", DEADLINE_S)
|
||||
timed("move after", page.mouse.move, *LAST_MOVE)
|
||||
assert closed, "the context menu was still %r after the press of a click elsewhere on the page; calls (s): %r" % (menu(), calls)
|
||||
assert [label for label, _ in calls] == ["right click", "move 0", "move 1", "move 2", "left click", "move after"], "an input call did not return: %r" % calls
|
||||
@@ -0,0 +1,295 @@
|
||||
"""A served browser measures the UDP exit of a proxy endpoint once, and keeps the final verdict for its own life.
|
||||
|
||||
The core waits for the FINAL verdict of a SOCKS5 proxy before the proxy is declared to the engine, and a browser keeps
|
||||
the verdicts per endpoint (`invisible_core._udp_exit.UdpExitCache`, one per core `Browser`). The wrapper's served browser
|
||||
(`BrowserDispatcher`) is that browser for the contexts of its clients, so it keeps ONE cache and passes it on every
|
||||
context proxy: the first context given an endpoint pays the wait, the later ones reuse the verdict, and a second served
|
||||
browser starts with nothing of the first one's.
|
||||
|
||||
No network and no engine: the measurement is a fake that counts its calls, and the connection records the commands.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core import _udp_exit
|
||||
from invisible_core._udp_exit import UdpExitCache
|
||||
from invisible_core.juggler.connection import EventListeners
|
||||
from invisible_playwright._juggler.server import BrowserDispatcher, Server
|
||||
from _browser_census import closes_with_the_test
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
PROXY = {"server": "socks5://192.0.2.10:1080", "username": "u", "password": "p"}
|
||||
OTHER = {"server": "socks5://192.0.2.11:1080", "username": "u", "password": "p"}
|
||||
|
||||
|
||||
class _Connection(EventListeners):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
closes_with_the_test(self)
|
||||
self.sent = []
|
||||
|
||||
def startup_send(self, method, params=None):
|
||||
return self.send(method, params, timeout=None)
|
||||
|
||||
def send(self, method, params=None, session=None, timeout=30):
|
||||
self.sent.append((method, params))
|
||||
return {"browserContextId": "CTX"}
|
||||
|
||||
|
||||
class _Measurements:
|
||||
"""The fake of `_udp_exit._measured`: what the core would measure through the proxy, counted per endpoint."""
|
||||
|
||||
def __init__(self, verdict="coherent"):
|
||||
self.verdict = verdict
|
||||
self.calls = []
|
||||
|
||||
def __call__(self, proxy, udp_stun_servers):
|
||||
self.calls.append(proxy["server"])
|
||||
return self.verdict, True
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def measured(monkeypatch):
|
||||
fake = _Measurements()
|
||||
monkeypatch.setattr(_udp_exit, "_measured", fake)
|
||||
return fake
|
||||
|
||||
|
||||
def _served_browser():
|
||||
return BrowserDispatcher(Server(), None, _Connection(), "151.0")
|
||||
|
||||
|
||||
def _context_proxy_commands(browser, proxy):
|
||||
browser.conn.sent.clear()
|
||||
browser._apply_context_options("CTX", {"proxy": dict(proxy)})
|
||||
return [p for m, p in browser.conn.sent if m == "Browser.setContextProxy"]
|
||||
|
||||
|
||||
def test_two_contexts_of_one_served_browser_given_one_endpoint_measure_it_once(measured):
|
||||
browser = _served_browser()
|
||||
first = _context_proxy_commands(browser, PROXY)
|
||||
second = _context_proxy_commands(browser, PROXY)
|
||||
assert [c["udp"] for c in first + second] == ["coherent", "coherent"]
|
||||
assert measured.calls == [PROXY["server"]], "one cache, one verdict: the second context measured again"
|
||||
|
||||
|
||||
def test_another_endpoint_of_the_same_served_browser_is_measured_of_its_own(measured):
|
||||
browser = _served_browser()
|
||||
_context_proxy_commands(browser, PROXY)
|
||||
_context_proxy_commands(browser, OTHER)
|
||||
_context_proxy_commands(browser, OTHER)
|
||||
assert measured.calls == [PROXY["server"], OTHER["server"]]
|
||||
|
||||
|
||||
def test_two_served_browsers_do_not_share_a_cache(measured):
|
||||
one, other = _served_browser(), _served_browser()
|
||||
assert isinstance(one.udp_exit_cache, UdpExitCache) and isinstance(other.udp_exit_cache, UdpExitCache)
|
||||
assert one.udp_exit_cache is not other.udp_exit_cache
|
||||
_context_proxy_commands(one, PROXY)
|
||||
_context_proxy_commands(other, PROXY)
|
||||
assert measured.calls == [PROXY["server"], PROXY["server"]], "the second browser reused a verdict of the first"
|
||||
|
||||
|
||||
def test_a_context_proxy_command_carries_the_verdict_the_cache_holds(monkeypatch):
|
||||
def nothing_is_measured(proxy, udp_stun_servers):
|
||||
raise AssertionError("the cache held the verdict: nothing is measured")
|
||||
monkeypatch.setattr(_udp_exit, "_measured", nothing_is_measured)
|
||||
browser = _served_browser()
|
||||
browser.udp_exit_cache.remember(PROXY, "no")
|
||||
command, = _context_proxy_commands(browser, PROXY)
|
||||
assert command["udp"] == "no" and command["browserContextId"] == "CTX"
|
||||
|
||||
|
||||
def test_a_verdict_that_could_not_be_compared_is_declared_unmeasured_and_not_kept(monkeypatch):
|
||||
fake = _Measurements("unmeasured")
|
||||
monkeypatch.setattr(_udp_exit, "_measured", lambda proxy, servers: (fake(proxy, servers)[0], False))
|
||||
browser = _served_browser()
|
||||
assert [c["udp"] for c in _context_proxy_commands(browser, PROXY)] == ["unmeasured"]
|
||||
assert [c["udp"] for c in _context_proxy_commands(browser, PROXY)] == ["unmeasured"]
|
||||
assert len(fake.calls) == 2, "an inconclusive verdict is measured again, never kept"
|
||||
|
||||
|
||||
def test_the_launch_hands_its_verdict_to_the_cache_of_the_browser_it_serves():
|
||||
"""`op_launch` builds the served browser, then gives its cache the verdict the launch's geo step measured for the
|
||||
session's proxy (as the core's `launch` does for its `Browser`): the first context given that endpoint measures nothing."""
|
||||
import inspect
|
||||
|
||||
from invisible_playwright._juggler import server
|
||||
source = inspect.getsource(server.BrowserTypeDispatcher.op_launch)
|
||||
assert 'browser.udp_exit_cache.remember(params["proxy"], udp_exit)' in source
|
||||
assert source.index("browser = (self.browser_class or BrowserDispatcher)(") < source.index("udp_exit_cache.remember(")
|
||||
assert source.index("udp_exit_cache.remember(") < source.index('return {"browser": browser.channel}')
|
||||
cache = UdpExitCache()
|
||||
cache.remember(PROXY, "coherent")
|
||||
cache.remember(OTHER, "unmeasured")
|
||||
assert cache.final_for(PROXY) == "coherent"
|
||||
assert UdpExitCache.key(OTHER) not in cache._values, "an unmeasured verdict is not kept"
|
||||
|
||||
|
||||
# the wait is paid off the loop ------------------------------------------------------------------------------------
|
||||
def test_a_context_proxy_that_is_being_measured_holds_up_no_other_command_of_the_browser(monkeypatch):
|
||||
"""The core WAITS for the final verdict (about 11 s for a first endpoint) inside `new_context(proxy=...)`. That call is
|
||||
answered by a worker of the transport (`InProcessTransport._work`), never by the asyncio loop that carries every
|
||||
command of the client: while a first context's measurement is held, a second `new_context` of the same browser is
|
||||
answered. Red if the wait ran on the loop (it would never come back to read the second command)."""
|
||||
import asyncio
|
||||
import threading
|
||||
|
||||
from invisible_playwright._juggler.transport import InProcessTransport
|
||||
|
||||
entered, release = threading.Event(), threading.Event()
|
||||
|
||||
def held(proxy, udp_stun_servers):
|
||||
entered.set()
|
||||
# Bounded, so that a wait that blocks the loop fails this test instead of hanging it.
|
||||
assert release.wait(8), "the measurement was never released"
|
||||
return "coherent", True
|
||||
monkeypatch.setattr(_udp_exit, "_measured", held)
|
||||
|
||||
async def scenario():
|
||||
server = Server()
|
||||
transport = InProcessTransport(asyncio.get_running_loop(), server)
|
||||
replies = {}
|
||||
got = {1: asyncio.Event(), 2: asyncio.Event()}
|
||||
|
||||
def on_message(message):
|
||||
if message.get("id") in got:
|
||||
replies[message["id"]] = message
|
||||
got[message["id"]].set()
|
||||
transport.on_message = on_message
|
||||
await transport.connect()
|
||||
browser = BrowserDispatcher(server, None, _Connection(), "151.0")
|
||||
try:
|
||||
transport.send({"id": 1, "guid": browser.guid, "method": "newContext", "params": {"proxy": dict(PROXY)}})
|
||||
await asyncio.wait_for(asyncio.get_running_loop().run_in_executor(None, entered.wait, 8), 10)
|
||||
assert entered.is_set(), "the first context's measurement never began"
|
||||
transport.send({"id": 2, "guid": browser.guid, "method": "newContext", "params": {}})
|
||||
try:
|
||||
await asyncio.wait_for(got[2].wait(), 5)
|
||||
finally:
|
||||
release.set()
|
||||
await asyncio.wait_for(got[1].wait(), 10)
|
||||
finally:
|
||||
release.set()
|
||||
transport.request_stop()
|
||||
await asyncio.wait_for(transport.wait_until_stopped(), 30)
|
||||
return replies
|
||||
|
||||
replies = asyncio.run(scenario())
|
||||
assert "error" not in replies[2] and "error" not in replies[1], replies
|
||||
assert replies[1]["result"]["context"]["guid"] != replies[2]["result"]["context"]["guid"]
|
||||
|
||||
|
||||
def test_four_or_more_proxied_contexts_waiting_at_once_leave_the_workers_free(monkeypatch):
|
||||
"""A scraping client opens several proxied contexts together. Each waits for its proxy's verdict; none may hold one of the
|
||||
transport's four workers (`InProcessTransport.WORKERS`), or the next command of that client waits behind the measurements.
|
||||
Five measurements are held at once and a sixth command, a context without a proxy, is answered; then all are released and all six
|
||||
get replies, and no thread of the waiting is left after the stop. Red when the wait holds the worker that took the command."""
|
||||
import asyncio
|
||||
import threading
|
||||
import time
|
||||
|
||||
from invisible_playwright._juggler.transport import InProcessTransport
|
||||
|
||||
ENDPOINTS = 5
|
||||
started = threading.Semaphore(0)
|
||||
release = threading.Event()
|
||||
|
||||
def held(proxy, udp_stun_servers):
|
||||
started.release()
|
||||
assert release.wait(20), "the measurement was never released"
|
||||
return "coherent", True
|
||||
monkeypatch.setattr(_udp_exit, "_measured", held)
|
||||
|
||||
def entered_count():
|
||||
count = 0
|
||||
while started.acquire(blocking=False):
|
||||
count += 1
|
||||
return count
|
||||
|
||||
async def scenario():
|
||||
loop = asyncio.get_running_loop()
|
||||
server = Server()
|
||||
transport = InProcessTransport(loop, server)
|
||||
got = {n: asyncio.Event() for n in range(1, ENDPOINTS + 2)}
|
||||
replies = {}
|
||||
|
||||
def on_message(message):
|
||||
if message.get("id") in got:
|
||||
replies[message["id"]] = message
|
||||
got[message["id"]].set()
|
||||
transport.on_message = on_message
|
||||
await transport.connect()
|
||||
browser = BrowserDispatcher(server, None, _Connection(), "151.0")
|
||||
began = 0
|
||||
try:
|
||||
for n in range(1, ENDPOINTS + 1):
|
||||
proxy = {"server": "socks5://192.0.2.%d:1080" % (20 + n), "username": "u", "password": "p"}
|
||||
transport.send({"id": n, "guid": browser.guid, "method": "newContext", "params": {"proxy": proxy}})
|
||||
# Wait for as many as can begin (all five, when none holds a worker), then send the other command.
|
||||
deadline = time.monotonic() + 3
|
||||
while began < ENDPOINTS and time.monotonic() < deadline:
|
||||
began += entered_count()
|
||||
await asyncio.sleep(0.02)
|
||||
transport.send({"id": ENDPOINTS + 1, "guid": browser.guid, "method": "newContext", "params": {}})
|
||||
try:
|
||||
await asyncio.wait_for(got[ENDPOINTS + 1].wait(), 4)
|
||||
sixth_answered_while_held = True
|
||||
except asyncio.TimeoutError:
|
||||
sixth_answered_while_held = False
|
||||
release.set()
|
||||
for n in got:
|
||||
await asyncio.wait_for(got[n].wait(), 20)
|
||||
finally:
|
||||
release.set()
|
||||
transport.request_stop()
|
||||
await asyncio.wait_for(transport.wait_until_stopped(), 30)
|
||||
return began, sixth_answered_while_held, replies
|
||||
|
||||
began, sixth_answered_while_held, replies = asyncio.run(scenario())
|
||||
assert sixth_answered_while_held, "the sixth command waited behind the measurements (%d began)" % began
|
||||
assert began == ENDPOINTS
|
||||
assert sorted(replies) == list(range(1, ENDPOINTS + 2))
|
||||
assert not [m for m in replies.values() if "error" in m], replies
|
||||
assert len({m["result"]["context"]["guid"] for m in replies.values()}) == ENDPOINTS + 1
|
||||
for t in [t for t in threading.enumerate() if t.name == "invpw-answer-later"]:
|
||||
t.join(5) # the server has seen its work end; the thread is a moment from its last line
|
||||
assert not [t for t in threading.enumerate() if t.name == "invpw-answer-later"], "a thread of the waiting is left"
|
||||
|
||||
|
||||
def test_a_proxied_context_whose_wait_fails_is_answered_with_the_error_and_leaves_no_context(monkeypatch):
|
||||
"""An answer that comes later still ends: a failure of the work is the client's error reply, with the client's id."""
|
||||
import asyncio
|
||||
|
||||
from invisible_playwright._juggler.transport import InProcessTransport
|
||||
|
||||
def broken(proxy, udp_stun_servers):
|
||||
raise RuntimeError("the measurement broke")
|
||||
monkeypatch.setattr(_udp_exit, "_measured", broken)
|
||||
|
||||
async def scenario():
|
||||
server = Server()
|
||||
transport = InProcessTransport(asyncio.get_running_loop(), server)
|
||||
done, replies = asyncio.Event(), {}
|
||||
|
||||
def on_message(message):
|
||||
if message.get("id") == 7:
|
||||
replies[7] = message
|
||||
done.set()
|
||||
transport.on_message = on_message
|
||||
await transport.connect()
|
||||
conn = _Connection()
|
||||
browser = BrowserDispatcher(server, None, conn, "151.0")
|
||||
try:
|
||||
transport.send({"id": 7, "guid": browser.guid, "method": "newContext", "params": {"proxy": dict(PROXY)}})
|
||||
await asyncio.wait_for(done.wait(), 10)
|
||||
finally:
|
||||
transport.request_stop()
|
||||
await asyncio.wait_for(transport.wait_until_stopped(), 30)
|
||||
return replies[7], conn
|
||||
|
||||
reply, conn = asyncio.run(scenario())
|
||||
assert "result" not in reply and "the measurement broke" in reply["error"]["error"]["message"]
|
||||
assert [m for m, _ in conn.sent if m == "Browser.removeBrowserContext"], "the context made before the failure was left"
|
||||
@@ -6,7 +6,7 @@ calls ``#remoteBrowserTooltip.openPopupAtScreen(x / devicePixelRatio, y / device
|
||||
process, so that event point is a DECLARED screen point; opened as it is, the tooltip would sit away from the pointer by (declared - real) origin, and, in a frame of another
|
||||
process, by the declared chrome offset of its matrix as well. The engine maps the point back to the real one in the parent, before the popup opens (the tooltip map).
|
||||
|
||||
THE VERDICT IS "THE SAME OFFSET AS RETAIL". Retail Firefox 159 (the official build, driven by Marionette alone, no Playwright, headed on the job's display: ``_retail_reference``) does the
|
||||
THE VERDICT IS "THE SAME OFFSET AS RETAIL". Retail Firefox 159 (the official build, driven by Marionette alone, no Playwright, headed on a display of its own: ``_retail_reference``) does the
|
||||
same steps, one browser at a time, on the same local pages, at the same display scale and in a window of the same outer size as ours (the retail window is set to it, and both inner sizes are compared first: a difference is BROKEN CONTROL); the tooltip's offset from the pointer on ours equals retail's within two device pixels. The rule Firefox computes
|
||||
(``tooltip_offset()``: ``LookAndFeel::kDefaultTooltipOffset`` = 21 CSS pixels, widget/LookAndFeel.h:349, ``nsMenuPopupFrame::GetMargin`` layout/xul/nsMenuPopupFrame.cpp:2249; on Windows
|
||||
``GetTooltipOffsetVertical``, widget/windows/nsLookAndFeel.cpp:43-51, makes it ceil(21 * cursor size / 32) when the system cursor size is not 32) is in each record as a cross-check
|
||||
|
||||
+81
-6
@@ -15,6 +15,7 @@ import datetime
|
||||
import inspect
|
||||
import json
|
||||
import shutil
|
||||
import sysconfig
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
@@ -24,6 +25,7 @@ import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_host as host # noqa: E402
|
||||
from _ab_host_declared import GFXTEST_ROW, gfxtest_rows # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
@@ -60,7 +62,7 @@ def judge(a, b, **kw):
|
||||
|
||||
|
||||
def expected():
|
||||
return host.load_expected()
|
||||
return gfxtest_rows()
|
||||
|
||||
|
||||
def fake_engine(root, package, payload=b"engine bytes"):
|
||||
@@ -239,11 +241,9 @@ def test_nothing_is_excused_there_is_no_list_of_noise():
|
||||
# -
|
||||
# The declared differences.
|
||||
|
||||
def test_the_declared_difference_is_the_gfxtest_of_linux_by_kind_and_there_is_one_only():
|
||||
entries = expected()
|
||||
assert [(e["id"], e["os"], e["category"], e["name"]) for e in entries] == [("gfxtest-69", "linux", "proc", "gfxtest")]
|
||||
assert "0e896e4ee1" in entries[0]["reason"] and "GfxInfo.cpp:55" in entries[0]["reason"]
|
||||
assert len(entries) <= 1, "the list of declared differences may only shrink"
|
||||
def test_the_file_declares_nothing_now_that_the_published_engine_no_longer_spawns_gfxtest_and_the_row_of_the_test_is_by_kind():
|
||||
assert host.load_expected() == [], "the published engine is the 70, which does not spawn gfxtest: its row would be stale in every run (the list may only shrink)"
|
||||
assert [(e["id"], e["os"], e["category"], e["name"]) for e in expected()] == [("gfxtest-69", "linux", "proc", "gfxtest")]
|
||||
|
||||
|
||||
def test_the_declared_gfxtest_difference_passes_in_an_a_b():
|
||||
@@ -3743,3 +3743,78 @@ def test_a_read_of_the_list_that_fails_after_stop_is_read_again_until_the_sessio
|
||||
with pytest.raises(host.TraceError, match="could not be read in 1 s after `logman stop`, the last error: logman query -ets failed with 0x80071068"):
|
||||
trace2._stop_session(clock.sleep, clock.now, 1.0)
|
||||
|
||||
|
||||
|
||||
# -
|
||||
# Each side's own install folder is that side's own package (engine final candidate, run 46227711139, Linux: the same read of the branding of the core, in the folder each side's core is installed in).
|
||||
|
||||
PUBLISHED_INSTALL = "/srv/ci/work/_temp/published-set/lib/python3.11/site-packages"
|
||||
CANDIDATE_INSTALL = "/opt/hostedtoolcache/Python/3.11.18/x64/lib/python3.11/site-packages"
|
||||
BRANDING = "invisible_core/branding/official/branding.zip"
|
||||
SIDES = {"published": PUBLISHED_INSTALL, "candidate": CANDIDATE_INSTALL}
|
||||
|
||||
|
||||
def a_side_context(monkeypatch, tmp_path, install):
|
||||
"""The Context `_context` makes in the python of a side whose packages are installed in `install` (sysconfig says so), launching /e/firefox."""
|
||||
monkeypatch.setattr(sysconfig, "get_paths", lambda *args, **kwargs: {"purelib": install, "platlib": install})
|
||||
return host._context("/e/firefox", False, tmp_path)
|
||||
|
||||
|
||||
def a_side_footprint(engine, ctx, touched):
|
||||
"""The footprint of a side that touched `touched` besides FILES: the host paths the classifier leaves, as the run records them."""
|
||||
fp = footprint(engine)
|
||||
found, ours = host.classify_paths(list(FILES) + list(touched), ctx)
|
||||
for seed in fp["seeds"]:
|
||||
seed["files"], seed["ours"] = found, ours
|
||||
return fp
|
||||
|
||||
|
||||
@pytest.mark.parametrize("side", ["published", "candidate"])
|
||||
def test_the_branding_of_the_core_each_side_reads_in_its_own_install_folder_is_its_own_package(monkeypatch, tmp_path, side):
|
||||
ctx = a_side_context(monkeypatch, tmp_path, SIDES[side])
|
||||
assert host.classify(SIDES[side] + "/" + BRANDING, ctx) == ("package", BRANDING)
|
||||
assert host.classify_paths([SIDES[side] + "/" + BRANDING], ctx) == ([], {"package": 1})
|
||||
|
||||
|
||||
def test_the_pair_of_the_run_is_no_difference_when_each_side_is_judged_in_its_own_install_folder(monkeypatch, tmp_path):
|
||||
a = a_side_footprint("firefox-70", a_side_context(monkeypatch, tmp_path, PUBLISHED_INSTALL), [PUBLISHED_INSTALL + "/" + BRANDING])
|
||||
b = a_side_footprint("candidate", a_side_context(monkeypatch, tmp_path, CANDIDATE_INSTALL), [CANDIDATE_INSTALL + "/" + BRANDING])
|
||||
report = judge(a, b, expected=[])
|
||||
assert report["verdict"] == "green", report["problems"]
|
||||
assert report["differences"] == [] and [s["ours"] for s in a["seeds"]] == [{"package": 1}, {"package": 1}] == [s["ours"] for s in b["seeds"]]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("side,path", [
|
||||
("candidate", PUBLISHED_INSTALL + "/" + BRANDING), # the other side's install folder
|
||||
("published", CANDIDATE_INSTALL + "/" + BRANDING),
|
||||
("published", "/srv/ci/work/_temp/published-set/lib/python3.11/os.py"), # the python's own library, outside the folder packages are installed in
|
||||
("candidate", CANDIDATE_INSTALL + "-other/" + BRANDING), # a sibling folder that only starts with the same text
|
||||
("candidate", "/etc/machine-id"), # a path of the host, declared nowhere
|
||||
])
|
||||
def test_a_path_outside_the_side_s_own_install_folder_stays_a_host_path_and_a_difference(monkeypatch, tmp_path, side, path):
|
||||
a_ctx = a_side_context(monkeypatch, tmp_path, PUBLISHED_INSTALL)
|
||||
b_ctx = a_side_context(monkeypatch, tmp_path, CANDIDATE_INSTALL)
|
||||
own = {"published": PUBLISHED_INSTALL, "candidate": CANDIDATE_INSTALL}
|
||||
a = a_side_footprint("firefox-70", a_ctx, [own["published"] + "/" + BRANDING] + ([path] if side == "published" else []))
|
||||
b = a_side_footprint("candidate", b_ctx, [own["candidate"] + "/" + BRANDING] + ([path] if side == "candidate" else []))
|
||||
report = judge(a, b, expected=[])
|
||||
assert report["verdict"] == "red", "a read of %s by the %s side is nobody's package" % (path, side)
|
||||
assert {d["leaf"] for d in report["differences"]} == {"file." + path}
|
||||
|
||||
|
||||
def test_the_install_folders_of_a_process_are_where_its_python_installs_packages_with_the_real_folder_too(monkeypatch, tmp_path):
|
||||
real = tmp_path / "real"
|
||||
real.mkdir()
|
||||
monkeypatch.setattr(sysconfig, "get_paths", lambda *args, **kwargs: {"purelib": str(real), "platlib": str(real / ".." / "real")})
|
||||
assert str(real) in host.install_folders() and os.path.realpath(str(real / ".." / "real")) in host.install_folders()
|
||||
assert host.install_folders() <= {sysconfig.get_paths()["purelib"], os.path.realpath(sysconfig.get_paths()["purelib"]), sysconfig.get_paths()["platlib"],
|
||||
os.path.realpath(sysconfig.get_paths()["platlib"])}
|
||||
|
||||
|
||||
def test_the_row_of_the_graphics_probe_is_stale_when_the_published_engine_no_longer_spawns_it_and_the_file_declares_nothing():
|
||||
without = {k: n for k, n in KINDS.items() if k != "gfxtest"}
|
||||
a, b = footprint("firefox-70", kinds=without), a_candidate_without_gfxtest()
|
||||
report = judge(a, b, expected=expected())
|
||||
assert report["verdict"] == "red" and report["stale"] == ["gfxtest-69"] and report["declared"] == [] and report["differences"] == []
|
||||
assert report["problems"] == ["the declared difference 'gfxtest-69' (%s) does not show in this run: it is stale, remove it" % GFXTEST_ROW["reason"]]
|
||||
assert judge(a, b, expected=host.load_expected())["verdict"] == "green", "the file declares nothing: the same run is green"
|
||||
@@ -17,6 +17,7 @@ import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_host as host # noqa: E402
|
||||
from _ab_host_declared import gfxtest_rows # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
@@ -66,7 +67,7 @@ def test_the_a_a_of_a_real_run_has_no_red_path(run, swap):
|
||||
@pytest.mark.parametrize("run", ("45077433049", "45088980743"))
|
||||
def test_the_a_b_of_a_real_run_whose_candidate_is_the_same_engine_has_no_red_path(run):
|
||||
first, again, candidate = real(run, "68"), real(run, "68-again"), real(run, "candidate")
|
||||
report = host.judge(first, candidate, expected=host.load_expected(), also_68=[again])
|
||||
report = host.judge(first, candidate, expected=gfxtest_rows(), also_68=[again])
|
||||
assert file_leaves(report) == set(), sorted(file_leaves(report))[:5]
|
||||
|
||||
|
||||
@@ -74,7 +75,7 @@ def test_the_install_folder_of_the_candidate_is_a_constant_difference_and_stays_
|
||||
"""Run 45060573559: the candidate was installed in another folder, so the hash of the folder in the names the updater makes (uninstall_ping_<hash>_..., updatelock-<hash>,
|
||||
updates\\<hash>) differs in EVERY launch of each side."""
|
||||
first, again, candidate = real("45060573559", "68"), real("45060573559", "68-again"), real("45060573559", "candidate")
|
||||
report = host.judge(first, candidate, expected=host.load_expected(), also_68=[again])
|
||||
report = host.judge(first, candidate, expected=gfxtest_rows(), also_68=[again])
|
||||
assert report["verdict"] == "red"
|
||||
hashed = {d["leaf"]: d for d in report["differences"] if d["category"] == "file" and any(
|
||||
h in d["leaf"] for h in ("uninstall_ping_", "updatelock-", BS + "updates" + BS, BS + "updates")) and "mozilla" in d["leaf"]}
|
||||
@@ -86,7 +87,7 @@ def test_the_install_folder_of_the_candidate_is_a_constant_difference_and_stays_
|
||||
|
||||
def test_the_declared_difference_of_a_real_linux_run_is_still_declared_and_not_red():
|
||||
first, again, candidate = real(LINUX_RUN, "68"), real(LINUX_RUN, "68-again"), real(LINUX_RUN, "candidate")
|
||||
report = host.judge(first, candidate, expected=host.load_expected(), also_68=[again])
|
||||
report = host.judge(first, candidate, expected=gfxtest_rows(), also_68=[again])
|
||||
assert report["verdict"] == "green", report["problems"]
|
||||
assert report["differences"] == [] and report["stale"] == []
|
||||
assert {d["leaf"] for d in report["declared"]} >= {"proc.gfxtest"} and {d["id"] for d in report["declared"]} == {"gfxtest-69"}
|
||||
@@ -225,7 +226,7 @@ GFX = "/var/lib/probe/gfxtest-only"
|
||||
def test_a_difference_the_list_declares_stays_declared_with_its_paths_and_is_not_lost_nor_red():
|
||||
kinds = dict(KINDS, gfxtest=1)
|
||||
a = built("firefox-68", only_in(MEASURED, (GFX,)), by={GFX: ["gfxtest"]}, kinds=kinds)
|
||||
report = judge(a, built("candidate"), expected=host.load_expected())
|
||||
report = judge(a, built("candidate"), expected=gfxtest_rows())
|
||||
assert report["verdict"] == "green", report["problems"]
|
||||
assert {d["leaf"] for d in report["declared"]} == {"proc.gfxtest"} | {"file." + GFX} and {d["id"] for d in report["declared"]} == {"gfxtest-69"}
|
||||
assert report["differences"] == []
|
||||
|
||||
@@ -18,8 +18,8 @@ Two modes, chosen by the environment as the gate chooses it:
|
||||
candidate set, or on all of them when the pull request changes a file of this oracle (AB_HOST_PR_SEEDS, exported by the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py).
|
||||
This is the stability measurement: what the two traces do not agree on is a difference in diff-a-a.json, and red here says "what is compared is not stable". Nothing is
|
||||
excused: there is no list of noise.
|
||||
* a candidate (the gate's ab_oracle leg: INVPW_BINARY_PATH the candidate's binary, INVISIBLE_SEAL_FILE its seal): the A/A on the published firefox-68 (its seal and archive
|
||||
fetched the way the core fetches an engine) on every seed of the set, then the published engine against the candidate, with the declared differences of ci/ab-host-expected.json.
|
||||
* a candidate (the gate's ab_oracle leg: INVPW_BINARY_PATH the candidate's binary, INVISIBLE_SEAL_FILE its seal): the A/A on the engine of the PUBLISHED SET (INVPW_PUBLISHED_PYTHON: its own core and wrapper in a venv, its engine fetched the way its core
|
||||
fetches one) on every seed of the set, then the published engine against the candidate, with the declared differences of ci/ab-host-expected.json.
|
||||
|
||||
The launches run with a cache folder and a temp root of their own, so they leave nothing for the fontconfig test's cold launch and what the engine makes there is `ours`.
|
||||
|
||||
@@ -56,7 +56,8 @@ PR_SEEDS = 2
|
||||
def expected_footprints(candidate: bool, platform: str) -> list:
|
||||
"""The footprints a green run writes, sorted: the two runs of the published engine, the candidate's in the A/B, and on Windows the stock control's, which runs after a green
|
||||
A/A on every Windows run, a pull request included (run 45165805370: the control passed and the list without it was red)."""
|
||||
names = ["footprint-68-again.json", "footprint-68.json"] + (["footprint-candidate.json"] if candidate else [])
|
||||
number = host.oracle.default_tag().rsplit("-", 1)[-1] # the engine of the published set (a pull request: the engine of the core in use)
|
||||
names = ["footprint-%s-again.json" % number, "footprint-%s.json" % number] + (["footprint-candidate.json"] if candidate else [])
|
||||
return sorted(names + (["footprint-stock.json"] if platform == "win32" else []))
|
||||
|
||||
|
||||
|
||||
@@ -1778,7 +1778,7 @@ def test_each_engine_run_of_the_network_oracle_has_a_cache_folder_of_its_own_tha
|
||||
def _ab_args(tmp_path, *extra):
|
||||
empty = tmp_path / "volatile.json"
|
||||
empty.write_text(json.dumps({"format": ab.VOLATILE_FORMAT, "entries": []}), encoding="utf-8")
|
||||
return ["ab", "--out", str(tmp_path / "out"), "--published-binary", "published-ff", "--published-seal", "pub.seal.json", "--volatile", str(empty), "--seeds", "11,12", *extra]
|
||||
return ["ab", "--out", str(tmp_path / "out"), "--engine-tag", "firefox-68", "--published-binary", "published-ff", "--published-seal", "pub.seal.json", "--volatile", str(empty), "--seeds", "11,12", *extra]
|
||||
|
||||
|
||||
def test_the_a_a_first_then_the_candidate_and_a_broken_control_stops_the_a_b(tmp_path, monkeypatch, capsys):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""The network A/B oracle on a runner: the same journey on the local lab with the published firefox-68 engine twice (the A/A, the control), and, with a candidate, against the candidate.
|
||||
"""The network A/B oracle on a runner: the same journey on the local lab with the engine of the published set twice (the A/A, the control), and, with a candidate, against the candidate.
|
||||
|
||||
scripts/ci_ab_network.py walks the P4 journey (17 steps), one HTTPS site (HTTP/1.1 and HTTP/2), one HTTP/3 site, one WebRTC page and two idle launches through a SOCKS5 gateway in coherent mode, with the fake DoH,
|
||||
a witness and the watcher of direct connections, and writes what the lab saw as a transcript: the hosts contacted in order, the DNS questions, the TLS ClientHello, the HTTP/2 frames, every request head in
|
||||
|
||||
@@ -464,7 +464,7 @@ def test_ab_with_the_hunt_variable_runs_only_the_walk_n_times_for_each_engine_of
|
||||
monkeypatch.setattr(ab, "run_engine", never)
|
||||
monkeypatch.setattr(ab, "compare_files", never)
|
||||
monkeypatch.setenv(ab.HUNT_ENV, "webrtc:4:3")
|
||||
assert ab.main(["ab", "--a-a", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 0
|
||||
assert ab.main(["ab", "--a-a", "--engine-tag", "firefox-68", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 0
|
||||
binary = str(Path("/e/firefox"))
|
||||
assert calls == [(binary, None, "firefox-68", 4, 3), (binary, None, "firefox-68-again", 4, 3)]
|
||||
hunt = tmp_path / "network" / "hunt"
|
||||
@@ -480,14 +480,14 @@ def test_ab_with_the_hunt_variable_runs_only_the_walk_n_times_for_each_engine_of
|
||||
def test_a_hunt_decides_nothing_even_when_an_engine_run_fails(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(ab, "hunt_engine", lambda *a, **k: 1)
|
||||
monkeypatch.setenv(ab.HUNT_ENV, "webrtc:4:2")
|
||||
assert ab.main(["ab", "--a-a", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 0
|
||||
assert ab.main(["ab", "--a-a", "--engine-tag", "firefox-68", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 0
|
||||
assert json.loads((tmp_path / "network" / "hunt" / "summary.json").read_text(encoding="utf-8"))["repetitions"] == []
|
||||
|
||||
|
||||
def test_a_hunt_variable_that_does_not_read_is_refused_and_runs_nothing(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.setattr(ab, "hunt_engine", lambda *a, **k: pytest.fail("a spec that does not read runs nothing"))
|
||||
monkeypatch.setenv(ab.HUNT_ENV, "webrtc:4")
|
||||
assert ab.main(["ab", "--a-a", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 2
|
||||
assert ab.main(["ab", "--a-a", "--engine-tag", "firefox-68", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox"]) == 2
|
||||
assert "FAIL AB_NETWORK_HUNT" in capsys.readouterr().out
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ def test_without_the_hunt_variable_ab_is_the_a_a_it_was(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(ab, "hunt_engine", lambda *a, **k: pytest.fail("no hunt without the variable"))
|
||||
ran = []
|
||||
monkeypatch.setattr(ab, "run_engine", lambda binary, seal, label, seeds, out: ran.append(label) or 1)
|
||||
assert ab.main(["ab", "--a-a", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox", "--seeds", "4"]) == 2
|
||||
assert ab.main(["ab", "--a-a", "--engine-tag", "firefox-68", "--out", str(tmp_path / "network"), "--published-binary", "/e/firefox", "--seeds", "4"]) == 2
|
||||
assert ran == ["firefox-68", "firefox-68-again"], "the A/A runs the engine twice and says so when neither made a transcript: its own red, as before"
|
||||
|
||||
|
||||
|
||||
+22
-11
@@ -25,6 +25,15 @@ VISITS = tuple((dpr, seed) for dpr in gate.DPRS for seed in gate.SEEDS)
|
||||
SMALL = {dpr: 6 for dpr in gate.DPRS}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def no_declared_differences(tmp_path_factory, monkeypatch):
|
||||
"""The visits of these tests are fake pages: the real rows of ci/ab-oracle-expected.json (what the persona seeds 6 and 63 read) are not theirs. The rows are tested in
|
||||
tests/test_ab_oracle_declared_differences.py."""
|
||||
empty = tmp_path_factory.mktemp("declared") / "ab-oracle-expected.json"
|
||||
empty.write_text(json.dumps({"format": ab.EXPECTED_FORMAT, "differences": []}), encoding="utf-8")
|
||||
monkeypatch.setattr(ab, "EXPECTED_FILE", empty)
|
||||
|
||||
|
||||
def items(seed=11):
|
||||
"""A visit of the page: nested objects, an image, a list, and a diag. value. The visit of seed 0 also has the second launch on a reused profile, under relaunch."""
|
||||
out = {
|
||||
@@ -194,9 +203,9 @@ def test_the_floor_is_what_the_host_gate_s_own_reference_holds_today():
|
||||
assert ab.MIN_LEAVES[dpr] == len(ref), "the reference holds %d leaves at dpr %s: move MIN_LEAVES with it" % (len(ref), dpr)
|
||||
|
||||
|
||||
def test_the_published_engine_is_firefox_68_and_its_dump_is_named_for_it():
|
||||
assert ab.ENGINE_TAG == "firefox-68" and ab.dump_name("firefox-68") == "dump-68.json"
|
||||
assert ab.dump_name("firefox-69") == "dump-69.json"
|
||||
def test_the_published_engine_is_named_by_the_set_never_by_the_harness_and_its_dump_is_named_for_it():
|
||||
assert not hasattr(ab, "ENGINE_TAG"), "a tag written in the harness is a baseline that goes stale at the next release (firefox-68 was held as the control when firefox-70 was published)"
|
||||
assert ab.dump_name("firefox-68") == "dump-68.json" and ab.dump_name("firefox-70") == "dump-70.json"
|
||||
|
||||
|
||||
# --- the files --------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -238,7 +247,7 @@ def test_compare_from_the_files_writes_the_diff_and_exits_by_the_verdict(tmp_pat
|
||||
|
||||
|
||||
def _compare(directory, capsys):
|
||||
rc = ab.main(["compare", str(directory)])
|
||||
rc = ab.main(["compare", "--engine-tag", "firefox-68", str(directory)])
|
||||
capsys.readouterr()
|
||||
return rc, (directory / "diff.json").read_text(encoding="utf-8")
|
||||
|
||||
@@ -280,7 +289,7 @@ def test_a_run_whose_engine_cannot_be_fetched_is_red_and_says_why(tmp_path, monk
|
||||
raise RuntimeError("the release index is down")
|
||||
|
||||
monkeypatch.setattr(ab, "fetch_published", broken)
|
||||
rc = ab.run("cand", tmp_path / "cand.seal.json", "leg", tmp_path / "out", "firefox-68")
|
||||
rc = ab.run("cand", tmp_path / "cand.seal.json", "linux-x86_64", tmp_path / "out", "firefox-68")
|
||||
out = capsys.readouterr().out
|
||||
assert rc == 1 and "FAIL RuntimeError: the release index is down" in out
|
||||
assert (tmp_path / "out" / "diff.json").is_file()
|
||||
@@ -522,9 +531,9 @@ def test_the_a_a_compares_again_from_the_files(tmp_path, monkeypatch, capsys):
|
||||
full = {key: items(key[1]) for key in asked}
|
||||
ab.write_json(tmp_path / "dump-68.json", ab.pack("firefox-68", full))
|
||||
ab.write_json(tmp_path / ab.again_name("firefox-68"), ab.pack("firefox-68-again", full))
|
||||
assert ab.main(["compare", str(tmp_path), "--a-a", "--limit", "2"]) == 0
|
||||
assert ab.main(["compare", "--engine-tag", "firefox-68", str(tmp_path), "--a-a", "--limit", "2"]) == 0
|
||||
ab.write_json(tmp_path / ab.again_name("firefox-68"), ab.pack("firefox-68-again", _changed(full)))
|
||||
assert ab.main(["compare", str(tmp_path), "--a-a", "--limit", "2"]) == 2
|
||||
assert ab.main(["compare", "--engine-tag", "firefox-68", str(tmp_path), "--a-a", "--limit", "2"]) == 2
|
||||
|
||||
|
||||
def test_the_limit_takes_the_first_seeds_and_the_command_line_needs_a_candidate_or_a_published_engine(tmp_path):
|
||||
@@ -563,11 +572,11 @@ def test_a_pull_request_that_touches_no_oracle_runs_the_default_seeds():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path,only", [
|
||||
("scripts/ci_host_gate.py", "AB_ORACLE_PR_SEEDS"), ("scripts/host_gate/exceptions.json", "AB_ORACLE_PR_SEEDS"), ("scripts/host_gate/page/index.html", "AB_ORACLE_PR_SEEDS"),
|
||||
("scripts/ci_host_gate.py", "AB_ORACLE_PR_SEEDS"), ("ci/ab-oracle-expected.json", "AB_ORACLE_PR_SEEDS"), ("scripts/host_gate/exceptions.json", "AB_ORACLE_PR_SEEDS"), ("scripts/host_gate/page/index.html", "AB_ORACLE_PR_SEEDS"),
|
||||
("tests/test_ab_oracle.py", "AB_ORACLE_PR_SEEDS"), ("tests/test_ab_oracle_e2e.py", "AB_ORACLE_PR_SEEDS"),
|
||||
("scripts/ci_ab_network.py", "AB_NETWORK_PR_SEEDS"), ("ci/ab-network-volatile.json", "AB_NETWORK_PR_SEEDS"), ("tests/test_ab_network_e2e.py", "AB_NETWORK_PR_SEEDS"),
|
||||
("scripts/ci_ab_host.py", "AB_HOST_PR_SEEDS"), ("ci/ab-host-expected.json", "AB_HOST_PR_SEEDS"), ("tests/test_ab_host.py", "AB_HOST_PR_SEEDS"),
|
||||
("tests/_strace_stand_in.py", "AB_HOST_PR_SEEDS"),
|
||||
("tests/_strace_stand_in.py", "AB_HOST_PR_SEEDS"), ("tests/_ab_host_declared.py", "AB_HOST_PR_SEEDS"),
|
||||
])
|
||||
def test_a_pull_request_that_touches_the_files_of_one_oracle_runs_every_seed_of_that_oracle_only(path, only):
|
||||
got = pr.pr_seed_counts(["README.md", path], every=5)
|
||||
@@ -706,7 +715,9 @@ def test_the_host_e2e_expects_the_stock_footprint_on_windows_in_both_modes_and_n
|
||||
control that had passed. The four cases, so that the gate (the candidate mode) does not find a fifth."""
|
||||
import test_ab_host_e2e as host_e2e
|
||||
|
||||
a_a, a_b = ["footprint-68-again.json", "footprint-68.json"], ["footprint-68-again.json", "footprint-68.json", "footprint-candidate.json"]
|
||||
number = ab.default_tag().rsplit("-", 1)[-1] # the tag of the published set: the files are named for it, whichever release it is
|
||||
a_a = ["footprint-%s-again.json" % number, "footprint-%s.json" % number]
|
||||
a_b = a_a + ["footprint-candidate.json"]
|
||||
assert host_e2e.expected_footprints(False, "linux") == a_a
|
||||
assert host_e2e.expected_footprints(True, "linux") == a_b
|
||||
assert host_e2e.expected_footprints(False, "win32") == sorted(a_a + ["footprint-stock.json"])
|
||||
@@ -898,7 +909,7 @@ def test_a_candidate_set_visit_list_with_seed_0_expects_the_second_launch_of_it_
|
||||
assert ab.judge(full, lacking, [], expected=tuple(asked))["verdict"] == "red"
|
||||
ab.write_json(tmp_path / "dump-68.json", ab.pack("firefox-68", full))
|
||||
ab.write_json(tmp_path / "dump-candidate.json", ab.pack("candidate", lacking))
|
||||
assert ab.main(["compare", str(tmp_path), "--limit", "2"]) == 1
|
||||
assert ab.main(["compare", "--engine-tag", "firefox-68", str(tmp_path), "--limit", "2"]) == 1
|
||||
assert "second launch of dpr" in capsys.readouterr().out
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
"""The page oracle's declared differences (ci/ab-oracle-expected.json), judged against the run of the engine's final candidate (run 46227711139, Linux and Windows).
|
||||
|
||||
That run's A/B was red on 24 differences per system, all of them the bar of the main window above the content: seed 6 at 1.25 (106 device px as retail Firefox 159 measures it,
|
||||
the published engine's core said 107) and seed 63 at 1.5 (the compact density that retail picks by itself under 720 CSS px, 73 CSS px instead of the normal 85). The DIFF lines
|
||||
of that run are the data below, the same on both systems. The judge allows a difference only when a row of the file matches it exactly, is red on any other, red on a row that
|
||||
does not show (stale), and never applies the rows to the A/A.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_oracle as ab # noqa: E402
|
||||
import ci_host_gate as gate # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
FILE = Path(__file__).resolve().parents[1] / "ci" / "ab-oracle-expected.json"
|
||||
SMALL = {1.0: 3, 1.25: 3, 1.5: 3}
|
||||
CANDIDATE_SET = tuple(ab.select_visits()) # what a run visits by default: seeds 0, 2, 4, 6 and 63, each at its own DPR
|
||||
|
||||
#: The 24 DIFF lines of the A/B of both systems in run 46227711139 (identical on Linux and Windows).
|
||||
TODAY = """\
|
||||
DIFF seed 6 dpr 1.25 leaf state.after_fullscreen.events.mousemove: firefox-70 [[0, 86], [0, 85]] | candidate [[0, 85], [0, 84]]
|
||||
DIFF seed 6 dpr 1.25 leaf state.after_fullscreen.innerHeight: firefox-70 730 | candidate 731
|
||||
DIFF seed 6 dpr 1.25 leaf state.after_fullscreen.mozInnerScreenY: firefox-70 85.5999984741211 | candidate 84.80000305175781
|
||||
DIFF seed 6 dpr 1.25 leaf state.normal.events.mousemove: firefox-70 [[0, 86], [0, 85]] | candidate [[0, 85], [0, 84]]
|
||||
DIFF seed 6 dpr 1.25 leaf state.normal.innerHeight: firefox-70 730 | candidate 731
|
||||
DIFF seed 6 dpr 1.25 leaf state.normal.mozInnerScreenY: firefox-70 85.5999984741211 | candidate 84.80000305175781
|
||||
DIFF seed 6 dpr 1.25 leaf surface.visualViewport.height: firefox-70 730.4000244140625 | candidate 731.2000122070312
|
||||
DIFF seed 6 dpr 1.25 leaf surface.window.innerHeight: firefox-70 730 | candidate 731
|
||||
DIFF seed 6 dpr 1.25 leaf surface.window.mozInnerScreenY: firefox-70 85.5999984741211 | candidate 84.80000305175781
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.events.click: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.events.mousedown: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.events.mousemove: firefox-70 [[0, 85], [0, 84]] | candidate [[0, 73], [0, 72]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.events.mouseup: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.innerHeight: firefox-70 587 | candidate 599
|
||||
DIFF seed 63 dpr 1.5 leaf state.after_fullscreen.mozInnerScreenY: firefox-70 84.66666412353516 | candidate 72.66666412353516
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.events.click: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.events.mousedown: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.events.mousemove: firefox-70 [[0, 85], [0, 84]] | candidate [[0, 72], [0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.events.mouseup: firefox-70 [[0, 85]] | candidate [[0, 73]]
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.innerHeight: firefox-70 587 | candidate 599
|
||||
DIFF seed 63 dpr 1.5 leaf state.normal.mozInnerScreenY: firefox-70 84.66666412353516 | candidate 72.66666412353516
|
||||
DIFF seed 63 dpr 1.5 leaf surface.visualViewport.height: firefox-70 587.3333129882812 | candidate 599.3333129882812
|
||||
DIFF seed 63 dpr 1.5 leaf surface.window.innerHeight: firefox-70 587 | candidate 599
|
||||
DIFF seed 63 dpr 1.5 leaf surface.window.mozInnerScreenY: firefox-70 84.66666412353516 | candidate 72.66666412353516
|
||||
"""
|
||||
_LINE = re.compile(r"^DIFF seed (\d+) dpr ([\d.]+) leaf (\S+): firefox-70 (.*) \| candidate (.*)$")
|
||||
DIFFS = [(int(m[1]), float(m[2]), m[3], json.loads(m[4]), json.loads(m[5])) for m in map(_LINE.match, TODAY.splitlines())]
|
||||
|
||||
|
||||
def _put(items: dict, leaf: str, value) -> None:
|
||||
node = items
|
||||
*path, last = leaf.split(".")
|
||||
for name in path:
|
||||
node = node.setdefault(name, {})
|
||||
node[last] = value
|
||||
|
||||
|
||||
def _visit(seed: int, side: int | None) -> dict:
|
||||
"""What the page dumped in one visit: leaves that do not move, and, for the two seeds of the run, the leaves of today's differences with the value of one side (0 the published
|
||||
engine, 1 the candidate)."""
|
||||
items = {"surface": {"navigator": {"hardwareConcurrency": 8, "language": "en-US"}, "screen": {"width": 1920, "height": 1080}}, "text": {"fonts": ["Arial", "Segoe UI"]}}
|
||||
for s, dpr, leaf, published, candidate in DIFFS:
|
||||
if s == seed:
|
||||
_put(items, leaf, (published, candidate)[side])
|
||||
if seed == ab.RELAUNCH_SEED:
|
||||
items.update(copy.deepcopy(gate.relaunch_items(items)))
|
||||
return items
|
||||
|
||||
|
||||
def dumps(side: int) -> dict:
|
||||
return {(dpr, seed): _visit(seed, side) for dpr, seed in CANDIDATE_SET}
|
||||
|
||||
|
||||
def rows(os_name: str) -> list:
|
||||
return [r for r in ab.load_expected(FILE) if r["os"] == os_name]
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def small_floor(monkeypatch):
|
||||
monkeypatch.setattr(ab, "MIN_LEAVES", SMALL)
|
||||
|
||||
|
||||
def judge(published, candidate, os_name="linux", declared=None, expected=CANDIDATE_SET):
|
||||
return ab.judge(published, candidate, [], expected=expected, declared=declared, os_name=os_name)
|
||||
|
||||
|
||||
# -
|
||||
# Today's run, as data.
|
||||
|
||||
@pytest.mark.parametrize("os_name", ["linux", "windows"])
|
||||
def test_the_old_judge_is_red_on_the_24_differences_of_the_run_and_the_new_one_is_green_with_the_rows(os_name):
|
||||
without = judge(dumps(0), dumps(1))
|
||||
assert without["verdict"] == "red" and len(without["differences"]) == 24
|
||||
assert {(d["seed"], d["dpr"], d["leaf"], json.dumps(d["a"]), json.dumps(d["b"])) for d in without["differences"]} == {(s, d, leaf, json.dumps(p), json.dumps(c)) for s, d, leaf, p, c in DIFFS}
|
||||
report = judge(dumps(0), dumps(1), os_name, declared=ab.load_expected(FILE))
|
||||
assert report["verdict"] == "green", report["problems"]
|
||||
assert len(report["declared"]) == 24 and report["differences"] == [] and report["stale"] == []
|
||||
|
||||
|
||||
def test_the_file_has_a_row_per_os_seed_and_leaf_of_the_run_with_its_two_values_and_exactly_the_keys():
|
||||
document = json.loads(FILE.read_text(encoding="utf-8"))
|
||||
assert document["format"] == "ab-oracle-expected/1"
|
||||
got = document["differences"]
|
||||
assert len(got) == 48
|
||||
for row in got:
|
||||
assert sorted(row) == sorted(["id", "os", "seed", "dpr", "leaf", "published", "candidate", "reason"]), "no field that says who decided, nothing else"
|
||||
for os_name in ("linux", "windows"):
|
||||
assert sorted((r["seed"], r["dpr"], r["leaf"], json.dumps(r["published"]), json.dumps(r["candidate"])) for r in got if r["os"] == os_name) == \
|
||||
sorted((s, d, leaf, json.dumps(p), json.dumps(c)) for s, d, leaf, p, c in DIFFS)
|
||||
assert len({r["id"] for r in got}) == 48
|
||||
|
||||
|
||||
def test_every_row_says_the_retail_source_the_core_function_and_the_leaf():
|
||||
for row in ab.load_expected(FILE):
|
||||
reason = row["reason"]
|
||||
assert "45672953042" in reason and "45679625406" in reason and "retail window-geometry capture workflow" in reason, row["id"]
|
||||
assert "window_frame.chrome_height_device" in reason and "This leaf: " in reason, row["id"]
|
||||
assert ("106 device px" in reason) if row["seed"] == 6 else ("720 CSS px" in reason and "gUIDensity" in reason and "compact" in reason), row["id"]
|
||||
assert not any(name in FILE.read_text(encoding="utf-8").lower() for name in ("decided_by", "c:\\", "/home/"))
|
||||
|
||||
|
||||
def test_the_rows_are_for_visits_that_a_run_makes():
|
||||
from persona_cover import load_visits
|
||||
|
||||
visits = {(dpr, seed) for kind in ("candidate", "final") for seed, dpr in load_visits(kind)}
|
||||
for row in ab.load_expected(FILE):
|
||||
assert (row["dpr"], row["seed"]) in visits, "%s names a visit that no seed set makes: it could never show, and never be stale" % row["id"]
|
||||
|
||||
|
||||
# -
|
||||
# What stays red.
|
||||
|
||||
def test_a_difference_that_no_row_covers_is_red_and_the_rows_stay_applied():
|
||||
candidate = dumps(1)
|
||||
candidate[(1.0, 2)]["surface"]["navigator"]["language"] = "it-IT"
|
||||
report = judge(dumps(0), candidate, declared=ab.load_expected(FILE))
|
||||
assert report["verdict"] == "red" and len(report["declared"]) == 24
|
||||
assert [(d["seed"], d["leaf"], d["a"], d["b"]) for d in report["differences"]] == [(2, "surface.navigator.language", "en-US", "it-IT")]
|
||||
assert report["problems"] == ["seed 2 dpr 1.0 surface.navigator.language: \"en-US\" vs \"it-IT\""]
|
||||
|
||||
|
||||
def test_a_leaf_of_a_row_with_another_value_than_the_row_says_is_red_and_its_row_is_stale():
|
||||
candidate = dumps(1)
|
||||
candidate[(1.25, 6)]["surface"]["window"]["innerHeight"] = 732 # a row says 731
|
||||
report = judge(dumps(0), candidate, declared=ab.load_expected(FILE))
|
||||
assert report["verdict"] == "red"
|
||||
assert [(d["seed"], d["leaf"], d["a"], d["b"]) for d in report["differences"]] == [(6, "surface.window.innerHeight", 730, 732)]
|
||||
assert report["stale"] == ["linux-seed6-surface.window.innerHeight"]
|
||||
|
||||
|
||||
def test_a_row_of_another_seed_dpr_or_os_does_not_cover_the_same_leaf():
|
||||
rows_linux = [r for r in ab.load_expected(FILE) if r["os"] == "linux"]
|
||||
assert judge(dumps(0), dumps(1), "windows", declared=rows_linux)["verdict"] == "red", "the rows of another os do not apply"
|
||||
report = judge(dumps(0), dumps(1), declared=[dict(r, dpr=1.0) if r["seed"] == 6 else r for r in rows_linux])
|
||||
assert report["verdict"] == "red" and {d["seed"] for d in report["differences"]} == {6}, "a row of another dpr does not cover seed 6"
|
||||
|
||||
|
||||
def test_a_row_that_does_not_show_is_red_and_says_it_is_stale_and_to_remove_it():
|
||||
candidate = dumps(1)
|
||||
candidate[(1.5, 63)] = _visit(63, 0) # the candidate reads what the published engine reads at seed 63: its 24 - 15 rows are gone from the run
|
||||
report = judge(dumps(0), candidate, declared=ab.load_expected(FILE))
|
||||
assert report["verdict"] == "red" and len(report["stale"]) == 15 and report["differences"] == []
|
||||
assert any("the declared difference 'linux-seed63-state.normal.innerHeight'" in p and "does not show in this run: it is stale, remove it" in p for p in report["problems"])
|
||||
|
||||
|
||||
def test_when_the_published_engine_is_the_candidate_s_own_work_every_row_is_stale():
|
||||
report = judge(dumps(1), dumps(1), declared=ab.load_expected(FILE))
|
||||
assert report["verdict"] == "red" and len(report["stale"]) == 24 and report["declared"] == [] and report["differences"] == []
|
||||
|
||||
|
||||
def test_a_row_of_a_visit_this_run_did_not_make_is_not_judged_here():
|
||||
only = ((1.0, 0),)
|
||||
report = judge({k: v for k, v in dumps(0).items() if k in only}, {k: v for k, v in dumps(1).items() if k in only}, declared=ab.load_expected(FILE), expected=only)
|
||||
assert report["verdict"] == "green", report["problems"]
|
||||
assert report["declared"] == [] and report["stale"] == []
|
||||
|
||||
|
||||
# -
|
||||
# The A/A, the files and the command line.
|
||||
|
||||
def _write(directory: Path, name: str, engine: str, visits: dict) -> None:
|
||||
ab.write_json(directory / name, ab.pack(engine, visits))
|
||||
|
||||
|
||||
def _run(directory: Path, capsys, *argv) -> tuple:
|
||||
rc = ab.main(["compare", "--engine-tag", "firefox-70", str(directory), *argv])
|
||||
return rc, capsys.readouterr().out
|
||||
|
||||
|
||||
def test_the_rows_are_applied_to_the_a_b_from_the_files_and_never_to_the_a_a(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.setattr(ab, "EXPECTED_FILE", FILE)
|
||||
_write(tmp_path, "dump-70.json", "firefox-70", dumps(0))
|
||||
_write(tmp_path, "dump-candidate.json", "candidate", dumps(1))
|
||||
_write(tmp_path, ab.again_name("firefox-70"), "firefox-70-again", dumps(1))
|
||||
for leg in ("linux-x86_64", "win-x86_64"):
|
||||
rc, out = _run(tmp_path, capsys, "--leg", leg)
|
||||
assert rc == 0 and "AB ORACLE OK: 0 differences, 0 problems" in out
|
||||
assert out.count("DECLARED ") == 24 and "DIFF seed" not in out and "24 differences declared in ci/ab-oracle-expected.json" in out
|
||||
rc, out = _run(tmp_path, capsys, "--a-a", "--leg", "linux-x86_64")
|
||||
report = json.loads((tmp_path / "diff-a-a.json").read_text(encoding="utf-8"))
|
||||
assert rc == 2 and report["declared"] == [] and report["stale"] == [] and len(report["differences"]) == 24, "the A/A is held to equality, whatever the file says"
|
||||
assert out.count("DIFF seed") == 24 and "DECLARED" not in out
|
||||
|
||||
|
||||
def test_the_a_b_from_the_files_is_red_on_the_old_command_line_data_without_the_rows_and_names_the_stale_one_with_them(tmp_path, monkeypatch, capsys):
|
||||
empty = tmp_path / "none.json"
|
||||
empty.write_text(json.dumps({"format": ab.EXPECTED_FORMAT, "differences": []}), encoding="utf-8")
|
||||
monkeypatch.setattr(ab, "EXPECTED_FILE", empty)
|
||||
_write(tmp_path, "dump-70.json", "firefox-70", dumps(0))
|
||||
_write(tmp_path, "dump-candidate.json", "candidate", dumps(1))
|
||||
rc, out = _run(tmp_path, capsys, "--leg", "linux-x86_64")
|
||||
assert rc == 1 and out.count("DIFF seed") == 24 and "AB ORACLE FAILED: 24 differences, 24 problems" in out
|
||||
monkeypatch.setattr(ab, "EXPECTED_FILE", FILE)
|
||||
_write(tmp_path, "dump-candidate.json", "candidate", dumps(0))
|
||||
rc, out = _run(tmp_path, capsys, "--leg", "win-x86_64")
|
||||
assert rc == 1 and out.count("is stale, remove it") == 24 and "FAIL the declared difference 'windows-seed6-state.normal.innerHeight'" in out
|
||||
|
||||
|
||||
# -
|
||||
# The file itself.
|
||||
|
||||
def _document(tmp_path, **change):
|
||||
row = {"id": "a", "os": "linux", "seed": 6, "dpr": 1.25, "leaf": "surface.window.innerHeight", "published": 730, "candidate": 731, "reason": "why"}
|
||||
document = {"format": ab.EXPECTED_FORMAT, "differences": [row]}
|
||||
document.update(change)
|
||||
path = tmp_path / "expected.json"
|
||||
path.write_text(json.dumps(document), encoding="utf-8")
|
||||
return path
|
||||
|
||||
|
||||
def test_a_row_must_have_exactly_its_keys_one_place_and_one_id_and_a_reason(tmp_path):
|
||||
assert len(ab.load_expected(_document(tmp_path))) == 1
|
||||
good = json.loads(_document(tmp_path).read_text(encoding="utf-8"))["differences"][0]
|
||||
for bad in (dict(good, decided_by="x"), {k: v for k, v in good.items() if k != "candidate"}, dict(good, os="macos"), dict(good, reason=" ")):
|
||||
path = _document(tmp_path, differences=[bad])
|
||||
with pytest.raises(SystemExit):
|
||||
ab.load_expected(path)
|
||||
with pytest.raises(SystemExit):
|
||||
ab.load_expected(_document(tmp_path, differences=[good, dict(good, id="b")])) # one place twice
|
||||
with pytest.raises(SystemExit):
|
||||
ab.load_expected(_document(tmp_path, differences=[good, dict(good, leaf="x")])) # one id twice
|
||||
with pytest.raises(SystemExit):
|
||||
ab.load_expected(_document(tmp_path, format="ab-host-expected/1"))
|
||||
|
||||
|
||||
def test_the_os_of_a_leg_is_the_one_of_the_two_the_gate_runs_and_any_other_is_refused():
|
||||
assert (ab.os_of_leg("linux-x86_64"), ab.os_of_leg("win-x86_64")) == ("linux", "windows")
|
||||
with pytest.raises(SystemExit):
|
||||
ab.os_of_leg("leg")
|
||||
with pytest.raises(ValueError):
|
||||
ab.compare_visits({}, {}, [], declared=[{"os": "linux"}])
|
||||
|
||||
|
||||
def test_a_run_applies_the_rows_of_its_leg_to_the_a_b_only_and_a_published_engine_that_differs_from_itself_is_a_broken_control_whatever_the_rows_say(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.setattr(ab, "EXPECTED_FILE", FILE)
|
||||
|
||||
def fake(sequence):
|
||||
queue = iter(sequence)
|
||||
return lambda *args, **kwargs: (next(queue), [])
|
||||
|
||||
monkeypatch.setattr(ab, "_dump_visits", fake([dumps(0), dumps(0), dumps(1)]))
|
||||
assert ab.run_ab("win-x86_64", tmp_path / "out", "firefox-70", ("pub", None), "cand", tmp_path / "s.json", list(CANDIDATE_SET)) == 0
|
||||
assert len(json.loads((tmp_path / "out" / "diff.json").read_text(encoding="utf-8"))["declared"]) == 24
|
||||
assert json.loads((tmp_path / "out" / "diff-a-a.json").read_text(encoding="utf-8"))["declared"] == []
|
||||
monkeypatch.setattr(ab, "_dump_visits", fake([dumps(0), dumps(1)])) # the published engine against itself reads what the candidate reads
|
||||
assert ab.run_ab("linux-x86_64", tmp_path / "out2", "firefox-70", ("pub", None), "cand", tmp_path / "s.json", list(CANDIDATE_SET)) == 2
|
||||
assert "BROKEN CONTROL" in capsys.readouterr().out
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Same seed, same bytes: the published firefox-68 engine against itself (the control) and, with a candidate, against the candidate, on this machine.
|
||||
"""Same seed, same bytes: the published engine (the one of the published set) against itself (the control) and, with a candidate, against the candidate, on this machine.
|
||||
|
||||
scripts/ci_ab_oracle.py runs the host gate's dump (the page of scripts/host_gate, every API a page reads) over the persona seeds of ci/persona-seeds.json, each at its own
|
||||
DPR. Like the network and host oracles, it has two modes, told by whether there is a candidate:
|
||||
@@ -11,8 +11,8 @@ DPR. Like the network and host oracles, it has two modes, told by whether there
|
||||
(fetched the way the core fetches an engine: the release's seal.json and the archive checked against it) against the candidate. If the A/A is broken the A/B is not run. AB_ORACLE_SEED_SET=final and
|
||||
AB_ORACLE_SHARD=i/n run the 20 seeds that reach every value of every dimension, split over n jobs.
|
||||
|
||||
The only differences either comparison lets through are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys. The verdict is the pytest result; the files (dump-68.json,
|
||||
dump-68-again.json, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) and the log are the evidence.
|
||||
The only differences either comparison lets through are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys. The verdict is the pytest result; the files (dump-<N>.json for the tag of the published set,
|
||||
dump-<N>-again.json, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) and the log are the evidence.
|
||||
|
||||
Two more things the comparison cannot say are held here (`_check_ab_visit_and_poison`). The oracle's dumps carry the ab. leaves (scripts/ci_host_gate.py): the poison probe of the page on every
|
||||
seed and, on seeds 0 and 63, the extra visit of every realm and window a page can make; seed 63 must differ from seed 0 on at least AB_CONTROL_MIN of them (the count is in ab-control.json and the log).
|
||||
@@ -91,7 +91,7 @@ def _check_ab_visit_and_poison(out: Path, candidate: bool) -> None:
|
||||
any A/B), and seed 63 reads other values than seed 0 (the control of the ab leaves; the measured count goes to ab-control.json and the log).
|
||||
On a poisoned host (the gate's leg: AB_ORACLE_POISON=1) the poison is in force, the negative control of stock Firefox read it, and neither
|
||||
engine read any of it: its dumps hold the identity the core declares."""
|
||||
published = out / "dump-68.json"
|
||||
published = out / ab.dump_name(ab.default_tag())
|
||||
dumps = [("the published engine", published)] + ([("the candidate", out / "dump-candidate.json")] if candidate else [])
|
||||
problems = []
|
||||
for name, path in dumps:
|
||||
@@ -171,11 +171,12 @@ def test_the_published_engine_repeats_itself_and_the_candidate_gives_the_same_by
|
||||
assert sorted(control["relaunch"]) == sorted(ab.visit_name(*key) for key in ab.relaunch_visits(visits)), "seed 0 is launched twice on one profile, whichever shard has it"
|
||||
_check_what_every_launch_left(out, candidate)
|
||||
_check_ab_visit_and_poison(out, candidate)
|
||||
tag = ab.default_tag()
|
||||
names = sorted(p.name for p in out.glob("*.json") if not p.name.startswith("poison-"))
|
||||
if candidate:
|
||||
diff = json.loads((out / "diff.json").read_text(encoding="utf-8"))
|
||||
assert diff["verdict"] == "green" and diff["differences"] == [] and diff["problems"] == []
|
||||
assert len(diff["visits"]) >= 1 and len(diff["compared"]) == len(diff["visits"]), "every visit asked for is compared: %s" % diff["visits"]
|
||||
assert names == ["ab-control.json", "diff-a-a.json", "diff.json", "dump-68-again.json", "dump-68.json", "dump-candidate.json"]
|
||||
assert names == sorted(["ab-control.json", "diff-a-a.json", "diff.json", ab.again_name(tag), ab.dump_name(tag), "dump-candidate.json"])
|
||||
else:
|
||||
assert names == ["ab-control.json", "diff-a-a.json", "dump-68-again.json", "dump-68.json"]
|
||||
assert names == sorted(["ab-control.json", "diff-a-a.json", ab.again_name(tag), ab.dump_name(tag)])
|
||||
@@ -0,0 +1,88 @@
|
||||
"""A browser whose output says that a release went on without the popup its press opened failing the test that launched it, and a clean output not failing it.
|
||||
|
||||
The engine's Juggler writes ``WARNING: popup <id> did not say popupshown within 1000 ms of its press, the release goes on`` when the wait of a release for ``popupshown`` runs out (``juggler/protocol/PageHandler.js``,
|
||||
``_waitForPopupOfPress``). ``tests/_browser_log.py`` puts a tee in front of the core's reader of the browser's output, and ``tests/conftest.py`` fails every e2e test whose browser wrote the line. This test runs the real
|
||||
``ProcessOutput`` of the core over a pipe that holds a log: with the line the test fails and names it, with a clean log it passes, and the reader still gets every line (the tee takes nothing).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
import _browser_log
|
||||
from invisible_core.juggler.connection import ProcessOutput
|
||||
|
||||
#: The line as the engine writes it (PageHandler.js: ``WARNING: popup ${popup.id || popup.localName} did not say popupshown within ${POPUP_SHOWN_WAIT_MS} ms of its press, the release goes on``).
|
||||
EXPIRED = "WARNING: popup ContentSelectDropdownPopup did not say popupshown within 1000 ms of its press, the release goes on"
|
||||
CLEAN = ["console.warn: something else", "WARNING: 3 events wait for frame 7, Network.requestWillBeSent is dropped", "JavaScript warning: popupshown listener added", "popup shown"]
|
||||
|
||||
|
||||
def _read(monkeypatch, lines):
|
||||
"""The real reader of the core over ``lines``, with the tee installed: ``(sink, output)`` once the reader has reached the end."""
|
||||
sink = _browser_log.Sink()
|
||||
_browser_log.install(monkeypatch, sink)
|
||||
output = ProcessOutput(io.BytesIO(("\n".join(lines) + "\n").encode()))
|
||||
output._thread.join(5)
|
||||
assert not output._thread.is_alive(), "the reader of the output did not reach the end of the log"
|
||||
return sink, output
|
||||
|
||||
|
||||
def test_a_log_with_the_expired_wait_fails_the_test_and_names_the_line(monkeypatch):
|
||||
sink, output = _read(monkeypatch, CLEAN[:2] + [EXPIRED] + CLEAN[2:])
|
||||
with pytest.raises(pytest.fail.Exception) as failed:
|
||||
sink.fail_if_any()
|
||||
message = str(failed.value)
|
||||
assert EXPIRED in message, message
|
||||
assert "popupshown" in message and "1 line(s)" in message, message
|
||||
# The reader got every line, in order: the tee took nothing.
|
||||
assert output.tail(20) == CLEAN[:2] + [EXPIRED] + CLEAN[2:]
|
||||
|
||||
|
||||
def test_a_log_with_no_such_line_passes(monkeypatch):
|
||||
sink, output = _read(monkeypatch, CLEAN)
|
||||
sink.fail_if_any()
|
||||
assert sink.lines == []
|
||||
assert output.tail(20) == CLEAN
|
||||
|
||||
|
||||
def test_every_expired_wait_of_a_log_is_named_with_its_popup(monkeypatch):
|
||||
other = EXPIRED.replace("ContentSelectDropdownPopup", "menupopup")
|
||||
sink, _output = _read(monkeypatch, [EXPIRED, other])
|
||||
with pytest.raises(pytest.fail.Exception) as failed:
|
||||
sink.fail_if_any()
|
||||
assert "ContentSelectDropdownPopup" in str(failed.value) and "menupopup" in str(failed.value)
|
||||
assert "2 line(s)" in str(failed.value)
|
||||
|
||||
|
||||
def test_the_matcher_is_the_engines_line_and_nothing_wider():
|
||||
assert _browser_log.failing(EXPIRED)
|
||||
assert _browser_log.failing(" prefix " + EXPIRED + " suffix")
|
||||
# Another bound, another popup: the same line. A line that only mentions the words is not it.
|
||||
assert _browser_log.failing(EXPIRED.replace("1000", "250"))
|
||||
assert not _browser_log.failing("WARNING: popup x did not say popupshown")
|
||||
assert not _browser_log.failing("the popup said popupshown within 12 ms of its press")
|
||||
|
||||
|
||||
def test_the_conftest_installs_the_check_for_every_e2e_test_only():
|
||||
text = (Path(__file__).parent / "conftest.py").read_text(encoding="utf-8")
|
||||
body = text[text.index("def _the_browser_log_holds_no_line_that_fails_the_test"):]
|
||||
body = body[:body.index("\n\n\n")]
|
||||
assert "@pytest.fixture(autouse=True)" in text[text.index("def _the_browser_log_holds_no_line_that_fails_the_test") - 80:text.index("def _the_browser_log_holds_no_line_that_fails_the_test")]
|
||||
assert re.search(r'get_closest_marker\("e2e"\) is None', body)
|
||||
assert "_browser_log.install(monkeypatch, sink)" in body and "sink.fail_if_any()" in body
|
||||
|
||||
|
||||
#: The engine's line for a release whose press the page never handled (juggler/protocol/PageHandler.js, _holdReleaseForItsPress).
|
||||
UNHANDLED_PRESS = "WARNING: the press of this release was not handled by the page within 5 s, the release goes on"
|
||||
|
||||
|
||||
def test_an_expired_wait_for_the_press_of_a_release_fails_the_test_and_names_the_line(monkeypatch):
|
||||
sink, output = _read(monkeypatch, CLEAN[:1] + [UNHANDLED_PRESS] + CLEAN[1:])
|
||||
with pytest.raises(pytest.fail.Exception) as failed:
|
||||
sink.fail_if_any()
|
||||
assert UNHANDLED_PRESS in str(failed.value) and "handled by the page" in str(failed.value)
|
||||
assert output.tail(20) == CLEAN[:1] + [UNHANDLED_PRESS] + CLEAN[1:]
|
||||
assert not _browser_log.failing("the press of this release was handled by the page")
|
||||
+16
-9
@@ -124,7 +124,7 @@ def test_both_apis_declare_the_same_lifetime_machinery():
|
||||
# could only ever catch the bug that had already happened and was blind by
|
||||
# construction to the fourth feature landing on one side. Three real
|
||||
# divergences existed: the process-leak fix (sync only, shipped as fixed),
|
||||
# INVPW_TRUE_HEADLESS (async only, a documented env var), and _build_prefs
|
||||
# a documented env var (async only, since retired), and _build_prefs
|
||||
# (a method on one side, twenty inline lines on the other).
|
||||
#
|
||||
# Sync-only members, each with its reason. Anything not listed must exist
|
||||
@@ -152,15 +152,18 @@ def test_both_apis_declare_the_same_lifetime_machinery():
|
||||
f"in both directions")
|
||||
|
||||
|
||||
def test_both_apis_read_the_same_environment_variables():
|
||||
"""A documented knob must not depend on which entry point was imported.
|
||||
def test_both_entry_points_refuse_the_retired_variable():
|
||||
"""The retired `INVPW_TRUE_HEADLESS` is refused the same way on both entry points.
|
||||
|
||||
`INVPW_TRUE_HEADLESS` was honoured in `async_api._resolve_headless` and
|
||||
nowhere else, so the same documented variable worked or did not depending
|
||||
on whether the caller wrote `with` or `async with`. Reading the source is
|
||||
deliberate: the alternative is setting each variable and driving a real
|
||||
browser, and this catches the omission where it is made.
|
||||
It was honoured by the async class alone, so the same variable worked or
|
||||
did not depending on whether the caller wrote `with` or `async with`. It is
|
||||
retired now and refused at launch (the behaviour is run in
|
||||
`test_the_retired_true_headless_variable_is_refused.py`). This test pins
|
||||
where the refusal lives: both classes call the one function in `_session`
|
||||
and read no environment variable themselves, so the two cannot drift again.
|
||||
Reading the source is deliberate: it catches the omission where it is made.
|
||||
"""
|
||||
import inspect
|
||||
import pathlib
|
||||
import re
|
||||
|
||||
@@ -178,13 +181,17 @@ def test_both_apis_read_the_same_environment_variables():
|
||||
# read directly in one class was masked by the shared module also naming
|
||||
# it, and the mutation that puts INVPW_TRUE_HEADLESS back into async_api
|
||||
# alone SURVIVED. Neither class may name one at all.
|
||||
for module, entry in ((launcher, "__enter__"), (async_api, "__aenter__")):
|
||||
body = inspect.getsource(getattr(module.InvisiblePlaywright, entry))
|
||||
assert "_session.refuse_retired_true_headless()" in body, (
|
||||
f"{module.__name__}.{entry} does not refuse the retired variable")
|
||||
stray = {m.__name__.rsplit(".", 1)[-1]: sorted(env_names(m))
|
||||
for m in (launcher, async_api) if env_names(m)}
|
||||
assert not stray, (
|
||||
f"environment variables are read inside the entry-point classes: "
|
||||
f"{stray}. Every one belongs in `_session`, which is what makes it "
|
||||
f"impossible for a documented knob to work on one API and not the "
|
||||
f"other - `INVPW_TRUE_HEADLESS` did exactly that for weeks")
|
||||
f"other - the retired `INVPW_TRUE_HEADLESS` did exactly that for weeks")
|
||||
assert env_names(_session), "_session names no environment variable at all"
|
||||
|
||||
|
||||
|
||||
@@ -516,26 +516,27 @@ def test_the_summary_groups_by_family_and_is_a_finding_not_a_failure():
|
||||
def test_without_a_clean_dump_the_summary_says_it_and_no_file_is_written(tmp_path):
|
||||
(tmp_path / "dump-68.json").write_text(json.dumps(packed((1.0, 0, {"a": 1}))), encoding="utf-8")
|
||||
summary = tmp_path / "summary.md"
|
||||
assert poison.write_dependence(tmp_path, summary) is None
|
||||
assert poison.write_dependence(tmp_path, summary, "firefox-68") is None
|
||||
assert "No dump of the published engine on the clean runner" in summary.read_text(encoding="utf-8")
|
||||
assert not (tmp_path / poison.DEPENDENCE_FILE).exists()
|
||||
assert not (tmp_path / poison.dependence_file("firefox-68")).exists()
|
||||
|
||||
|
||||
def test_the_dependence_is_written_to_its_own_file_and_to_the_summary(tmp_path):
|
||||
(tmp_path / poison.CLEAN_FILE).write_text(json.dumps(packed((1.0, 0, {"a": 1}))), encoding="utf-8")
|
||||
(tmp_path / poison.clean_file("firefox-68")).write_text(json.dumps(packed((1.0, 0, {"a": 1}))), encoding="utf-8")
|
||||
(tmp_path / "dump-68.json").write_text(json.dumps(packed((1.0, 0, {"a": 2}))), encoding="utf-8")
|
||||
summary = tmp_path / "summary.md"
|
||||
report = poison.write_dependence(tmp_path, summary)
|
||||
assert json.loads((tmp_path / poison.DEPENDENCE_FILE).read_text(encoding="utf-8")) == report
|
||||
report = poison.write_dependence(tmp_path, summary, "firefox-68")
|
||||
assert json.loads((tmp_path / poison.dependence_file("firefox-68")).read_text(encoding="utf-8")) == report
|
||||
assert report["differences"] == [{"seed": 0, "dpr": 1.0, "leaf": "a", "clean": 1, "poisoned": 2}]
|
||||
assert "1 of 1 leaves differ" in summary.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_the_files_of_the_by_product_are_poison_files_which_the_oracle_s_listing_ignores():
|
||||
assert poison.CLEAN_FILE.startswith("poison-") and poison.DEPENDENCE_FILE.startswith("poison-")
|
||||
assert poison.clean_file("firefox-70").startswith("poison-") and poison.dependence_file("firefox-70").startswith("poison-")
|
||||
import ci_ab_oracle as oracle
|
||||
|
||||
assert oracle.clean_name("firefox-68") == poison.CLEAN_FILE
|
||||
for tag in ("firefox-68", "firefox-70"):
|
||||
assert oracle.clean_name(tag) == poison.clean_file(tag), "the clean dump of the oracle and the file the dependence reads are named by one tag"
|
||||
|
||||
|
||||
def test_the_clean_dump_is_the_published_engine_dumped_on_this_machine_and_judges_nothing(tmp_path, monkeypatch):
|
||||
|
||||
@@ -0,0 +1,673 @@
|
||||
"""The control side of every A/B oracle is the PUBLISHED SET, as a user installs it (scripts/ci_published_set.py, ci/py-lock/published.txt).
|
||||
|
||||
Engine candidate 5 (run 46208549074) had every A/B red on a BROKEN CONTROL: the published engine (labelled firefox-68 in the logs, a tag written in the harness, when
|
||||
firefox-70 was the last published) was launched by the CANDIDATE'S core, which no longer declares `zoom.stealth.screen.popup_position`, and an engine refuses a launch
|
||||
whose declarations its core does not emit (rule 7). The pairing the oracle held the candidate to was one no user ever has. A control is the set a user gets:
|
||||
|
||||
* the last `invisible-playwright` on the index, the `invisible-core` it pins exactly, and the engine that core's seal pins, in a venv of their own;
|
||||
* nothing is chosen by hand: no tag, no version, no commit is written in a harness file or a workflow;
|
||||
* installed by hash (ci-03), from the wheelhouse of the run, offline; the lock is one file that .github/workflows/published-set.yml keeps equal to the index;
|
||||
* the candidate's side is what it was: core_ref, wrapper_ref and the candidate engine.
|
||||
|
||||
Without a browser: the first test below is the defect itself on a fake engine that refuses as rule 7 does, with two fake cores (the candidate's lacks a declaration the
|
||||
published engine requires) and the harness's real command line; it is red on the harness that launched the control with the candidate's core. The others hold the lock
|
||||
(known-bad inputs first), the resolver on synthetic index documents, the install commands, and that no tag is written in a harness file.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import types
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
import ci_ab_host as host # noqa: E402
|
||||
import ci_ab_network as net # noqa: E402
|
||||
import ci_ab_oracle as ab # noqa: E402
|
||||
import ci_crash_evidence as crash # noqa: E402
|
||||
import ci_host_gate as gate # noqa: E402
|
||||
import ci_published_set as ps # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
#: The variable that names the python of the published set's venv. Spelled here, so that the defect test below runs on a harness that has no notion of it.
|
||||
PUBLISHED_PYTHON_ENV = "INVPW_PUBLISHED_PYTHON"
|
||||
REQUIRED = "zoom.stealth.screen.popup_position"
|
||||
RULE_7 = "stealth: %s is not declared" % REQUIRED
|
||||
|
||||
|
||||
# -
|
||||
# The defect: the control launched by the candidate's core
|
||||
|
||||
#: What `ci_host_gate.py dump` is for this test: the engine at argv[2] says what it requires its core to declare (`requires.txt` beside it) and refuses, as the engine's
|
||||
#: declaration gate does, when the core it is launched by (the `invisible_core` this python imports) does not declare it; else it writes the visit the page would.
|
||||
FAKE_DUMP = '''\
|
||||
import json, os, sys
|
||||
from pathlib import Path
|
||||
import invisible_core
|
||||
|
||||
binary = Path(sys.argv[2])
|
||||
out = Path(sys.argv[sys.argv.index("--out") + 1])
|
||||
required = binary.with_name("requires.txt").read_text(encoding="utf-8").split()
|
||||
missing = [name for name in required if name not in invisible_core.DECLARED]
|
||||
if missing:
|
||||
print("stealth: %s is not declared by the core %s (rule 7)" % (missing[0], invisible_core.NAME), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
visits = [a.split(":") for i, a in enumerate(sys.argv) if i and sys.argv[i - 1] == "--visit"]
|
||||
for seed, dpr in visits:
|
||||
items = json.loads(ITEMS)
|
||||
(out / ("leg_dpr%s_seed%s.json" % (dpr, seed))).write_text(json.dumps({"leg": "leg", "dpr": float(dpr), "seed": int(seed), "result": {"format": FORMAT, "items": items}}), encoding="utf-8")
|
||||
where = os.environ.get(CRASH_DIR_ENV)
|
||||
if where:
|
||||
Path(where).mkdir(parents=True, exist_ok=True)
|
||||
(Path(where) / "exits.json").write_text(json.dumps({"format": CRASH_FORMAT, "launches": [{"n": 1, "label": {"seed": 0, "dpr": 1.0, "launch": "visit"}, "pid": 1, "returncode": 0}]}), encoding="utf-8")
|
||||
'''
|
||||
|
||||
FAKE_CORE = '''\
|
||||
NAME = %(name)r
|
||||
DECLARED = %(declared)r
|
||||
'''
|
||||
FAKE_SEAL = '''\
|
||||
class _Seal:
|
||||
tag = %(tag)r
|
||||
is_local = False
|
||||
|
||||
def describe(self):
|
||||
return "the seal of the fake core %(name)s: " + self.tag
|
||||
|
||||
|
||||
def active_seal():
|
||||
return _Seal()
|
||||
'''
|
||||
FAKE_DOWNLOAD = '''\
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
ENGINE_DIR_ENV = "INVISIBLE_PLAYWRIGHT_ENGINE_DIR"
|
||||
|
||||
|
||||
def ensure_binary(*args, **kwargs):
|
||||
folder = Path(os.environ[ENGINE_DIR_ENV]) / %(tag)r
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
(folder / "firefox").write_text("the published engine", encoding="utf-8")
|
||||
(folder / "requires.txt").write_text(%(requires)r, encoding="utf-8")
|
||||
return folder / "firefox"
|
||||
'''
|
||||
|
||||
|
||||
def write_core(site: Path, name: str, declared: list, tag: str = "firefox-70", requires: str = "") -> None:
|
||||
package = site / "invisible_core"
|
||||
package.mkdir(parents=True, exist_ok=True)
|
||||
(package / "__init__.py").write_text(FAKE_CORE % {"name": name, "declared": declared}, encoding="utf-8")
|
||||
(package / "seal.py").write_text(FAKE_SEAL % {"name": name, "tag": tag}, encoding="utf-8")
|
||||
(package / "download.py").write_text(FAKE_DOWNLOAD % {"tag": tag, "requires": requires}, encoding="utf-8")
|
||||
|
||||
|
||||
def make_venv(folder: Path, core_name: str, declared: list, requires: str) -> Path:
|
||||
"""A real venv (no pip: it installs nothing) whose site-packages holds a fake `invisible_core` that declares `declared`: the published set's venv."""
|
||||
subprocess.run([sys.executable, "-m", "venv", "--without-pip", str(folder)], check=True, capture_output=True)
|
||||
python = ps.venv_python(folder)
|
||||
purelib = subprocess.run([str(python), "-c", "import sysconfig; print(sysconfig.get_paths()['purelib'])"], check=True, capture_output=True, text=True).stdout.strip()
|
||||
write_core(Path(purelib), core_name, declared, requires=requires)
|
||||
return python
|
||||
|
||||
|
||||
class _GateWithAFakeDump:
|
||||
"""The host gate module, but `ci_host_gate.py dump` is the fake dump script: the command line the harness builds is the real one."""
|
||||
|
||||
def __init__(self, script: Path):
|
||||
self.__file__ = str(script)
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(gate, name)
|
||||
|
||||
|
||||
def _items(seed: int) -> dict:
|
||||
return {"surface": {"navigator": {"hardwareConcurrency": 8 + seed % 3, "language": "en-US"}, "screen": {"width": 1920, "height": 1080}},
|
||||
"text": {"fonts": ["Arial", "Segoe UI"]}, "blend": {"data": "AAEC", "enc": "png", "w": 1, "h": 1}}
|
||||
|
||||
|
||||
def test_the_control_is_launched_by_the_core_it_was_built_for_never_by_the_candidates(tmp_path, monkeypatch, capfd):
|
||||
"""Candidate core: declares only `a`. Candidate engine: needs only `a`. Published core (in the set's venv): declares `a` and the popup position the published engine
|
||||
needs. The job's python imports the candidate core (as the gate's python does); the published engine run by it is refused as rule 7. A harness that launches the control
|
||||
with the job's python (and the job's PYTHONPATH, seal and pin switches) is red here with that refusal; one that launches it in the set's venv is green."""
|
||||
candidate_site = tmp_path / "candidate-site"
|
||||
write_core(candidate_site, "candidate-core", ["a"])
|
||||
published_python = make_venv(tmp_path / "set-venv", "published-core", ["a", REQUIRED], requires="a %s" % REQUIRED)
|
||||
script = tmp_path / "fake_dump.py"
|
||||
script.write_text("ITEMS = %r\nFORMAT = %r\nCRASH_DIR_ENV = %r\nCRASH_FORMAT = %r\n" % (json.dumps(_items(11)), gate.FORMAT, crash.CRASH_DIR_ENV, crash.FORMAT) + FAKE_DUMP, encoding="utf-8")
|
||||
candidate = tmp_path / "candidate-engine" / "firefox"
|
||||
candidate.parent.mkdir()
|
||||
candidate.write_text("the candidate", encoding="utf-8")
|
||||
(candidate.parent / "requires.txt").write_text("a", encoding="utf-8")
|
||||
|
||||
monkeypatch.setattr(ab, "gate", _GateWithAFakeDump(script))
|
||||
monkeypatch.setattr(ab, "MIN_LEAVES", {1.0: 6})
|
||||
monkeypatch.setenv("PYTHONPATH", str(candidate_site)) # the job's python imports the candidate's core, as the gate's does
|
||||
monkeypatch.setenv(PUBLISHED_PYTHON_ENV, str(published_python))
|
||||
monkeypatch.setenv("INVISIBLE_CORE_PIN", "allow")
|
||||
|
||||
# What the OLD harness fetched the control with, in this process: the candidate's core downloads the published engine under the published seal. The new harness asks the set.
|
||||
in_process = []
|
||||
import invisible_core.download as download
|
||||
import invisible_core.seal as seal_module
|
||||
|
||||
def old_fetch(*args, **kwargs):
|
||||
in_process.append("download")
|
||||
return [str(tmp_path / "seal-source")]
|
||||
|
||||
def old_download_file(url, dst, *a, **k):
|
||||
in_process.append("download")
|
||||
Path(dst).write_text("{}", encoding="utf-8")
|
||||
|
||||
def old_ensure(*a, **k):
|
||||
in_process.append("download")
|
||||
folder = Path(os.environ[download.ENGINE_DIR_ENV]) / "firefox-70"
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
(folder / "firefox").write_text("the published engine", encoding="utf-8")
|
||||
(folder / "requires.txt").write_text("a %s" % REQUIRED, encoding="utf-8")
|
||||
return folder / "firefox"
|
||||
|
||||
monkeypatch.setattr(download, "release_asset_urls", old_fetch)
|
||||
monkeypatch.setattr(download, "_download_file", old_download_file)
|
||||
monkeypatch.setattr(download, "ensure_binary", old_ensure)
|
||||
monkeypatch.setattr(seal_module, "load_seal", lambda path: types.SimpleNamespace(tag="firefox-70", is_local=False, describe=lambda: "the published seal"))
|
||||
|
||||
out = tmp_path / "out"
|
||||
rc = ab.run(str(candidate), tmp_path / "candidate.seal.json", "linux-x86_64", out, "firefox-70", visits=[(1.0, 11)])
|
||||
seen = capfd.readouterr()
|
||||
said = seen.out + seen.err
|
||||
assert RULE_7 not in said, ("the published engine was launched by the candidate's core and refused it (BROKEN CONTROL, engine candidate 5): the control is the published set, "
|
||||
"launched in its own venv:\n" + said[-1500:])
|
||||
assert rc == 0 and json.loads((out / "diff.json").read_text(encoding="utf-8"))["verdict"] == "green", said[-1500:]
|
||||
assert not in_process, "the control's engine is fetched by the published set's own core, never in this process by the candidate's: %s" % in_process
|
||||
assert (out / "dump-70.json").is_file() and (out / "dump-candidate.json").is_file()
|
||||
|
||||
|
||||
# -
|
||||
# The seams of the three oracles: the control side runs in the set's python, with nothing of the candidate's job
|
||||
|
||||
JOB_ENV = {"PYTHONPATH": "/candidate/site", "VIRTUAL_ENV": "/candidate/venv", "INVISIBLE_SEAL_FILE": "/candidate/gate.seal.json", "INVISIBLE_CORE_PIN": "allow",
|
||||
"INVISIBLE_CORE_AUTOFIX": "off", "PYTHONHOME": "/candidate/home", "MOZ_LOG": "sync", "STEALTHFOX_GEOIP_MMDB": "/lab/geoip.mmdb"}
|
||||
|
||||
|
||||
class _Done:
|
||||
returncode = 0
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def job(monkeypatch):
|
||||
for name in ps.SET_LEAKS:
|
||||
monkeypatch.delenv(name, raising=False)
|
||||
for name, value in JOB_ENV.items():
|
||||
monkeypatch.setenv(name, value)
|
||||
|
||||
|
||||
def _recorded(monkeypatch, module):
|
||||
calls = []
|
||||
monkeypatch.setattr(module.subprocess, "run", lambda cmd, env=None, timeout=None, **k: calls.append((cmd, env)) or _Done())
|
||||
return calls
|
||||
|
||||
|
||||
def _own_cache(monkeypatch):
|
||||
monkeypatch.setattr(ab, "own_cache_env", lambda env, folder, platform=None: dict(env))
|
||||
|
||||
|
||||
def _check_set_side(cmd, env, python, seal):
|
||||
assert cmd[0] == python, "the control runs in the venv of the published set, not in the python of the job"
|
||||
for name in ("PYTHONPATH", "PYTHONHOME", "VIRTUAL_ENV", "MOZ_LOG"):
|
||||
assert name not in env, "%s of the candidate's job reaches the published set's process and can make it import another core" % name
|
||||
assert env["INVISIBLE_CORE_AUTOFIX"] == "off" and "INVISIBLE_CORE_PIN" not in env, "the pin of the set's wrapper on its core stays checked, as on a user's machine"
|
||||
assert env.get("INVISIBLE_SEAL_FILE") == seal and env["STEALTHFOX_GEOIP_MMDB"] == "/lab/geoip.mmdb", "the lab's files still reach it"
|
||||
|
||||
|
||||
def test_the_page_oracle_runs_the_control_dump_in_the_set_s_python(tmp_path, monkeypatch, job):
|
||||
calls = _recorded(monkeypatch, ab)
|
||||
_own_cache(monkeypatch)
|
||||
assert ab.run_dump("pub", None, "linux-x86_64", tmp_path / "o", [(1.0, 11)], python="/set/bin/python") == 0
|
||||
_check_set_side(*calls[0], "/set/bin/python", None)
|
||||
assert calls[0][0][1] == str(Path(gate.__file__))
|
||||
assert ab.run_dump("cand", tmp_path / "s.json", "linux-x86_64", tmp_path / "o", [(1.0, 11)]) == 0
|
||||
cmd, env = calls[1]
|
||||
assert cmd[0] == sys.executable and env["INVISIBLE_SEAL_FILE"] == str(tmp_path / "s.json") and env["PYTHONPATH"] == "/candidate/site", "the candidate's side is as it was"
|
||||
assert env["INVISIBLE_CORE_PIN"] == "allow" and env["INVISIBLE_CORE_AUTOFIX"] == "off"
|
||||
|
||||
|
||||
def test_the_host_oracle_runs_the_control_in_the_set_s_python(tmp_path, monkeypatch, job):
|
||||
calls = _recorded(monkeypatch, host)
|
||||
_own_cache(monkeypatch)
|
||||
monkeypatch.setattr(host.oracle, "own_cache_env", lambda env, folder, platform=None: dict(env))
|
||||
assert host.run_subprocess("pub", None, "linux-x86_64", tmp_path / "f.json", "firefox-70", [11], python="/set/bin/python") == 0
|
||||
_check_set_side(*calls[0], "/set/bin/python", None)
|
||||
assert host.run_subprocess("cand", tmp_path / "s.json", "linux-x86_64", tmp_path / "f.json", "candidate", [11]) == 0
|
||||
assert calls[1][0][0] == sys.executable and calls[1][1]["PYTHONPATH"] == "/candidate/site"
|
||||
|
||||
|
||||
def test_the_network_oracle_runs_the_control_in_the_set_s_python(tmp_path, monkeypatch, job):
|
||||
calls = _recorded(monkeypatch, net)
|
||||
monkeypatch.setattr(ab, "own_cache_env", lambda env, folder, platform=None: dict(env))
|
||||
assert net.run_engine("pub", None, "firefox-70", (11,), tmp_path / "t.json", python="/set/bin/python") == 0
|
||||
_check_set_side(*calls[0], "/set/bin/python", None)
|
||||
assert net.run_engine("cand", str(tmp_path / "s.json"), "candidate", (11,), tmp_path / "t.json") == 0
|
||||
assert calls[1][0][0] == sys.executable and calls[1][1]["INVISIBLE_CORE_PIN"] == "allow"
|
||||
|
||||
|
||||
def test_the_published_engine_of_each_oracle_comes_from_the_set_and_its_python_goes_with_it(tmp_path, monkeypatch):
|
||||
package = tmp_path / "engines" / "firefox-70"
|
||||
package.mkdir(parents=True)
|
||||
(package / "firefox").write_bytes(b"the published engine")
|
||||
monkeypatch.setattr(ab, "fetch_published", lambda tag, work: (str(package / "firefox"), None, "/set/bin/python"))
|
||||
monkeypatch.setattr(host, "stage_dir", lambda base=None: tmp_path / "stage" / "firefox")
|
||||
seen = {}
|
||||
monkeypatch.setattr(host, "run_subprocess", lambda exe, seal, leg, out, label, seeds, crash_with=None, python=None: seen.setdefault(label, python) and 1)
|
||||
host.ab(None, None, "linux-x86_64", tmp_path / "h", "firefox-70", [11])
|
||||
assert seen == {"firefox-70": "/set/bin/python", "firefox-70 again": "/set/bin/python"}, "both runs of the A/A"
|
||||
args = types.SimpleNamespace(published_binary=None, published_seal=None, engine_tag="firefox-70")
|
||||
assert net.published_engine(args, tmp_path) == (str(package / "firefox"), None, "/set/bin/python")
|
||||
given = types.SimpleNamespace(published_binary="/given/firefox", published_seal=None, engine_tag="firefox-70")
|
||||
assert net.published_engine(given, tmp_path) == ("/given/firefox", None, None), "a binary the caller gives (a pull request's A/A) runs as this process does"
|
||||
|
||||
|
||||
def test_the_variable_is_the_one_the_harness_reads():
|
||||
assert ab.PUBLISHED_PYTHON_ENV == PUBLISHED_PYTHON_ENV
|
||||
|
||||
|
||||
def test_a_candidate_with_no_published_set_is_refused_never_held_to_its_own_core(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv(ab.PUBLISHED_PYTHON_ENV, raising=False)
|
||||
with pytest.raises(RuntimeError) as e:
|
||||
ab.fetch_published("firefox-70", tmp_path)
|
||||
assert ab.PUBLISHED_PYTHON_ENV in str(e.value) and "ci_published_set.py install" in str(e.value) and "never the core and the wrapper of the candidate" in str(e.value)
|
||||
monkeypatch.setenv(ab.PUBLISHED_PYTHON_ENV, str(tmp_path / "no-python"))
|
||||
with pytest.raises(RuntimeError):
|
||||
ab.fetch_published(None, tmp_path)
|
||||
|
||||
|
||||
def test_a_label_that_is_not_the_engine_of_the_set_is_refused(tmp_path, monkeypatch):
|
||||
python = make_venv(tmp_path / "set-venv", "published-core", ["a"], requires="a")
|
||||
monkeypatch.setenv(ab.PUBLISHED_PYTHON_ENV, str(python))
|
||||
binary, seal, set_python = ab.fetch_published("firefox-70", tmp_path / "work")
|
||||
assert Path(binary).is_file() and seal is None and set_python == str(python)
|
||||
assert ab.default_tag() == "firefox-70", "the tag of the control is what the set's seal says"
|
||||
with pytest.raises(RuntimeError, match="labelled firefox-68 but the published set carries firefox-70"):
|
||||
ab.fetch_published("firefox-68", tmp_path / "work2")
|
||||
|
||||
|
||||
def _written_tags(path: Path) -> list:
|
||||
"""The `firefox-<N>` string constants of the CODE of a script (docstrings and comments are prose, and may name a release)."""
|
||||
tree = ast.parse(path.read_text(encoding="utf-8"))
|
||||
docstrings = {id(n.body[0].value) for n in ast.walk(tree) if isinstance(n, (ast.Module, ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))
|
||||
and n.body and isinstance(n.body[0], ast.Expr) and isinstance(getattr(n.body[0], "value", None), ast.Constant)}
|
||||
import re
|
||||
|
||||
return [(n.lineno, n.value) for n in ast.walk(tree) if isinstance(n, ast.Constant) and isinstance(n.value, str) and id(n) not in docstrings
|
||||
and re.fullmatch(r"firefox-\d+(-candidate)?", n.value)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("script", ["ci_ab_oracle.py", "ci_ab_host.py", "ci_ab_network.py", "ci_poison_host.py", "ci_published_set.py"])
|
||||
def test_no_oracle_writes_the_tag_of_the_engine_it_holds_the_candidate_to(script):
|
||||
"""firefox-68 stayed written in the oracles as the control after firefox-69 and firefox-70 were published: the baseline is the published set, so a new release is the new baseline."""
|
||||
assert _written_tags(ROOT / "scripts" / script) == []
|
||||
|
||||
|
||||
def test_the_checker_of_a_written_tag_sees_one(tmp_path):
|
||||
bad = tmp_path / "x.py"
|
||||
bad.write_text('"""docs may say firefox-68."""\nENGINE_TAG = "firefox-68"\n', encoding="utf-8")
|
||||
assert _written_tags(bad) == [(2, "firefox-68")]
|
||||
|
||||
|
||||
# -
|
||||
# The lock
|
||||
|
||||
LOCK = ROOT / "ci" / "py-lock" / "published.txt"
|
||||
GATE_LOCK = ROOT / "ci" / "py-lock" / "gate.txt"
|
||||
H1, H2, H3 = "a" * 64, "b" * 64, "c" * 64
|
||||
|
||||
|
||||
def _lock(**kw) -> str:
|
||||
text = "\n".join([
|
||||
"# header", "# wrapper-requires: greenlet<4.0.0,>=3.1.1 | psutil>=5.9", "# core-requires: platformdirs>=4",
|
||||
"invisible-core==70.83.0 \\", " --hash=sha256:%s \\" % H1, " --hash=sha256:%s" % H2,
|
||||
"invisible-playwright==0.60.0 \\", " --hash=sha256:%s" % H3, ""])
|
||||
for old, new in kw.items():
|
||||
assert old in text, old
|
||||
text = text.replace(old, new)
|
||||
return text
|
||||
|
||||
|
||||
def test_the_committed_lock_reads_and_every_entry_has_hashes_and_an_exact_version():
|
||||
parsed = ps.parse_lock(LOCK.read_text(encoding="utf-8"))
|
||||
assert parsed["wrapper"][0] and parsed["core"][0] and parsed["wrapper"][1] and parsed["core"][1]
|
||||
assert LOCK.read_bytes().count(b"\r") == 0, "LF only"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("what,text,says", [
|
||||
("a range", _lock(**{"invisible-core==70.83.0": "invisible-core>=70.83.0"}), "not `name==version"),
|
||||
("an entry with no hash", _lock(**{"invisible-playwright==0.60.0 \\\n --hash=sha256:" + H3: "invisible-playwright==0.60.0"}), "has no hash"),
|
||||
("a hash that is not a sha256", _lock(**{H3: "zz"}), "not a --hash=sha256"),
|
||||
("the wrapper missing", _lock().split("invisible-playwright")[0], "must hold exactly"),
|
||||
("a duplicated entry", _lock() + "invisible-core==70.83.0 --hash=sha256:%s\n" % H1, "listed twice"),
|
||||
("the requirements of the wrapper unsaid", _lock().replace("# wrapper-requires: greenlet<4.0.0,>=3.1.1 | psutil>=5.9\n", ""), "wrapper-requires"),
|
||||
("a URL", _lock(**{"invisible-core==70.83.0": "invisible-core @ https://x/y.whl"}), "not `name==version"),
|
||||
])
|
||||
def test_a_lock_that_is_not_a_hash_pinned_set_is_refused(what, text, says):
|
||||
with pytest.raises(ValueError, match=says):
|
||||
ps.parse_lock(text)
|
||||
|
||||
|
||||
def test_the_committed_set_installs_over_the_gate_s_own_lock_offline():
|
||||
"""The venv of the set is the gate's third-party lock plus the two wheels, `--no-deps`: every requirement of either must be met by a package that lock holds."""
|
||||
parsed = ps.parse_lock(LOCK.read_text(encoding="utf-8"))
|
||||
assert ps.problems_of_lock(parsed, GATE_LOCK.read_text(encoding="utf-8")) == []
|
||||
|
||||
|
||||
def test_a_requirement_the_gate_lock_does_not_meet_is_named():
|
||||
parsed = ps.parse_lock(_lock())
|
||||
gate_text = "greenlet==3.5.6 \\\n --hash=sha256:%s\npsutil==7.2.2 \\\n --hash=sha256:%s\n" % (H1, H1)
|
||||
found = ps.problems_of_lock(parsed, gate_text)
|
||||
assert any("platformdirs>=4" in p and "does not hold it" in p for p in found), found
|
||||
old = "greenlet==2.0.0 \\\n --hash=sha256:%s\npsutil==7.2.2 \\\n --hash=sha256:%s\nplatformdirs==4.1 \\\n --hash=sha256:%s\n" % (H1, H1, H1)
|
||||
assert any("greenlet<4.0.0,>=3.1.1" in p and "holds greenlet==2.0.0" in p for p in ps.problems_of_lock(parsed, old))
|
||||
|
||||
|
||||
def test_the_wrapper_pins_the_core_of_the_lock_exactly_and_the_ledger_knows_the_version():
|
||||
"""Offline: the lock says what the ledger (PUBLISHED.json, written at each release) says of that version of the wrapper. A lock that names a version nobody published, or
|
||||
a core the wrapper of that version did not pin, is wrong; whether it is the LAST release is the index's to say (published-set.yml)."""
|
||||
parsed = ps.parse_lock(LOCK.read_text(encoding="utf-8"))
|
||||
ledger = json.loads((ROOT / "PUBLISHED.json").read_text(encoding="utf-8"))["released"]
|
||||
rows = [r for r in ledger if r["version"] == parsed["wrapper"][0]]
|
||||
assert len(rows) == 1, "the lock names invisible-playwright %s, which the ledger does not list as published" % parsed["wrapper"][0]
|
||||
requires = [r for r in rows[0]["requires_dist"] if "extra ==" not in r]
|
||||
assert ps.core_pin_of(requires) == parsed["core"][0]
|
||||
others = sorted(r.replace(" ", "") for r in requires if not r.startswith("invisible-core"))
|
||||
assert sorted(r.replace(" ", "") for r in parsed["wrapper_requires"]) == others
|
||||
|
||||
|
||||
# -
|
||||
# The resolver, on documents made here (the index is read by `check` in published-set.yml, never by a unit test)
|
||||
|
||||
def _doc(name: str, version: str, requires: list, files: list) -> dict:
|
||||
return {"info": {"name": name, "version": version, "requires_dist": requires},
|
||||
"urls": [{"filename": f, "packagetype": "bdist_wheel" if f.endswith(".whl") else "sdist", "digests": {"sha256": h}, "yanked": y} for f, h, y in files]}
|
||||
|
||||
|
||||
def _index(wrapper_pin="70.83.0", extra=()):
|
||||
docs = {
|
||||
"invisible-playwright/json": _doc("invisible-playwright", "0.60.0", [], []),
|
||||
"invisible-playwright/0.60.0/json": _doc("invisible-playwright", "0.60.0", ["greenlet<4.0.0,>=3.1.1", "invisible-core==%s" % wrapper_pin, "psutil>=5.9", "pytest>=7; extra == 'dev'"],
|
||||
[("w.whl", H3, False), ("w.tar.gz", H1, False), ("yanked.whl", H2, True)]),
|
||||
"invisible-core/70.83.0/json": _doc("invisible-core", "70.83.0", ["platformdirs>=4", "ruff>=0.6; extra == 'dev'"], [("c.whl", H2, False), ("c.tar.gz", H1, False)]),
|
||||
}
|
||||
docs.update(dict(extra))
|
||||
return lambda url: docs[url.split("/pypi/", 1)[1]]
|
||||
|
||||
|
||||
def test_the_lock_is_made_from_the_last_release_and_the_core_it_pins():
|
||||
text = ps.resolve(_index())
|
||||
parsed = ps.parse_lock(text)
|
||||
assert parsed["wrapper"] == ("0.60.0", sorted([H1, H3])), "every file of the version that is on the index and not yanked, by its sha256"
|
||||
assert parsed["core"] == ("70.83.0", sorted([H1, H2]))
|
||||
assert parsed["wrapper_requires"] == ["greenlet<4.0.0,>=3.1.1", "psutil>=5.9"] and parsed["core_requires"] == ["platformdirs>=4"], "no extra"
|
||||
assert ps.resolve(_index()) == text, "the same index, the same bytes"
|
||||
|
||||
|
||||
def test_a_wrapper_that_does_not_pin_its_core_exactly_is_no_set():
|
||||
with pytest.raises(ValueError, match="does not pin invisible-core exactly once"):
|
||||
ps.core_pin_of(["invisible-core>=70", "psutil>=5.9"])
|
||||
with pytest.raises(ValueError, match="pins invisible-core==70.83.0 but the core document is of 70.84.0"):
|
||||
ps.lock_text(_index()("https://x/pypi/invisible-playwright/0.60.0/json"), _doc("invisible-core", "70.84.0", [], [("c.whl", H2, False)]))
|
||||
|
||||
|
||||
def test_the_check_is_red_when_the_index_has_a_newer_release_and_says_the_command(tmp_path):
|
||||
stale = tmp_path / "published.txt"
|
||||
stale.write_text(ps.resolve(_index()), encoding="utf-8")
|
||||
assert ps.check(_index(), stale) == []
|
||||
newer = {"invisible-playwright/json": _doc("invisible-playwright", "0.61.0", [], []),
|
||||
"invisible-playwright/0.61.0/json": _doc("invisible-playwright", "0.61.0", ["invisible-core==71.84.0", "psutil>=5.9"], [("w2.whl", H1, False)]),
|
||||
"invisible-core/71.84.0/json": _doc("invisible-core", "71.84.0", ["platformdirs>=4"], [("c2.whl", H3, False)])}
|
||||
found = ps.check(_index(extra=newer), stale)
|
||||
assert len(found) == 1 and "invisible-playwright 0.60.0 + invisible-core 70.83.0" in found[0] and "invisible-playwright 0.61.0 + invisible-core 71.84.0" in found[0]
|
||||
assert "resolve --write" in found[0]
|
||||
assert ps.check(_index(), tmp_path / "missing.txt")[0].startswith("missing.txt holds nothing")
|
||||
|
||||
|
||||
def test_an_index_that_cannot_be_read_is_red_not_green():
|
||||
def down(url):
|
||||
raise OSError("the index is down")
|
||||
|
||||
assert "the index is down" in ps.check(down)[0]
|
||||
|
||||
|
||||
# -
|
||||
# The install (offline, by hash) and what is verified of it
|
||||
|
||||
def _wheel(folder: Path, name: str, who: str, requires: str = "") -> str:
|
||||
"""A real, tiny wheel `<name>-70.83.0-py3-none-any.whl` whose package says in WHO whose it is (it declares `requires`, a Requires-Dist line, when given); returns its sha256."""
|
||||
import hashlib
|
||||
import zipfile
|
||||
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
version = "70.83.0"
|
||||
dist = "%s-%s.dist-info" % (name, version)
|
||||
files = {"%s/__init__.py" % name: "WHO = %r\n" % who,
|
||||
dist + "/METADATA": "Metadata-Version: 2.1\nName: %s\nVersion: %s\n%s" % (name.replace("_", "-"), version, ("Requires-Dist: %s\n" % requires) if requires else ""),
|
||||
dist + "/WHEEL": "Wheel-Version: 1.0\nGenerator: test\nRoot-Is-Purelib: true\nTag: py3-none-any\n"}
|
||||
path = folder / ("%s-%s-py3-none-any.whl" % (name, version))
|
||||
with zipfile.ZipFile(path, "w") as z:
|
||||
for n, text in files.items():
|
||||
z.writestr(n, text)
|
||||
z.writestr(dist + "/RECORD", "".join("%s,,\n" % n for n in files) + dist + "/RECORD,,\n")
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
NAMES = ("invisible_core", "invisible_playwright")
|
||||
|
||||
|
||||
def _tiny_house(tmp_path: Path):
|
||||
"""A wheelhouse as the run's has it: the published set's two wheels in `published/`, and in its own folder the CANDIDATE's wheels of the same two packages, built from the
|
||||
refs: the same file names, other bytes. The lock names the published ones. Returns (house, lock, published sha256 by name, candidate sha256 by name)."""
|
||||
house = tmp_path / "house"
|
||||
house.mkdir()
|
||||
(house / "lock.txt").write_text("", encoding="utf-8")
|
||||
published = {name: _wheel(house / "published", name, "published") for name in NAMES}
|
||||
candidate = {name: _wheel(house, name, "candidate") for name in NAMES}
|
||||
for name in NAMES:
|
||||
assert candidate[name] != published[name], "same file name, other bytes: the candidate's"
|
||||
lock = tmp_path / "published.txt"
|
||||
lock.write_text("# wrapper-requires: \n# core-requires: \ninvisible-core==70.83.0 --hash=sha256:%s\ninvisible-playwright==70.83.0 --hash=sha256:%s\n"
|
||||
% (published["invisible_core"], published["invisible_playwright"]), encoding="utf-8")
|
||||
return house, lock, published, candidate
|
||||
|
||||
|
||||
def test_the_install_is_offline_hash_checked_and_in_a_venv_of_its_own(tmp_path, monkeypatch):
|
||||
house, lock, _published, _candidate = _tiny_house(tmp_path)
|
||||
ran = []
|
||||
monkeypatch.setenv("PYTHONPATH", "/candidate/site")
|
||||
ps.install(house, tmp_path / "venv", lock, run=lambda cmd, **kw: ran.append((cmd, kw)) or types.SimpleNamespace(returncode=0, stdout="", stderr=""))
|
||||
venv_cmd, first, second, check = ran
|
||||
assert check[0][1:] == ["-m", "pip", "check"] and "PYTHONPATH" not in check[1]["env"], "then pip check over the whole venv, with the set's python"
|
||||
assert venv_cmd[0][1:] == ["-m", "venv", str(tmp_path / "venv")]
|
||||
for cmd, kw in (first, second):
|
||||
assert cmd[0] == str(ps.venv_python(tmp_path / "venv")) and cmd[1:5] == ["-m", "pip", "install", "--quiet"]
|
||||
assert "--no-index" in cmd and "--require-hashes" in cmd and cmd.count("--find-links") == 1
|
||||
assert "PYTHONPATH" not in kw["env"], "nothing of the candidate's job"
|
||||
assert first[0][first[0].index("--find-links") + 1] == str(house), "the third-party lock comes from the wheelhouse"
|
||||
assert second[0][second[0].index("--find-links") + 1] == str(house / "published"), "the two wheels of the set come from published/ and from nowhere else: the wheelhouse's own folder holds the candidate's"
|
||||
assert first[0][-2:] == ["-r", str(house / "lock.txt")] and "--no-deps" not in first[0]
|
||||
assert "--no-deps" in second[0] and second[0][-2:] == ["-r", str(lock)], "the two wheels, by the hashes of the lock, over the third-party lock"
|
||||
|
||||
|
||||
def test_an_install_without_the_gate_s_lock_in_the_wheelhouse_is_refused(tmp_path):
|
||||
with pytest.raises(FileNotFoundError, match="not a py-deps wheelhouse"):
|
||||
ps.install(tmp_path, tmp_path / "venv", LOCK, run=lambda *a, **k: None)
|
||||
|
||||
|
||||
def test_an_install_without_the_published_folder_is_refused_not_served_by_the_candidates_wheels(tmp_path):
|
||||
(tmp_path / "lock.txt").write_text("", encoding="utf-8")
|
||||
with pytest.raises(FileNotFoundError, match="has no published/ folder"):
|
||||
ps.install(tmp_path, tmp_path / "venv", LOCK, run=lambda *a, **k: None)
|
||||
|
||||
|
||||
def test_an_install_whose_published_folder_holds_another_file_than_the_lock_s_is_refused_naming_both(tmp_path):
|
||||
"""The published folder has a wheel of the right name and version whose sha256 is not the lock's (a candidate build put there): refused before anything is installed."""
|
||||
house, lock, published, candidate = _tiny_house(tmp_path)
|
||||
_wheel(house / "published", "invisible_core", "candidate") # overwrites the published one with the candidate's bytes, the same name
|
||||
ran = []
|
||||
with pytest.raises(FileNotFoundError) as e:
|
||||
ps.install(house, tmp_path / "venv", lock, run=lambda cmd, **kw: ran.append(cmd))
|
||||
assert published["invisible_core"] in str(e.value) and candidate["invisible_core"] in str(e.value) and ran == []
|
||||
|
||||
|
||||
def test_the_set_is_installed_from_published_never_from_the_candidates_wheels_of_the_same_names(tmp_path):
|
||||
"""The wheelhouse's own folder holds the candidate's invisible_core and invisible_playwright, built from the refs, with the file names of the published ones (the versions
|
||||
are equal). The old install looked in the wheelhouse for the two wheels of the set: it refused the candidate's file by its hash (and with no hash check it would have put
|
||||
the candidate's core in the control's venv). A real pip, offline, on wheels made here; what was installed is read back from the disk, not from the version."""
|
||||
house, lock, published, _candidate = _tiny_house(tmp_path)
|
||||
python = ps.install(house, tmp_path / "venv", lock)
|
||||
done = subprocess.run([str(python), "-I", "-c", "import invisible_core, invisible_playwright; print(invisible_core.WHO, invisible_playwright.WHO)"],
|
||||
capture_output=True, text=True, check=True)
|
||||
assert done.stdout.split() == ["published", "published"]
|
||||
record = json.loads((tmp_path / "venv" / ps.RECORD_FILE).read_text(encoding="utf-8"))["packages"]
|
||||
assert {n: record[n.replace("_", "-")]["sha256"] for n in NAMES} == published
|
||||
assert record["invisible-core"]["wheel"] == "invisible_core-70.83.0-py3-none-any.whl"
|
||||
assert ps.verify(str(python), lock, run=_real_identity(tmp_path / "venv", python)) == []
|
||||
|
||||
|
||||
def _real_identity(venv: Path, python: Path):
|
||||
"""The identity of a real venv made here (its tiny wheels have no seal): what the set's python would print, from the venv's own folders."""
|
||||
purelib = subprocess.run([str(python), "-c", "import sysconfig; print(sysconfig.get_paths()['purelib'])"], capture_output=True, text=True, check=True).stdout.strip()
|
||||
return _identity(prefix=str(venv), core_file=str(Path(purelib) / "invisible_core" / "__init__.py"), wrapper_file=str(Path(purelib) / "invisible_playwright" / "__init__.py"),
|
||||
core="70.83.0", core_version="70.83.0", wrapper="70.83.0")
|
||||
|
||||
|
||||
def test_pip_check_is_red_when_a_published_wheel_requires_what_the_wheelhouse_does_not_hold_and_green_on_the_normal_house(tmp_path):
|
||||
"""`--no-deps` installs a wheel without reading what it declares. A published wheel that requires a package the house's dependencies do not satisfy is red at pip check,
|
||||
with what pip says; the normal house (the same two wheels declaring nothing unmet) is green. Real pip."""
|
||||
normal = tmp_path / "normal"
|
||||
normal.mkdir()
|
||||
house, lock, _published, _candidate = _tiny_house(normal)
|
||||
assert ps.install(house, normal / "venv", lock).is_file()
|
||||
bad = tmp_path / "bad"
|
||||
bad.mkdir()
|
||||
house = bad / "house"
|
||||
house.mkdir()
|
||||
(house / "lock.txt").write_text("", encoding="utf-8")
|
||||
hashes = {"invisible_core": _wheel(house / "published", "invisible_core", "published", requires="a-package-no-house-holds>=1"),
|
||||
"invisible_playwright": _wheel(house / "published", "invisible_playwright", "published")}
|
||||
lock = bad / "published.txt"
|
||||
lock.write_text("# wrapper-requires: \n# core-requires: \ninvisible-core==70.83.0 --hash=sha256:%s\ninvisible-playwright==70.83.0 --hash=sha256:%s\n"
|
||||
% (hashes["invisible_core"], hashes["invisible_playwright"]), encoding="utf-8")
|
||||
with pytest.raises(RuntimeError, match="pip check .* is red") as e:
|
||||
ps.install(house, bad / "venv", lock)
|
||||
assert "a-package-no-house-holds" in str(e.value) and "invisible-core" in str(e.value), "it names what pip reports"
|
||||
assert not (bad / "venv" / ps.RECORD_FILE).exists(), "a venv that failed its check records nothing"
|
||||
|
||||
|
||||
def test_a_published_lock_that_names_neither_wheel_is_red_with_real_pip_files_in_both_folders(tmp_path):
|
||||
"""The negative control of the same-name case: two real wheels of one name and version (the candidate's in the wheelhouse's folder, the published one in published/), and a lock
|
||||
that names the hash of neither. It is red, and names the sha256 of what published/ holds."""
|
||||
house, _lock, published, candidate = _tiny_house(tmp_path)
|
||||
other = tmp_path / "other.txt"
|
||||
other.write_text("# wrapper-requires: \n# core-requires: \ninvisible-core==70.83.0 --hash=sha256:%s\ninvisible-playwright==70.83.0 --hash=sha256:%s\n" % ("e" * 64, "f" * 64), encoding="utf-8")
|
||||
with pytest.raises(FileNotFoundError) as e:
|
||||
ps.install(house, tmp_path / "venv", other)
|
||||
assert published["invisible_core"] in str(e.value) and "e" * 64 in str(e.value) and candidate["invisible_core"] not in str(e.value)
|
||||
assert not (tmp_path / "venv").exists(), "nothing was installed"
|
||||
|
||||
|
||||
def test_verify_names_the_file_installed_and_is_green_only_when_it_is_the_published_lock_s(tmp_path):
|
||||
"""The candidate's lock and the published one can name the same package at the same version, so the version proves nothing. A venv that holds the CANDIDATE's wheels of the
|
||||
same names (installed wrongly, from the wheelhouse's own folder) says so: the file, its sha256 and the sha256 the lock holds. The old verify compared versions only and
|
||||
was green on it."""
|
||||
import subprocess as sp
|
||||
|
||||
house, lock, published, candidate = _tiny_house(tmp_path)
|
||||
venv = tmp_path / "wrong-venv"
|
||||
sp.run([sys.executable, "-m", "venv", str(venv)], check=True, capture_output=True)
|
||||
python = ps.venv_python(venv)
|
||||
env = {k: v for k, v in os.environ.items() if k != "PYTHONPATH"}
|
||||
sp.run([str(python), "-m", "pip", "install", "--quiet", "--no-index", "--no-deps", str(house / "invisible_core-70.83.0-py3-none-any.whl"),
|
||||
str(house / "invisible_playwright-70.83.0-py3-none-any.whl")], check=True, env=env)
|
||||
ps.write_record(venv, {n.replace("_", "-"): (house / ("%s-70.83.0-py3-none-any.whl" % n), candidate[n]) for n in NAMES})
|
||||
problems = ps.verify(str(python), lock, run=_real_identity(venv, python))
|
||||
assert len(problems) == 2, problems
|
||||
for name, n in (("invisible-core", "invisible_core"), ("invisible-playwright", "invisible_playwright")):
|
||||
text = next(p for p in problems if p.startswith(name + ":"))
|
||||
assert "%s-70.83.0-py3-none-any.whl" % n in text and candidate[n] in text and published[n] in text, "it names the file installed, its sha256 and the lock's: " + text
|
||||
# the record says the published wheel but the disk holds the candidate's bytes: a record is not believed over the files
|
||||
ps.write_record(venv, {n.replace("_", "-"): (house / "published" / ("%s-70.83.0-py3-none-any.whl" % n), published[n]) for n in NAMES})
|
||||
again = ps.verify(str(python), lock, run=_real_identity(venv, python))
|
||||
assert len(again) == 2 and all("on disk is" in p and "__init__.py" in p for p in again), again
|
||||
# and without any record nothing says which file it is
|
||||
(venv / ps.RECORD_FILE).unlink()
|
||||
assert "has no %s" % ps.RECORD_FILE in ps.verify(str(python), lock, run=_real_identity(venv, python))[0]
|
||||
|
||||
|
||||
def _identity(**kw):
|
||||
parsed = ps.parse_lock(LOCK.read_text(encoding="utf-8"))
|
||||
prefix = "/set"
|
||||
base = {"prefix": prefix, "core": parsed["core"][0], "core_version": parsed["core"][0], "core_file": prefix + "/lib/invisible_core/__init__.py",
|
||||
"wrapper": parsed["wrapper"][0], "wrapper_file": prefix + "/lib/invisible_playwright/__init__.py", "seal_tag": "firefox-70", "seal_local": False}
|
||||
base.update(kw)
|
||||
return lambda cmd, **k: types.SimpleNamespace(returncode=0, stdout=json.dumps(base), stderr="")
|
||||
|
||||
|
||||
def _installed_set(tmp_path: Path):
|
||||
"""The state `install` leaves, made here: the published wheels' package files in a site folder, and the record naming the wheels. Returns (lock, identity kwargs)."""
|
||||
import zipfile
|
||||
|
||||
house, lock, published, _candidate = _tiny_house(tmp_path)
|
||||
prefix, site = tmp_path / "set", tmp_path / "set" / "lib"
|
||||
site.mkdir(parents=True)
|
||||
chosen = {}
|
||||
for n in NAMES:
|
||||
wheel = house / "published" / ("%s-70.83.0-py3-none-any.whl" % n)
|
||||
with zipfile.ZipFile(wheel) as z:
|
||||
z.extract("%s/__init__.py" % n, site)
|
||||
chosen[n.replace("_", "-")] = (wheel, published[n])
|
||||
ps.write_record(prefix, chosen)
|
||||
return lock, dict(prefix=str(prefix), core_file=str(site / "invisible_core" / "__init__.py"), wrapper_file=str(site / "invisible_playwright" / "__init__.py"),
|
||||
core="70.83.0", core_version="70.83.0", wrapper="70.83.0")
|
||||
|
||||
|
||||
def test_what_the_set_s_python_imports_is_the_lock_from_its_own_venv(tmp_path):
|
||||
lock, kw = _installed_set(tmp_path)
|
||||
assert ps.verify("py", lock, run=_identity(**kw)) == []
|
||||
assert any("core it runs" in p for p in ps.verify("py", lock, run=_identity(**dict(kw, core="71.1.0"))))
|
||||
assert any("core it runs" in p for p in ps.verify("py", lock, run=_identity(**dict(kw, core_file="/candidate/src/invisible_core/__init__.py")))), "a core from another place is the candidate's"
|
||||
assert any("wrapper it runs" in p for p in ps.verify("py", lock, run=_identity(**dict(kw, wrapper_file="/candidate/src/invisible_playwright/__init__.py"))))
|
||||
assert any("local seal" in p for p in ps.verify("py", lock, run=_identity(**dict(kw, seal_local=True))))
|
||||
|
||||
|
||||
def test_a_set_that_cannot_import_is_an_error_not_a_pass():
|
||||
with pytest.raises(RuntimeError, match="could not import the published set"):
|
||||
ps.identity("py", run=lambda cmd, **k: types.SimpleNamespace(returncode=1, stdout="", stderr="ModuleNotFoundError: invisible_core"))
|
||||
|
||||
|
||||
# -
|
||||
# The wiring: the lock is kept equal to the index, and these tests are run by the rounds
|
||||
|
||||
def test_a_workflow_keeps_the_lock_equal_to_the_index_every_day_and_on_a_pull_request_that_touches_it():
|
||||
text = (ROOT / ".github" / "workflows" / "published-set.yml").read_text(encoding="utf-8")
|
||||
assert 'cron: "' in text and "pull_request:" in text and "ci/py-lock/published.txt" in text and "scripts/ci_published_set.py" in text
|
||||
assert "python scripts/ci_published_set.py check" in text and "pip install" not in text, "it reads the index and installs nothing"
|
||||
|
||||
|
||||
def test_this_file_is_run_by_the_whole_unit_suite_of_both_systems():
|
||||
rows = {r["id"]: r for r in json.loads((ROOT / "ci" / "required-suites.json").read_text(encoding="utf-8"))}
|
||||
for suite in ("wrapper.unit.all.linux", "wrapper.unit.all.windows"):
|
||||
assert "tests/test_ci_published_set.py" in rows[suite]["tests"], suite
|
||||
|
||||
|
||||
def test_the_required_suites_of_the_oracles_say_the_control_is_the_set():
|
||||
rows = {r["id"]: r for r in json.loads((ROOT / "ci" / "required-suites.json").read_text(encoding="utf-8"))}
|
||||
for suite in ("wrapper.e2e.ab_oracle", "wrapper.e2e.ab_network", "wrapper.e2e.ab_host"):
|
||||
assert "published set" in rows[suite]["note"].lower(), suite
|
||||
assert "firefox-68" not in rows[suite]["note"], suite
|
||||
@@ -0,0 +1,107 @@
|
||||
"""A fixture whose exact bytes a test pins is checked out byte for byte on every OS, so `.gitattributes` marks it `-text` (or `binary`, or `eol=lf`).
|
||||
|
||||
A Windows checkout with core.autocrlf=true hands a text fixture over with CRLF: its sha256, or a byte comparison with what a script writes, is then red on Windows and green on Linux.
|
||||
The set of pinned fixtures is read, not remembered:
|
||||
* every `sources.json` the repository tracks is a hash table, one entry per file of its own folder;
|
||||
* `ci/security-state.pin.json` names the file it hashes;
|
||||
* the rows of `tests/vendor/README.md` name each bundle with its sha256;
|
||||
* the files below in PINNED_BY_BYTES are compared byte for byte (or hashed through a header) by the test named beside them.
|
||||
A test that hashes a file it reads (`sha256(... .read_bytes())`) has to be in HASHING_TESTS, so a new pin cannot be added without a decision about where its fixture comes from.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ME = Path(__file__).name
|
||||
ROW = re.compile(r"^\|\s*`([^`]+)`\s*\|.*\|\s*`[0-9a-f]{64}`\s*\|", re.MULTILINE)
|
||||
HASHES_A_FILE = re.compile(r"sha256\(.*read_bytes\(\)")
|
||||
|
||||
# Fixtures compared byte for byte, or hashed through a header, by a test: path -> the test that holds it.
|
||||
PINNED_BY_BYTES = {
|
||||
"ci/persona-seeds.json": "tests/test_persona_cover.py",
|
||||
"tests/gates/wire_method_debt.json": "tests/test_every_wire_method_is_served_or_refused.py",
|
||||
"ci/py-lock/gate.in": "tests/test_the_gate_lock_follows_the_sources.py",
|
||||
"ci/py-lock/gate.txt": "tests/test_the_gate_lock_follows_the_sources.py",
|
||||
"tests/data/password_mask_page.html": "tests/test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py",
|
||||
}
|
||||
|
||||
# Every test file that hashes a file it reads, and where its fixtures come from.
|
||||
HASHING_TESTS = {
|
||||
"test_ci_lab_security_state.py": "ci/security-state.pin.json names the file",
|
||||
"test_known_mozilla_defects_in_crash_evidence.py": "sources.json beside the evidence",
|
||||
"test_the_vendored_bundles_are_listed_with_their_hash.py": "the rows of tests/vendor/README.md",
|
||||
"test_ci_published_set.py": "a wheel the test builds in tmp_path: no fixture of the repository",
|
||||
"test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py": "tests/data/password_mask_page.html, the page of the retail capture (PINNED_BY_BYTES, `-text` in .gitattributes); the capture itself is built in tmp_path",
|
||||
}
|
||||
|
||||
|
||||
def tracked(*patterns: str) -> list[str]:
|
||||
out = subprocess.run(["git", "ls-files", "--", *patterns], cwd=ROOT, capture_output=True, text=True, check=True).stdout
|
||||
return [line for line in out.splitlines() if line]
|
||||
|
||||
|
||||
def pinned_fixtures() -> dict[str, str]:
|
||||
"""path -> what pins it, for every fixture of the repository whose bytes a test pins."""
|
||||
found = dict(PINNED_BY_BYTES)
|
||||
for table in tracked("sources.json", "**/sources.json"):
|
||||
folder = Path(table).parent.as_posix()
|
||||
for name in json.loads((ROOT / table).read_text(encoding="utf-8")):
|
||||
found[(folder + "/" + name) if folder != "." else name] = table
|
||||
pin = json.loads((ROOT / "ci" / "security-state.pin.json").read_text(encoding="utf-8"))
|
||||
found[pin["file"]] = "ci/security-state.pin.json"
|
||||
for name in ROW.findall((ROOT / "tests" / "vendor" / "README.md").read_text(encoding="utf-8")):
|
||||
found["tests/vendor/" + name] = "tests/vendor/README.md"
|
||||
return found
|
||||
|
||||
|
||||
def not_byte_exact(paths: list[str], cwd: Path = ROOT) -> list[str]:
|
||||
"""One line per path that a checkout may rewrite: git's `text` attribute is not unset (`-text`, `binary`) and `eol` is not `lf`."""
|
||||
out = subprocess.run(["git", "check-attr", "text", "eol", "--", *paths], cwd=cwd, capture_output=True, text=True, check=True).stdout
|
||||
attrs: dict[str, dict[str, str]] = {}
|
||||
for line in out.splitlines():
|
||||
path, name, value = line.rsplit(": ", 2)
|
||||
attrs.setdefault(path, {})[name] = value
|
||||
return ["%s: text is %r, eol is %r: add `%s -text` to .gitattributes" % (p, a["text"], a["eol"], p)
|
||||
for p, a in sorted(attrs.items()) if not (a["text"] == "unset" or a["eol"] == "lf")]
|
||||
|
||||
|
||||
def test_every_fixture_whose_bytes_a_test_pins_is_not_converted_by_a_checkout():
|
||||
pins = pinned_fixtures()
|
||||
missing = [p for p in sorted(pins) if not (ROOT / p).is_file()]
|
||||
assert not missing, "pinned by %s, and not a file: %s" % ({pins[p] for p in missing}, missing)
|
||||
assert not_byte_exact(sorted(pins)) == []
|
||||
|
||||
|
||||
def test_the_pinned_fixtures_include_the_defects_evidence_and_its_matcher():
|
||||
pins = pinned_fixtures()
|
||||
assert pins["tests/data/known_mozilla_defects/gdb-core.FSBroker14298.14187.1796087906.txt"] == "tests/data/known_mozilla_defects/sources.json"
|
||||
assert pins["tests/data/known_mozilla_defects/ci_mozilla_defects.py.txt"] == "tests/data/known_mozilla_defects/sources.json"
|
||||
assert "tests/vendor/bot-detector-2.0.0.esm.js" in pins and "ci/security-state/securitystate-result.json" in pins
|
||||
|
||||
|
||||
def test_every_test_that_hashes_a_file_it_reads_is_listed():
|
||||
hashing = {p.name for folder in (ROOT / "tests", ROOT / "tests" / "unit") for p in folder.glob("test_*.py")
|
||||
if p.name != ME and HASHES_A_FILE.search(p.read_text(encoding="utf-8"))}
|
||||
assert hashing == set(HASHING_TESTS), "tests that hash a file and are not in HASHING_TESTS (or listed and no longer hashing): %s" % sorted(hashing ^ set(HASHING_TESTS))
|
||||
|
||||
|
||||
def test_a_pinned_fixture_without_its_line_is_red_and_named(tmp_path):
|
||||
subprocess.run(["git", "init", "-q"], cwd=tmp_path, check=True)
|
||||
(tmp_path / "data").mkdir()
|
||||
(tmp_path / "data" / "evidence.txt").write_bytes(b"a\nb\n")
|
||||
assert not_byte_exact(["data/evidence.txt"], tmp_path) == [
|
||||
"data/evidence.txt: text is 'unspecified', eol is 'unspecified': add `data/evidence.txt -text` to .gitattributes"]
|
||||
(tmp_path / ".gitattributes").write_text("data/** -text\n", encoding="utf-8")
|
||||
assert not_byte_exact(["data/evidence.txt"], tmp_path) == []
|
||||
(tmp_path / ".gitattributes").write_text("data/** text eol=lf\n", encoding="utf-8")
|
||||
assert not_byte_exact(["data/evidence.txt"], tmp_path) == []
|
||||
(tmp_path / ".gitattributes").write_text("data/** text\n", encoding="utf-8")
|
||||
assert len(not_byte_exact(["data/evidence.txt"], tmp_path)) == 1
|
||||
@@ -0,0 +1,219 @@
|
||||
"""Every page or frame that an e2e test asks the fake sites for is a route that the same file registers.
|
||||
|
||||
``Sites`` (``tests/_fission_frames.py``) answers a path that nobody routed with a 404 and an EMPTY body, in no error. A page that is loaded from such a path is an empty document: the test
|
||||
goes on and fails later, in a place that does not say why. The intersection twin did that: the frame's source was ``sites.url("B", "/io")``, the route of that path was dropped in one commit
|
||||
and ``_register`` did not get it back, so ``document.getElementById('t')`` was null and ``IntersectionObserver.observe`` threw, in a frame whose request was answered 404.
|
||||
|
||||
The rule (a red closes by a written rule that a test imposes on every file): in each test module that runs ``Sites()``, every ``X.url(site, path)`` call, and every
|
||||
``wait_frame``/``frame_of`` call that names a site and a path (``X.url(site)`` or ``X.origin[site]``, and the path), has a ``X.route(site, path, ...)`` call in the same module.
|
||||
|
||||
HOW THE PATHS ARE READ (``ast``, no browser). A path is its text where it is a string. A part that is computed (``"/io-" + tag``, ``"/h%d" % n``, an f-string) is a wildcard, so ``"/io-" + tag`` asked
|
||||
and ``"/io-" + tag`` routed are the same page. A site that is a name (a loop variable) is any site. A path that is only a name (``sites.url(site, path)``) is any route of that site: it is
|
||||
resolved at run time, and the module must at least route something for it. The scope is the module: a registration is in a helper that the tests of the module call, and the module is the unit
|
||||
that holds both ends, so the check does not follow calls.
|
||||
|
||||
THE EXEMPTIONS are listed in ``EXEMPT`` with the reason; an entry that no call uses any more is itself red, so the list cannot outlive its case.
|
||||
|
||||
Known-bad input: the intersection file as it was (``sites.url("B", "/io")`` asked, ``B /io`` never routed), and a snippet of the same shape. Green: the file with the route back, a snippet that routes it,
|
||||
and the paths with a computed part. The scan must find calls: a scan that reads no ``url`` and no ``route`` of a file that has both is red, so a change of the call shapes cannot turn the check into a pass.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, NamedTuple, Optional, Tuple
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
TESTS = Path(__file__).resolve().parent
|
||||
|
||||
#: (file name, site, path as the scan reads it) -> why this asked path is no page that a browser loads. A path that is asked and compared, never requested.
|
||||
EXEMPT: Dict[Tuple[str, str, str], str] = {
|
||||
("test_fission_frames_workers_storage_and_special_frames_e2e.py", "B", "/"):
|
||||
"the expected scope of a service worker (the folder of its script) is compared with the scope the page reads; no request is made for it",
|
||||
}
|
||||
|
||||
#: A frame lookup: ``wait_frame(page, origin, path)`` and ``frame_of(page, origin, path)``, ``origin`` being ``X.url(site)`` or ``X.origin[site]``.
|
||||
FRAME_LOOKUPS = ("wait_frame", "frame_of")
|
||||
|
||||
_SPEC = re.compile(r"%[-#0 +]*\d*(?:\.\d+)?[sdrifx]")
|
||||
_FORMAT_FIELD = re.compile(r"\{[^{}]*\}")
|
||||
|
||||
|
||||
class Use(NamedTuple):
|
||||
kind: str # "url" or "route"
|
||||
site: str # "A", "B", "C" or "*" (not a literal)
|
||||
path: str # the text, a computed part as "*"
|
||||
line: int
|
||||
|
||||
|
||||
def _shape(node: ast.AST) -> str:
|
||||
"""The text of a path expression, a computed part as ``*``."""
|
||||
if isinstance(node, ast.Constant) and isinstance(node.value, str):
|
||||
return node.value
|
||||
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.Add):
|
||||
return _shape(node.left) + _shape(node.right)
|
||||
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.Mod) and isinstance(node.left, ast.Constant) and isinstance(node.left.value, str):
|
||||
return _SPEC.sub("*", node.left.value)
|
||||
if isinstance(node, ast.JoinedStr):
|
||||
return "".join(_shape(part.value) if isinstance(part, ast.Constant) or not isinstance(part, ast.FormattedValue) else "*" for part in node.values)
|
||||
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and node.func.attr == "format"
|
||||
and isinstance(node.func.value, ast.Constant) and isinstance(node.func.value.value, str)):
|
||||
return _FORMAT_FIELD.sub("*", node.func.value.value)
|
||||
return "*"
|
||||
|
||||
|
||||
def _site(node: ast.AST) -> str:
|
||||
if isinstance(node, ast.Constant) and node.value in ("A", "B", "C"):
|
||||
return node.value
|
||||
return "*"
|
||||
|
||||
|
||||
def _is_url_call(node: ast.AST, args: int) -> bool:
|
||||
return isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and node.func.attr == "url" and len(node.args) == args and not node.keywords
|
||||
|
||||
|
||||
def _origin_site(node: ast.AST) -> Optional[str]:
|
||||
"""The site of an origin expression: ``X.url("B")`` or ``X.origin["B"]``; None for anything else."""
|
||||
if _is_url_call(node, 1):
|
||||
return _site(node.args[0])
|
||||
if isinstance(node, ast.Subscript) and isinstance(node.value, ast.Attribute) and node.value.attr == "origin":
|
||||
return _site(node.slice)
|
||||
return None
|
||||
|
||||
|
||||
def uses_in(source: str) -> List[Use]:
|
||||
"""Every path a module asks the fake sites for (``url``) and every one it registers (``route``), in source order."""
|
||||
out: List[Use] = []
|
||||
for node in ast.walk(ast.parse(source)):
|
||||
if not isinstance(node, ast.Call):
|
||||
continue
|
||||
if _is_url_call(node, 2):
|
||||
out.append(Use("url", _site(node.args[0]), _shape(node.args[1]), node.lineno))
|
||||
elif isinstance(node.func, ast.Attribute) and node.func.attr == "route" and len(node.args) >= 3 and isinstance(node.args[0], (ast.Constant, ast.Name)):
|
||||
out.append(Use("route", _site(node.args[0]), _shape(node.args[1]), node.lineno))
|
||||
elif isinstance(node.func, ast.Name) and node.func.id in FRAME_LOOKUPS and len(node.args) >= 3:
|
||||
site = _origin_site(node.args[1])
|
||||
if site is not None:
|
||||
out.append(Use("url", site, _shape(node.args[2]), node.lineno))
|
||||
return out
|
||||
|
||||
|
||||
def runs_sites(source: str) -> bool:
|
||||
"""Whether the module builds a ``Sites()`` (a call, not a name in text)."""
|
||||
return any(isinstance(n, ast.Call) and isinstance(n.func, ast.Name) and n.func.id == "Sites" for n in ast.walk(ast.parse(source)))
|
||||
|
||||
|
||||
def _same_page(asked: Use, routed: Use) -> bool:
|
||||
if "*" not in (asked.site, routed.site) and asked.site != routed.site:
|
||||
return False
|
||||
if asked.path == "*" or routed.path == "*":
|
||||
return True
|
||||
pattern = lambda text: re.compile(".*".join(re.escape(part) for part in text.split("*"))) # noqa: E731
|
||||
return bool(pattern(asked.path).fullmatch(routed.path) or pattern(routed.path).fullmatch(asked.path))
|
||||
|
||||
|
||||
def unrouted(source: str, name: str = "<module>") -> List[str]:
|
||||
"""What the module asks for that it does not route, one line each: where, what, how to correct, which rule. ``[]`` when each is routed or exempt."""
|
||||
uses = uses_in(source)
|
||||
routes = [u for u in uses if u.kind == "route"]
|
||||
problems: List[str] = []
|
||||
for asked in (u for u in uses if u.kind == "url"):
|
||||
if (name, asked.site, asked.path) in EXEMPT:
|
||||
continue
|
||||
if not any(_same_page(asked, routed) for routed in routes):
|
||||
problems.append(
|
||||
"%s:%d asks the fake sites for %s %s and nothing in the module routes it: an unrouted path is a 404 with an empty body (tests/_fission_frames.py), so the page that loads it is "
|
||||
"an empty document. Add sites.route(%r, %r, <page>) where the module registers its pages (the rule: every page a test asks the fake sites for is a route of the same module)"
|
||||
% (name, asked.line, "site " + asked.site, repr(asked.path), asked.site, asked.path))
|
||||
return problems
|
||||
|
||||
|
||||
def _modules() -> Dict[str, str]:
|
||||
return {path.name: path.read_text(encoding="utf-8") for path in sorted(TESTS.glob("*.py")) if path.name != Path(__file__).name
|
||||
and "Sites(" in path.read_text(encoding="utf-8") and runs_sites(path.read_text(encoding="utf-8"))}
|
||||
|
||||
|
||||
# ---- the rule, on every module of the tests ------------------------------------------------------------------------------------------
|
||||
|
||||
def test_every_page_an_e2e_test_asks_the_fake_sites_for_is_routed_by_its_module():
|
||||
problems: List[str] = []
|
||||
for name, source in _modules().items():
|
||||
problems += unrouted(source, name)
|
||||
assert not problems, "\n" + "\n".join(problems)
|
||||
|
||||
|
||||
def test_an_exemption_that_no_call_uses_is_red():
|
||||
used = set()
|
||||
for name, source in _modules().items():
|
||||
used |= {(name, u.site, u.path) for u in uses_in(source) if u.kind == "url"}
|
||||
stale = sorted(set(EXEMPT) - used)
|
||||
assert not stale, "EXEMPT lists a path that no module asks for any more (remove it, with its reason): %r" % (stale,)
|
||||
|
||||
|
||||
def test_the_scan_reads_the_calls_of_the_modules_it_judges():
|
||||
"""A scan that finds no ``url`` or no ``route`` in a module that has them judges nothing; the modules are checked one by one for that."""
|
||||
modules = _modules()
|
||||
assert len(modules) >= 17, "the scan found %d modules that run Sites(); the tests of the fission frames and the twins are at least that: %s" % (len(modules), sorted(modules))
|
||||
for name, source in modules.items():
|
||||
uses = uses_in(source)
|
||||
kinds = {u.kind for u in uses}
|
||||
assert kinds == {"url", "route"}, "%s runs Sites() and the scan read %s of it (calls read: %d)" % (name, sorted(kinds) or "nothing", len(uses))
|
||||
intersection = uses_in(modules["test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"])
|
||||
assert {("url", "B", "/io"), ("route", "B", "/io")} <= {(u.kind, u.site, u.path) for u in intersection}, "the intersection file is read without its frame page"
|
||||
|
||||
|
||||
# ---- known bad and known good ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
#: The shape of the intersection file when it was red: the frame's source is B /io and only A is routed.
|
||||
OLD_REGISTER = '''
|
||||
def _intersection(sites, page, chrome, tag):
|
||||
page.goto(sites.url("A", "/io-" + tag))
|
||||
frame = wait_frame(page, sites.origin["B"], "/io", seconds=30)
|
||||
|
||||
def _register(sites, tag):
|
||||
sites.route("A", "/io-" + tag, lambda handler: TOP_IO % sites.url("B", "/io"))
|
||||
sites.route("B", "/leaf-top-" + tag, LEAF)
|
||||
sites.route("C", "/leaf-nested-" + tag, LEAF)
|
||||
'''
|
||||
|
||||
NEW_REGISTER = OLD_REGISTER.replace(' sites.route("B", "/leaf-top-"', ' sites.route("B", "/io", FRAME_IO)\n sites.route("B", "/leaf-top-"')
|
||||
|
||||
|
||||
def test_the_old_intersection_register_is_red_and_says_where_what_and_how_to_correct():
|
||||
problems = unrouted(OLD_REGISTER, "old.py")
|
||||
assert len(problems) == 2, problems # the url in the page of A and the frame lookup
|
||||
assert all("old.py:" in p and "site B" in p and "'/io'" in p and "sites.route('B', '/io'" in p for p in problems), problems
|
||||
|
||||
|
||||
def test_the_register_with_the_route_back_is_green():
|
||||
assert unrouted(NEW_REGISTER, "new.py") == []
|
||||
|
||||
|
||||
def test_a_route_of_another_site_does_not_answer_for_the_asked_site():
|
||||
source = 'def f(s):\n s.url("B", "/x")\n s.route("A", "/x", "page")\n'
|
||||
assert len(unrouted(source, "snippet.py")) == 1
|
||||
|
||||
|
||||
def test_a_computed_part_of_a_path_is_the_same_page_on_both_sides():
|
||||
green = 'def f(s, tag):\n s.url("A", "/page-" + tag)\n s.url("B", "/h%d" % 1)\n s.route("A", "/page-" + tag, "p")\n s.route("B", "/h%d" % 2, "p")\n'
|
||||
assert unrouted(green, "snippet.py") == []
|
||||
red = 'def f(s, tag):\n s.url("A", "/page-" + tag)\n s.route("A", "/other-" + tag, "p")\n'
|
||||
assert len(unrouted(red, "snippet.py")) == 1
|
||||
|
||||
|
||||
def test_a_loop_over_the_sites_routes_every_site():
|
||||
source = 'def f(s):\n s.url("C", "/file.bin")\n for site in ("A", "B", "C"):\n s.route(site, "/file.bin", "x")\n'
|
||||
assert unrouted(source, "snippet.py") == []
|
||||
|
||||
|
||||
def test_the_files_of_the_tests_read_the_old_intersection_file_as_red():
|
||||
"""The file as it was when the route was gone (the register without ``B /io``), cut from the real file: the real shape, not only a snippet."""
|
||||
source = (TESTS / "test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py").read_text(encoding="utf-8")
|
||||
old = source.replace(' sites.route("B", "/io", FRAME_IO)\n', "")
|
||||
assert old != source, "the intersection file does not route B /io in the form this check removes"
|
||||
assert unrouted(old, "test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"), "the file without the route of B /io is not red"
|
||||
assert unrouted(source, "test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py") == []
|
||||
@@ -0,0 +1,99 @@
|
||||
"""On Windows, a pytest process of a job that keeps WER dumps clears SEM_NOGPFAULTERRORBOX of its error mode and keeps its other bits (tests/_wer_error_mode.py).
|
||||
|
||||
The runner starts the pytest controllers with the error mode 0x0003 (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX), every child inherits the mode of its parent,
|
||||
and a process with the bit 0x0002 never invokes Windows Error Reporting: the LocalDumps key of python.exe of the job (e2e.yml) never saw a crashing xdist worker.
|
||||
|
||||
The behaviour, in a real child python (the mode is a property of the process, and a child inherits it from the parent's ``SetErrorMode`` at its start):
|
||||
|
||||
* born with 0x0003 and ``INVPW_WER_DUMPS`` naming an existing folder: the child's mode afterwards is 0x0001, and ``error-mode.log`` next to the dumps' folder holds the
|
||||
line of that process, with the mode it was born with and the mode it has now; other bits of the mode stay (0x8003 gives 0x8001, 0x0000 stays 0x0000);
|
||||
* without the variable, or with a folder that does not exist: the mode is unchanged and no log is written.
|
||||
|
||||
A file of its own, and only the row of Windows names it: the kernel's error mode is a Windows mechanism and the test skips on every other system, where a skip is red
|
||||
in the row (tests/test_reaper_on_windows.py is the same case). What runs on both systems (nothing happens off Windows) is in
|
||||
tests/test_every_windows_job_keeps_a_dump_of_a_crashing_python.py.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ctypes
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit, pytest.mark.skipif(os.name != "nt", reason="the error mode of a process is a Windows mechanism")]
|
||||
|
||||
TESTS = Path(__file__).resolve().parent
|
||||
#: What the child does: runs the entry point of tests/_wer_error_mode.py as conftest's pytest_configure does, and says its pid and its mode before and after.
|
||||
CHILD = (
|
||||
"import ctypes, json, os, sys\n"
|
||||
"sys.path.insert(0, sys.argv[1])\n"
|
||||
"k = ctypes.WinDLL('kernel32')\n"
|
||||
"k.GetErrorMode.restype = ctypes.c_uint\n"
|
||||
"born = k.GetErrorMode()\n"
|
||||
"import _wer_error_mode\n"
|
||||
"_wer_error_mode.clear_for_wer_dumps()\n"
|
||||
"print(json.dumps({'pid': os.getpid(), 'born': born, 'now': k.GetErrorMode()}))\n"
|
||||
)
|
||||
|
||||
|
||||
def _run_child(born_mode: int, variable: str | None) -> tuple[dict, subprocess.CompletedProcess]:
|
||||
"""A child python started with the error mode ``born_mode`` (set in this process just before the spawn, put back after), and ``INVPW_WER_DUMPS`` = ``variable``."""
|
||||
kernel32 = ctypes.WinDLL("kernel32")
|
||||
kernel32.GetErrorMode.restype = ctypes.c_uint
|
||||
kernel32.SetErrorMode.argtypes = [ctypes.c_uint]
|
||||
kernel32.SetErrorMode.restype = ctypes.c_uint
|
||||
env = {k: v for k, v in os.environ.items() if k != "INVPW_WER_DUMPS"}
|
||||
if variable is not None:
|
||||
env["INVPW_WER_DUMPS"] = variable
|
||||
mine = kernel32.GetErrorMode()
|
||||
kernel32.SetErrorMode(born_mode)
|
||||
try:
|
||||
done = subprocess.run([sys.executable, "-c", CHILD, str(TESTS)], env=env, capture_output=True, text=True, timeout=120)
|
||||
finally:
|
||||
kernel32.SetErrorMode(mine)
|
||||
assert done.returncode == 0, "the child failed: " + done.stderr[-1500:]
|
||||
return json.loads(done.stdout.strip().splitlines()[-1]), done
|
||||
|
||||
|
||||
def _evidence(tmp_path: Path) -> tuple[Path, Path]:
|
||||
"""The shape of the job's evidence: <evidence>/dumps/python is the folder of the dumps, the log goes to <evidence>/dumps."""
|
||||
dumps = tmp_path / "invpw-evidence" / "dumps" / "python"
|
||||
dumps.mkdir(parents=True)
|
||||
return dumps, dumps.parent / "error-mode.log"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("born, expected", [(0x0003, 0x0001), (0x0002, 0x0000), (0x8003, 0x8001), (0x0001, 0x0001), (0x0000, 0x0000)])
|
||||
def test_the_child_loses_the_gp_fault_bit_and_keeps_the_other_bits(tmp_path, born, expected):
|
||||
dumps, log = _evidence(tmp_path)
|
||||
seen, done = _run_child(born, str(dumps))
|
||||
assert seen["born"] == born, "the child was not born with 0x%04x but 0x%04x (the mode is not inherited here): %r" % (born, seen["born"], seen)
|
||||
assert seen["now"] == expected, "born 0x%04x, expected 0x%04x after the entry point, got 0x%04x" % (born, expected, seen["now"])
|
||||
assert seen["now"] == born & ~0x0002
|
||||
assert done.stderr == "" and done.stdout.strip() == json.dumps(seen), "the entry point wrote to stdout or stderr: %r %r" % (done.stdout, done.stderr)
|
||||
line = "pid %d error mode born 0x%04x, now 0x%04x" % (seen["pid"], born, expected)
|
||||
assert line in log.read_text(encoding="utf-8").splitlines(), "no evidence line %r in %s: %r" % (line, log, log.read_text(encoding="utf-8") if log.exists() else None)
|
||||
|
||||
|
||||
def test_the_runner_mode_0x0003_gives_0x0001_and_the_evidence_says_so(tmp_path):
|
||||
dumps, log = _evidence(tmp_path)
|
||||
seen, _ = _run_child(0x0003, str(dumps))
|
||||
assert (seen["born"], seen["now"]) == (0x0003, 0x0001)
|
||||
assert log.read_text(encoding="utf-8") == "pid %d error mode born 0x0003, now 0x0001\n" % seen["pid"]
|
||||
|
||||
|
||||
def test_without_the_variable_the_mode_is_unchanged_and_nothing_is_written(tmp_path):
|
||||
dumps, log = _evidence(tmp_path)
|
||||
seen, _ = _run_child(0x0003, None)
|
||||
assert (seen["born"], seen["now"]) == (0x0003, 0x0003), seen
|
||||
assert not log.exists() and list(tmp_path.rglob("*.log")) == []
|
||||
|
||||
|
||||
def test_a_variable_that_names_no_folder_leaves_the_mode_unchanged(tmp_path):
|
||||
dumps, log = _evidence(tmp_path)
|
||||
seen, _ = _run_child(0x0003, str(tmp_path / "no-such-folder"))
|
||||
assert (seen["born"], seen["now"]) == (0x0003, 0x0003), seen
|
||||
assert not log.exists()
|
||||
@@ -10,10 +10,14 @@ For each Windows job that runs pytest (found by ``runs-on: windows-*``, so a new
|
||||
|
||||
* before its first pytest step a PowerShell step turns WER on (``Disabled`` 0, ``DontShowUI`` 1) and sets LocalDumps of python.exe: ``DumpType`` 2, ``DumpCount`` 3,
|
||||
``DumpFolder`` an expandable string, ``$RUNNER_TEMP/invpw-evidence/dumps/python``: inside the folder the job's evidence upload takes;
|
||||
* the same step exports ``INVPW_WER_DUMPS=$dumps`` (the DumpFolder) to ``$GITHUB_ENV``, so that every later step has it: tests/conftest.py then makes every pytest
|
||||
process (the controller and each xdist worker) clear SEM_NOGPFAULTERRORBOX (0x0002) of its error mode (tests/_wer_error_mode.py). The runner gives its pytest
|
||||
processes the mode 0x0003, every child inherits it, and a process with that bit never invokes Windows Error Reporting: with LocalDumps set and the bit kept, a
|
||||
crashing worker still left no dump. Nothing else sets the variable;
|
||||
* after the tests a step with ``if: always()`` runs ``scripts/ci_wer_dumps.py`` on that folder (sizes, faulting module), before the upload;
|
||||
* the upload of ``$RUNNER_TEMP/invpw-evidence`` is ``if: always()``, after the tests.
|
||||
|
||||
Known-bad inputs: a job without the step, the step after the first pytest step, a mini dump (DumpType 1), a key of another executable, a folder outside the evidence, a
|
||||
Known-bad inputs: a job whose step does not export the variable, one that exports another folder, a job that sets the variable elsewhere, a job without the step, the step after the first pytest step, a mini dump (DumpType 1), a key of another executable, a folder outside the evidence, a
|
||||
summary missing or not ``always()``, an upload that is not ``always()``. The green case is the state of the repository.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -89,6 +93,14 @@ def _problems(name: str, job: str) -> list[str]:
|
||||
bad.append("%s: WER is not made enabled (Disabled 0)" % name)
|
||||
if not re.search(r"-Name DontShowUI -PropertyType DWord -Value 1\b", step):
|
||||
bad.append("%s: WER may show a dialog (DontShowUI 1 missing)" % name)
|
||||
if not re.search(r'^\s*"INVPW_WER_DUMPS=\$dumps"\s*\|\s*Out-File -FilePath \$env:GITHUB_ENV -Append', step, re.M):
|
||||
bad.append("%s: the LocalDumps step does not export INVPW_WER_DUMPS=$dumps (the DumpFolder) to $GITHUB_ENV: without it tests/conftest.py leaves the error mode of "
|
||||
"every pytest process as the runner gave it (0x0003, SEM_NOGPFAULTERRORBOX set) and a crashing xdist worker never reaches the LocalDumps above" % name)
|
||||
in_job = [ln for ln in job.split("\n") if "INVPW_WER_DUMPS" in ln and not ln.strip().startswith("#")]
|
||||
in_step = [ln for ln in step.split("\n") if "INVPW_WER_DUMPS" in ln]
|
||||
if len(in_job) != len(in_step):
|
||||
bad.append("%s: INVPW_WER_DUMPS is set outside the LocalDumps step (%d lines in the job, %d in the step): the one step that sets the dump folder exports it"
|
||||
% (name, len(in_job), len(in_step)))
|
||||
uploads = [i for i, s in enumerate(steps) if "actions/upload-artifact" in s and re.search(r"^\s+(path: )?\$\{\{ runner\.temp \}\}/invpw-evidence$", s, re.M)]
|
||||
if len(uploads) != 1:
|
||||
return bad + ["%s: %d steps upload the evidence folder, expected 1" % (name, len(uploads))]
|
||||
@@ -132,6 +144,9 @@ def test_the_job_keeps_a_full_dump_of_a_crashing_python_in_its_evidence(name):
|
||||
(lambda t: t.replace("-Name Disabled -PropertyType DWord -Value 0", "-Name Disabled -PropertyType DWord -Value 1"), "Disabled 0"),
|
||||
(lambda t: t.replace("-PropertyType ExpandString", "-PropertyType String"), "not an expandable string"),
|
||||
(lambda t: t.replace("'invpw-evidence\\dumps\\python'", "'crash-dumps'"), "not RUNNER_TEMP/invpw-evidence/dumps/python"),
|
||||
(lambda t: t.replace('"INVPW_WER_DUMPS=$dumps" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8\n', ""), "does not export INVPW_WER_DUMPS=$dumps"),
|
||||
(lambda t: t.replace('"INVPW_WER_DUMPS=$dumps"', '"INVPW_WER_DUMPS=C:\\elsewhere"'), "does not export INVPW_WER_DUMPS=$dumps"),
|
||||
(lambda t: t.replace(" - name: Upload what the test saved\n", " - name: Upload what the test saved\n env:\n INVPW_WER_DUMPS: x\n"), "set outside the LocalDumps step"),
|
||||
(lambda t: t.replace("scripts/ci_wer_dumps.py", "scripts/nothing.py"), "0 steps run scripts/ci_wer_dumps.py"),
|
||||
(lambda t: t.replace(SUMMARY_STEP + ALWAYS, SUMMARY_STEP), "dump summary is not if: always()"),
|
||||
(lambda t: t.replace(" - name: Upload what the test saved\n" + ALWAYS, " - name: Upload what the test saved\n"), "upload of the evidence is not if: always()"),
|
||||
@@ -153,3 +168,13 @@ def test_the_step_after_the_tests_and_the_missing_step_are_refused():
|
||||
assert any("0 steps set LocalDumps" in p for p in _problems("x", gone))
|
||||
moved = job[:start] + job[end + 1:] + "\n" + job[start:end]
|
||||
assert any("after the first pytest step" in p for p in _problems("x", moved)), _problems("x", moved)
|
||||
|
||||
|
||||
def test_the_entry_point_does_nothing_off_windows(tmp_path, monkeypatch):
|
||||
"""Linux (and any system but Windows) is left alone, whatever the variable says: no log, no error, nothing written."""
|
||||
import _wer_error_mode
|
||||
dumps = tmp_path / "invpw-evidence" / "dumps" / "python"
|
||||
dumps.mkdir(parents=True)
|
||||
monkeypatch.setattr(_wer_error_mode.sys, "platform", "linux")
|
||||
_wer_error_mode.clear_for_wer_dumps({"INVPW_WER_DUMPS": str(dumps)})
|
||||
assert list(tmp_path.rglob("*.log")) == []
|
||||
@@ -44,8 +44,10 @@ on the next launch anyway.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
@@ -91,6 +93,69 @@ def _timestamps(exe: str) -> dict:
|
||||
return out
|
||||
|
||||
|
||||
#: The Application Event Log source the launcher writes its failures to (kEventSourceName in
|
||||
#: browser/app/winlauncher/ErrorHandler.cpp). Its payload names the failing call's file and line.
|
||||
LAUNCHER_EVENT_SOURCE = "Firefox Launcher"
|
||||
#: Shown as "absent" when the key has no such value, so the message always says which ones were looked for.
|
||||
EVIDENCE_SUFFIXES = ("Image", "Launcher", "Browser", "LauncherCrashTime", "Blocklist", "Telemetry")
|
||||
|
||||
|
||||
def _utc_now_iso() -> str:
|
||||
"""The moment as the event log's @SystemTime writes it (UTC, millisecond, Z)."""
|
||||
return datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
|
||||
|
||||
|
||||
def _launcher_values_text(exe: str) -> str:
|
||||
"""Every value under the launcher key whose name starts with `exe` (case-insensitive, as Windows
|
||||
compares paths), raw, with the expected suffixes listed as "absent" when missing."""
|
||||
import winreg
|
||||
|
||||
found = {}
|
||||
prefix = (exe + "|").lower()
|
||||
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, LAUNCHER_KEY) as key:
|
||||
i = 0
|
||||
while True:
|
||||
try:
|
||||
name, value, kind = winreg.EnumValue(key, i)
|
||||
except OSError:
|
||||
break
|
||||
i += 1
|
||||
if name.lower().startswith(prefix):
|
||||
found[name[len(prefix):]] = f"{value!r} (reg type {kind})"
|
||||
lines = [f" {exe}|{suffix} = {found.pop(suffix, 'absent')}" for suffix in EVIDENCE_SUFFIXES]
|
||||
lines += [f" {exe}|{suffix} = {raw}" for suffix, raw in sorted(found.items())]
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def _launcher_events_text(since_iso: str) -> str:
|
||||
"""The Application Event Log entries from the launcher's source written since `since_iso`."""
|
||||
query = (f"*[System[Provider[@Name='{LAUNCHER_EVENT_SOURCE}'] and "
|
||||
f"TimeCreated[@SystemTime>='{since_iso}']]]")
|
||||
done = subprocess.run(["wevtutil", "qe", "Application", f"/q:{query}", "/f:text", "/c:20", "/rd:true"],
|
||||
capture_output=True, timeout=30)
|
||||
out = done.stdout.decode("utf-8", errors="replace").strip()
|
||||
err = done.stderr.decode("utf-8", errors="replace").strip()
|
||||
if done.returncode != 0:
|
||||
return f"wevtutil exited {done.returncode}: {err or out}"
|
||||
return out or "no entry from this source since the test started"
|
||||
|
||||
|
||||
def _evidence(exe: str, since_iso: str) -> str:
|
||||
"""What the machine says about the launcher for `exe`, to append to a failure message. Never raises:
|
||||
a red test must stay the red it was, with whatever could be read next to it."""
|
||||
parts = ["\n--- launcher evidence (diagnostic only) ---"]
|
||||
try:
|
||||
parts.append(f"registry values under HKCU, key {LAUNCHER_KEY}, for this path:\n{_launcher_values_text(exe)}")
|
||||
except BaseException as exc: # noqa: BLE001 - a diagnostic must not replace the failure
|
||||
parts.append(f"registry values could not be read: {type(exc).__name__}: {exc}")
|
||||
try:
|
||||
parts.append(f"Application event log, source '{LAUNCHER_EVENT_SOURCE}', since {since_iso}:\n"
|
||||
f"{_launcher_events_text(since_iso)}")
|
||||
except BaseException as exc: # noqa: BLE001
|
||||
parts.append(f"event log could not be read: {type(exc).__name__}: {exc}")
|
||||
return "\n".join(parts)
|
||||
|
||||
|
||||
def _link_or_copy(src: str, dst: str) -> str:
|
||||
try:
|
||||
os.link(src, dst)
|
||||
@@ -120,7 +185,8 @@ def test_the_first_launch_from_a_new_path_works(new_path):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
exe = new_path
|
||||
assert not any(_timestamps(exe).values()), "this path has run before"
|
||||
started = _utc_now_iso()
|
||||
assert not any(_timestamps(exe).values()), "this path has run before" + _evidence(exe, started)
|
||||
|
||||
with InvisiblePlaywright(binary_path=exe, headless=True, seed=1) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
@@ -128,11 +194,11 @@ def test_the_first_launch_from_a_new_path_works(new_path):
|
||||
assert page.evaluate("1 + 1") == 2
|
||||
|
||||
stamps = _timestamps(exe)
|
||||
assert stamps["Launcher"], "the launcher process never recorded a start, so this was not a first launch"
|
||||
assert stamps["Launcher"], "the launcher process never recorded a start, so this was not a first launch" + _evidence(exe, started)
|
||||
assert stamps["Browser"], (
|
||||
"the launcher recorded a start and the browser never did: the launcher "
|
||||
"died before creating it, which is the first-launch failure this test exists for")
|
||||
assert stamps["Browser"] != 0, "the launcher was disabled after a failure instead of running"
|
||||
"died before creating it, which is the first-launch failure this test exists for" + _evidence(exe, started))
|
||||
assert stamps["Browser"] != 0, "the launcher was disabled after a failure instead of running" + _evidence(exe, started)
|
||||
assert stamps["Launcher"] < stamps["Browser"], (
|
||||
"the browser timestamp predates the launcher's, so the browser that ran "
|
||||
"was not the one this launcher created")
|
||||
"was not the one this launcher created" + _evidence(exe, started))
|
||||
@@ -65,6 +65,10 @@ def cross_site_loop():
|
||||
"""a.test/top -> b.test/mid -> a.test/leaf, plus a same-site frame page and the reports the pages send."""
|
||||
reports = []
|
||||
routes = {}
|
||||
# A knob for the tests that need a slow answer: `hold["pageshow_s"] = n` makes the server keep the response of the NEXT
|
||||
# `/report/pageshow` for n seconds after it recorded the report (the report is in `reports` at once, the fetch of the page is
|
||||
# still in flight). It is used once, by the first report that finds it, and the knob is gone.
|
||||
hold = {}
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
timeout = 5
|
||||
@@ -77,6 +81,8 @@ def cross_site_loop():
|
||||
host = (self.headers.get("Host") or "").split(":")[0]
|
||||
if url.path.startswith("/report"):
|
||||
reports.append({"host": host, "path": url.path, "query": parse_qs(url.query)})
|
||||
if url.path == "/report/pageshow" and hold.get("pageshow_s"):
|
||||
time.sleep(hold.pop("pageshow_s"))
|
||||
body, ctype = b"ok", "text/plain"
|
||||
elif url.path in routes:
|
||||
body, ctype = routes[url.path](host).encode(), "text/html; charset=utf-8"
|
||||
@@ -117,8 +123,11 @@ def cross_site_loop():
|
||||
for n in range(0, 14):
|
||||
routes["/deep%d" % n] = (lambda n: lambda host: "<!doctype html><title>deep%d</title><iframe id=\"f\" src=\"%s\"></iframe>" % (n, at(host, "/deep%d" % (n + 1))))(n)
|
||||
# a page that reports each time it is shown, and whether it came out of the back-forward cache
|
||||
# (`window.__sent` is the report's own request: it settles when the response has been read, so a test can wait for the
|
||||
# request to be over; a page left with a request in flight is not put in the back-forward cache)
|
||||
routes["/shown"] = lambda host: ("<!doctype html><title>shown</title><script>addEventListener('pageshow', e => "
|
||||
"fetch('/report/pageshow?persisted=' + e.persisted + '&top=' + (window === top)))</script>")
|
||||
"{ window.__sent = fetch('/report/pageshow?persisted=' + e.persisted + '&top=' + (window === top))"
|
||||
".then(r => r.text()) })</script>")
|
||||
routes["/top-shown"] = lambda host: ('<!doctype html><title>top-shown</title><iframe id="b" src="%s"></iframe>' % at("b.test", "/shown"))
|
||||
# a page and one iframe of another site, named, with nothing else in it
|
||||
routes["/one-iframe"] = lambda host: ('<!doctype html><title>one</title><iframe id="f" name="f" src="%s"></iframe>' % at("b.test", "/plain"))
|
||||
@@ -126,7 +135,7 @@ def cross_site_loop():
|
||||
try:
|
||||
yield {"top": at("a.test", "/top"), "one_iframe": at("a.test", "/one-iframe"), "deep": at("a.test", "/deep0"), "top_shown": at("a.test", "/top-shown"), "mid": at("b.test", "/mid"), "leaf": at("a.test", "/leaf"),
|
||||
"same_site": at("a.test", "/same-site"), "plain": at("a.test", "/plain"),
|
||||
"reports": reports, "origin_mid": "http://b.test:%d" % port, "origin_top": "http://a.test:%d" % port}
|
||||
"reports": reports, "hold": hold, "origin_mid": "http://b.test:%d" % port, "origin_top": "http://a.test:%d" % port}
|
||||
finally:
|
||||
server.shutdown()
|
||||
server.server_close()
|
||||
@@ -457,16 +466,49 @@ def test_content_frame_of_an_iframe_nested_too_deep_is_none(page, cross_site_loo
|
||||
owner.dispose()
|
||||
|
||||
|
||||
def _leave_the_top_and_come_back(page, loop, leave_on):
|
||||
"""Show the page with the frame of another site, leave it, go back, and wait for the frame's persisted pageshow.
|
||||
|
||||
`leave_on` is the condition the sequence waits for before it leaves the page:
|
||||
"finished" the request that the frame's pageshow sent is over (`window.__sent` of the frame settled). The frame's load
|
||||
group is empty, so Firefox may put the page in the back-forward cache. This is the sequence of the test.
|
||||
"recorded" the server has recorded the report. The response is still on its way, the fetch is still in the frame's load
|
||||
group, and Firefox refuses the cache for a page left like that (BFCacheStatus::REQUEST,
|
||||
CanonicalBrowsingContext::AllowedInBFCache): both reports then come with persisted=false. Stock Firefox does
|
||||
the same; the product never promised the cache for a page left with a request in flight. This was the old
|
||||
sequence of the test, and with a server that is slow to answer it never passes."""
|
||||
assert leave_on in ("finished", "recorded")
|
||||
page.goto(loop["top_shown"], wait_until="load")
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/pageshow" for r in loop["reports"]))
|
||||
if leave_on == "finished":
|
||||
# the frame of b.test has sent its report (the server recorded it, so `__sent` is set); wait until that request is over
|
||||
assert wait_for(page, lambda: any("/shown" in f.url for f in page.frames))
|
||||
shown = next(f for f in page.frames if "/shown" in f.url)
|
||||
assert shown.evaluate("window.__sent.then(() => 1)") == 1
|
||||
page.goto(loop["plain"], wait_until="load")
|
||||
page.go_back(wait_until="load")
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/pageshow" and r["query"]["persisted"] == ["true"] and
|
||||
r["query"]["top"] == ["false"] for r in loop["reports"])), loop["reports"]
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_oop_frame_comes_out_of_the_back_forward_cache_with_the_top(page, cross_site_loop):
|
||||
"""What the engine does, not the product: the document of a frame in another process is shown again, persisted,
|
||||
when the top comes back from the cache (step 8.3 relies on it)."""
|
||||
page.goto(cross_site_loop["top_shown"], wait_until="load")
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/pageshow" for r in cross_site_loop["reports"]))
|
||||
page.goto(cross_site_loop["plain"], wait_until="load")
|
||||
page.go_back(wait_until="load")
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/pageshow" and r["query"]["persisted"] == ["true"] and
|
||||
r["query"]["top"] == ["false"] for r in cross_site_loop["reports"])), cross_site_loop["reports"]
|
||||
when the top comes back from the cache (step 8.3 relies on it). The top is left when the request of the frame's
|
||||
pageshow report is over, not when the server has recorded it (`_leave_the_top_and_come_back`)."""
|
||||
_leave_the_top_and_come_back(page, cross_site_loop, "finished")
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_oop_frame_comes_out_of_the_back_forward_cache_when_the_report_is_slow(page, cross_site_loop):
|
||||
"""The same sequence with a server that keeps the first pageshow report's response for 2 s after it recorded it.
|
||||
|
||||
The case of the old sequence: it left the top as soon as the server had recorded the report (`leave_on="recorded"`),
|
||||
while the fetch was still in the frame's load group, and the page was not cached (both reports persisted=false).
|
||||
That sequence with this knob is the RED case of this test: it cannot be run on this PC, it runs on GitHub, and
|
||||
the candidate runs this test with `leave_on="finished"`, which waits for the request to be over and is green."""
|
||||
cross_site_loop["hold"]["pageshow_s"] = 2.0
|
||||
_leave_the_top_and_come_back(page, cross_site_loop, "finished")
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
|
||||
@@ -20,6 +20,14 @@ window size and scale; ours must read what stock reads, step by step. No expecte
|
||||
viewport's bottom edge and then 24 above it: whether it was requested at each. The server's own record of requests says what was asked (the requests of each browser have a path of their own). The
|
||||
"not yet" side is watched for 1.5 s, the "near" side is waited for up to 6 s; ours equals stock's in every one of them.
|
||||
|
||||
THE TWIN RULE (``DECLARED``): stock's cross-site frame is in the top's process (stock Playwright's Firefox sets ``fission.webContentIsolationStrategy=0``) and ours is not. A field of a step that
|
||||
depends on that is in the record and not compared with stock, and the retail capture decides it. Declared: ``box`` (the size of ``boundingClientRect``) of the two steps where the frame is fully out of
|
||||
view ("all above", "all below"). In Mozilla's code a fission frame scrolled fully out of view reads an empty ``boundingClientRect``: DOMIntersectionObserver.cpp 792-794 returns early when there is no
|
||||
in-process root frame, after the transform chain HitTestingTreeNode.cpp 298-328, BrowserChild.cpp 3751-3778 and UnitTransforms.h 343-351; Mozilla's own web-platform meta
|
||||
(testing/web-platform/meta/intersection-observer/cross-origin-iframe.sub.html.ini) marks that out-of-view step FAIL under fission. Stock's frame is in-process, so it reads the rectangle, and ours,
|
||||
as every retail fission frame, does not. The ``box`` of the steps where the frame is in view stays compared (both sides agree there), and so does every other field of every step.
|
||||
``recorded_differences`` of the report lists what differs in the declared fields.
|
||||
|
||||
The record also has the scales of each browser (page and chrome ``devicePixelRatio``, and the real scale of the screen from chrome scope).
|
||||
|
||||
The engine that answers these values is not released yet: with a matrix moved and a rect not moved, the readings and the lazy loads differ from stock's, so this test is RED there, on purpose.
|
||||
@@ -30,7 +38,7 @@ from typing import Any, Dict, List
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _stock_twin import Chrome, both, differences, run_twin
|
||||
from _stock_twin import IN_PROCESS_FRAME, Chrome, both, run_twin, split_differences
|
||||
from _window_origin import CASES, DEADLINE_S, observe, settled, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
@@ -42,6 +50,12 @@ LAZY_TOP = 4000
|
||||
#: One CSS pixel: scroll and boxes are snapped to device pixels.
|
||||
TOLERANCE_PX = 1.0
|
||||
WATCH_S = 1.5
|
||||
#: The fields of a step of the intersection record that are recorded and not compared with stock, with the reason (``_stock_twin.REASONS``): a pattern of canonical paths of ``measured``
|
||||
#: (``steps.all above.box*``), and ``IN_PROCESS_FRAME`` or ``SYNTHETIC_DRAG``. The boundingClientRect of the observer's entry (``box``) at the two steps where the frame is fully out of view is
|
||||
#: the empty rectangle of a fission frame (DOMIntersectionObserver.cpp 792-794, early return with no in-process root frame; HitTestingTreeNode.cpp 298-328, BrowserChild.cpp 3751-3778,
|
||||
#: UnitTransforms.h 343-351; Mozilla's web-platform meta cross-origin-iframe.sub.html.ini marks the step FAIL under fission) and the whole rectangle in stock's in-process frame: recorded, and the
|
||||
#: retail capture decides it. The step names are those of ``_steps_of``.
|
||||
DECLARED: Dict[str, str] = {"steps.all above.box*": IN_PROCESS_FRAME, "steps.all below.box*": IN_PROCESS_FRAME}
|
||||
NEAR_WAIT_S = 6
|
||||
|
||||
TOP_IO = """<!doctype html><meta charset=utf-8><title>io</title>
|
||||
@@ -95,7 +109,7 @@ def _intersection(sites, page, chrome: Chrome, tag: str) -> Dict[str, Any]:
|
||||
page.goto(sites.url("A", "/io-" + tag), wait_until="load", timeout=30000)
|
||||
frame = wait_frame(page, sites.origin["B"], "/io", seconds=DEADLINE_S)
|
||||
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
|
||||
scales = chrome.scales(page)
|
||||
scales = chrome.scales()
|
||||
vh = page.evaluate(TOP_BOX)["vh"]
|
||||
steps: Dict[str, Any] = {}
|
||||
for name, step_top in _steps_of(vh):
|
||||
@@ -112,7 +126,7 @@ def _lazy(sites, page, chrome: Chrome, tag: str) -> Dict[str, Any]:
|
||||
"""Whether each lazy frame was requested at each distance. The requests of one browser have a path with its tag, so the other's do not count."""
|
||||
measured: Dict[str, Any] = {}
|
||||
page.goto(sites.url("A", "/lazy-top-" + tag), wait_until="load", timeout=30000)
|
||||
scales = chrome.scales(page)
|
||||
scales = chrome.scales()
|
||||
vh = page.evaluate(TOP_BOX)["vh"]
|
||||
|
||||
def requested_top() -> int:
|
||||
@@ -140,6 +154,7 @@ def _lazy(sites, page, chrome: Chrome, tag: str) -> Dict[str, Any]:
|
||||
|
||||
def _register(sites: Sites, tag: str) -> None:
|
||||
sites.route("A", "/io-" + tag, lambda handler: TOP_IO % sites.url("B", "/io"))
|
||||
sites.route("B", "/io", FRAME_IO)
|
||||
sites.route("A", "/lazy-top-" + tag, lambda handler: _top_lazy(100, "lazy", sites.url("B", "/leaf-top-" + tag)))
|
||||
sites.route("A", "/lazy-nested-" + tag, lambda handler: _top_lazy(FRAME_SIZE, "eager", sites.url("B", "/host-" + tag)))
|
||||
sites.route("B", "/leaf-top-" + tag, LEAF)
|
||||
@@ -158,11 +173,14 @@ def _twin(case: str, firefox_binary: str, monkeypatch, steps) -> Any:
|
||||
return stock, ours
|
||||
|
||||
|
||||
TOLERANCES = {"ratio": TOLERANCE_PX / FRAME_SIZE + 0.001, "inter_y": TOLERANCE_PX, "inter_h": TOLERANCE_PX, "top": TOLERANCE_PX, "viewport_height": 0.0}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_the_intersection_of_a_frame_of_another_site_is_what_stock_reads(firefox_binary, monkeypatch, case):
|
||||
def test_the_intersection_of_a_frame_of_another_site_is_what_stock_reads(firefox_binary, monkeypatch, case, record_property):
|
||||
stock, ours = _twin(case, firefox_binary, monkeypatch, _intersection)
|
||||
differing = differences(stock["measured"], ours["measured"],
|
||||
{"ratio": TOLERANCE_PX / FRAME_SIZE + 0.001, "inter_y": TOLERANCE_PX, "inter_h": TOLERANCE_PX, "top": TOLERANCE_PX, "viewport_height": 0.0}, "measured")
|
||||
differing, recorded = split_differences(stock["measured"], ours["measured"], DECLARED, TOLERANCES, "measured")
|
||||
record_property("recorded_differences", "\n".join(recorded))
|
||||
assert not differing, (
|
||||
"%s: what the frame of another site reads of the scrolled top is not what stock reads (a step reads the ratio, isIntersecting, rootBounds and the intersection rectangle):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, stock, ours)))
|
||||
@@ -171,7 +189,7 @@ def test_the_intersection_of_a_frame_of_another_site_is_what_stock_reads(firefox
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_lazy_frame_loads_when_it_does_on_stock(firefox_binary, monkeypatch, case):
|
||||
stock, ours = _twin(case, firefox_binary, monkeypatch, _lazy)
|
||||
differing = differences(stock["measured"], ours["measured"], {}, "measured")
|
||||
differing = split_differences(stock["measured"], ours["measured"], {}, {}, "measured")[0]
|
||||
assert not differing, (
|
||||
"%s: a lazy frame is requested at another distance than on stock (requested or not, at the four distances):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, stock, ours)))
|
||||
@@ -0,0 +1,509 @@
|
||||
"""A core a browser process leaves is judged against the list of known Mozilla defects, with the core's exact matcher (scripts/ci_crash_evidence.py).
|
||||
|
||||
A crash that matches a listed defect is reported by its D<n> and is not red; a crash that cost a measurement stays red; anything unmatched stays red; and the judge is closed:
|
||||
no matcher, a matcher without the API, an unreadable list or no engine version keeps every crash red and says why. The first caller is the A/A control of the A/B oracle
|
||||
(scripts/ci_ab_oracle.py); every other caller judges nothing and stays red as ever.
|
||||
|
||||
The evidence is a real core: the `FSBroker` thread of a `-backgroundtask` process of Firefox 159.0 that crashed at the exit with `pthread_mutex_lock failed` (run 46539190316), in
|
||||
tests/data/known_mozilla_defects/ with the matcher of the core's main (a copy, with its sha256 and source in `sources.json`; the tests do not use the network). The row of the list
|
||||
is written in the test: the wrapper's own list is tested in tests/test_the_wrapper_list_of_known_mozilla_defects.py.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_oracle as ab # noqa: E402
|
||||
import ci_crash_evidence as crash # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
DATA = Path(__file__).resolve().parent / "data" / "known_mozilla_defects"
|
||||
CORE = "core.FSBroker14298.14187.1796087906"
|
||||
CLOSING = 1796087900.0 # the launch began to close the browser 6 s before the core was written
|
||||
D31 = {"id": "D31", "bug": "", "firefox": {"from": "159.0", "to": "159.*"},
|
||||
"signature": {"process": "backgroundtask", "phase": "exit", "thread": "FSBroker",
|
||||
"reason": "MOZ_CRASH(mozilla::detail::MutexImpl::mutexLock: pthread_mutex_lock failed)"},
|
||||
"seen": "oss-invisible/firefox_antidetect_patch/actions/runs/46539190316/job/142310624770",
|
||||
"why": "at the exit of a -backgroundtask process the FSBroker thread unregisters from the profiler after the static destructors ran and locks a destroyed mutex"}
|
||||
RECORD = {"process": "backgroundtask", "phase": "exit", "thread": "FSBroker", "reason": D31["signature"]["reason"],
|
||||
"frames": ["pthread_kill", "raise", "??", "<signal handler called>", "mozilla::detail::MutexImpl::lock()", "??", "??", "??", "??", "??", "??"]}
|
||||
HEADER_FULL = "Core was generated by `/tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/firefox --backg'.\n"
|
||||
|
||||
|
||||
def gdb_text() -> str:
|
||||
return (DATA / "gdb-core.FSBroker14298.14187.1796087906.txt").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def world(tmp_path, monkeypatch):
|
||||
"""A matcher (the real one of the core's main, from the copy beside the evidence), a list with the row of D31, an engine folder with its application.ini, and a launch."""
|
||||
matcher = tmp_path / "matcher" / "ci_mozilla_defects.py"
|
||||
matcher.parent.mkdir()
|
||||
matcher.write_bytes((DATA / "ci_mozilla_defects.py.txt").read_bytes())
|
||||
rows = tmp_path / "ci" / "mozilla-defects.json"
|
||||
rows.parent.mkdir()
|
||||
rows.write_text(json.dumps([D31]), encoding="utf-8")
|
||||
engine = tmp_path / "engine"
|
||||
engine.mkdir()
|
||||
(engine / "application.ini").write_text("[App]\nVendor=Mozilla\nName=Firefox\nVersion=159.0\nBuildID=20261126160241\n", encoding="utf-8")
|
||||
monkeypatch.setenv(crash.MATCHER_ENV, str(matcher))
|
||||
monkeypatch.setattr(crash, "DEFECTS_LIST", rows)
|
||||
return type("World", (), {"matcher": matcher, "rows": rows, "binary": str(engine / "firefox"), "engine": engine, "path": tmp_path})
|
||||
|
||||
|
||||
def launch(record=None, code=0, cores=(CORE, CORE), **extra) -> dict:
|
||||
"""The entry the probe writes for the launch of the A/A control that left the core of the real crash (its two folders list it twice)."""
|
||||
out = {"n": 9, "label": {"seed": 63, "dpr": 1.5, "launch": "ab-visit"}, "pid": 14315, "returncode": code, "cores": list(cores), "dmp": [], "closing_at": CLOSING,
|
||||
"crash_records": [{"core": CORE, "record": copy.deepcopy(RECORD if record is None else record)}], "evidence": "firefox-70-again/09-63-1.5-ab-visit"}
|
||||
out.update(extra)
|
||||
return out
|
||||
|
||||
|
||||
def judged(world, launches, complete=True, notes=None, missing=()):
|
||||
return crash.exit_problems(launches, "firefox-70-again", False, notes=notes, measurements_complete=complete, missing=missing, binary=world.binary)
|
||||
|
||||
|
||||
# --- the record of a core ----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def test_the_record_built_from_the_real_core_is_what_the_row_of_the_defect_names():
|
||||
assert crash.crash_record(gdb_text(), CORE, None, CLOSING) == RECORD
|
||||
|
||||
|
||||
def test_a_field_the_evidence_cannot_give_is_left_out_of_the_record():
|
||||
record = crash.crash_record("", "core", None, None)
|
||||
assert record == {}, "no gdb text, a core named without %e, no time: nothing is claimed"
|
||||
no_reason = gdb_text().replace("MOZ_CRASH(", "NOT_A_REASON(").replace('"NOT_A_REASON(mozilla::detail::MutexImpl::mutexLock: pthread_mutex_lock failed)"', "<error: Cannot access memory>")
|
||||
assert "reason" not in crash.crash_record(no_reason, CORE, None, CLOSING)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, closing, phase", [
|
||||
("core.FSBroker14298.14187.1796087906", 1796087900.0, "exit"),
|
||||
("core.FSBroker14298.14187.1796087906", 1796087906.0, "exit"),
|
||||
("core.FSBroker14298.14187.1796087906", 1796087906.4, "exit"), # whole seconds: the second the close began is an exit
|
||||
("core.FSBroker14298.14187.1796087906", 1796087907.0, "run"),
|
||||
("core.FSBroker14298.14187.1796087906", None, None),
|
||||
])
|
||||
def test_the_phase_is_exit_when_the_core_was_written_at_or_after_the_close_began(name, closing, phase):
|
||||
assert crash.crash_record(gdb_text(), name, None, closing).get("phase") == phase
|
||||
|
||||
|
||||
def test_a_core_without_a_time_in_its_name_is_placed_by_its_mtime():
|
||||
assert crash.phase_of("core.77", 1000.0, 999.0) == "exit"
|
||||
assert crash.phase_of("core.77", 998.0, 999.0) == "run"
|
||||
assert crash.phase_of("core.77", None, 999.0) is None
|
||||
|
||||
|
||||
HEADER = "Core was generated by `%s'.\nProgram terminated with signal SIGSEGV, Segmentation fault.\n"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("line, process", [
|
||||
("/e/firefox --backgroundtask pingsender", "backgroundtask"),
|
||||
("/e/firefox -backgroundtask pingsender", "backgroundtask"),
|
||||
("/e/firefox -contentproc -childID 4 -isForBrowser tab", "tab"),
|
||||
("/e/firefox --contentproc -childID 1 -prefsLen 7 gpu", "gpu"),
|
||||
("/e/firefox --profile /p about:blank", "parent"),
|
||||
("/e/firefox", "parent"),
|
||||
("/e/firefox -contentproc -childID 4 -isForBrowser notatype", None),
|
||||
("/e/firefox --foreground", "parent"),
|
||||
])
|
||||
def test_the_process_type_is_read_from_a_whole_command_line(line, process):
|
||||
assert crash.process_type(HEADER % line) == process
|
||||
|
||||
|
||||
@pytest.mark.parametrize("tail, process", [
|
||||
("--backg", "backgroundtask"), # the real core's line
|
||||
("--back", "backgroundtask"),
|
||||
("-backgroundtas", "backgroundtask"),
|
||||
("--bac", None), # three letters name no flag
|
||||
("--b", None),
|
||||
("--foregr", None),
|
||||
("-contentproc -childID 4 -isForBrowser ta", None), # the type is not known to be whole
|
||||
("-contentproc -childID 4 -isForBrowser tab", None), # a whole type at the cut is not known to be whole either
|
||||
("--profile /p", None),
|
||||
])
|
||||
def test_the_process_type_of_a_line_cut_at_79_characters_is_the_background_task_only_when_a_flag_of_it_is_cut(tail, process):
|
||||
path = "/tmp/ab-oracle" + "/" * (crash.CUT_LINE - 1 - len(tail) - len("/tmp/ab-oracle"))
|
||||
line = "%s %s" % (path, tail)
|
||||
assert len(line) == 79, "the kernel keeps 80 bytes of the arguments with the NUL: 79 visible characters"
|
||||
assert crash.process_type(HEADER % line) == process
|
||||
|
||||
|
||||
def test_the_real_header_is_a_cut_line_that_names_the_background_task():
|
||||
line = HEADER_FULL.split("`")[1].split("'")[0]
|
||||
assert len(line) == 79 and crash.process_type(HEADER_FULL) == "backgroundtask"
|
||||
assert crash.process_type("no header here") is None
|
||||
|
||||
|
||||
def test_a_cut_contentproc_line_gives_no_process():
|
||||
line = ("/tmp/ab-oracle-qi59xcf3/engines/firefox-70_159.0_20261126160241/firefox -contentproc -c")[:79]
|
||||
assert len(line) == 79 and crash.process_type("Core was generated by `%s'." % line) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("header, name, thread", [
|
||||
('Thread 1 (Thread 0x7f (LWP 5) "FSBroker14298"):', "core.Other.5.1", "FSBroker"), # gdb quotes the name: it wins over %e
|
||||
("Thread 1 (Thread 0x7f (LWP 5)):", "core.FSBroker14298.5.1", "FSBroker"),
|
||||
("Thread 1 (Thread 0x7f (LWP 5)):", "core.Web Content.5.1", "Web Content"),
|
||||
("Thread 1 (Thread 0x7f (LWP 5)):", "core.123.5.1", None),
|
||||
("Thread 1 (Thread 0x7f (LWP 5)):", "core.5", None),
|
||||
])
|
||||
def test_the_thread_name_is_gdbs_or_the_name_of_the_core_without_its_instance_number(header, name, thread):
|
||||
text = "[Current thread is 1 (Thread 0x7f (LWP 5))]\n\n%s\n#0 0x1 in pthread_kill () from /lib/libc.so.6\n" % header
|
||||
assert crash.thread_name(text, name) == thread
|
||||
|
||||
|
||||
def test_the_frames_are_the_function_names_of_the_crashing_thread_top_first():
|
||||
text = ("[Current thread is 2 (Thread 0x7f (LWP 5))]\n\nThread 3 (Thread 0x1 (LWP 6)):\n#0 0x1 in other ()\n\nThread 2 (Thread 0x7f (LWP 5)):\n"
|
||||
"#0 0x00007f in ns::f<int> (a=1) at f.cpp:7\n#1 0x00007e in ?? () from /lib/libxul.so\n#2 <signal handler called>\n")
|
||||
assert crash.crashing_thread(text) == (None, ["ns::f<int>", "??", "<signal handler called>"])
|
||||
assert crash.crashing_thread("no current thread") == (None, None)
|
||||
|
||||
|
||||
# --- the judge: the matcher, the list, the version, closed ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def test_the_a_a_with_the_core_of_d31_and_every_measurement_is_not_red_and_says_which_defect(world):
|
||||
notes: list = []
|
||||
assert judged(world, [launch()], True, notes) == []
|
||||
assert len(notes) == 1 and notes[0].startswith("known Mozilla defect D31 (not filed): at the exit of a -backgroundtask process")
|
||||
assert notes[0].endswith("run firefox-70-again, side B, seed 63, dpr 1.5, launch ab-visit, launch number 9")
|
||||
|
||||
|
||||
def test_the_same_with_a_measurement_missing_is_red_and_names_the_defect_and_what_is_missing(world):
|
||||
notes: list = []
|
||||
lines = judged(world, [launch()], False, notes, missing=["no dump of dpr1.0_seed64"])
|
||||
assert notes == []
|
||||
assert lines[0].startswith("a process of the browser crashed while the parent ended with 0") and "(evidence: firefox-70-again/09-63-1.5-ab-visit)" in lines[0]
|
||||
text = "\n".join(lines)
|
||||
assert "MATCHED D31" in text and "the crash matched D31" in text and "a measurement is missing" in text and "measurement missing: no dump of dpr1.0_seed64" in text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("change", [
|
||||
{"thread": "FSBrokerX"},
|
||||
{"thread": None},
|
||||
{"reason": "MOZ_CRASH(another reason)"},
|
||||
{"reason": None},
|
||||
{"process": "tab"},
|
||||
{"process": None},
|
||||
{"phase": "run"},
|
||||
{"phase": None},
|
||||
])
|
||||
def test_a_core_that_is_not_exactly_the_listed_defect_stays_red(world, change):
|
||||
record = copy.deepcopy(RECORD)
|
||||
for key, value in change.items():
|
||||
record.pop(key) if value is None else record.__setitem__(key, value)
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(record)], True, notes)
|
||||
assert notes == [] and lines and lines[0].startswith("a process of the browser crashed while the parent ended with 0")
|
||||
assert any("no known defect matches" in x or "has no string" in x for x in lines[1:]), lines
|
||||
|
||||
|
||||
def test_a_core_written_before_the_close_began_is_a_crash_of_the_run_and_stays_red(world):
|
||||
record = crash.crash_record(gdb_text(), CORE, None, 1796087999.0)
|
||||
assert record["phase"] == "run"
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(record)], True, notes)
|
||||
assert notes == [] and any("no known defect matches" in x for x in lines)
|
||||
|
||||
|
||||
def test_a_parent_that_did_not_end_with_0_is_never_excused_whatever_its_cores_say(world):
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(code=-11)], True, notes)
|
||||
assert notes == [] and len(lines) == 1 and lines[0].startswith("the parent process exited with code")
|
||||
|
||||
|
||||
def test_a_minidump_is_not_judged_and_stays_red_even_beside_the_core_of_a_known_defect(world):
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(dmp=["x.dmp"]), launch(cores=[], dmp=["y.dmp"], crash_records=[])], True, notes)
|
||||
assert notes == [] and len(lines) == 2 and all("a process of the browser crashed while the parent ended with 0" in x for x in lines)
|
||||
assert "minidump x.dmp" in lines[0] and "minidump y.dmp" in lines[1]
|
||||
|
||||
|
||||
def test_a_core_with_no_record_stays_red(world):
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(crash_records=[])], True, notes)
|
||||
assert notes == [] and any("no crash record for core %s" % CORE in x for x in lines)
|
||||
|
||||
|
||||
def test_two_launches_are_judged_apart_and_one_unmatched_core_keeps_its_own_red(world):
|
||||
other = launch(n=10, cores=[CORE], crash_records=[{"core": CORE, "record": dict(RECORD, thread="Other")}])
|
||||
notes: list = []
|
||||
lines = judged(world, [launch(), other], True, notes)
|
||||
assert len(notes) == 1 and "launch number 9" in notes[0]
|
||||
assert lines and "launch number 10" in lines[0] and any("no known defect matches" in x for x in lines[1:])
|
||||
|
||||
|
||||
def test_a_caller_that_does_not_know_judges_nothing_and_stays_red_as_it_always_was(world, monkeypatch):
|
||||
monkeypatch.setattr(crash, "defects_judge", lambda *a, **k: pytest.fail("a caller that does not say whether its measurements are complete must not load a matcher"))
|
||||
notes: list = []
|
||||
lines = crash.exit_problems([launch()], "firefox-70-again", False, notes=notes)
|
||||
assert notes == [] and len(lines) == 1
|
||||
assert lines[0] == ("a process of the browser crashed while the parent ended with 0: run firefox-70-again, side B, seed 63, dpr 1.5, launch ab-visit, launch number 9 left core %s, %s"
|
||||
" (evidence: firefox-70-again/09-63-1.5-ab-visit)" % (CORE, CORE))
|
||||
assert crash.exit_problems([launch()], "firefox-70-again", False) == lines
|
||||
|
||||
|
||||
def test_the_matcher_is_called_with_the_rows_the_version_the_records_and_whether_the_measurements_are_complete(world, tmp_path):
|
||||
fake = tmp_path / "fake_matcher.py"
|
||||
fake.write_text("calls = []\n"
|
||||
"def load(path):\n return [path.name]\n"
|
||||
"def problems(rows, version, name=None):\n return []\n"
|
||||
"def verdict(rows, version, crashes, measurements_complete):\n calls.append((rows, version, crashes, measurements_complete))\n"
|
||||
" return False, ['MATCHED D1 (not filed): why']\n", encoding="utf-8")
|
||||
judge = crash.defects_judge(world.binary, environ={crash.MATCHER_ENV: str(fake)}, list_path=world.rows)
|
||||
notes: list = []
|
||||
assert crash.exit_problems([launch()], "r", False, notes=notes, measurements_complete=True, binary=world.binary, judge=judge) == []
|
||||
assert judge.module.calls == [(["mozilla-defects.json"], "159.0", [RECORD], True)]
|
||||
assert notes[0].startswith("known Mozilla defect D1 (not filed): why: run r,")
|
||||
|
||||
|
||||
# --- closed: no judge, every crash stays red, and the line says why -------------------------------------------------------------------------------------------------------
|
||||
|
||||
def closed(world, **kw):
|
||||
notes: list = []
|
||||
lines = crash.exit_problems([launch()], "firefox-70-again", False, notes=notes, measurements_complete=True, binary=kw.pop("binary", world.binary),
|
||||
judge=crash.defects_judge(kw.pop("binary_of_judge", world.binary), **kw))
|
||||
assert notes == []
|
||||
assert lines[0].startswith("a process of the browser crashed while the parent ended with 0")
|
||||
return "\n".join(lines[1:])
|
||||
|
||||
|
||||
def test_no_matcher_is_red_and_says_so(world, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(crash, "_FETCHED", {})
|
||||
assert "does not exist" in closed(world, environ={crash.MATCHER_ENV: str(tmp_path / "nowhere.py")})
|
||||
|
||||
class Done:
|
||||
returncode, stdout, stderr = 128, "", "fatal: unable to access"
|
||||
|
||||
text = closed(world, environ={}, run=lambda *a, **k: Done())
|
||||
assert "main of oss-invisible/core cannot be resolved" in text and "every crash stays red" in text
|
||||
|
||||
|
||||
def test_a_matcher_without_the_api_is_red_and_says_so(world, tmp_path):
|
||||
broken = tmp_path / "broken.py"
|
||||
broken.write_text("def load(path):\n return []\n", encoding="utf-8")
|
||||
text = closed(world, environ={crash.MATCHER_ENV: str(broken)})
|
||||
assert "has no problems, verdict" in text
|
||||
broken.write_text("raise RuntimeError('boom')\n", encoding="utf-8")
|
||||
assert "cannot be imported (RuntimeError: boom)" in closed(world, environ={crash.MATCHER_ENV: str(broken)})
|
||||
|
||||
|
||||
def test_a_list_that_cannot_be_read_is_red_and_says_so(world, tmp_path):
|
||||
assert "cannot be read" in closed(world, list_path=tmp_path / "nowhere.json")
|
||||
broken = tmp_path / "broken.json"
|
||||
broken.write_text("{not json", encoding="utf-8")
|
||||
assert "is not JSON" in closed(world, list_path=broken)
|
||||
|
||||
|
||||
def test_an_engine_without_application_ini_or_without_a_version_is_red_and_says_so(world, tmp_path):
|
||||
assert "application.ini" in closed(world, binary_of_judge=str(tmp_path / "elsewhere" / "firefox"))
|
||||
(world.engine / "application.ini").write_text("[App]\nMinVersion=159.0\n", encoding="utf-8")
|
||||
assert "has no Version= line" in closed(world)
|
||||
assert "the browser binary is not known" in closed(world, binary_of_judge=None)
|
||||
(world.engine / "application.ini").write_text("[App]\nVersion=abc\n", encoding="utf-8")
|
||||
assert "cannot use the engine version abc" in closed(world)
|
||||
|
||||
|
||||
def test_an_engine_the_list_does_not_hold_for_is_red_even_for_the_listed_crash(world):
|
||||
(world.engine / "application.ini").write_text("[App]\nVersion=160.0\n", encoding="utf-8")
|
||||
notes: list = []
|
||||
lines = judged(world, [launch()], True, notes)
|
||||
assert notes == [] and any("does not contain the engine under test (160.0)" in x for x in lines)
|
||||
|
||||
|
||||
def test_the_matcher_of_the_core_is_fetched_once_per_process_from_the_sha_of_main_and_the_sha_is_printed(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(crash, "_FETCHED", {})
|
||||
sha = "882eed52ae1776c570053eb772c068206207cac8"
|
||||
asked, said = [], []
|
||||
|
||||
class Done:
|
||||
returncode, stdout, stderr = 0, "%s\trefs/heads/main\n" % sha, ""
|
||||
|
||||
class Page:
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *a):
|
||||
return False
|
||||
|
||||
def read(self):
|
||||
return (DATA / "ci_mozilla_defects.py.txt").read_bytes()
|
||||
|
||||
def run(argv, **kw):
|
||||
asked.append(argv)
|
||||
return Done()
|
||||
|
||||
def urlopen(url, timeout=None):
|
||||
asked.append(url)
|
||||
return Page()
|
||||
|
||||
first = crash.matcher_path({}, run, urlopen, said.append)
|
||||
second = crash.matcher_path({}, run, urlopen, said.append)
|
||||
assert first == second and first.name == "ci_mozilla_defects.py" and crash.load_matcher(first).problems([], "159.0") == []
|
||||
assert asked == [["git", "ls-remote", "https://github.com/oss-invisible/core", "refs/heads/main"],
|
||||
"https://raw.githubusercontent.com/oss-invisible/core/%s/scripts/ci_mozilla_defects.py" % sha]
|
||||
assert len(said) == 1 and sha in said[0]
|
||||
|
||||
|
||||
def test_the_copy_of_the_matcher_is_the_one_its_sidecar_names():
|
||||
sources = json.loads((DATA / "sources.json").read_text(encoding="utf-8"))
|
||||
for name, entry in sources.items():
|
||||
assert hashlib.sha256((DATA / name).read_bytes()).hexdigest() == entry["sha256"], name
|
||||
assert sources["ci_mozilla_defects.py.txt"]["source"] == "oss-invisible/core scripts/ci_mozilla_defects.py"
|
||||
|
||||
|
||||
# --- the probe records what the judge reads, and the A/A passes whether its visits are all there ---------------------------------------------------------------------------
|
||||
|
||||
class ProcessOf:
|
||||
pid = 4242
|
||||
|
||||
def __init__(self, code):
|
||||
self.code = code
|
||||
|
||||
def poll(self):
|
||||
return self.code
|
||||
|
||||
def terminate(self):
|
||||
pass
|
||||
|
||||
|
||||
class Gdb:
|
||||
"""`subprocess.run` that answers gdb with the text of the real core."""
|
||||
|
||||
def __init__(self):
|
||||
self.calls = []
|
||||
|
||||
def __call__(self, argv, **kw):
|
||||
self.calls.append(argv)
|
||||
|
||||
class Done:
|
||||
stdout, stderr = gdb_text(), ""
|
||||
|
||||
return Done()
|
||||
|
||||
which = staticmethod(lambda name: "/usr/bin/gdb" if name == "gdb" else None)
|
||||
|
||||
|
||||
def a_launch_that_leaves(probe, core_name, folder):
|
||||
from invisible_core.juggler.connection import Connection, ProcessOutput
|
||||
|
||||
probe.set_label(seed=63, dpr=1.5, launch="ab-visit")
|
||||
to_r, to_w = os.pipe()
|
||||
from_r, from_w = os.pipe()
|
||||
out_r, out_w = os.pipe()
|
||||
output = ProcessOutput(os.fdopen(out_r, "rb"))
|
||||
conn = Connection(to_w, from_r, ProcessOf(0))
|
||||
conn.output = output
|
||||
os.close(out_w)
|
||||
output.settle()
|
||||
(folder / core_name).write_bytes(b"\x7fELF") # the browser's process dies; the core is written before the close the launch makes
|
||||
conn.close()
|
||||
os.close(from_w)
|
||||
os.close(to_r)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("core_name, phase", [("core.FSBroker14298.14187.9999999999", "exit"), ("core.FSBroker14298.14187.1000000000", "run")])
|
||||
def test_the_probe_records_when_the_close_began_and_a_record_of_every_core_it_found(tmp_path, core_name, phase):
|
||||
from invisible_core.juggler.connection import Connection
|
||||
|
||||
cores = tmp_path / "cores"
|
||||
cores.mkdir()
|
||||
gdb = Gdb()
|
||||
probe = crash.LaunchProbe("/e/firefox", tmp_path / "out" / "crash", windows=False, folders=[], core_folders=[cores], run=gdb, which=gdb.which)
|
||||
probe.install(Connection, output=None)
|
||||
try:
|
||||
a_launch_that_leaves(probe, core_name, cores)
|
||||
finally:
|
||||
probe.uninstall()
|
||||
entry = probe.launches[0]
|
||||
assert entry["closing_at"] > 1_700_000_000 and entry["cores"] == [core_name]
|
||||
expected = dict(RECORD, phase=phase)
|
||||
assert entry["crash_records"] == [{"core": core_name, "record": expected}]
|
||||
probe.write()
|
||||
assert crash.read_exits(tmp_path / "out" / "crash" / "exits.json")["launches"][0]["crash_records"] == entry["crash_records"]
|
||||
|
||||
|
||||
def write_visits(folder: Path, keys) -> None:
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
for dpr, seed in keys:
|
||||
(folder / ("%s.json" % ab.visit_name(dpr, seed))).write_text(json.dumps({"dpr": dpr, "seed": seed, "result": {"items": {"a": {"b": 1}}}}), encoding="utf-8")
|
||||
|
||||
|
||||
def fake_dump(exits_dir: Path, written, record=None):
|
||||
"""`run_dump` that writes the visits `written` and the exits.json of a probe that saw the launch of the core of D31."""
|
||||
def run_dump(binary, seal, leg, out, visits, **kw):
|
||||
write_visits(out, written)
|
||||
document = {"format": crash.FORMAT, "core_limit": None, "stderr_said": None, "launches_without_connection": [], "launches": [launch(record)]}
|
||||
folder = Path(os.environ[crash.CRASH_DIR_ENV])
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
(folder / "exits.json").write_text(json.dumps(document), encoding="utf-8")
|
||||
return 0
|
||||
return run_dump
|
||||
|
||||
|
||||
def test_the_a_a_with_the_core_of_d31_and_every_visit_is_not_red_and_names_the_defect(world, monkeypatch):
|
||||
visits = [(1.5, 63), (1.0, 64)]
|
||||
monkeypatch.setattr(ab, "run_dump", fake_dump(world.path, visits))
|
||||
notes: list = []
|
||||
rc, problems = ab.dump_with_exits("firefox-70-again", world.binary, None, "linux-x86_64", visits, world.path / "t", world.path / "out", notes=notes, control=True)
|
||||
assert rc == 0 and problems == []
|
||||
assert len(notes) == 1 and notes[0].startswith("known Mozilla defect D31 (not filed)")
|
||||
|
||||
|
||||
def test_the_a_a_with_the_core_of_d31_and_a_visit_missing_is_red_and_says_which(world, monkeypatch):
|
||||
visits = [(1.5, 63), (1.0, 64)]
|
||||
monkeypatch.setattr(ab, "run_dump", fake_dump(world.path, visits[:1]))
|
||||
notes: list = []
|
||||
rc, problems = ab.dump_with_exits("firefox-70-again", world.binary, None, "linux-x86_64", visits, world.path / "t", world.path / "out", notes=notes, control=True)
|
||||
text = "\n".join(problems)
|
||||
assert notes == [] and problems[0].startswith("a process of the browser crashed while the parent ended with 0")
|
||||
assert "MATCHED D31" in text and "the crash matched D31" in text and "measurement missing: no dump of dpr1.0_seed64" in text
|
||||
|
||||
|
||||
def test_a_dump_that_is_not_the_a_a_judges_no_core_and_stays_red(world, monkeypatch):
|
||||
visits = [(1.5, 63)]
|
||||
monkeypatch.setattr(ab, "run_dump", fake_dump(world.path, visits))
|
||||
monkeypatch.setattr(crash, "defects_judge", lambda *a, **k: pytest.fail("only the A/A judges a core"))
|
||||
notes: list = []
|
||||
rc, problems = ab.dump_with_exits("candidate", world.binary, None, "linux-x86_64", visits, world.path / "t", world.path / "out", notes=notes)
|
||||
assert notes == [] and len(problems) == 1 and "crashed while the parent ended with 0" in problems[0]
|
||||
|
||||
|
||||
def test_a_visit_whose_tab_died_is_not_a_complete_measurement(tmp_path):
|
||||
folder = tmp_path / "t"
|
||||
write_visits(folder, [(1.5, 63)])
|
||||
assert ab.visits_complete(0, folder, [(1.5, 63)]) == (True, [])
|
||||
path = folder / "dpr1.5_seed63.json"
|
||||
document = json.loads(path.read_text(encoding="utf-8"))
|
||||
document["result"]["items"] = {"crash.tab.visit.error": "Target closed", "crash.tab.visit.step": "goto"}
|
||||
path.write_text(json.dumps(document), encoding="utf-8")
|
||||
complete, missing = ab.visits_complete(0, folder, [(1.5, 63)])
|
||||
assert not complete and "the tab of dpr1.5_seed63 died" in missing[0]
|
||||
assert ab.visits_complete(None, folder / "none", [(1.5, 63)]) == (False, ["the dump process ended with None", "no dump of dpr1.5_seed63"])
|
||||
|
||||
|
||||
def test_the_a_a_run_prints_the_notes_and_keeps_them_in_its_report(world, monkeypatch, capsys):
|
||||
visits = [(1.5, 63)]
|
||||
seen = []
|
||||
|
||||
def dumps(name, exe, seal_file, leg, asked, work, out, file_name, python=None, notes=None, control=False):
|
||||
seen.append((name, control))
|
||||
if control and name.endswith("-again"):
|
||||
notes.append("known Mozilla defect D31 (not filed): why: run %s" % name)
|
||||
return {(1.5, 63): {"a": {"b": 1}}}, []
|
||||
|
||||
monkeypatch.setattr(ab, "_dump_visits", dumps)
|
||||
monkeypatch.setattr(ab, "split_published", lambda published: ("pub", None, None))
|
||||
monkeypatch.setattr(ab.gate, "load_exceptions", lambda: {"noise": []})
|
||||
monkeypatch.setattr(ab, "MIN_LEAVES", {1.5: 1})
|
||||
out = world.path / "out"
|
||||
ab.run_ab("linux-x86_64", out, "firefox-70", published=("pub", None), visits=visits)
|
||||
assert seen == [("firefox-70", True), ("firefox-70-again", True)], "the two dumps of the A/A are the control; no other dump is"
|
||||
assert "NOTE known Mozilla defect D31 (not filed): why: run firefox-70-again" in capsys.readouterr().out
|
||||
assert json.loads((out / "diff-a-a.json").read_text(encoding="utf-8"))["known_defects"] == ["known Mozilla defect D31 (not filed): why: run firefox-70-again"]
|
||||
@@ -78,10 +78,11 @@ EXPECTED = {
|
||||
('frame', 'mousemove', True, None, None, None, 0, 0, 0),
|
||||
('frame', 'pointerdown', True, 0.5, 0, 'mouse', 2, 2, 0),
|
||||
('frame', 'mousedown', True, None, None, None, 2, 2, 1),
|
||||
('frame', 'contextmenu', True, 0.5, 0, 'mouse', 2, 2, 1),
|
||||
('frame', 'pointerup', True, 0, 0, 'mouse', 0, 2, 0),
|
||||
('frame', 'mouseup', True, None, None, None, 0, 2, 1),
|
||||
('frame', 'auxclick', True, 0, 0, 'mouse', 0, 2, 1),
|
||||
# the contextmenu comes after the release, as on Windows (WM_CONTEXTMENU follows WM_RBUTTONUP): no button is held, so no pressure
|
||||
('frame', 'contextmenu', True, 0, 0, 'mouse', 0, 2, 1),
|
||||
],
|
||||
'move with button down': [
|
||||
('frame', 'pointermove', True, 0, 0, 'mouse', 0, -1, 0),
|
||||
@@ -140,8 +141,13 @@ def test_the_events_of_the_page_and_of_an_iframe_of_its_process_keep_their_order
|
||||
"frame click": lambda: (page.mouse.move(260, 150), page.mouse.down(), page.mouse.up()),
|
||||
"top double click": lambda: (page.mouse.move(60, 35), page.mouse.click(60, 35, click_count=2)),
|
||||
"frame right click": lambda: (page.mouse.move(260, 150), page.mouse.click(260, 150, button="right")),
|
||||
"move with button down": lambda: (page.mouse.move(300, 200), page.mouse.down(),
|
||||
page.mouse.move(310, 205), page.mouse.move(330, 215), page.mouse.up()),
|
||||
# The action before this one, "frame right click" at (260, 150), leaves its context menu open (Juggler closes a
|
||||
# menu on a press only, as the platform does; Escape would not do it, Juggler sends keys in the content process).
|
||||
# The menu opens at that point and extends right and down, so the points here are left of and above it, inside the
|
||||
# iframe (left 200, top 100) and on its button: a move over the open menu is never seen by the page, on retail or on
|
||||
# ours. The press of this action closes the menu, so the release and the click are the page's own.
|
||||
"move with button down": lambda: (page.mouse.move(225, 115), page.mouse.down(),
|
||||
page.mouse.move(235, 120), page.mouse.move(245, 125), page.mouse.up()),
|
||||
}
|
||||
got = {}
|
||||
for name, action in actions.items():
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
"""No code of this repository arms a thread dump that copies the frames of every thread without the GIL: that dump crashes a live process.
|
||||
|
||||
``faulthandler.dump_traceback_later`` (and pytest's ``faulthandler_timeout``, which arms it), and ``faulthandler.dump_traceback`` with ``all_threads`` true or
|
||||
defaulted, walk the frames of every thread with ``_Py_DumpTracebackThreads``: CPython documents it as "for debug purpose only ... after a segmentation fault, at
|
||||
fatal error". Its watchdog is a C thread that does not hold the GIL while the process keeps running, so it reads a frame another thread is freeing. The Windows
|
||||
part 3 of the e2e lost five workers that way, inside ``dump_frame`` of ``faulthandler_thread`` (two full dumps), all on the one test that runs 2 minutes with about 50
|
||||
threads. The e2e stack watchdog is ``tests/_stack_watchdog.py``, a Python thread that writes ``sys._current_frames()`` holding the GIL.
|
||||
|
||||
What is read, as code and never as text: the ``.py`` files of ``tests/``, ``scripts/`` and ``src/`` with ``ast`` (a call, through ``import faulthandler``, an alias
|
||||
of it, or ``from faulthandler import ...``; a comment or a string that names the function is not a call); ``pyproject.toml`` with a TOML parser, and
|
||||
``pytest.ini``, ``setup.cfg`` and ``tox.ini`` with ``configparser``, for the key ``faulthandler_timeout`` and for it inside ``addopts``; the strings of the
|
||||
``conftest.py`` files and of ``scripts/`` (an ``addopts`` or a ``-o`` argument); the lines of ``.github/workflows/*.yml`` that are not comments.
|
||||
|
||||
Vendored code is excluded only where the repository already has an exclusion list: ``norecursedirs`` of ``[tool.pytest.ini_options]`` in ``pyproject.toml``
|
||||
(``playwright-upstream``, the vendored suite of Playwright, which is not in the tree). The Playwright client vendored in ``src/invisible_playwright/_pw`` has no
|
||||
list and is read like the rest.
|
||||
|
||||
Known-bad inputs, each on a tree in ``tmp_path``: the two lines of ``tests/conftest.py`` of 03425bb8, every form of the call, every place the timeout can be set.
|
||||
Each has its positive next to it: ``dump_traceback(all_threads=False)``, ``faulthandler.enable(all_threads=True)`` (a dump at the death of the process), a comment
|
||||
and a string that name the function, a workflow comment, an excluded folder. The green case is the state of the repository.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import configparser
|
||||
import re
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
CODE_DIRS = ("tests", "scripts", "src")
|
||||
ALWAYS_SKIPPED = {"__pycache__"}
|
||||
TIMEOUT_NAME = re.compile(r"faulthandler[-_]timeout")
|
||||
RULE = ("the rule: no thread dump that reads the frames of every thread without the GIL (faulthandler.dump_traceback_later, pytest's faulthandler_timeout, "
|
||||
"dump_traceback with all_threads) may be armed in a live process, because it crashed the Windows part 3 worker")
|
||||
FIX = "use tests/_stack_watchdog.py (arm and cancel), a Python thread that writes sys._current_frames() holding the GIL"
|
||||
|
||||
|
||||
def _say(where: str, what: str) -> str:
|
||||
return "%s: %s. How to fix: %s. %s" % (where, what, FIX, RULE)
|
||||
|
||||
|
||||
def _pyproject(root: Path) -> dict:
|
||||
path = root / "pyproject.toml"
|
||||
return tomllib.loads(path.read_text(encoding="utf-8")) if path.is_file() else {}
|
||||
|
||||
|
||||
def _pytest_tables(data: dict) -> list:
|
||||
tool = data.get("tool", {}).get("pytest", {})
|
||||
return [t for t in (tool.get("ini_options"), tool if "ini_options" not in tool else None) if isinstance(t, dict)]
|
||||
|
||||
|
||||
def excluded_dirs(root: Path) -> set:
|
||||
"""The only exclusion list the repository has: norecursedirs of pytest, in pyproject.toml."""
|
||||
out = set(ALWAYS_SKIPPED)
|
||||
for table in _pytest_tables(_pyproject(root)):
|
||||
out.update(table.get("norecursedirs", []))
|
||||
return out
|
||||
|
||||
|
||||
def python_files(root: Path, folders=CODE_DIRS):
|
||||
skipped = excluded_dirs(root)
|
||||
for folder in folders:
|
||||
base = root / folder
|
||||
if not base.is_dir():
|
||||
continue
|
||||
for path in sorted(base.rglob("*.py")):
|
||||
if not skipped.intersection(path.relative_to(root).parts):
|
||||
yield path
|
||||
|
||||
|
||||
def _faulthandler_names(tree: ast.AST):
|
||||
modules, functions = set(), {}
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Import):
|
||||
modules.update(a.asname or a.name for a in node.names if a.name == "faulthandler")
|
||||
elif isinstance(node, ast.ImportFrom) and node.module == "faulthandler":
|
||||
functions.update({a.asname or a.name: a.name for a in node.names})
|
||||
return modules, functions
|
||||
|
||||
|
||||
def _all_threads_is_false(call: ast.Call) -> bool:
|
||||
"""dump_traceback(file, all_threads): only a literal False is proof that one thread is dumped."""
|
||||
for keyword in call.keywords:
|
||||
if keyword.arg == "all_threads":
|
||||
return isinstance(keyword.value, ast.Constant) and keyword.value.value is False
|
||||
return len(call.args) >= 2 and isinstance(call.args[1], ast.Constant) and call.args[1].value is False
|
||||
|
||||
|
||||
def calls_in_source(source: str) -> list:
|
||||
"""(line, text) of every call to faulthandler.dump_traceback_later and of faulthandler.dump_traceback that dumps every thread."""
|
||||
tree = ast.parse(source)
|
||||
modules, functions = _faulthandler_names(tree)
|
||||
found = []
|
||||
for node in ast.walk(tree):
|
||||
if not isinstance(node, ast.Call):
|
||||
continue
|
||||
func = node.func
|
||||
if isinstance(func, ast.Attribute) and isinstance(func.value, ast.Name) and func.value.id in modules:
|
||||
name = func.attr
|
||||
elif isinstance(func, ast.Name) and func.id in functions:
|
||||
name = functions[func.id]
|
||||
else:
|
||||
continue
|
||||
if name == "dump_traceback_later":
|
||||
found.append((node.lineno, "faulthandler.dump_traceback_later is armed"))
|
||||
elif name == "dump_traceback" and not _all_threads_is_false(node):
|
||||
found.append((node.lineno, "faulthandler.dump_traceback dumps every thread (all_threads is true or defaulted)"))
|
||||
return found
|
||||
|
||||
|
||||
def timeout_strings_in_source(source: str) -> list:
|
||||
"""(line, text) of every string of the code that names pytest's faulthandler_timeout (an addopts, a -o argument, a command line)."""
|
||||
return [(n.lineno, "a string names pytest's faulthandler_timeout: %r" % n.value[:80])
|
||||
for n in ast.walk(ast.parse(source)) if isinstance(n, ast.Constant) and isinstance(n.value, str) and TIMEOUT_NAME.search(n.value)]
|
||||
|
||||
|
||||
def python_problems(root: Path) -> list:
|
||||
out = []
|
||||
for path in python_files(root):
|
||||
where = path.relative_to(root).as_posix()
|
||||
try:
|
||||
source = path.read_text(encoding="utf-8")
|
||||
found = calls_in_source(source)
|
||||
except (SyntaxError, UnicodeDecodeError, ValueError) as error:
|
||||
out.append(_say(where, "the file cannot be read as Python (%s), so it cannot be shown free of the dump" % error))
|
||||
continue
|
||||
out += [_say("%s:%d" % (where, line), what) for line, what in found]
|
||||
return out
|
||||
|
||||
|
||||
def string_problems(root: Path) -> list:
|
||||
"""The strings of every conftest.py and of scripts/ that name faulthandler_timeout."""
|
||||
paths = [p for p in python_files(root, ("tests",)) if p.name == "conftest.py"] + list(python_files(root, ("scripts",)))
|
||||
out = []
|
||||
for path in paths:
|
||||
try:
|
||||
found = timeout_strings_in_source(path.read_text(encoding="utf-8"))
|
||||
except (SyntaxError, UnicodeDecodeError, ValueError):
|
||||
continue # python_problems already says that a file cannot be read
|
||||
out += [_say("%s:%d" % (path.relative_to(root).as_posix(), line), what) for line, what in found]
|
||||
return out
|
||||
|
||||
|
||||
def _value_names_timeout(value) -> bool:
|
||||
return bool(TIMEOUT_NAME.search(" ".join(value) if isinstance(value, list) else str(value)))
|
||||
|
||||
|
||||
def config_problems(root: Path) -> list:
|
||||
out = []
|
||||
for table in _pytest_tables(_pyproject(root)):
|
||||
if "faulthandler_timeout" in table:
|
||||
out.append(_say("pyproject.toml [tool.pytest.ini_options]", "faulthandler_timeout is set (it arms dump_traceback_later for every test)"))
|
||||
if _value_names_timeout(table.get("addopts", "")):
|
||||
out.append(_say("pyproject.toml [tool.pytest.ini_options] addopts", "addopts names faulthandler_timeout"))
|
||||
for name, section in (("pytest.ini", "pytest"), ("setup.cfg", "tool:pytest"), ("tox.ini", "pytest")):
|
||||
path = root / name
|
||||
if not path.is_file():
|
||||
continue
|
||||
parser = configparser.ConfigParser(interpolation=None)
|
||||
parser.read_string(path.read_text(encoding="utf-8"))
|
||||
if parser.has_option(section, "faulthandler_timeout"):
|
||||
out.append(_say("%s [%s]" % (name, section), "faulthandler_timeout is set (it arms dump_traceback_later for every test)"))
|
||||
if parser.has_option(section, "addopts") and _value_names_timeout(parser.get(section, "addopts")):
|
||||
out.append(_say("%s [%s] addopts" % (name, section), "addopts names faulthandler_timeout"))
|
||||
return out
|
||||
|
||||
|
||||
def workflow_problems(root: Path) -> list:
|
||||
out = []
|
||||
folder = root / ".github" / "workflows"
|
||||
for path in sorted(folder.glob("*.yml")) if folder.is_dir() else []:
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1):
|
||||
code = re.split(r"(?:^|\s)#", line, maxsplit=1)[0]
|
||||
if TIMEOUT_NAME.search(code):
|
||||
out.append(_say("%s:%d" % (path.relative_to(root).as_posix(), number), "the workflow sets pytest's faulthandler_timeout: %s" % code.strip()[:100]))
|
||||
return out
|
||||
|
||||
|
||||
def problems(root: Path) -> list:
|
||||
return python_problems(root) + string_problems(root) + config_problems(root) + workflow_problems(root)
|
||||
|
||||
|
||||
def _tree(tmp_path: Path, files: dict) -> Path:
|
||||
for name, text in files.items():
|
||||
path = tmp_path / name
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(text, encoding="utf-8")
|
||||
return tmp_path
|
||||
|
||||
|
||||
def test_no_file_of_the_repository_arms_a_gil_free_thread_dump():
|
||||
found = problems(ROOT)
|
||||
assert not found, "\n".join(found)
|
||||
|
||||
|
||||
# The two lines of tests/conftest.py of 03425bb8, which the e2e of the Windows part 3 ran.
|
||||
OLD_CONFTEST = '''import faulthandler
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
handle = open("w.log", "a")
|
||||
faulthandler.dump_traceback_later(150.0, repeat=True, file=handle)
|
||||
|
||||
|
||||
def pytest_runtest_teardown(item, nextitem):
|
||||
faulthandler.cancel_dump_traceback_later()
|
||||
'''
|
||||
|
||||
|
||||
def test_the_conftest_of_03425bb8_is_red_and_names_the_file_and_the_line(tmp_path):
|
||||
found = problems(_tree(tmp_path, {"tests/conftest.py": OLD_CONFTEST}))
|
||||
assert len(found) == 1
|
||||
assert found[0].startswith("tests/conftest.py:6: faulthandler.dump_traceback_later is armed. How to fix: use tests/_stack_watchdog.py")
|
||||
assert "crashed the Windows part 3 worker" in found[0]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source, line", [
|
||||
("import faulthandler\nfaulthandler.dump_traceback_later(1)\n", 2),
|
||||
("import faulthandler as fh\nfh.dump_traceback_later(1, repeat=True)\n", 2),
|
||||
("from faulthandler import dump_traceback_later\ndump_traceback_later(1)\n", 2),
|
||||
("from faulthandler import dump_traceback_later as arm\ndef f():\n arm(1)\n", 3),
|
||||
("import faulthandler\nfaulthandler.dump_traceback()\n", 2),
|
||||
("import faulthandler\nfaulthandler.dump_traceback(all_threads=True)\n", 2),
|
||||
("import faulthandler, sys\nfaulthandler.dump_traceback(sys.stderr, True)\n", 2),
|
||||
("import faulthandler\nfaulthandler.dump_traceback(all_threads=some_flag)\n", 2),
|
||||
("from faulthandler import dump_traceback\ndump_traceback(None)\n", 2),
|
||||
])
|
||||
@pytest.mark.parametrize("folder", ["tests", "scripts", "src/pkg"])
|
||||
def test_every_form_of_the_call_is_red_in_every_folder(tmp_path, folder, source, line):
|
||||
found = python_problems(_tree(tmp_path, {folder + "/a.py": source}))
|
||||
assert [f.split(":")[0:2] for f in found] == [["%s/a.py" % folder, str(line)]]
|
||||
|
||||
|
||||
def test_a_file_that_cannot_be_parsed_is_red_and_not_skipped(tmp_path):
|
||||
found = python_problems(_tree(tmp_path, {"scripts/broken.py": "def (:\n"}))
|
||||
assert len(found) == 1 and found[0].startswith("scripts/broken.py: the file cannot be read as Python")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source", [
|
||||
"import faulthandler\nfaulthandler.dump_traceback(all_threads=False)\n",
|
||||
"import faulthandler, sys\nfaulthandler.dump_traceback(sys.stderr, False)\n",
|
||||
"import faulthandler\nfaulthandler.enable(all_threads=True)\nfaulthandler.cancel_dump_traceback_later()\n",
|
||||
"# faulthandler.dump_traceback_later(1)\nx = 'faulthandler.dump_traceback_later(1)'\n",
|
||||
'"""faulthandler.dump_traceback_later(1)"""\n',
|
||||
"def dump_traceback_later(x):\n return x\ndump_traceback_later(1)\n",
|
||||
"class faulthandler:\n def dump_traceback_later(self): ...\nfaulthandler().dump_traceback_later()\n",
|
||||
])
|
||||
def test_the_uses_that_do_not_crash_a_live_process_are_green(tmp_path, source):
|
||||
assert python_problems(_tree(tmp_path, {"tests/a.py": source})) == []
|
||||
|
||||
|
||||
def test_a_folder_in_norecursedirs_is_the_only_one_left_out(tmp_path):
|
||||
call = "import faulthandler\nfaulthandler.dump_traceback_later(1)\n"
|
||||
pyproject = '[tool.pytest.ini_options]\nnorecursedirs = ["playwright-upstream"]\n'
|
||||
root = _tree(tmp_path, {"pyproject.toml": pyproject, "tests/playwright-upstream/a.py": call, "tests/vendor/b.py": call})
|
||||
assert [f.split(":")[0] for f in python_problems(root)] == ["tests/vendor/b.py"]
|
||||
assert excluded_dirs(root) == {"__pycache__", "playwright-upstream"}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("pyproject", [
|
||||
'[tool.pytest.ini_options]\nfaulthandler_timeout = 300\n',
|
||||
'[tool.pytest.ini_options]\naddopts = "-m unit -o faulthandler_timeout=300"\n',
|
||||
'[tool.pytest.ini_options]\naddopts = ["-m", "unit", "--faulthandler-timeout=300"]\n',
|
||||
'[tool.pytest]\nfaulthandler_timeout = 300\n',
|
||||
])
|
||||
def test_the_timeout_of_pytest_in_pyproject_is_red(tmp_path, pyproject):
|
||||
found = config_problems(_tree(tmp_path, {"pyproject.toml": pyproject}))
|
||||
assert len(found) == 1 and found[0].startswith("pyproject.toml [tool.pytest")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, section", [("pytest.ini", "pytest"), ("setup.cfg", "tool:pytest"), ("tox.ini", "pytest")])
|
||||
def test_the_timeout_of_pytest_in_an_ini_file_is_red(tmp_path, name, section):
|
||||
found = config_problems(_tree(tmp_path, {name: "[%s]\nfaulthandler_timeout = 300\n" % section}))
|
||||
assert len(found) == 1 and found[0].startswith("%s [%s]" % (name, section))
|
||||
found = config_problems(_tree(tmp_path / "b", {name: "[%s]\naddopts = -x --faulthandler-timeout=9\n" % section}))
|
||||
assert len(found) == 1 and found[0].startswith("%s [%s] addopts" % (name, section))
|
||||
|
||||
|
||||
def test_a_config_with_no_timeout_is_green(tmp_path):
|
||||
files = {"pyproject.toml": '[tool.pytest.ini_options]\naddopts = "-m unit"\ntimeout = 420\n', "pytest.ini": "[pytest]\naddopts = -x\n",
|
||||
"tox.ini": "[tox]\nenvlist = a\n[testenv]\ncommands = pytest -o faulthandler_timeout=3\n", "setup.cfg": "[flake8]\nmax-line-length = 9\n"}
|
||||
assert config_problems(_tree(tmp_path, files)) == []
|
||||
|
||||
|
||||
def test_a_conftest_and_a_script_that_name_the_timeout_in_a_string_are_red(tmp_path):
|
||||
root = _tree(tmp_path, {
|
||||
"tests/conftest.py": "def pytest_configure(config):\n config.addinivalue_line('addopts', '--faulthandler-timeout=9')\n",
|
||||
"scripts/run.py": "ARGS = ['pytest', '-o', 'faulthandler_timeout=9']\n",
|
||||
"tests/test_a.py": "ARGS = ['-o', 'faulthandler_timeout=9']\n",
|
||||
})
|
||||
assert [f.split(":")[0:2] for f in string_problems(root)] == [["tests/conftest.py", "2"], ["scripts/run.py", "1"]]
|
||||
|
||||
|
||||
def test_a_workflow_that_sets_the_timeout_is_red_and_a_comment_is_not(tmp_path):
|
||||
root = _tree(tmp_path, {".github/workflows/a.yml": "jobs:\n t:\n steps:\n # pytest -o faulthandler_timeout=9 is what not to do\n"
|
||||
" - run: pytest -o faulthandler_timeout=300 tests # not this\n"
|
||||
" - run: pytest --faulthandler-timeout 5\n"
|
||||
" - run: pytest tests # --faulthandler-timeout 5\n"})
|
||||
assert [f.split(":")[0:2] for f in workflow_problems(root)] == [[".github/workflows/a.yml", "5"], [".github/workflows/a.yml", "6"]]
|
||||
+407
@@ -0,0 +1,407 @@
|
||||
"""No fontconfig file of the host is opened, and the screenshot draws the bundle even when the host's caches are poisoned (e2e, Linux).
|
||||
|
||||
Why Linux only: fontconfig exists only there. On Windows the parent rebuilds a font from the path a text run carries with DirectWrite, which opens the
|
||||
file by its path and has no configuration and no cache of fonts to read; this test has no Windows form (the row of ``ci/required-suites.json`` says so:
|
||||
``linux_only``).
|
||||
|
||||
It replaces the test of the warm cache (``test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py``), which asked that a second launch read
|
||||
fontconfig's cache of the bundle. The engine no longer has that behaviour, on purpose: it runs fontconfig on its own empty configuration. It reads no
|
||||
``fonts.conf``, no rule, no cache folder and no GTK or Xft font option, it does not show ``<GRE>/fonts`` to fontconfig (the core declares
|
||||
``gfx.bundled-fonts.activate=0`` on Linux), and the screenshot takes the file and the face of each text run from the bundle's manifest. So the host's
|
||||
fontconfig can neither decide a face nor be asked.
|
||||
|
||||
What the test does, in one launch under strace (the stand-in of ``tests/_strace_stand_in.py``: the engine's folder as links, whose executable runs the real
|
||||
one under ``strace -f`` in its place):
|
||||
|
||||
(a) POISONS the caches first. Fontconfig names the cache of a folder by the md5 of its path and trusts it while the folder's mtime is the one the cache
|
||||
recorded. The test makes a copy of the engine's fonts folder (links to the files) WITHOUT one ``.ttc`` (``msgothic5_32.ttc``: MS Gothic, MS PGothic,
|
||||
MS UI Gothic), gives the copy the mtime of the real folder, and has ``fc-cache`` write the cache of the copy AS IF it were the real folder
|
||||
(``<remap-dir as-path=...>``: the cache is named for the real path and lists the real path), once into ``$HOME/.fontconfig`` and once into
|
||||
``$XDG_CACHE_HOME/fontconfig`` of the test, the two folders an old engine reads. A cache valid for the real folder that does not list that face. The
|
||||
test then asks fontconfig itself (``fc-list``, with the real folder and one cache folder) and fails if the face is listed or the real folder is
|
||||
not what it lists: a poison that is not in force would let every assertion below pass for the wrong reason;
|
||||
(b) asserts that NO process of the browser (the parent, the content processes, any other) OPENS a path under ``/etc/fonts``, a file called
|
||||
``fonts.conf``, or a fontconfig cache file (``*.cache-*``, also the ``.NEW`` and ``.TMP-*`` it is written through), whatever the result of the open:
|
||||
an open that is refused (no such file) is a look at the host's configuration all the same. The other calls that look at a path
|
||||
(stat, access, readlink) are written to the evidence and not judged;
|
||||
(c) takes a screenshot of Japanese text in a bundled face (MS PGothic, which is face 2 of the ``.ttc`` the poison lacks) and asserts it equals the content's
|
||||
own drawing, as ``tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py`` does: the same text as HTML (the parent
|
||||
rebuilds it for the screenshot) and as a canvas the content drew, in the same screenshot, equal byte by byte.
|
||||
|
||||
Red on the old engine: it opens ``/etc/fonts/fonts.conf`` (and the caches) at ``FcInit``, and with the poisoned cache the parent asks fontconfig which file is the
|
||||
face of the text run, which does not list it: it draws another file's outlines (a font of the host), so the two boxes differ. Green on the engine that runs
|
||||
fontconfig on its own empty configuration.
|
||||
|
||||
The environment reaches the browser as it does for a user: the test sets ``HOME`` and ``XDG_CACHE_HOME`` in its own environment (and ``XDG_CONFIG_HOME`` to a
|
||||
folder with nothing in it; the core gives the engine empty configuration folders of its own, whatever the test sets), and the core composes the rest of the
|
||||
engine's environment from it. ``FONTCONFIG_FILE`` and ``FONTCONFIG_PATH`` of the runner are taken off.
|
||||
|
||||
Evidence, whatever the verdict: when ``RUNNER_TEMP`` is set the test writes ``result.json`` (the poison, what fontconfig says of it, every open of a
|
||||
forbidden path with the role of its process, every other forbidden look, the boxes of the screenshot) and the screenshot under
|
||||
``$RUNNER_TEMP/invpw-evidence/fontconfig-host-files/``.
|
||||
|
||||
Run: pytest tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
import _page_bytes as pb
|
||||
from _waits import wait_until
|
||||
from _strace_stand_in import (
|
||||
_detached, _group_members, _group_of, _kill_group, _LINE, _require_strace_can_trace, _RESUMED, _roles, _stand_in, _SYSCALLS, _wait_for_exit)
|
||||
from test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e import (
|
||||
BLOCK_H, BLOCK_W, EVIDENCE_FOLDER, PIN, VIEWPORT, _dark, _integer_box, _page)
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.e2e,
|
||||
pytest.mark.skipif(not sys.platform.startswith("linux"), reason="fontconfig is the Linux font system"),
|
||||
]
|
||||
|
||||
SEED = 21
|
||||
|
||||
#: The face of the screenshot: MS PGothic is face 2 of msgothic5_32.ttc (face 0 is MS Gothic), the file the poison lacks.
|
||||
FAMILY = "MS PGothic"
|
||||
MISSING_FACE_FILE = "msgothic5_32.ttc"
|
||||
|
||||
#: What is traced: the opens (what the test judges), the other calls that look at a path (evidence), and the clones and the execve (the role of a process).
|
||||
TRACE = _SYSCALLS + ",openat2"
|
||||
OPEN_CALLS = ("open", "openat", "openat2")
|
||||
_LOOK_CALLS = ("stat", "lstat", "newfstatat", "statx", "access", "faccessat", "faccessat2", "readlink")
|
||||
#: Calls whose first argument is a directory descriptor (``-y`` prints its path: ``3</etc/fonts/conf.d>``, ``AT_FDCWD</cwd>``).
|
||||
_AT_CALLS = ("openat", "openat2", "newfstatat", "statx", "faccessat", "faccessat2")
|
||||
|
||||
_QUOTED_FIRST = re.compile(r'^"((?:[^"\\]|\\.)*)"')
|
||||
_AT_ARGS = re.compile(r'^([^,"]*),\s*"((?:[^"\\]|\\.)*)"')
|
||||
_RETURN = re.compile(r"\)\s+=\s+(-?\d+)")
|
||||
#: A fontconfig cache file: ``<md5 or uuid>-<arch>.cache-<n>``, and what it is written through (``.NEW``, ``.TMP-xxxxxx``).
|
||||
_CACHE_FILE = re.compile(r"\.cache-\d+(\.|$)")
|
||||
|
||||
#: The folders an old engine reads a cache from, besides ``/var/cache/fontconfig``: the legacy ``~/.fontconfig`` and ``$XDG_CACHE_HOME/fontconfig``.
|
||||
POISONED_FOLDERS = ("home", "xdg")
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
# What the log says (pure: unit-tested without a browser, tests/unit/test_fontconfig_cache_criterion.py)
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
def is_a_fontconfig_file_of_the_host(path: str) -> bool:
|
||||
"""A path the engine must never open: under ``/etc/fonts``, a file called ``fonts.conf`` (anywhere: a user's, the system's, a bundle's), or a
|
||||
fontconfig cache file (``*.cache-<n>`` and what it is written through)."""
|
||||
folder = posixpath.normpath(path)
|
||||
base = posixpath.basename(folder)
|
||||
return folder == "/etc/fonts" or folder.startswith("/etc/fonts/") or base == "fonts.conf" or _CACHE_FILE.search(base) is not None
|
||||
|
||||
|
||||
def _full_path(dirfd: str, path: str) -> str:
|
||||
"""The path a call names: absolute as it is; a relative one with the folder ``-y`` printed for its descriptor (``3</etc/fonts/conf.d>``)."""
|
||||
if path.startswith("/"):
|
||||
return posixpath.normpath(path)
|
||||
folder = re.search(r"<(.*)>", dirfd)
|
||||
return posixpath.normpath(posixpath.join(folder.group(1), path)) if folder else path
|
||||
|
||||
|
||||
def _results_of_unfinished(lines) -> dict:
|
||||
"""``{index of an unfinished call: its result}``: strace -f writes a call that another thread interrupts as "PID openat(...<unfinished ...>" and gives
|
||||
the result on the next line of that pid, "PID <... openat resumed>) = -1 ENOENT". An unfinished line with no resumed line has no entry."""
|
||||
pending, results = {}, {}
|
||||
for i, line in enumerate(lines):
|
||||
m = _LINE.match(line)
|
||||
if m and "<unfinished ...>" in m.group(3):
|
||||
pending[(int(m.group(1)), m.group(2))] = i
|
||||
continue
|
||||
r = _RESUMED.match(line)
|
||||
if r and (int(r.group(1)), r.group(2)) in pending:
|
||||
result = _RETURN.search(r.group(3))
|
||||
if result:
|
||||
results[pending.pop((int(r.group(1)), r.group(2)))] = int(result.group(1))
|
||||
return results
|
||||
|
||||
|
||||
def paths_of_calls(lines, calls) -> list:
|
||||
"""``[{"line", "pid", "call", "path", "result"}]``: every call of ``calls`` on the log, with the path it names, whatever its result (``None`` when the log
|
||||
has none: an unfinished call with no resumed line). A call that names a path through a descriptor with no printed folder keeps the relative path."""
|
||||
results = _results_of_unfinished(lines)
|
||||
found = []
|
||||
for i, line in enumerate(lines):
|
||||
m = _LINE.match(line)
|
||||
if not m or m.group(2) not in calls:
|
||||
continue
|
||||
call, rest = m.group(2), m.group(3)
|
||||
if call in _AT_CALLS:
|
||||
args = _AT_ARGS.match(rest)
|
||||
path = _full_path(args.group(1), args.group(2)) if args else None
|
||||
else:
|
||||
args = _QUOTED_FIRST.match(rest)
|
||||
path = posixpath.normpath(args.group(1)) if args else None
|
||||
if path is None:
|
||||
continue
|
||||
result = _RETURN.search(rest)
|
||||
found.append({"line": i, "pid": int(m.group(1)), "call": call, "path": path,
|
||||
"result": int(result.group(1)) if result else results.get(i)})
|
||||
return found
|
||||
|
||||
|
||||
def host_fontconfig_looks(lines, real: str) -> dict:
|
||||
"""``{"opens": [...], "other": [...]}``: the opens of a fontconfig file of the host by any process of the browser, and (evidence, not judged) the stat,
|
||||
access and readlink calls on one. Each has the role of its process (``parent``, ``content`` or ``other``)."""
|
||||
role, _argv = _roles(lines, real)
|
||||
out = {"opens": [], "other": []}
|
||||
for key, calls in (("opens", OPEN_CALLS), ("other", _LOOK_CALLS)):
|
||||
for call in paths_of_calls(lines, calls):
|
||||
if is_a_fontconfig_file_of_the_host(call["path"]):
|
||||
out[key].append(dict(call, role=role(call["pid"])))
|
||||
return out
|
||||
|
||||
|
||||
def poison_config(as_path: str, copy: str, cache_dir: str) -> str:
|
||||
"""The configuration ``fc-cache`` reads to write the poison: scan ``copy`` AS IF it were ``as_path`` (the cache is named for ``as_path`` and lists
|
||||
its path), into ``cache_dir`` only, and nothing else (no system folder, no rule)."""
|
||||
return ('<?xml version="1.0"?>\n<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">\n<fontconfig>\n'
|
||||
' <remap-dir as-path="%s">%s</remap-dir>\n <cachedir>%s</cachedir>\n</fontconfig>\n' % (as_path, copy, cache_dir))
|
||||
|
||||
|
||||
def reader_config(folder: str, cache_dir: str) -> str:
|
||||
"""The configuration that asks fontconfig what the cache holds for ``folder``: the folder and one cache folder, nothing else."""
|
||||
return ('<?xml version="1.0"?>\n<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">\n<fontconfig>\n'
|
||||
' <dir>%s</dir>\n <cachedir>%s</cachedir>\n</fontconfig>\n' % (folder, cache_dir))
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
# The test's own steps
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
def _evidence_dir():
|
||||
base = os.environ.get("RUNNER_TEMP")
|
||||
return Path(base) / EVIDENCE_FOLDER / "fontconfig-host-files" if base else None
|
||||
|
||||
|
||||
def _tool_env(conf: Path, home: Path) -> dict:
|
||||
"""The environment of ``fc-cache`` and ``fc-list``: the test's own, with this one configuration and nothing of the variables the core strips."""
|
||||
env = {k: v for k, v in os.environ.items() if not k.startswith(("FONTCONFIG_", "FC_"))}
|
||||
env["FONTCONFIG_FILE"] = str(conf)
|
||||
env["HOME"] = str(home)
|
||||
return env
|
||||
|
||||
|
||||
def _run(argv, env) -> str:
|
||||
done = subprocess.run(argv, env=env, capture_output=True, text=True, timeout=300)
|
||||
assert done.returncode == 0, "%s failed (%d): %s" % (" ".join(argv), done.returncode, (done.stderr or done.stdout)[-800:])
|
||||
return done.stdout
|
||||
|
||||
|
||||
def _poison(work: Path, gre_fonts: str, home: Path, xdg_cache: Path) -> dict:
|
||||
"""Write the poisoned cache of the real fonts folder into ``home/.fontconfig`` and ``xdg_cache/fontconfig``; -> what was written and what fontconfig says
|
||||
of each (the files it lists for the real folder, read back by ``fc-list`` from that cache folder alone)."""
|
||||
copy = work / "fonts-without-one-ttc"
|
||||
copy.mkdir()
|
||||
entries = sorted((e for e in os.scandir(gre_fonts) if e.is_file()), key=lambda e: e.name)
|
||||
assert any(e.name == MISSING_FACE_FILE for e in entries), "<GRE>/fonts has no %s: the poison has nothing to lack" % MISSING_FACE_FILE
|
||||
for entry in entries:
|
||||
if entry.name != MISSING_FACE_FILE:
|
||||
(copy / entry.name).symlink_to(entry.path)
|
||||
stat = os.stat(gre_fonts)
|
||||
# The cache is valid while the folder's mtime is the one it recorded (the package gives the folder 1767225600): the copy gets the real folder's own, in
|
||||
# nanoseconds, after the links, which moved it.
|
||||
os.utime(copy, ns=(stat.st_atime_ns, stat.st_mtime_ns))
|
||||
md5 = hashlib.md5(gre_fonts.rstrip("/").encode()).hexdigest()
|
||||
caches = {"home": home / ".fontconfig", "xdg": xdg_cache / "fontconfig"}
|
||||
said = {}
|
||||
for name, folder in caches.items():
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
conf = work / ("poison-%s.conf" % name)
|
||||
conf.write_text(poison_config(gre_fonts, str(copy), str(folder)), encoding="utf-8")
|
||||
_run(["fc-cache", "-f", "-v"], _tool_env(conf, home))
|
||||
reader = work / ("reader-%s.conf" % name)
|
||||
reader.write_text(reader_config(gre_fonts, str(folder)), encoding="utf-8")
|
||||
listed = sorted(line for line in _run(["fc-list", "-f", "%{file}\\n"], _tool_env(reader, home)).splitlines() if line.strip())
|
||||
said[name] = {
|
||||
"cache_folder": str(folder),
|
||||
"cache_files": sorted(f.name for f in folder.iterdir() if f.is_file()),
|
||||
"listed_files": sorted(set(listed)),
|
||||
}
|
||||
return {"copy": str(copy), "real_folder": gre_fonts, "md5_of_the_real_folder": md5, "mtime_ns": stat.st_mtime_ns,
|
||||
"font_files_in_the_real_folder": [e.name for e in entries], "caches": said}
|
||||
|
||||
|
||||
def _poison_problems(poison: dict) -> list:
|
||||
"""Why the poison is not in force (empty when it is): a cache that fontconfig does not read for the real folder, or that still lists the face, is no poison."""
|
||||
problems = []
|
||||
real = poison["real_folder"]
|
||||
for name, said in poison["caches"].items():
|
||||
mine = [f for f in said["cache_files"] if f.startswith(poison["md5_of_the_real_folder"]) and _CACHE_FILE.search(f)]
|
||||
if not mine:
|
||||
problems.append("%s: no cache named for the real folder (%s-*.cache-*) in %s (it holds %s)"
|
||||
% (name, poison["md5_of_the_real_folder"], said["cache_folder"], said["cache_files"]))
|
||||
listed = said["listed_files"]
|
||||
if not listed:
|
||||
problems.append("%s: fontconfig lists no font for the real folder %s with this cache" % (name, real))
|
||||
elif any(posixpath.dirname(f) != real for f in listed):
|
||||
problems.append("%s: fontconfig lists files outside the real folder: %s" % (name, [f for f in listed if posixpath.dirname(f) != real][:3]))
|
||||
if any(posixpath.basename(f) == MISSING_FACE_FILE for f in listed):
|
||||
problems.append("%s: fontconfig lists %s for the real folder: the cache is not the poisoned one (the folder was scanned again)" % (name, MISSING_FACE_FILE))
|
||||
return problems
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def launch(firefox_binary, tmp_path_factory):
|
||||
"""The one launch under strace, with the caches poisoned: -> {poison, looks, measured, whole, dom, cv, ...}; the record is written before any assertion."""
|
||||
for tool in ("strace", "fc-cache", "fc-list"):
|
||||
if shutil.which(tool) is None:
|
||||
pytest.fail("needs %s (apt install strace fontconfig): without it nothing is measured" % tool, pytrace=False)
|
||||
work = tmp_path_factory.mktemp("fcfiles")
|
||||
_require_strace_can_trace(work)
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
real = os.path.realpath(firefox_binary)
|
||||
gre_fonts = os.path.join(os.path.dirname(real), "fonts")
|
||||
home, xdg_cache, xdg_config = work / "home", work / "xdg-cache", work / "xdg-config"
|
||||
for folder in (home, xdg_cache, xdg_config):
|
||||
folder.mkdir()
|
||||
out = {"poison": _poison(work, gre_fonts, home, xdg_cache)}
|
||||
|
||||
run = work / "run"
|
||||
run.mkdir()
|
||||
log, pidfile = run / "strace.log", run / "stand-in.pid"
|
||||
stand_in = _stand_in(firefox_binary, run / "engine", log, pidfile, syscalls=TRACE, fd_paths=True)
|
||||
shot, measured = None, None
|
||||
try:
|
||||
with pytest.MonkeyPatch.context() as patch:
|
||||
patch.setenv("HOME", str(home))
|
||||
patch.setenv("XDG_CACHE_HOME", str(xdg_cache))
|
||||
patch.setenv("XDG_CONFIG_HOME", str(xdg_config))
|
||||
for variable in ("FONTCONFIG_FILE", "FONTCONFIG_PATH"):
|
||||
patch.delenv(variable, raising=False)
|
||||
with InvisiblePlaywright(seed=SEED, binary_path=stand_in, headless=True, pin=PIN) as browser:
|
||||
page = browser.new_context(viewport=VIEWPORT).new_page()
|
||||
page.set_content(_page())
|
||||
page.evaluate("fam => { window.DONE = false; window.ERR = null;"
|
||||
" draw(fam).then(r => { window.R = r; window.DONE = true; },"
|
||||
" e => { window.ERR = String(e); window.DONE = true; }); }", FAMILY)
|
||||
page.wait_for_function("window.DONE === true", timeout=60_000)
|
||||
out["page_error"] = page.evaluate("window.ERR")
|
||||
measured = page.evaluate("window.R")
|
||||
shot = page.screenshot(type="png")
|
||||
finally:
|
||||
_kill_group(pidfile)
|
||||
lines = log.read_text(encoding="utf-8", errors="replace").splitlines()
|
||||
out["log_lines"] = len(lines)
|
||||
out["looks"] = host_fontconfig_looks(lines, real)
|
||||
out["measured"], out["shot"] = measured, shot
|
||||
if shot is not None and measured is not None:
|
||||
whole = pb.unfiltered(shot)
|
||||
out["whole"] = {"w": whole["w"], "h": whole["h"]}
|
||||
out["dom"] = _integer_box("DOM", measured["dom"])
|
||||
out["cv"] = _integer_box("canvas", measured["cv"])
|
||||
out["dom_img"] = pb.crop(whole, out["dom"]["x"], out["dom"]["y"], out["dom"]["width"], out["dom"]["height"])
|
||||
out["cv_img"] = pb.crop(whole, out["cv"]["x"], out["cv"]["y"], out["cv"]["width"], out["cv"]["height"])
|
||||
out["diff"] = pb.pixels_differ(out["dom_img"], out["cv_img"])
|
||||
where = _evidence_dir()
|
||||
if where is not None:
|
||||
try:
|
||||
where.mkdir(parents=True, exist_ok=True)
|
||||
record = {k: v for k, v in out.items() if k not in ("shot", "dom_img", "cv_img")}
|
||||
(where / "result.json").write_text(json.dumps(record, indent=1, sort_keys=True, default=str) + "\n", encoding="utf-8")
|
||||
if shot is not None:
|
||||
(where / "page.png").write_bytes(shot)
|
||||
except Exception as exc: # a record never changes the outcome
|
||||
print("the record could not be written:", repr(exc))
|
||||
return out
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
# The tests
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
@pytest.mark.timeout(120, method="thread")
|
||||
def test_the_stand_in_stays_in_the_engine_s_place_and_its_group_is_killed_whole(tmp_path):
|
||||
"""The tool, without a browser. A fake engine (a script that starts a child and waits for it) is launched through the stand-in
|
||||
as the core launches the engine: the leader of a process group of its own (``_detached``). Once the fake engine says its child
|
||||
runs (a signal file, no pause), the process the launcher holds must be alive and be the fake engine's parent, strace: with the
|
||||
stand-in that exec'd ``setsid``, setsid forked (its caller led a group), its parent exited 0 at once, and the core saw the engine
|
||||
exit during startup (candidate 44161687675, job 134356188701). The group the cleanup kills is the launcher's, it holds strace and
|
||||
the fake engine's child, and nothing of it is left afterwards."""
|
||||
if shutil.which("strace") is None:
|
||||
pytest.fail("needs strace (apt install strace): without it the stand-in cannot be tried", pytrace=False)
|
||||
_require_strace_can_trace(tmp_path)
|
||||
real = tmp_path / "real" / "firefox"
|
||||
real.parent.mkdir()
|
||||
# The signal, written whole (a rename) once the child runs: the child's pid and the fake engine's parent, the process strace is.
|
||||
signal_file = tmp_path / "started"
|
||||
real.write_text('#!/bin/sh\nsleep 300 &\necho "$! $PPID" > %s.tmp && mv %s.tmp %s\nwait\n' % (signal_file, signal_file, signal_file))
|
||||
real.chmod(0o755)
|
||||
log, pidfile = tmp_path / "strace.log", tmp_path / "stand-in.pid"
|
||||
stand_in = _stand_in(str(real), tmp_path / "engine", log, pidfile)
|
||||
proc = _detached([stand_in], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
try:
|
||||
started = wait_until(signal_file.exists, 30, lambda: time.sleep(0.05))
|
||||
child, engine_parent = (int(word) for word in signal_file.read_text().split()) if started else (None, None)
|
||||
exited_with = proc.poll()
|
||||
pgid = _group_of(pidfile)
|
||||
members = _group_members(pgid) if pgid is not None else []
|
||||
comms = sorted(Path("/proc/%d/comm" % p).read_text().strip() for p in members if Path("/proc/%d/comm" % p).exists())
|
||||
killed = _kill_group(pidfile)
|
||||
proc.wait(timeout=30)
|
||||
left = _wait_for_exit(pgid) if pgid is not None else []
|
||||
finally:
|
||||
_kill_group(pidfile)
|
||||
if proc.poll() is None:
|
||||
proc.kill()
|
||||
proc.wait(timeout=30)
|
||||
assert started, "the fake engine did not start its child under the stand-in"
|
||||
assert exited_with is None and engine_parent == proc.pid, (
|
||||
"the process the launcher holds (pid %d, exited with %s) is not the one that runs the engine (its parent is %s): the launcher would "
|
||||
"see the engine gone" % (proc.pid, exited_with, engine_parent))
|
||||
assert pgid == proc.pid and pgid != os.getpgrp(), "the group is not the one the launcher gave (group %s, pid %d)" % (pgid, proc.pid)
|
||||
assert "strace" in comms and child in members, "the group holds %s (%s), not strace and the child %s" % (members, comms, child)
|
||||
assert killed == pgid and not left, "after the kill of group %s: killed %s, left %s" % (pgid, killed, left)
|
||||
|
||||
|
||||
@pytest.mark.timeout(900, method="thread")
|
||||
def test_the_caches_of_the_host_hold_a_valid_cache_of_the_bundle_that_lacks_a_face(launch):
|
||||
"""The precondition of the two below, in fontconfig's own words: without it a clean log and an equal screenshot would prove nothing."""
|
||||
problems = _poison_problems(launch["poison"])
|
||||
assert not problems, "the poison is not in force, so the test measures nothing: %s" % "; ".join(problems)
|
||||
|
||||
|
||||
@pytest.mark.timeout(900, method="thread")
|
||||
def test_no_process_of_the_browser_opens_a_fontconfig_file_of_the_host(launch):
|
||||
problems = _poison_problems(launch["poison"])
|
||||
assert not problems, "the poison is not in force, so the test measures nothing: %s" % "; ".join(problems)
|
||||
assert launch["log_lines"] > 0, "strace wrote nothing: the browser was not traced"
|
||||
opens = launch["looks"]["opens"]
|
||||
assert not opens, (
|
||||
"%d open(s) of a fontconfig file of the host by the browser (under /etc/fonts, a fonts.conf, or a *.cache-* cache), by role: %s. The first ones: %s. "
|
||||
"Looks that are not opens (stat, access, readlink), not judged: %d"
|
||||
% (len(opens), sorted({o["role"] for o in opens}),
|
||||
[(o["role"], o["call"], o["path"], o["result"]) for o in opens[:8]], len(launch["looks"]["other"])))
|
||||
|
||||
|
||||
@pytest.mark.timeout(900, method="thread")
|
||||
def test_the_screenshot_of_japanese_text_in_a_bundled_face_is_the_content_s_drawing_with_the_caches_poisoned(launch):
|
||||
problems = _poison_problems(launch["poison"])
|
||||
assert not problems, "the poison is not in force, so the test measures nothing: %s" % "; ".join(problems)
|
||||
assert launch["page_error"] is None, "the page could not draw the two blocks: %s" % launch["page_error"]
|
||||
measured, whole, dom, cv = launch["measured"], launch["whole"], launch["dom"], launch["cv"]
|
||||
assert measured["dpr"] == 1, "the device pixel ratio is %r, not 1: the boxes would be resampled" % measured["dpr"]
|
||||
assert (dom["width"], dom["height"]) == (cv["width"], cv["height"]) == (BLOCK_W, BLOCK_H), (dom, cv)
|
||||
assert measured["lines"] == 6, "the block has %r lines, not 6" % measured["lines"]
|
||||
assert (whole["w"], whole["h"]) == (VIEWPORT["width"], VIEWPORT["height"]), (
|
||||
"the screenshot is %dx%d for a viewport of %dx%d: the boxes are not where the page measured them"
|
||||
% (whole["w"], whole["h"], VIEWPORT["width"], VIEWPORT["height"]))
|
||||
dom_img, cv_img, diff = launch["dom_img"], launch["cv_img"], launch["diff"]
|
||||
# a box with no text in it would be equal to another box with no text in it
|
||||
assert _dark(dom_img) > 0, "the DOM box of %s is blank: the screenshot has no text there" % FAMILY
|
||||
assert _dark(cv_img) > 0, "the canvas box of %s is blank: the SVG image drew no text" % FAMILY
|
||||
assert dom_img["data"] == cv_img["data"], (
|
||||
"%s: the text the screenshot rebuilt in the parent (the DOM box) is not the text the content drew (the canvas box): %d of %d pixels differ, the first at %r, "
|
||||
"inside the box %r. With the caches of the host poisoned (a valid cache of the bundle without %s), the parent drew the face from another file."
|
||||
% (FAMILY, diff["pixels"], BLOCK_W * BLOCK_H, diff["first"], diff["box"], MISSING_FACE_FILE))
|
||||
@@ -0,0 +1,103 @@
|
||||
"""A page that closes with a popup open leaves no popup open and no browser element that cannot be pointed at, as on every Firefox.
|
||||
|
||||
The popups that a page opens in the chrome (the dropdown of a ``<select>``, the datalist's list, the page context menu) belong to the tab that opened them. A tab that goes away with one open takes it with it: no menu is left
|
||||
showing over the window, and nothing that the automation did to let a press through (it can switch the ``pointer-events`` of the browser elements while a popup is open) is left on a browser element that stays. A popup that outlives its page
|
||||
is a window nobody can close, and a browser element that keeps ``pointer-events: none`` is a page that no longer takes a click, in the tab the user goes back to.
|
||||
|
||||
What it does, per popup (the dropdown, the context menu, the datalist list), on one display case (the 1920x1080 panel at scale 1.0): two pages are open (the first is kept open, as a user's other tab), the second is clicked with the client's own mouse
|
||||
until the popup is open (read from chrome: the state ``open``), and then closed with ``page.close()``. The chrome (Marionette, ``MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1``) walks every ``navigator:browser`` window and lists every ``menupopup`` and ``panel`` whose state is not
|
||||
``closed``, and reads, for every ``browser`` element that is left, the inline ``pointer-events`` and the computed one. The wait is a condition with a deadline (``wait_for``), and the verdict is on the last reading: no popup is open, and no browser element
|
||||
has an inline ``none`` or a pair that no browser element had before the popup was opened (the baseline is read on the same two pages, with nothing open).
|
||||
|
||||
The positive control is in the same test: with the popup open, before the page closes, the same walk must list it as not closed, so a walk that answered ``closed`` whatever was open would not pass for nothing.
|
||||
|
||||
Green on the published engine and on the one under test: the close of a tab with a popup open is what the engine must not break.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Callable, Dict, List
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _stock_twin import MARIONETTE_ARGS, Chrome
|
||||
from _window_origin import DEADLINE_S, launch_case, wait_for
|
||||
from test_a_press_on_an_open_select_follows_windows_rollup_e2e import ANCHOR_CENTRE, BOX_CENTRE, INPUT_CENTRE, PAGE, STATES_JS
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
CASE = "1920x1080-dpr1.0"
|
||||
|
||||
#: Every window of the browser: the popups that are not closed (``menupopup`` and ``panel``), and for each ``browser`` element the inline ``pointer-events`` and the computed one.
|
||||
WALK_JS = """
|
||||
const out = {popups: [], browsers: [], windows: 0};
|
||||
const windows = Services.wm.getEnumerator("navigator:browser");
|
||||
while (windows.hasMoreElements()) {
|
||||
const win = windows.getNext();
|
||||
out.windows += 1;
|
||||
for (const popup of win.document.querySelectorAll("menupopup, panel")) {
|
||||
if (typeof popup.state === "string" && popup.state !== "closed") out.popups.push({window: out.windows, id: popup.id, tag: popup.localName, state: popup.state});
|
||||
}
|
||||
for (const browser of win.document.querySelectorAll("browser")) {
|
||||
out.browsers.push({window: out.windows, id: browser.id, inline: browser.style.pointerEvents, computed: win.getComputedStyle(browser).pointerEvents});
|
||||
}
|
||||
}
|
||||
return JSON.stringify(out);
|
||||
"""
|
||||
|
||||
|
||||
def _open_dropdown(page: Any, chrome: Chrome) -> None:
|
||||
page.mouse.click(*ANCHOR_CENTRE)
|
||||
assert wait_for(page, lambda: chrome.script(STATES_JS)["select"] == "open", DEADLINE_S), "the real click did not open the dropdown: %r" % chrome.script(STATES_JS)
|
||||
|
||||
|
||||
def _open_context_menu(page: Any, chrome: Chrome) -> None:
|
||||
page.mouse.click(*BOX_CENTRE, button="right")
|
||||
assert wait_for(page, lambda: chrome.script(STATES_JS)["context"] == "open", DEADLINE_S), "the real right click did not open the context menu: %r" % chrome.script(STATES_JS)
|
||||
|
||||
|
||||
def _open_datalist(page: Any, chrome: Chrome) -> None:
|
||||
page.mouse.click(*INPUT_CENTRE)
|
||||
page.keyboard.type("a")
|
||||
assert wait_for(page, lambda: chrome.script(STATES_JS)["autocomplete"] == "open", DEADLINE_S), "a click on the input and a typed letter did not open the list: %r" % chrome.script(STATES_JS)
|
||||
|
||||
|
||||
#: Each popup, by what it is called here, and how a real click opens it.
|
||||
POPUPS: Dict[str, Callable[[Any, Chrome], None]] = {"the dropdown of a select": _open_dropdown, "the page context menu": _open_context_menu, "the datalist list": _open_datalist}
|
||||
|
||||
|
||||
def _problems(before: Dict[str, Any], after: Dict[str, Any]) -> List[str]:
|
||||
"""What is wrong with the walk ``after``: the popups still not closed, and the browser elements whose pointer-events are not what some browser element had with nothing open (an inline ``none`` never is)."""
|
||||
known = {(b["inline"], b["computed"]) for b in before["browsers"]}
|
||||
out = ["a popup is not closed: %r" % popup for popup in after["popups"]]
|
||||
out += ["a browser element has pointer-events %r (computed %r), which no browser element had with nothing open (%r)" % (b["inline"], b["computed"], sorted(known))
|
||||
for b in after["browsers"] if b["inline"] == "none" or (b["inline"], b["computed"]) not in known]
|
||||
return out
|
||||
|
||||
|
||||
@pytest.mark.parametrize("popup", sorted(POPUPS))
|
||||
def test_no_popup_is_left_when_a_page_closes(firefox_binary, monkeypatch, popup):
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites, launch_case(firefox_binary, CASE, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
sites.route("A", "/page", PAGE)
|
||||
other = browser.new_page() # first: the window the chrome session waits for, and the second tab of the user that stays
|
||||
chrome = Chrome(other)
|
||||
try:
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/page"))
|
||||
before = chrome.script(WALK_JS)
|
||||
assert not before["popups"] and before["browsers"], "the baseline walk is not of a quiet browser with browser elements: %r" % before
|
||||
POPUPS[popup](page, chrome)
|
||||
open_now = chrome.script(WALK_JS)
|
||||
assert open_now["popups"], "the walk did not list the popup that is open (the control of the walk): %r" % open_now
|
||||
page.close()
|
||||
seen: Dict[str, Any] = {}
|
||||
|
||||
def clean() -> bool:
|
||||
seen["after"] = chrome.script(WALK_JS)
|
||||
return not _problems(before, seen["after"])
|
||||
|
||||
wait_for(other, clean, DEADLINE_S)
|
||||
problems = _problems(before, seen["after"])
|
||||
assert not problems, "after page.close() with %s open (waited %s s): %s; baseline %r, walk %r" % (popup, DEADLINE_S, "; ".join(problems), before, seen["after"])
|
||||
finally:
|
||||
chrome.close()
|
||||
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user