Compare commits
86
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67b2ad3188 | ||
|
|
fe50cdc118 | ||
|
|
e4aa743af3 | ||
|
|
5298149cd0 | ||
|
|
9140845e4d | ||
|
|
cb67c18332 | ||
|
|
652c911514 | ||
|
|
229cfb7da2 | ||
|
|
3259840c7c | ||
|
|
c39a976a44 | ||
|
|
df35204915 | ||
|
|
de9c19b578 | ||
|
|
678978399c | ||
|
|
310b88e81d | ||
|
|
6f84d62290 | ||
|
|
eb2629fea1 | ||
|
|
465386fd7d | ||
|
|
ce55e15e60 | ||
|
|
21b5276c4d | ||
|
|
abfc2d2764 | ||
|
|
025ae12b72 | ||
|
|
28841856d0 | ||
|
|
9ba446ed3c | ||
|
|
5e535d9faa | ||
|
|
0c43c7ec60 | ||
|
|
08f7fd91c7 | ||
|
|
90449bbdb2 | ||
|
|
dbdd7c7c6d | ||
|
|
244fdcf0a8 | ||
|
|
53b5a1ef17 | ||
|
|
eef12eb659 | ||
|
|
54ce892a60 | ||
|
|
f3f35ea0c3 | ||
|
|
11c1b4573f | ||
|
|
8a6ef83ef4 | ||
|
|
4b97532753 | ||
|
|
67648a9eb6 | ||
|
|
b4f7cde592 | ||
|
|
fb8a407084 | ||
|
|
603ca155c9 | ||
|
|
d12d722975 | ||
|
|
c5709c6bd8 | ||
|
|
b39b7f65e1 | ||
|
|
1d21e84954 | ||
|
|
6e3e166bb7 | ||
|
|
91346ececc | ||
|
|
cccef5dadb | ||
|
|
bb610da22e | ||
|
|
c3c1fcee2a | ||
|
|
c1b9c5392d | ||
|
|
cb31015dd5 | ||
|
|
6834f16734 | ||
|
|
d348c347f6 | ||
|
|
fe26fca02c | ||
|
|
2206289d7e | ||
|
|
3b362bab4b | ||
|
|
020fe74328 | ||
|
|
250ac6919d | ||
|
|
444cf1128d | ||
|
|
2703848a44 | ||
|
|
7369fffa53 | ||
|
|
e02024933a | ||
|
|
5140ecd424 | ||
|
|
c39077a050 | ||
|
|
d1cf338a2f | ||
|
|
411c2ad6ae | ||
|
|
8ca47cba13 | ||
|
|
e2e1c49db6 | ||
|
|
041010070c | ||
|
|
9ea819445f | ||
|
|
2ec1a9026b | ||
|
|
f0d25a86ff | ||
|
|
ca0c6e33f8 | ||
|
|
46cf6a579a | ||
|
|
0a031d2688 | ||
|
|
a9e56c0b21 | ||
|
|
04b7a79b66 | ||
|
|
2c5cd5ea79 | ||
|
|
877027f9f4 | ||
|
|
0e48424da8 | ||
|
|
43e1b355a3 | ||
|
|
ebfd0fa573 | ||
|
|
b699439355 | ||
|
|
7031c911c7 | ||
|
|
464e0b132b | ||
|
|
c2c3d3c289 |
No files matched your search
@@ -24,3 +24,7 @@ tests/gates/wire_method_debt.json text eol=lf
|
||||
|
||||
# The lock of the gate is hashed byte for byte: its header names the sha256 of gate.in, so neither file may be rewritten with CRLF on a Windows checkout.
|
||||
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
|
||||
@@ -22,6 +22,15 @@
|
||||
# Windows runner separates the two without asking anyone to stay off it
|
||||
# for six hours.
|
||||
#
|
||||
# A second use, chosen by the input `ab_network_webrtc_seed` (empty = the loop
|
||||
# above, as always): the network oracle's WebRTC walk of that seed, alone,
|
||||
# `runs` times for each engine of its A/A (the published engine twice). It
|
||||
# exists to tell two readings apart when the A/A of that walk differs from
|
||||
# itself in the number of TURN Allocate datagrams (scripts/ci_ab_network.py:
|
||||
# AB_NETWORK_HUNT): each repetition keeps every datagram with its time and its
|
||||
# STUN transaction id and the page's own ICE times (network/hunt/<engine>-<i>.json,
|
||||
# summary in network/hunt/summary.json). It decides nothing: the step exits 0.
|
||||
#
|
||||
# Doesn't start on its own: `workflow_dispatch` only. It's not a gate, it's
|
||||
# an investigation tool, and it must not be added to the required contexts.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
@@ -34,6 +43,10 @@ on:
|
||||
description: "How many runs at most (at 12% it takes ~18 for a 90% chance)"
|
||||
required: false
|
||||
default: "18"
|
||||
ab_network_webrtc_seed:
|
||||
description: "A seed (e.g. 4) to repeat ONLY the network oracle's WebRTC walk of, `runs` times for each engine of its A/A, instead of the e2e loop. Empty: the e2e loop."
|
||||
required: false
|
||||
default: ""
|
||||
os:
|
||||
description: "Where to hunt. windows-latest answers a DIFFERENT question: are the interaction retries seen on the dev machine the product or contention?"
|
||||
required: false
|
||||
@@ -75,6 +88,11 @@ jobs:
|
||||
needs: linux-deps-hunt
|
||||
if: ${{ !cancelled() && (needs.linux-deps-hunt.result == 'success' || needs.linux-deps-hunt.result == 'skipped') }}
|
||||
runs-on: ${{ inputs.os }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(inputs.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(inputs.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
# 18 runs of ~6 minutes plus install time. Deliberately generous: the
|
||||
# ceiling here must NEVER be the thing that stops the hunt, or we're back
|
||||
# to a killed job that explains nothing, which is the original defect.
|
||||
@@ -121,10 +139,29 @@ jobs:
|
||||
sudo apt-get $APT update
|
||||
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
|
||||
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
if: inputs.ab_network_webrtc_seed != ''
|
||||
run: python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json
|
||||
- name: Fetch the published firefox binary
|
||||
run: echo "FF=$(python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
|
||||
- name: The GeoIP database (made by the repository, same bytes every run)
|
||||
if: inputs.ab_network_webrtc_seed != ''
|
||||
run: python scripts/ci_lab_geoip.py build
|
||||
|
||||
# The hunt of the network oracle's WebRTC walk: instead of the loop below, never with it. `runs` is the number of repetitions per engine.
|
||||
- name: The network oracle's WebRTC walk of one seed, repeated (decides nothing)
|
||||
if: inputs.ab_network_webrtc_seed != ''
|
||||
env:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
AB_NETWORK_HUNT: webrtc:${{ inputs.ab_network_webrtc_seed }}:${{ inputs.runs }}
|
||||
run: |
|
||||
set -u
|
||||
if [ "$RUNNER_OS" = "Linux" ]; then PRE="xvfb-run -a"; else PRE=""; fi
|
||||
mkdir -p network
|
||||
$PRE python -u scripts/ci_ab_network.py ab --a-a --out network --published-binary "$FF"
|
||||
|
||||
- name: Loop until it catches one
|
||||
if: inputs.ab_network_webrtc_seed == ''
|
||||
env:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
INVPW_TEST_WATCHDOG_FILE: evidence/e2e-watchdog.log
|
||||
@@ -179,3 +216,12 @@ jobs:
|
||||
evidence/e2e-watchdog.log
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload the hunt of the network oracle's WebRTC walk
|
||||
if: always() && inputs.ab_network_webrtc_seed != ''
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: e2e-hunt-network-webrtc-${{ inputs.os }}-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
path: network/hunt
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
@@ -411,8 +411,41 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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
|
||||
- name: Install wrapper + test deps (the stock client is in the dev extra)
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
@@ -428,6 +461,18 @@ jobs:
|
||||
env:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
run: INVPW_BINARY_PATH="$FF" python -u -m pytest -m e2e -p no:cacheprovider -v tests/test_control_a_selects_all_in_a_field_e2e.py
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the tests saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: invpw-evidence-windows-control-a-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
path: ${{ runner.temp }}/invpw-evidence
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
|
||||
# THE SAME e2e ON WINDOWS (Federico, 12/11: every test of the product runs on Linux AND Windows; where Windows behaves
|
||||
# differently the test adapts to the system). Before this, 562 of the 808 e2e had never run on Windows in any round. The census
|
||||
@@ -457,8 +502,41 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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 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.
|
||||
@@ -522,6 +600,10 @@ jobs:
|
||||
path: ${{ runner.temp }}/e2e-junit-*.xml
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the tests saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -634,14 +716,51 @@ jobs:
|
||||
runs-on: windows-2022
|
||||
# the network oracle's own guard (2197 s, two engine runs: the measured runs 45121964904 and 45153612447 plus 25%) and the job's own steps, with room for a slow runner
|
||||
timeout-minutes: 50
|
||||
# TEMP and TMP on D:\a\_temp, as every Windows job that launches a browser (see e2e-windows): on C: the profiles saturate the disk.
|
||||
env:
|
||||
TEMP: 'D:\a\_temp'
|
||||
TMP: 'D:\a\_temp'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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
|
||||
- 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
|
||||
@@ -684,6 +803,10 @@ jobs:
|
||||
run: |
|
||||
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
||||
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the test saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -816,14 +939,51 @@ jobs:
|
||||
if: needs.core-on-index.outputs.available == 'true' && inputs.only != 'windows-control-a'
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 45
|
||||
# TEMP and TMP on D:\a\_temp, as every Windows job that launches a browser (see e2e-windows): on C: the profiles saturate the disk.
|
||||
env:
|
||||
TEMP: 'D:\a\_temp'
|
||||
TMP: 'D:\a\_temp'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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
|
||||
- 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
|
||||
@@ -932,6 +1092,10 @@ jobs:
|
||||
run: |
|
||||
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
||||
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the test saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -1045,14 +1209,51 @@ jobs:
|
||||
if: needs.core-on-index.outputs.available == 'true' && inputs.only != 'windows-control-a'
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 45
|
||||
# TEMP and TMP on D:\a\_temp, as every Windows job that launches a browser (see e2e-windows): on C: the profiles saturate the disk.
|
||||
env:
|
||||
TEMP: 'D:\a\_temp'
|
||||
TMP: 'D:\a\_temp'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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
|
||||
- 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
|
||||
@@ -1095,6 +1296,10 @@ jobs:
|
||||
run: |
|
||||
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
||||
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the test saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -1234,6 +1439,10 @@ jobs:
|
||||
if: needs.core-on-index.outputs.available == 'true' && needs.e2e-page-final-touched.outputs.touched == 'true'
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 40
|
||||
# TEMP and TMP on D:\a\_temp, as every Windows job that launches a browser (see e2e-windows): on C: the profiles saturate the disk.
|
||||
env:
|
||||
TEMP: 'D:\a\_temp'
|
||||
TMP: 'D:\a\_temp'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -1244,8 +1453,41 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
# The runner's screen (1024x768 by default) is smaller than the browser window the e2e open (1936x1048 for a 1920x1080 identity), so the
|
||||
# OS cursor cannot be parked outside it (tests/_os_cursor.py) and a native move for it reaches the page. 1920x1080 is the largest mode the
|
||||
# runner's video device accepts (run 45730213378 of oss-invisible/playwright): it leaves the strip below the window free. Declared here, read back.
|
||||
- name: The runner's screen is 1920x1080, larger than the browser window is tall (read back)
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$b = [System.Windows.Forms.SystemInformation]::VirtualScreen
|
||||
"the runner's screen: $($b.Width)x$($b.Height) at $($b.X),$($b.Y)"
|
||||
if ($b.Width -lt 1920 -or $b.Height -lt 1080) { Write-Error "the runner's screen is $($b.Width)x$($b.Height), not 1920x1080: the OS cursor could not be parked outside the browser window"; exit 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
# The native crash of the pytest worker ("node down: Not properly terminated", "Windows fatal exception: access violation" in a thread Python has no state for, jobs
|
||||
# 138402013609 and 138966622085): Windows Error Reporting writes a FULL dump of a python.exe that dies from an unhandled exception, into the evidence folder the job
|
||||
# uploads (dumps/python), so the faulting module and stack can be read. HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\<image>, DumpType 2 = full,
|
||||
# DumpCount = how many are kept: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps . faulthandler (pytest enables it) is a vectored handler that
|
||||
# returns EXCEPTION_CONTINUE_SEARCH, so WER still sees the exception. BEFORE the first pytest step; the summary step before the upload reads what it left.
|
||||
- name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$dumps = Join-Path $env:RUNNER_TEMP 'invpw-evidence\dumps\python'
|
||||
New-Item -ItemType Directory -Force -Path $dumps | Out-Null
|
||||
$wer = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting'
|
||||
New-Item -Force -Path $wer | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name Disabled -PropertyType DWord -Value 0 | Out-Null
|
||||
New-ItemProperty -Force -Path $wer -Name DontShowUI -PropertyType DWord -Value 1 | Out-Null
|
||||
$key = "$wer\LocalDumps\python.exe"
|
||||
New-Item -Force -Path $key | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpFolder -PropertyType ExpandString -Value $dumps | Out-Null
|
||||
New-ItemProperty -Force -Path $key -Name DumpType -PropertyType DWord -Value 2 | Out-Null
|
||||
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
|
||||
- name: Install wrapper + test deps (+ Playwright ONLY as a system tool)
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
@@ -1284,6 +1526,10 @@ jobs:
|
||||
run: |
|
||||
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
||||
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
|
||||
- name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: python scripts/ci_wer_dumps.py "$RUNNER_TEMP/invpw-evidence/dumps/python"
|
||||
- name: Upload what the test saved
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
|
||||
@@ -69,6 +69,11 @@ jobs:
|
||||
needs: [core-on-index, linux-deps-fakeweb]
|
||||
if: needs.core-on-index.outputs.available == 'true'
|
||||
runs-on: ${{ matrix.runner }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -50,6 +50,11 @@ jobs:
|
||||
needs: core-on-index
|
||||
if: needs.core-on-index.outputs.available == 'true'
|
||||
runs-on: ${{ matrix.os }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: 'D:\a\_temp'
|
||||
TMP: 'D:\a\_temp'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -164,7 +164,11 @@ jobs:
|
||||
fail-fast: false # one system failing must not hide the other's table
|
||||
matrix:
|
||||
os: [ubuntu-24.04, windows-latest]
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
VERSION: ${{ needs.plan.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
@@ -272,6 +276,11 @@ jobs:
|
||||
needs: [plan, linux-deps-real-sites]
|
||||
if: needs.plan.outputs.admission == 'true'
|
||||
runs-on: ${{ matrix.os }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -171,6 +171,11 @@ jobs:
|
||||
needs: core-on-index
|
||||
if: needs.core-on-index.outputs.available == 'true'
|
||||
runs-on: ${{ matrix.os }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -91,6 +91,11 @@ jobs:
|
||||
needs: linux-deps-user-install
|
||||
name: ${{ matrix.os }} - install from ${{ github.event.inputs.source || 'index' }} and launch
|
||||
runs-on: ${{ matrix.os }}
|
||||
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
|
||||
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
|
||||
env:
|
||||
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false # one OS failing must not hide the other's result
|
||||
@@ -103,12 +108,15 @@ jobs:
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
|
||||
with: { python-version: '3.11' }
|
||||
|
||||
# Only what the TEST needs (and `uv`, for the wait below to ask uv, which the release test installs the package with). The package under test is installed by the
|
||||
# Only what the TEST needs, from the wrapper's hashed lock (ci/py-lock/gate.txt), the one the other test jobs read: never a hand list, which is how
|
||||
# `psutil` (imported by the OS-cursor helper of the tests since #609) was missing here and ledger #618 was red. The lock holds `uv` (the wait below asks it, and the
|
||||
# release test installs the package with it) and holds neither invisible-playwright nor invisible-core: the package under test is installed by the
|
||||
# test itself, into a venv it creates, from the index - installing it
|
||||
# here as well would put a second copy on the path and the assertions
|
||||
# would be reading the wrong one.
|
||||
# would be reading the wrong one. The runner's own pip, nothing unhashed.
|
||||
# A rule test of the unit suite (the install job has every module its tests import) holds every third-party module the tests import to that lock.
|
||||
- name: Test harness only
|
||||
run: python -m pip install --upgrade pip pytest packaging uv
|
||||
run: python -m pip install --require-hashes -r ci/py-lock/gate.txt
|
||||
|
||||
# ⛔ THE VERSION OF A LEDGER PULL REQUEST IS THE ONE IT ADDS TO PUBLISHED.json, NOT THE ONE THE TREE DECLARES.
|
||||
# The ledger PR of a release is merged after this job is green, and the next release's tree can already be on main: ledger #534 recorded
|
||||
|
||||
+8
-1
@@ -4,10 +4,17 @@ 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).
|
||||
|
||||
## [0.59.1] - 2026-11-25
|
||||
## [0.60.0] - 2026-11-27
|
||||
|
||||
### Changed
|
||||
- Pins invisible-core 70.83.0 on the engine firefox-70 (Firefox 159.0).
|
||||
- The engine carries Firefox's fix for the race between the start and the shutdown of its telemetry (Glean): a browser closed while it was
|
||||
still starting no longer leaves that work half done.
|
||||
- ElementHandle pointer actions (`click`, `dblclick`, `hover`, `tap`, `check`, `uncheck`, `set_checked`) now use the same humanised pointer walk as selector actions (they used to jump to the exact centre of the element in one move).
|
||||
- Screenshot parameters that Playwright honours by modifying the page (`mask`/`maskColor`, `style`, `animations="disabled"`,
|
||||
`caret="initial"`) are now refused by name with a clear error instead of being silently ignored; `omitBackground` with PNG answers
|
||||
Firefox's own `Not implemented`, as stock Playwright does. A refused screenshot of an element or a locator is refused before the page is
|
||||
scrolled or measured.
|
||||
|
||||
## [0.59.0] - 2026-11-24
|
||||
|
||||
|
||||
+795
@@ -45048,6 +45048,801 @@
|
||||
}
|
||||
},
|
||||
"wheel_filename": "invisible_playwright-0.59.0-py3-none-any.whl"
|
||||
},
|
||||
{
|
||||
"published_at": "2026-11-27T04:50:51Z",
|
||||
"requires_dist": [
|
||||
"greenlet<4.0.0,>=3.1.1",
|
||||
"invisible-core==70.83.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": "6a1d3e424c8d389cf75cbdec33a0c9144948fe6633eccb2e364ccd84f692a1ba",
|
||||
"files": {
|
||||
"LICENSE": "2abb03e63a96918967f383cbc36e3faefe10a47ae20b2cab43212ef965e02f96",
|
||||
"PKG-INFO": "f374a11bcc9be054d30229fe7515237150f2b889a0690d3318906cc1a7debb86",
|
||||
"README.md": "2114ecc63ee45954a88b4d91d3e11f01e416f40810a3d71963f3d5d986d4cf67",
|
||||
"docs/README.md": "ae694f21758d2b80d1dc8eb4d13867d7241ca80fb4137c0ead03e7af799b7192",
|
||||
"docs/integrations/README.md": "d9d4a01c5ce0b3a94123653bf8e78283113cae0a6ec22ba0bc2a2a77baf8ea19",
|
||||
"pyproject.toml": "64c93d06773cc6573cd062fe67b1c852d2a36b07426ea7076632900eebe956a1",
|
||||
"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/_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/_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/_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_geometry.py": "e971c9a05db7b4655fee554edc682a7143c1fa170d5fa5a7bdc38bd8019317a2",
|
||||
"tests/_ports.py": "318c91399b6397395df993f55c5109e06d2b25b351d93d73d19369825d445202",
|
||||
"tests/_post_publication.py": "a7009a34d0b0a22f9eab18904d638becb3b776117843e70e59081d417905be40",
|
||||
"tests/_process_sampler.py": "686f6d303f6f8372a700ab812637e082000e2591364792411b871ce2e0bbae19",
|
||||
"tests/_processes.py": "c7a9bda6836a62679c6f9bea65e735df13c3c135ceb3820bcc8b455687df0672",
|
||||
"tests/_realness_support.py": "3b2413ad78be0742f7689e99293b508938bdcd1eeb57ff15a9f9b91f18edd0f7",
|
||||
"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/_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/_webgl_unavailable.py": "2c12948840005a6645e57f9c11883f20dec826369e54c2f77eeb0fc15eafb172",
|
||||
"tests/_window_sessions.py": "60d383210b93a3d920b51b3e504339ce711d62692dad40592a63214dd93b328c",
|
||||
"tests/_wire_capture.py": "cb5434b43cd0366154c14f6b1a94234e679ec21ff067b77538ae382b2e8f3b84",
|
||||
"tests/_witness.py": "e3bf4f0c8a377daa5a51d52194e774b2d7be66e08eb573315dd6b7146b474c87",
|
||||
"tests/_x_visibility.py": "2c4e88ec1fae2dcdd793f07c4a21b5cbb3aacafbce928f155049be75bcc101e9",
|
||||
"tests/conftest.py": "820cb8dc79d87f397421d97be58853cf196f2633fd788e340808fbbf65c1488e",
|
||||
"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": "e949fb5898c9d14cfb76c49507004168585af463a12722296ca6876c7815408a",
|
||||
"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_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_tap_needs_a_context_with_touch.py": "58fa6e7c0df34f33c9d2c52e684744bd52f83d1432d7bce3dc59159a99e87de4",
|
||||
"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_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": "4f0d0ddee18bbac04c0d467be975ccd6dc546860c6ac028dd12d9d7b1afc97ec",
|
||||
"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_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_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_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": "4427893f278793806efcb2151678df4f5579a5991acca8f59ea4fc827c45837d",
|
||||
"tests/test_ab_host_aa_stable.py": "c16986a76c890348634d41a0444e61c91bd25692ec4ce35fbc2d0a754784bff1",
|
||||
"tests/test_ab_host_crash_linux_e2e.py": "225c865b605356f478f73cd92550e7e9675079a425b6b0159886dfc1f492056d",
|
||||
"tests/test_ab_host_e2e.py": "4f0ac0961c702f0b922ffc2ebe8b08616f7a906f7569fb760363738d5065996d",
|
||||
"tests/test_ab_network.py": "9f921e590df94e66623ad67c8525a478f5d839823add40a1ef6c2a9a3a4986c1",
|
||||
"tests/test_ab_network_e2e.py": "75216132f603bcff5c8df498d2b7e1419781aeaa7203bfad2026dfea40ba55f9",
|
||||
"tests/test_ab_network_turn_credential.py": "e4d354a1b02f63934e08a87b0405d828793cc4a39ff5ce1bc773b460ceb05d55",
|
||||
"tests/test_ab_network_turn_deallocation.py": "b04b7114fce80182b9bbe58a4611ac31c2fb51b2697269ac2afc2c0ebb5c8f0b",
|
||||
"tests/test_ab_network_webrtc_evidence.py": "f049c8ae595fb81513bf2182150a4265d35e256ef377be9f7d8988aadb5a8adb",
|
||||
"tests/test_ab_oracle.py": "97fc316702256be92cb55977012e9c4d6b023dd23750139e2593e7e5b6aa132f",
|
||||
"tests/test_ab_oracle_e2e.py": "7f63c5f1340683151db3b8cf2509a179eff1afa4ba2e85ab85f11b21d5cf2789",
|
||||
"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": "dc4e76634a0caf1a85f0b17a29355409a86bf3a53229ee46827d3a1e5c6fcfe9",
|
||||
"tests/test_canvas_measure_text_metrics_e2e.py": "d0117d6ff5c1d83028857d00267d705f2e2aca1f7e69bdb77c6c8db5b299b997",
|
||||
"tests/test_canvas_reads_as_drawn.py": "a43318e5a64635cd9e5c05c167d4f99ac62afc76d13c63cf71678f9f67c8e510",
|
||||
"tests/test_canvas_render_stealth.py": "fb43cfd2cf77c91fdb836d1b9cce874c16486df9ceae0ba89e999fdd8ad2c14e",
|
||||
"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": "da1356d8a5f0ddfa9422fd5bc0505e3008928d5a0d12232a9927b2994246a790",
|
||||
"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": "b56f0f076efcf4cb021aea361cb8c91bbde6044625f3ccea9e747c6c7bf744cd",
|
||||
"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": "86a48cae0a462e62f34179059cea8e60e4683fbbb3b6bfca5bb447f9893f0915",
|
||||
"tests/test_declared_host_network_e2e.py": "18b667477a7bba7151a7b0b0b0df0fd6109fcc9a303e954ba7438a541daf27aa",
|
||||
"tests/test_detectors_e2e.py": "476fa9fd40bfb3d1e544a950efa7251f70a5eb650598ffc7912015d438cbf6e4",
|
||||
"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_draws_its_own_acts.py": "3a1f821d191e9c92b25e95f293094315cf9218f7e7083d08c0301a5824c2472f",
|
||||
"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_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": "b6da7f73a6fdd5ebf4297ee7f976ff0ca028493e40decd1be47b863b8dff5093",
|
||||
"tests/test_fingerprint_surface.py": "b23d1039caefd3d51910acf171c52de732e79cf26fc090a7863db80c28bbd1e9",
|
||||
"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": "7f2765991b2517d31480825bed118b2b2bdc7013f0d43158b22ee7a64c61230a",
|
||||
"tests/test_fission_identity_parity_e2e.py": "9b5eb515f8758fb29aa6d6017d3f0a19b1ce3ad75d5134f0c391938d03653d7d",
|
||||
"tests/test_fission_iframe_crash_e2e.py": "e64583b724671f81c796eebbcfa9667ae61f8732cd2f8d23cfae7675ab319a78",
|
||||
"tests/test_fission_strategy1_bench.py": "9193bb6a7067165df23d0fa7e40df923e0d02ab0e0529aa049b9eedf6c4b53b0",
|
||||
"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_integration.py": "39859483ad6fb2fed8137fb2c9310833248daf5d298ab35ed677c87fa5d47fe6",
|
||||
"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": "bbeb14ebc08e7b471f7ef8db32b91c945f0b444870f30e197c1ac5695fa55547",
|
||||
"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_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": "e91d379cf7f59fc72dd0954a0695a589c3bcc85e0d525c746db9e0bcd4a2bd53",
|
||||
"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": "1f1a6116aa8104f3c4afe4237f3a4c345dc50b92b26e9b3521bade5e09e2b9e5",
|
||||
"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": "c4f213a9d75577b84e64795c0da9fc57318acd2b536a6ce63d8968ad90a79850",
|
||||
"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_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_e2e_run_stops_at_the_first_engine_refusal.py": "0f29e035ee261be18d2d7d2250c6da072e7a35ea024525be4eeb6716d0dd0772",
|
||||
"tests/test_the_e2e_suite_is_accounted_for.py": "15258c4a43e3e0572f38eca03df5ce50c59e2cd2da7e583c251b952b2e5d4c13",
|
||||
"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_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": "6ac2e72aa16758488042fda6f8bea2be2dbb43406558801a2ab7c2ffc52c00f1",
|
||||
"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_waits_for_the_index.py": "00aded6450438c7ff6ace7915cccbf905128fc12643efadae2c95151ab318112",
|
||||
"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_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_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": "ce306b20ea74414d2915ea0493747d5d4560bf0b4d428b77754150bd80138c6c",
|
||||
"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_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_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": "f3301eafe09a6e915f4c78dc77c2026dee67556ee1dbd84f52b1691e63c79837",
|
||||
"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_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": "9b8c284e2f49d0a83ee2d76fe95ab0773a075d9cb8f0fb4ca80ba6da9027adf2",
|
||||
"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": "bb1caa5eee49194e5fa18b2c067122e6ff4e9f3c5bd88f544b982d11bfcf2cf4",
|
||||
"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": "551b2c2337690f908914ef1a7a1ed2385bdde5ddf444ae1410d9cee464403681",
|
||||
"tests/vendor/botd-2.0.0.esm.js": "f438ed251dc7414ece9d4a2b6941441ad9ffae1a1905817f5f0c7366e701dd86",
|
||||
"tests/vendor/creepjs-10aa672.js": "80f43f364bd973bc03cb5b82de033ce28b2bbb145cb04237632a46ef040a92be",
|
||||
"tests/vendor/fingerprintjs-5.2.0.umd.min.js": "a8de5ead580c42d2e2b01a5752aa08da510852230971aa18554d67cd5de5775b",
|
||||
"tests/vendor/fpscanner-1.0.6.es.js": "5680b88e6075fceab5343d31b43dcb1892a98cff072d37084efdd244fd2cb809",
|
||||
"tests/webfont_probe.py": "2760fe5d0eb510555e8247219940c21ec84c25a07d9f3610238595a122ece76c"
|
||||
}
|
||||
},
|
||||
"sdist_filename": "invisible_playwright-0.60.0.tar.gz",
|
||||
"seal_tag": "",
|
||||
"version": "0.60.0",
|
||||
"wheel": {
|
||||
"digest": "3a54b876134eac8c3f439e2d2fbf41fdf52cc44ff6267b4f387413cf2716a2a8",
|
||||
"files": {
|
||||
"<dist-info>/METADATA": "f374a11bcc9be054d30229fe7515237150f2b889a0690d3318906cc1a7debb86",
|
||||
"<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.60.0-py3-none-any.whl"
|
||||
}
|
||||
],
|
||||
"schema": 1
|
||||
|
||||
+32
-32
@@ -6,7 +6,7 @@
|
||||
6,
|
||||
63
|
||||
],
|
||||
"core_version": "69.82.0",
|
||||
"core_version": "70.83.0",
|
||||
"counts": {
|
||||
"audio": {
|
||||
"audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2": 4315,
|
||||
@@ -50,9 +50,9 @@
|
||||
"ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0": 40144
|
||||
},
|
||||
"dpr": {
|
||||
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72": 70210,
|
||||
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90": 18299,
|
||||
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.maximized_ui=127|screen.popup_ui=106": 11491
|
||||
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31": 70210,
|
||||
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38": 18299,
|
||||
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45": 11491
|
||||
},
|
||||
"gfx_device": {
|
||||
"adliris_7085": 7197,
|
||||
@@ -156,9 +156,9 @@
|
||||
"ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0"
|
||||
],
|
||||
"dpr": [
|
||||
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90",
|
||||
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.maximized_ui=127|screen.popup_ui=106"
|
||||
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
|
||||
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45"
|
||||
],
|
||||
"gfx_device": [
|
||||
"adliris_7085",
|
||||
@@ -254,7 +254,7 @@
|
||||
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
|
||||
"cores": "hw_concurrency=12",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx5070_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -266,7 +266,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=22",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "uhd630_2145",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
|
||||
"render_noise": "fpp.hw_seed=6",
|
||||
@@ -278,7 +278,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=32",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.maximized_ui=127|screen.popup_ui=106",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
|
||||
"gfx_device": "rpl770_7092",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
|
||||
"render_noise": "fpp.hw_seed=16",
|
||||
@@ -290,7 +290,7 @@
|
||||
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
|
||||
"cores": "hw_concurrency=5",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "gtx980_58278",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=6",
|
||||
@@ -302,7 +302,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=24",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
|
||||
"gfx_device": "adliris_7085",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -314,7 +314,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=6",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "gtx1650_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=20",
|
||||
@@ -326,7 +326,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=20",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "uhd620_2145",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:d1db3983c9",
|
||||
"render_noise": "fpp.hw_seed=28",
|
||||
@@ -338,7 +338,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=8",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "renoir_21925",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=16",
|
||||
@@ -350,7 +350,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=14",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx3060_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=19",
|
||||
@@ -362,7 +362,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=16",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
|
||||
"gfx_device": "rx580_21925",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=20",
|
||||
@@ -374,7 +374,7 @@
|
||||
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
|
||||
"cores": "hw_concurrency=28",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "irisxe_7085",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
|
||||
"render_noise": "fpp.hw_seed=6",
|
||||
@@ -386,7 +386,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=4",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "icl_2145",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
|
||||
"render_noise": "fpp.hw_seed=11",
|
||||
@@ -398,7 +398,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=12",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "uhd630_2145",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -410,7 +410,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=8",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rx6600_32015",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -422,7 +422,7 @@
|
||||
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
|
||||
"cores": "hw_concurrency=4",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx5060_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=28",
|
||||
@@ -434,7 +434,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=8",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.maximized_ui=127|screen.popup_ui=106",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
|
||||
"gfx_device": "arl_6629",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:098c0bf836",
|
||||
"render_noise": "fpp.hw_seed=19",
|
||||
@@ -446,7 +446,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=3",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx5080l_61742",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=28",
|
||||
@@ -458,7 +458,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=12",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
|
||||
"gfx_device": "adliris_7085",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
|
||||
"render_noise": "fpp.hw_seed=19",
|
||||
@@ -470,7 +470,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=7",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.maximized_ui=107|screen.popup_ui=90",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
|
||||
"gfx_device": "rx7600_32015",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=11",
|
||||
@@ -482,7 +482,7 @@
|
||||
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
|
||||
"cores": "hw_concurrency=32",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.maximized_ui=127|screen.popup_ui=106",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
|
||||
"gfx_device": "rx7600_32015",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -494,7 +494,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=4",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx5060ti_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=11",
|
||||
@@ -506,7 +506,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=10",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "uhd770_7092",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
|
||||
"render_noise": "fpp.hw_seed=5",
|
||||
@@ -518,7 +518,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=9",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "rtx4060_62101",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
|
||||
"render_noise": "fpp.hw_seed=6",
|
||||
@@ -530,7 +530,7 @@
|
||||
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=false|media.decode_support=sha:960968735a",
|
||||
"cores": "hw_concurrency=2",
|
||||
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.maximized_ui=85|screen.popup_ui=72",
|
||||
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
|
||||
"gfx_device": "renoir_21925",
|
||||
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
|
||||
"render_noise": "fpp.hw_seed=9",
|
||||
@@ -562,5 +562,5 @@
|
||||
],
|
||||
"format": "persona-seeds/1",
|
||||
"max_seed": 100000,
|
||||
"sha256": "8de3d8a621389f707181b9c9569b4d3266931e26f4cb3ea6b64e8f40f3e9dc29"
|
||||
"sha256": "82547e9f34ece0c17075d812dcc009c7e8e6f348eb33fb4cc5cdbff6253cc4f0"
|
||||
}
|
||||
+4
-2
@@ -1,11 +1,12 @@
|
||||
# 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 3b2ba212158746aeb37a92a36d013b31327d4b5ecf1d2806f19810cccc2f1a37 (at generation); its dependencies without invisible_core, and its `dev` extra
|
||||
# core: invisible_core==69.82.0, tag v69.82.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 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
|
||||
# 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)
|
||||
# harness: uv>=0.5 (the installers of the install-from-index job)
|
||||
aioquic>=1.2
|
||||
build>=1
|
||||
cryptography==44.0.3
|
||||
@@ -23,4 +24,5 @@ pytest-xdist>=3
|
||||
requests[socks]>=2.31
|
||||
ruff>=0.6
|
||||
tzdata>=2024.1
|
||||
uv>=0.5
|
||||
websockets>=13
|
||||
+21
-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 31b110a3356c66a0cb6e9a56b5f27849541f9956ed813b73516e13965ae64081
|
||||
# input: ci/py-lock/gate.in sha256 fc40deb4a528db91e487756180b44cfc8d6c9a1f64d548c1e8746e1cacf483e9
|
||||
# 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>
|
||||
@@ -668,6 +668,26 @@ tzdata==2026.6 \
|
||||
urllib3==2.8.0 \
|
||||
--hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \
|
||||
--hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63
|
||||
uv==0.13.10 \
|
||||
--hash=sha256:19a76fd50a6a2bba38ee088d8336566856569be08196865f98132a08806581fc \
|
||||
--hash=sha256:2a9ff188b442419c7aadebc445fcc1f287b25f99af50fa6d563b90cc0047b7cf \
|
||||
--hash=sha256:30e75714a9cff3aa56281c7bf533a4e93cb5bdfcc0325d3aae54b9106460bd63 \
|
||||
--hash=sha256:3bf1c1b13cac2533a342ca16b1c5f41347cd399404c9477a04ff79c5f7cb4dea \
|
||||
--hash=sha256:50bee2a59ea9422b493aabc0cde9288f58fbcf6e8d688c30c4ecd8309459cac1 \
|
||||
--hash=sha256:5bcf77c50760146ff7b41022ab7aeb1954d42dd47b89fad36b43a1a8a43da994 \
|
||||
--hash=sha256:771a749b34477501092c9fe6d5e52f45cef944d875b0f2e2c989047a2ee647ab \
|
||||
--hash=sha256:7cc9c41b43d583e34c781fd3446405b06e9c5fa2db468ce2a534d353db6429e5 \
|
||||
--hash=sha256:7fa025c4b0f33b9a5357252e1be058d94157e13bfb8ae45d7e27cfce3759c65d \
|
||||
--hash=sha256:8b0a15613aae9a3e1c134bb5ee706583af0addced7eb1add992f8b1b3e3a92a0 \
|
||||
--hash=sha256:a52ee170c00d4de1d42026c4dbb00c5d7f327edcf2b2bddeecd0cfb169868ac7 \
|
||||
--hash=sha256:a9636b4430a9b8a37ecc4d85111d1fd2560ef616edf5301b84f474073bf89e2f \
|
||||
--hash=sha256:bf7174b00c88879d4a1019b51256bbdb2dd61c55c7dc896031e16d090e380ce6 \
|
||||
--hash=sha256:c85a2ecb62d09d61904f5405b525fcc51f971d081f8508a881fa2f9bae7543a7 \
|
||||
--hash=sha256:d87b9cf8165f2b3cc596e856b5bf794da9cfad6d1b110ca9d87eed42a15b3684 \
|
||||
--hash=sha256:e52a1af7f97b717572f9e2bd69e54eb253b2c88a705500e35811c21106c439d4 \
|
||||
--hash=sha256:e89dd26ea831dde70639ba0a798fa04a4c7c0226fd2b241da86218bfa370e495 \
|
||||
--hash=sha256:ee3bca6523ed93c3ae0d1a90c2733be307f5f7cc5287c746214e93a3bae0da13 \
|
||||
--hash=sha256:ee403b6bbcfda1bc7db269be5c40c1624df27b3b838d3f8a416648e00e2de5d4
|
||||
websockets==17.4 \
|
||||
--hash=sha256:00ad98e4bb0df7a6711c645eec16d5a9fdf99f0692bd4f5b6cb85a68677ba8df \
|
||||
--hash=sha256:0132e3cbd3f5cfc1ec77588961b302d72a02e2603b82c2c23fd5fb59dc4fa206 \
|
||||
|
||||
@@ -6,24 +6,25 @@
|
||||
{"id": "wrapper.e2e.doh", "giro": "G2", "os": ["linux", "windows"], "min_tests": 19, "exact": true, "tests": ["tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_ice_names_by_the_context_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Linux needs root: the resolver trap of the file (ResolverTrap) points /etc/resolv.conf at a counting resolver on port 53. Su Windows il resolver trap non gira: l'asserzione sul resolver di sistema è l'unica omessa. Run it without xdist (port 53 is one per host). On the Linux leg the gate exports INVPW_REQUIRE_TRAP=1: a trap that cannot run or bind port 53 is a failure, not a skipped assertion."},
|
||||
{"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": 32, "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.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.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.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": 3719, "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_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_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_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_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_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_glean_ready.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_intLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 3720, "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_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_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_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_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_wire_method_is_served_or_refused.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fakeweb_stock_unsettled.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_glean_ready.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/testLine truncated
|
||||
{"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.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": 415, "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_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_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_Line truncated
|
||||
{"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": 313, "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_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_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_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_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": 299, "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_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.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.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": 274, "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_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_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_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_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.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.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"]},
|
||||
|
||||
@@ -8,5 +8,10 @@
|
||||
{"file": "tests/unit/test_canvas_text_refs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 7, "wrapper.unit.all.windows": 7}},
|
||||
{"file": "tests/unit/test_compare_canvas_text_runs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}},
|
||||
{"file": "tests/unit/test_fontconfig_criterion.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 5, "wrapper.unit.all.windows": 5}},
|
||||
{"file": "tests/unit/test_theme_refusal_drop.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}}
|
||||
{"file": "tests/unit/test_theme_refusal_drop.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}},
|
||||
{"nodeid": "tests/test_detectors_e2e.py::test_the_headless_detector_sees_no_headless_and_no_proxy_tell", "suite": "wrapper.e2e.suite.linux.1", "count": 1, "from_min_tests": 449, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
|
||||
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.suite.linux.1", "count": 1, "from_min_tests": 449, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
|
||||
{"nodeid": "tests/test_detectors_e2e.py::test_the_headless_detector_sees_no_headless_and_no_proxy_tell", "suite": "wrapper.e2e.suite.windows.1", "count": 1, "from_min_tests": 333, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
|
||||
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.suite.windows.4", "count": 1, "from_min_tests": 274, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
|
||||
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.realness", "count": 1, "from_min_tests": 32, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"}
|
||||
]
|
||||
+2
-2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "invisible_playwright"
|
||||
version = "0.59.1"
|
||||
version = "0.60.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==69.82.0",
|
||||
"invisible_core==70.83.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
|
||||
|
||||
+506
-34
@@ -49,6 +49,11 @@ under ``exits``, outside the leaves that are compared, and a parent that did not
|
||||
the side, the seed, the launch and the code. What a launch that died left is kept beside the transcript (``transcript-68.json`` -> ``transcript-68.crash/``): the core through gdb with
|
||||
the build ids, the ``.extra`` and the minidump names, ``said.txt`` for what the collectors did not find. This oracle runs no strace (a trace would change the outcome it observes).
|
||||
|
||||
THE WEBRTC EVIDENCE AND THE HUNT. The WebRTC walk keeps, under ``transcript["evidence"]["seeds"][<seed>]["webrtc"]`` (never compared: the comparison reads ``seeds`` and nothing else), every datagram the gateway
|
||||
routed in it (when, target, message, STUN transaction id), the moments of its stages and of the page's call, and the page's own ``performance.now()`` at each step of the gather. With
|
||||
``AB_NETWORK_HUNT=webrtc:<seed>:<n>`` the command ``ab`` runs ONLY that walk of that seed, ``n`` times for each engine of the A/A, and writes ``<out>/hunt/<engine>-<i>.json`` and ``<out>/hunt/summary.json``;
|
||||
it decides nothing and exits 0 (e2e-hunt.yml: the input ``ab_network_webrtc_seed``).
|
||||
|
||||
Exit codes: 0 green, 1 red (a finding), 2 broken control (the A/A is red) or a run that could not run.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -79,6 +84,13 @@ import ci_crash_evidence as crash # noqa: E402 (how each launch's parent ended
|
||||
FORMAT = "ab-network/1"
|
||||
DIFF_FORMAT = "ab-network-diff/1"
|
||||
EVIDENCE_FORMAT = "ab-network-evidence/1"
|
||||
HUNT_FORMAT = "ab-network-hunt/1"
|
||||
HUNT_SUMMARY_FORMAT = "ab-network-hunt-summary/1"
|
||||
#: The environment variable that makes ``ab`` repeat one walk of one seed and nothing else (``cmd_hunt``): ``webrtc:<seed>:<n>``.
|
||||
HUNT_ENV = "AB_NETWORK_HUNT"
|
||||
#: The engine's own log in a hunt (the launch's environment, in hunt mode only): nICEr's reasons for accepting or rejecting an answer or ending a transaction, and the signaling.
|
||||
#: ``sync`` makes each line reach the file as it is written, so a process that ends (or is killed) loses none.
|
||||
HUNT_MOZ_LOG = "sync,timestamp,nicer:5,signaling:5"
|
||||
VOLATILE_FORMAT = "ab-network-volatile/1"
|
||||
VOLATILE_FILE = ROOT / "ci" / "ab-network-volatile.json"
|
||||
SEEDS_FILE = ROOT / "ci" / "persona-seeds.json"
|
||||
@@ -86,6 +98,11 @@ SEEDS_FILE = ROOT / "ci" / "persona-seeds.json"
|
||||
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
|
||||
#: MANY transactions a walk has is the engine's and is compared, and how many datagrams each took is the network's timing and is not: a
|
||||
#: transaction over this number is a problem of the run (``udp_summary``'s ``over_limit``, ``_udp_overruns``), never a compared leaf.
|
||||
STUN_MAX_TRANSMITS = 7
|
||||
#: What a leaf that one side does not have reads as.
|
||||
MISSING = "<missing>"
|
||||
#: A value longer than this in diff.json is replaced by its length and its sha256.
|
||||
@@ -267,6 +284,68 @@ def _udp_attribution(la: Dict[str, Any], lb: Dict[str, Any]) -> Tuple[set, List[
|
||||
return paths, differences, unattributed
|
||||
|
||||
|
||||
_UDP_OVER_LIMIT = re.compile(r"^(?P<where>.*/udp)/over_limit/(?P<target>[^/]+)/\d+$")
|
||||
|
||||
|
||||
def _udp_overruns(la: Dict[str, Any], lb: Dict[str, Any], label_a: str, label_b: str) -> Tuple[set, List[str]]:
|
||||
"""The STUN transactions that were sent more times than the engine's maximum (``udp_summary``'s ``over_limit``: per destination, the number of transmits of each such
|
||||
transaction). They are not compared leaf by leaf: how many datagrams a transaction took is the network's timing, but more than the engine's own maximum is not
|
||||
timing, it is a client that does not stop. Returns the paths that take part and one problem line for each."""
|
||||
paths: set = set()
|
||||
problems: List[str] = []
|
||||
for label, leaves in ((label_a, la), (label_b, lb)):
|
||||
for path, value in sorted(leaves.items()):
|
||||
m = _UDP_OVER_LIMIT.match(path)
|
||||
if m:
|
||||
paths.add(path)
|
||||
problems.append("%s: a STUN transaction to %s was sent %s times, more than the engine's maximum of %d transmits (%s)"
|
||||
% (label, m.group("target"), value, STUN_MAX_TRANSMITS, m.group("where")))
|
||||
return paths, problems
|
||||
|
||||
|
||||
def turn_path_problems(transcript: Dict[str, Any], label: str) -> List[str]:
|
||||
"""Whether the TURN path of the lab WORKED in each WebRTC walk of a transcript: a relay candidate was made, no error names the lab's TURN server (701 is what a browser reports when
|
||||
every answer it got was thrown away as invalid, as with a wrong credential), and the server refused no request (``webrtc/turn/refused``, written by ``walk_webrtc``). An A/A that
|
||||
compared two runs in which the TURN path failed the same way would pass; this is the line that says it did not work. A transcript with no WebRTC walk says nothing."""
|
||||
out: List[str] = []
|
||||
for seed, body in sorted((transcript.get("seeds") or {}).items()):
|
||||
walk = body.get("webrtc")
|
||||
if not isinstance(walk, dict):
|
||||
continue
|
||||
errors = [e for e in walk.get("errors") or [] if TURN_TARGET in str(e)]
|
||||
refused = (walk.get("turn") or {}).get("refused") or 0
|
||||
if "relay" in (walk.get("candidate_types") or []) and not errors and not refused:
|
||||
continue
|
||||
seen = (errors + ["the lab TURN refused %d request(s)" % refused] * bool(refused)) or ["no error"]
|
||||
out.append("seeds/%s/webrtc: %s made no relay candidate through the lab TURN (%s). Fix: the probe's credential must be the lab TURN's (tests/_turn_chain.py PASSWORD) "
|
||||
"and the lab's answers must reach the browser. Rule: the A/A proves the TURN path it compares" % (seed, label, "; ".join(seen)))
|
||||
return out
|
||||
|
||||
|
||||
def turn_deallocation_problems(transcript: Dict[str, Any], label: str) -> List[str]:
|
||||
"""What the lab's TURN server heard of deallocations (``webrtc/turn/deallocation``, written by ``walk_webrtc`` with :func:`deallocation_facts`) that a walk must not have: an allocation ended
|
||||
by more than one deallocation, a deallocation from an address that has no allocation. One deallocation, or none, is the engine's best effort at teardown and is evidence, not a leaf; so is
|
||||
``early`` (see the comment below)."""
|
||||
out: List[str] = []
|
||||
for seed, body in sorted((transcript.get("seeds") or {}).items()):
|
||||
walk = body.get("webrtc")
|
||||
facts = ((walk or {}).get("turn") or {}).get("deallocation") if isinstance(walk, dict) else None
|
||||
if not isinstance(facts, dict):
|
||||
continue
|
||||
for key, what, fix in (("repeated", "%d allocation(s) of the lab TURN were ended by more than one deallocation (a Refresh with LIFETIME 0)",
|
||||
"find what sends the teardown twice; the engine sends it once"),
|
||||
("unallocated", "the lab TURN heard %d deallocation(s) (a Refresh with LIFETIME 0) from an address that has no allocation",
|
||||
"find what deallocates an allocation it never made; the lab's record is TurnServer.deallocations in tests/_turn_chain.py")):
|
||||
# ``early`` (a deallocation before the page began closing) is evidence, never a problem: the bound maps the page's performance.now() onto the recorder's clock,
|
||||
# and the page's clock is the engine's reduced-precision timer, not the recorder's. On Windows the published engine against itself was "early" on seeds 63 and 6
|
||||
# (wrapper #612's round, e2e (network, windows)), so the two events cannot be ordered on that mapping. Ordering them on one clock would take a marker the page
|
||||
# sends through the gateway before pc.close(), and that request would itself become a compared leaf of the walk.
|
||||
if facts.get(key):
|
||||
out.append("seeds/%s/webrtc: %s: %s. Fix: %s. Rule: the TURN deallocation is one best-effort send at teardown (nICEr nr_turn_client_deallocate)"
|
||||
% (seed, label, what % facts[key], fix))
|
||||
return out
|
||||
|
||||
|
||||
def exit_lines(transcript: Dict[str, Any], label: str, side: str) -> List[str]:
|
||||
"""The red lines of the launches of one side that did not end with 0 (``exits``, which ``run`` writes: scripts/ci_crash_evidence.py). A transcript that has no ``exits``
|
||||
was not made by ``run`` and says nothing about it; one that has it and no launch in it is a run whose probe saw no browser, which is red."""
|
||||
@@ -286,7 +365,11 @@ def compare_transcripts(a: Dict[str, Any], b: Dict[str, Any], volatile: List[Dic
|
||||
run the same seeds, when fewer than ``floor`` leaves were compared, or when an entry of the volatile list matches no leaf of either transcript (``stale``)."""
|
||||
la, lb = flatten(a.get("seeds") or {}), flatten(b.get("seeds") or {})
|
||||
attribution, attribution_differences, unattributed = _udp_attribution(la, lb)
|
||||
paths = sorted((set(la) | set(lb)) - attribution)
|
||||
overrun_paths, overruns = _udp_overruns(la, lb, label_a, label_b)
|
||||
turn_problems = (turn_path_problems(a, label_a) + turn_path_problems(b, label_b) +
|
||||
turn_deallocation_problems(a, label_a) + turn_deallocation_problems(b, label_b))
|
||||
refused_paths = {p for p in set(la) | set(lb) if re.match(r"^seeds/[^/]+/webrtc/turn/(refused|deallocation/(repeated|unallocated|early))$", p)}
|
||||
paths = sorted((set(la) | set(lb)) - attribution - overrun_paths - refused_paths)
|
||||
problems: List[str] = []
|
||||
if set(a.get("seeds") or {}) != set(b.get("seeds") or {}):
|
||||
problems.append("the sides ran different seeds: %s and %s" % (sorted(a.get("seeds") or {}), sorted(b.get("seeds") or {})))
|
||||
@@ -324,6 +407,8 @@ def compare_transcripts(a: Dict[str, Any], b: Dict[str, Any], volatile: List[Dic
|
||||
problems += ["a direct connection: " + d for d in direct]
|
||||
problems += exit_lines(a, label_a, "A") + exit_lines(b, label_b, "B")
|
||||
problems += invariants
|
||||
problems += overruns
|
||||
problems += turn_problems
|
||||
problems += ["the volatile entry %r matches no leaf of either transcript: it is stale, drop it" % p for p in stale]
|
||||
problems += ["%s: %s %s | %s %s" % (d["path"], label_a, json.dumps(d["a"], sort_keys=True)[:160], label_b, json.dumps(d["b"], sort_keys=True)[:160])
|
||||
for d in differences]
|
||||
@@ -468,17 +553,31 @@ def dns_summary(queries: List[Tuple[str, int, str]], openers: Optional[List[Opti
|
||||
|
||||
|
||||
def udp_summary(events: List[Dict[str, Any]], norm: Normalizer) -> Dict[str, Any]:
|
||||
"""The datagrams the relay carried in one phase: per destination, the kinds of message and how many."""
|
||||
"""The datagrams the relay carried in one phase: per destination, the kinds of message and how many.
|
||||
|
||||
``counts`` is the number of STUN TRANSACTIONS (distinct transaction ids) per destination, plus one for each datagram that is not STUN: a retransmission carries the
|
||||
transaction id of the request it repeats, and how many times a request is repeated is the timing of the network (the first RTO is 100 ms and doubles; a late answer
|
||||
on a loaded host adds one), so it is not what the engine decides. ``over_limit`` (only when there is one) lists, per destination, the transmits of each transaction
|
||||
that has more than ``STUN_MAX_TRANSMITS``: ``compare_transcripts`` reports it as a problem and never compares it."""
|
||||
kinds: Dict[str, set] = collections.defaultdict(set)
|
||||
counts: collections.Counter = collections.Counter()
|
||||
transmits: Dict[str, collections.Counter] = collections.defaultdict(collections.Counter)
|
||||
plain: collections.Counter = collections.Counter()
|
||||
order: List[str] = []
|
||||
for e in events:
|
||||
target = norm.text(e["target"])
|
||||
if target not in kinds:
|
||||
order.append(target)
|
||||
kinds[target].add(e["message"])
|
||||
counts[target] += 1
|
||||
out: Dict[str, Any] = {"order": order, "messages": {t: sorted(kinds[t]) for t in sorted(kinds)}, "counts": dict(sorted(counts.items()))}
|
||||
if e.get("tid") is None:
|
||||
plain[target] += 1
|
||||
else:
|
||||
transmits[target][e["tid"]] += 1
|
||||
counts = {t: plain[t] + len(transmits[t]) for t in sorted(kinds)}
|
||||
out: Dict[str, Any] = {"order": order, "messages": {t: sorted(kinds[t]) for t in sorted(kinds)}, "counts": counts}
|
||||
over = {t: sorted((n for n in transmits[t].values() if n > STUN_MAX_TRANSMITS), reverse=True) for t in sorted(kinds)}
|
||||
over = {t: v for t, v in over.items() if v}
|
||||
if over:
|
||||
out["over_limit"] = over
|
||||
who = _openers([norm.text(e["target"]) for e in events], [e.get("opener") for e in events])
|
||||
if who:
|
||||
out["openers"] = who
|
||||
@@ -544,6 +643,93 @@ def message_kind(payload: bytes) -> str:
|
||||
return "other"
|
||||
|
||||
|
||||
def stun_tid(payload: bytes) -> Optional[str]:
|
||||
"""The transaction id of a STUN message (bytes 8 to 20 of the datagram) in hex: what ties a retransmission to the request it repeats. None when the datagram is not STUN
|
||||
(the same test as :func:`message_kind`: the magic cookie at bytes 4 to 8). Written in the evidence of the WebRTC walk, never compared."""
|
||||
if len(payload) >= 20 and payload[4:8] == b"\x21\x12\xa4\x42":
|
||||
return payload[8:20].hex()
|
||||
return None
|
||||
|
||||
|
||||
def stun_attributes(data: bytes) -> Dict[int, bytes]:
|
||||
"""The attributes of a STUN message by type (RFC 8489: type, length, value padded to 4 bytes); what a truncated tail says is left out."""
|
||||
out: Dict[int, bytes] = {}
|
||||
i = 20
|
||||
while i + 4 <= len(data):
|
||||
kind, length = int.from_bytes(data[i:i + 2], "big"), int.from_bytes(data[i + 2:i + 4], "big")
|
||||
if i + 4 + length > len(data):
|
||||
break
|
||||
out[kind] = data[i + 4:i + 4 + length]
|
||||
i += 4 + ((length + 3) & ~3)
|
||||
return out
|
||||
|
||||
|
||||
def xor_address(value: Optional[bytes]) -> Optional[str]:
|
||||
"""An XOR-MAPPED-ADDRESS or XOR-RELAYED-ADDRESS value (IPv4) as ``ip:port``; None for a missing value or another family."""
|
||||
if value is None or len(value) < 8 or value[1] != 1:
|
||||
return None
|
||||
cookie = b"\x21\x12\xa4\x42"
|
||||
port = int.from_bytes(value[2:4], "big") ^ int.from_bytes(cookie[:2], "big")
|
||||
return "%s:%d" % (socket.inet_ntoa(bytes(a ^ b for a, b in zip(value[4:8], cookie))), port)
|
||||
|
||||
|
||||
def turn_request_record(data: bytes, source: Tuple[str, int], t: float) -> Optional[Dict[str, Any]]:
|
||||
"""What the lab's TURN server writes down of a datagram it receives (None when it is not STUN): when, from where, the transaction id, the message type, whether it carried
|
||||
USERNAME and MESSAGE-INTEGRITY, and (``responses``, filled by :func:`turn_response_record`) what the server answered."""
|
||||
if stun_tid(data) is None:
|
||||
return None
|
||||
attrs = stun_attributes(data)
|
||||
return {"t": t, "src": "%s:%d" % (source[0], source[1]), "tid": stun_tid(data), "type": "0x%04x" % int.from_bytes(data[:2], "big"),
|
||||
"username": 0x0006 in attrs, "integrity": 0x0008 in attrs, "responses": []}
|
||||
|
||||
|
||||
def turn_response_record(data: bytes, destination: Tuple[str, int], t: float) -> Optional[Dict[str, Any]]:
|
||||
"""What the lab's TURN server sends: when, the type (0x0113 an Allocate error, 0x0103 its success), the address it is sent to and, of a success, the XOR-RELAYED-ADDRESS and the
|
||||
XOR-MAPPED-ADDRESS it carries (of an error, its code)."""
|
||||
if stun_tid(data) is None:
|
||||
return None
|
||||
attrs = stun_attributes(data)
|
||||
error = attrs.get(0x0009)
|
||||
return {"t": t, "tid": stun_tid(data), "type": "0x%04x" % int.from_bytes(data[:2], "big"), "to": "%s:%d" % (destination[0], destination[1]),
|
||||
"relayed": xor_address(attrs.get(0x0016)), "mapped": xor_address(attrs.get(0x0020)),
|
||||
"error": (error[2] * 100 + error[3]) if error is not None and len(error) >= 4 else None}
|
||||
|
||||
|
||||
class ExchangeSocket:
|
||||
"""The UDP socket of the lab's TURN server with a record of what it receives and sends (``owner.exchanges``): the server's own code runs on it unchanged, and a failure of the record
|
||||
is never a failure of the server. ``owner.clock`` is the moment (the recorder's)."""
|
||||
|
||||
def __init__(self, sock: socket.socket, owner: Any) -> None:
|
||||
self._sock, self._owner = sock, owner
|
||||
|
||||
def recvfrom(self, size: int) -> Tuple[bytes, Any]:
|
||||
data, source = self._sock.recvfrom(size)
|
||||
try:
|
||||
record = turn_request_record(data, source, self._owner.clock())
|
||||
if record is not None:
|
||||
self._owner.exchanges.append(record)
|
||||
except Exception: # noqa: BLE001 - evidence, never the road
|
||||
pass
|
||||
return data, source
|
||||
|
||||
def sendto(self, data: bytes, address: Any) -> int:
|
||||
try:
|
||||
record = turn_response_record(data, address, self._owner.clock())
|
||||
if record is not None:
|
||||
for exchange in reversed(self._owner.exchanges):
|
||||
if exchange.get("tid") == record["tid"]:
|
||||
exchange["responses"].append(record)
|
||||
break
|
||||
else:
|
||||
self._owner.exchanges.append({"t": record["t"], "src": None, "tid": record["tid"], "type": None, "username": None, "integrity": None, "responses": [record]})
|
||||
except Exception: # noqa: BLE001 - evidence, never the road
|
||||
pass
|
||||
return self._sock.sendto(data, address)
|
||||
|
||||
def __getattr__(self, name: str) -> Any:
|
||||
return getattr(self._sock, name)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
# The seeds, the transcript and its files
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -591,6 +777,12 @@ class Recorder:
|
||||
self._t0 = time.monotonic()
|
||||
self._sources: Dict[str, list] = {}
|
||||
self._marks: List[Tuple[str, Dict[str, int]]] = []
|
||||
#: The moment (``t``, as an event's) at which each stage began: the evidence of the WebRTC walk says where its stages sit among the datagrams.
|
||||
self.phase_t: Dict[str, float] = {}
|
||||
|
||||
def now(self) -> float:
|
||||
"""The recorder's clock, the ``t`` of an event: seconds since the recorder started."""
|
||||
return round(time.monotonic() - self._t0, 3)
|
||||
|
||||
def attach(self, name: str, items: list) -> None:
|
||||
self._sources[name] = items
|
||||
@@ -600,6 +792,7 @@ class Recorder:
|
||||
with self._lock:
|
||||
self._marks.append((name, {k: len(v) for k, v in self._sources.items()}))
|
||||
self.phase = name
|
||||
self.phase_t[name] = self.now()
|
||||
|
||||
def event(self, kind: str, **fields: Any) -> None:
|
||||
with self._lock:
|
||||
@@ -707,7 +900,7 @@ def make_lab_classes() -> Tuple[type, type, type]:
|
||||
|
||||
import _doh_servers as ds
|
||||
from _socks_servers import MEASURE_NUMBER, STUN_NAME, STUN_NUMBER, STUN_PORT, WHOAMI4, WHOAMI6, WEB_NAME
|
||||
from _turn_chain import TURN_IP, TURN_PORT, TurnServer
|
||||
from _turn_chain import TURN_IP, TURN_PORT, TurnServer, is_deallocation
|
||||
|
||||
class LabGateway(ds.DohGateway):
|
||||
"""A coherent SOCKS5 gateway with the DoH road. Past loopback it carries only what the lab names: the CONNECTs to the servers of the lab that stand at the
|
||||
@@ -727,6 +920,17 @@ def make_lab_classes() -> Tuple[type, type, type]:
|
||||
self.opener_lookup: Callable[..., str] = self._look_up_opener
|
||||
super().__init__("lab", doh, udp="relay", tcp_exit=exit_ip, udp_exit=exit_ip, relay_host=host, exit_host=host)
|
||||
|
||||
def _deliver(self, relay: socket.socket, to: Any, host: str, port: int, payload: bytes) -> None:
|
||||
"""Every datagram the relay sends BACK to the browser is written down (``udp_back``: the address it claims in the SOCKS UDP header, where it is sent, from which relay
|
||||
socket, the STUN type and transaction id), then sent as it always was."""
|
||||
try:
|
||||
local = relay.getsockname()
|
||||
self.rec.event("udp_back", claimed="%s:%d" % (host, port), to="%s:%d" % (to[0], to[1]), relay="%s:%d" % (local[0], local[1]),
|
||||
message=message_kind(payload), tid=stun_tid(payload))
|
||||
except Exception: # noqa: BLE001 - evidence, never the road
|
||||
pass
|
||||
super()._deliver(relay, to, host, port, payload)
|
||||
|
||||
def _attributing(self) -> bool:
|
||||
phase = self.rec.phase
|
||||
return any(phase == p or phase.startswith(p + ".") for p in self.attribute_in)
|
||||
@@ -782,7 +986,9 @@ def make_lab_classes() -> Tuple[type, type, type]:
|
||||
|
||||
def _route(self, host: str, dport: int, atyp: int, payload: bytes, out_port: int, answer: Any) -> Any:
|
||||
association = getattr(self._dgram, "index", None)
|
||||
self.rec.event("udp", target="%s:%d" % (host, dport), message=message_kind(payload), opener=self._association_openers.get(association) if association is not None else None)
|
||||
# ``deallocation``: the datagram is a TURN deallocation by what it means (``_turn_chain.is_deallocation``, the reading the lab's TURN server uses): marked here, where the payload is.
|
||||
self.rec.event("udp", target="%s:%d" % (host, dport), message=message_kind(payload), tid=stun_tid(payload), deallocation=is_deallocation(payload),
|
||||
opener=self._association_openers.get(association) if association is not None else None)
|
||||
if atyp == 1 and (host, dport) == (TURN_IP, TURN_PORT):
|
||||
return self.turn.address, (host, dport)
|
||||
if (host, dport) in ((STUN_NAME, STUN_PORT), (STUN_NUMBER, STUN_PORT), (MEASURE_NUMBER, STUN_PORT)):
|
||||
@@ -796,12 +1002,18 @@ def make_lab_classes() -> Tuple[type, type, type]:
|
||||
from an address of the host to loopback."""
|
||||
|
||||
def __init__(self, address: str) -> None:
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
self.sock.bind((address, 0))
|
||||
self.address = self.sock.getsockname()
|
||||
raw = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
raw.bind((address, 0))
|
||||
self.address = raw.getsockname()
|
||||
#: Every STUN datagram it received with the answers it sent (``turn_request_record``), by the clock the lab sets (``Lab``): evidence of the WebRTC walk, never compared.
|
||||
self.exchanges: list = []
|
||||
self.clock: Callable[[], float] = time.monotonic
|
||||
self.sock = ExchangeSocket(raw, self)
|
||||
self.seen: list = []
|
||||
self.allocations: list = []
|
||||
self.requests: list = []
|
||||
self.deallocations: list = []
|
||||
self.refused: list = []
|
||||
self._closed = False
|
||||
threading.Thread(target=self._serve, daemon=True).start()
|
||||
|
||||
@@ -852,25 +1064,42 @@ JOURNEY_A, JOURNEY_O = "journey-a.test", "journey-o.test"
|
||||
PAGE_NAME, H1_NAME, H2_NAME, H3_NAME = "page.lab.test", "h1.lab.test", "h2.lab.test", "h3.lab.test"
|
||||
STUN_URL = "stun:198.51.100.5:19302"
|
||||
TURN_URL = "turn:198.51.100.7:3478?transport=udp"
|
||||
#: The probe of the WebRTC page: one STUN and one TURN server by address (the relay answers both), a data channel, and the page waits for the end of the gather (the
|
||||
#: The TURN server of ``TURN_URL`` as the gateway names the target of a datagram (a test holds it equal to ``tests/_turn_chain.py``).
|
||||
TURN_TARGET = "198.51.100.7:3478"
|
||||
#: The user name the probe gives the TURN server (the lab's server takes any: the key is made from it and the password of ``tests/_turn_chain.py``, which the walk passes as the credential).
|
||||
TURN_USERNAME = "lab"
|
||||
#: The probe of the WebRTC page: one STUN and one TURN server by address (the relay answers both; the TURN's user name and credential are its arguments, never written here), a data channel, and the page waits for the end of the gather (the
|
||||
#: timer is the safety net of a gather that never ends, not a measure of it).
|
||||
RTC_JS = r"""async (urls) => {
|
||||
const pc = new RTCPeerConnection({iceServers: [{urls: [urls[0]]}, {urls: [urls[1]], username: 'lab', credential: 'lab'}]});
|
||||
RTC_JS = r"""async (args) => {
|
||||
const [stunUrl, turnUrl, username, credential] = args;
|
||||
const T = {start: performance.now(), offer: null, local: null, candidates: [], errors: [], gathered: null, closing: null, closed: null};
|
||||
const pc = new RTCPeerConnection({iceServers: [{urls: [stunUrl]}, {urls: [turnUrl], username, credential}]});
|
||||
pc.createDataChannel('');
|
||||
const cands = [], errors = [];
|
||||
pc.addEventListener('icecandidate', e => { if (e.candidate && e.candidate.candidate) cands.push(e.candidate.candidate); });
|
||||
pc.addEventListener('icecandidateerror', e => { errors.push({code: e.errorCode, url: e.url}); });
|
||||
await pc.setLocalDescription(await pc.createOffer());
|
||||
pc.addEventListener('icecandidate', e => {
|
||||
if (e.candidate && e.candidate.candidate) cands.push(e.candidate.candidate);
|
||||
T.candidates.push({t: performance.now(), type: e.candidate ? (e.candidate.type || null) : 'end'});
|
||||
});
|
||||
pc.addEventListener('icecandidateerror', e => {
|
||||
errors.push({code: e.errorCode, url: e.url});
|
||||
T.errors.push({t: performance.now(), code: e.errorCode, url: e.url});
|
||||
});
|
||||
const offer = await pc.createOffer();
|
||||
T.offer = performance.now();
|
||||
await pc.setLocalDescription(offer);
|
||||
T.local = performance.now();
|
||||
await new Promise(resolve => {
|
||||
const timer = setTimeout(resolve, 30000);
|
||||
const done = () => { clearTimeout(timer); resolve(); };
|
||||
const done = () => { clearTimeout(timer); if (T.gathered === null) T.gathered = performance.now(); resolve(); };
|
||||
if (pc.iceGatheringState === 'complete') done();
|
||||
pc.addEventListener('icegatheringstatechange', () => { if (pc.iceGatheringState === 'complete') done(); });
|
||||
});
|
||||
const sdp = (pc.localDescription && pc.localDescription.sdp) || '';
|
||||
const gathering = pc.iceGatheringState;
|
||||
T.closing = performance.now();
|
||||
try { pc.close(); } catch (e) {}
|
||||
return {candidates: cands, errors, sdp, gathering};
|
||||
T.closed = performance.now();
|
||||
return {candidates: cands, errors, sdp, gathering, times: T};
|
||||
}"""
|
||||
FETCH_JS = r"""async () => {
|
||||
await (await fetch('/api?x=1', {cache: 'no-store'})).text();
|
||||
@@ -975,6 +1204,8 @@ class Lab:
|
||||
self.roles: Dict[int, str] = {}
|
||||
self.collisions: List[Tuple[int, str, str]] = []
|
||||
self.norm = Normalizer(self.roles)
|
||||
#: What the WebRTC walk measured about itself (``walk_webrtc``), for ``webrtc_evidence``: never a leaf.
|
||||
self.webrtc: Dict[str, Any] = {}
|
||||
self._closers: List[Callable[[], None]] = []
|
||||
self.h1 = self.h2 = self.h3 = None
|
||||
self.origin_a = self.origin_o = ""
|
||||
@@ -991,6 +1222,7 @@ class Lab:
|
||||
self._closers.append(self.witness.close)
|
||||
self._claim(self.witness.port, "witness")
|
||||
self.turn = turn_class(self.host)
|
||||
self.turn.clock = self.rec.now
|
||||
self._closers.append(self.turn.close)
|
||||
self.gateway = gateway_class(self.rec, self.doh, self.turn, self.host, self.exit_ip)
|
||||
self.gateway.attribute_in = attribute_in
|
||||
@@ -1078,9 +1310,10 @@ def guarded(fn: Callable[[], Any]) -> Any:
|
||||
return {"error": _first_line(exc)}
|
||||
|
||||
|
||||
def phase_data(lab: Lab, phase: str, skip_connects: Callable[[str], bool] = lambda target: False) -> Dict[str, Any]:
|
||||
def phase_data(lab: Lab, phase: str, skip_connects: Callable[[str], bool] = lambda target: False,
|
||||
skip_udp: Callable[[Dict[str, Any]], bool] = lambda event: False) -> Dict[str, Any]:
|
||||
"""What the lab saw in a stage and the stages under it: the CONNECTs, the DoH questions, the datagrams, the HTTP requests of the tees. Where the lab looked who opened an entry
|
||||
(``Lab(attribute_in=...)``), each summary says so: ``openers``. ``skip_connects`` leaves out the CONNECTs it is true of."""
|
||||
(``Lab(attribute_in=...)``), each summary says so: ``openers``. ``skip_connects`` leaves out the CONNECTs it is true of, ``skip_udp`` the datagrams (events) it is true of."""
|
||||
queries = [(q.name, q.qtype, q.via) for q in lab.rec.slice("doh", phase)]
|
||||
gateway = getattr(lab, "gateway", None)
|
||||
attributing = bool(gateway is not None and gateway.attribute_in)
|
||||
@@ -1088,7 +1321,7 @@ def phase_data(lab: Lab, phase: str, skip_connects: Callable[[str], bool] = lamb
|
||||
connects = [e for e in lab.rec.of(phase, "connect") if not skip_connects(e["target"])]
|
||||
return {"connects": connect_summary([e["target"] for e in connects], lab.norm, [e.get("opener") for e in connects]),
|
||||
"dns": dns_summary(queries, [gateway.opener_of_connection(i) for i in asked_on] if attributing else None),
|
||||
"udp": udp_summary(lab.rec.of(phase, "udp"), lab.norm), "requests": request_summary(lab.rec.of(phase, "http"), lab.norm)}
|
||||
"udp": udp_summary([e for e in lab.rec.of(phase, "udp") if not skip_udp(e)], lab.norm), "requests": request_summary(lab.rec.of(phase, "http"), lab.norm)}
|
||||
|
||||
|
||||
def launch_data(lab: Lab) -> Dict[str, Any]:
|
||||
@@ -1403,22 +1636,89 @@ def walk_h3(browser: Any, lab: Lab, guard_ms: int = LEAVE_GUARD_MS) -> Dict[str,
|
||||
|
||||
|
||||
def walk_webrtc(browser: Any, lab: Lab) -> Dict[str, Any]:
|
||||
from _turn_chain import PASSWORD as TURN_PASSWORD # the one the lab's TURN server signs its answers with: a browser with another finds every success invalid and makes no relay
|
||||
|
||||
lab.rec.set_phase("webrtc")
|
||||
context = browser.new_context(ignore_https_errors=True)
|
||||
try:
|
||||
page = context.new_page()
|
||||
page.goto("http://%s:%d/rtc" % (PAGE_NAME, lab.site.port), wait_until="load", timeout=60000)
|
||||
result = page.evaluate(RTC_JS, [STUN_URL, TURN_URL])
|
||||
lab.webrtc["evaluate"] = {"called": lab.rec.now()}
|
||||
result = page.evaluate(RTC_JS, [STUN_URL, TURN_URL, TURN_USERNAME, TURN_PASSWORD])
|
||||
lab.webrtc["evaluate"]["returned"] = lab.rec.now()
|
||||
finally:
|
||||
context.close()
|
||||
lab.rec.set_phase("webrtc.end")
|
||||
data = phase_data(lab, "webrtc")
|
||||
# What the page measured of itself goes to the evidence and to nothing that is compared: ``webrtc_summary`` reads the fields it always read.
|
||||
lab.webrtc["page"] = result.pop("times", None)
|
||||
# The TURN deallocation (a Refresh with LIFETIME 0) is one best-effort send at teardown, so it is evidence (``webrtc_evidence``) and no leaf. Source: dom/media/webrtc/transport/third_party/
|
||||
# nICEr/src/stun/turn_client_ctx.cpp:693-730, ``nr_turn_client_deallocate``: ONE request, no retransmission, sent while the TURN context is destroyed. It reaches the lab in some walks and
|
||||
# not in others for the same engine, so it is out of the datagrams counted for the TURN address (told by the mark the gateway wrote on it from its payload, not by when it came) and out
|
||||
# of the messages (told by the transaction id the lab's TURN server wrote for it, recorded before the request itself).
|
||||
ended = {tid.hex() for tid in lab.turn.deallocation_tids()}
|
||||
data = phase_data(lab, "webrtc", skip_udp=lambda event: event["target"] == TURN_TARGET and bool(event.get("deallocation")))
|
||||
lab.webrtc["counted"] = len(lab.rec.of("webrtc", "udp"))
|
||||
out = webrtc_summary(result, lab.exit_ip)
|
||||
marked = [e for e in lab.rec.of("webrtc", "udp") if e["target"] == TURN_TARGET and e.get("deallocation")]
|
||||
out.update(connects=data["connects"], dns=data["dns"], udp=data["udp"],
|
||||
turn={"messages": sorted({"0x%04x" % t for _ip, _port, t in lab.turn.seen}), "allocated": bool(lab.turn.allocations)})
|
||||
turn={"messages": sorted({"0x%04x" % t for _when, tid, t, _credentials in lab.turn.requests if tid.hex() not in ended}), "allocated": bool(lab.turn.allocations),
|
||||
"refused": len(lab.turn.refused), "deallocation": deallocation_facts(lab.turn, marked, closing_began(lab.webrtc["evaluate"]["called"], lab.webrtc["page"]))})
|
||||
return lab.norm.walk(out)
|
||||
|
||||
|
||||
def closing_began(called: float, page: Optional[Dict[str, Any]]) -> Optional[float]:
|
||||
"""The moment, on the recorder's clock, from which the page was closing its connection: the recorder's time at which the walk called the page (``evaluate.called``) plus the time the page
|
||||
measured from its start to its ``closing`` (``performance.now()`` in milliseconds, of the page's own clock: ``start`` and ``closing`` are both read there, so their difference is a length
|
||||
of time and needs no common origin). The script starts at or after the call, so this is never later than the real moment: a deallocation before it was surely sent before the close.
|
||||
None when the page did not return its times."""
|
||||
if not isinstance(page, dict) or page.get("start") is None or page.get("closing") is None:
|
||||
return None
|
||||
return called + (page["closing"] - page["start"]) / 1000.0
|
||||
|
||||
|
||||
def deallocation_facts(turn: Any, marked: List[Dict[str, Any]], began_closing: Optional[float]) -> Dict[str, int]:
|
||||
"""What the lab heard of deallocations that a walk must not have: ``repeated`` allocations that were ended by more than one transaction, ``unallocated`` deallocations from an address
|
||||
that has no allocation (both from the lab's TURN server), and ``early`` deallocation transactions that the gateway carried (``marked``, its events of them) before the page began closing
|
||||
(``began_closing``, :func:`closing_began`; unknown: none is early). ``repeated`` and ``unallocated`` are 0 in a healthy walk and ``turn_deallocation_problems`` says it when they are not;
|
||||
``early`` is evidence only (the page's clock cannot order it, see ``turn_deallocation_problems``). None of them is compared."""
|
||||
ends: collections.Counter = collections.Counter()
|
||||
unallocated = 0
|
||||
for _ip, _port, _tid, _t, allocation in turn.deallocation_transactions():
|
||||
if allocation is None:
|
||||
unallocated += 1
|
||||
else:
|
||||
ends[allocation] += 1
|
||||
first: Dict[Any, float] = {}
|
||||
for event in marked:
|
||||
first.setdefault(event.get("tid"), event["t"])
|
||||
early = sum(1 for t in first.values() if began_closing is not None and t < began_closing)
|
||||
return {"repeated": sum(1 for n in ends.values() if n > 1), "unallocated": unallocated, "early": early}
|
||||
|
||||
|
||||
def webrtc_evidence(lab: Lab) -> Dict[str, Any]:
|
||||
"""The WebRTC walk of a seed as it happened, outside the leaves that are compared: every datagram the gateway routed in its stages (when, to whom, the message, the STUN transaction id,
|
||||
its stage, and whether it was already there when the summary of the walk was taken: ``counted``), the moments of the stages and of the page's call on the recorder's clock, and the
|
||||
page's own ``performance.now()`` at each step of the gather (``page``: the offer, each candidate with its type, each error with its code and url, the end of the gather, the close).
|
||||
It exists to tell two readings of a run that differs from itself apart: a close that cuts the retransmissions of the TURN server short at a variable point, and a retransmission of the
|
||||
first request whose answer came late."""
|
||||
info = getattr(lab, "webrtc", None) or {}
|
||||
began = lab.rec.phase_t.get("webrtc")
|
||||
counted = info.get("counted")
|
||||
datagrams = [{"t": e["t"], "phase": e["phase"], "target": e["target"], "message": e["message"], "tid": e.get("tid"), "counted": counted is None or i < counted}
|
||||
for i, e in enumerate(lab.rec.of("webrtc", "udp"))]
|
||||
# The lab's TURN server: each request with what it carried and what it answered; the relay's datagrams back to the browser: the address each claims and the 5-tuple it goes to.
|
||||
exchanges = [e for e in getattr(getattr(lab, "turn", None), "exchanges", None) or [] if began is None or e["t"] >= began]
|
||||
returned = [{"t": e["t"], "phase": e["phase"], "claimed": e["claimed"], "to": e["to"], "relay": e["relay"], "message": e["message"], "tid": e.get("tid")} for e in lab.rec.of("webrtc", "udp_back")]
|
||||
# The deallocation (a Refresh with LIFETIME 0, sent once at teardown): whether the lab's TURN server heard it, and for each transaction when (the recorder's clock, from the exchange of
|
||||
# the same transaction id) and which. It is no leaf: the walk leaves it out of what it compares.
|
||||
heard = getattr(getattr(lab, "turn", None), "deallocation_transactions", None)
|
||||
when = {e["tid"]: e["t"] for e in reversed(exchanges)}
|
||||
records = [{"t": when.get(tid.hex()), "tid": tid.hex(), "src": "%s:%d" % (ip, port), "allocation": allocation} for ip, port, tid, _t, allocation in (heard() if heard else [])]
|
||||
return {"phase_t": {name: lab.rec.phase_t.get(name) for name in ("webrtc", "webrtc.end")}, "evaluate": info.get("evaluate"), "page": info.get("page"), "datagrams": datagrams,
|
||||
"turn": exchanges, "returned": returned, "send_errors": list(getattr(getattr(lab, "gateway", None), "send_errors", None) or []),
|
||||
"deallocation": {"seen": bool(records), "records": records}}
|
||||
|
||||
|
||||
def direct_report(lab: Lab, watcher: Any, trap: Any) -> Dict[str, Any]:
|
||||
"""Everything that reached the lab or the network around the proxy. Each list is empty on a browser that keeps its word; a watcher that never saw the
|
||||
browser is a list with that fact in it (a sink that sees nothing proves nothing)."""
|
||||
@@ -1515,7 +1815,7 @@ def wire_evidence(lab: Lab) -> Dict[str, Any]:
|
||||
for q in lab.h3.snapshot()["quic"]:
|
||||
h3.append({"phase": q["phase"], "requests": [{"t": r.get("t"), "written": r.get("written_t"),
|
||||
"request": "%s %s" % (dict(r["headers"]).get(":method"), lab.norm.text(dict(r["headers"]).get(":path", "")))} for r in q["requests"]]})
|
||||
return {"journey": journey, "https": https, "h3": h3}
|
||||
return {"journey": journey, "https": https, "h3": h3, "webrtc": webrtc_evidence(lab)}
|
||||
|
||||
|
||||
def sentinel_signature(lab: Lab) -> Dict[str, Any]:
|
||||
@@ -1726,13 +2026,19 @@ def judge(report: Dict[str, Any], control: bool) -> int:
|
||||
return 2 if control else 1
|
||||
|
||||
|
||||
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."""
|
||||
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")
|
||||
if seal:
|
||||
env["INVISIBLE_SEAL_FILE"] = str(seal)
|
||||
for name in ("MOZ_LOG", "MOZ_LOG_FILE"):
|
||||
env.pop(name, None)
|
||||
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)
|
||||
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)]
|
||||
print("=== run %s: %s (seal %s)" % (label, binary, seal or "the one this process has"))
|
||||
@@ -1746,6 +2052,167 @@ def run_engine(binary: str, seal: Optional[str], label: str, seeds: Tuple[int, .
|
||||
return 124
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
# The hunt: one walk of one seed, repeated, and the evidence of each repetition (never a verdict)
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
def parse_hunt(text: str) -> Tuple[str, int, int]:
|
||||
"""``webrtc:<seed>:<n>`` -> ``("webrtc", seed, n)``. Anything else is a usage error: the walk is named, the seed and the count are whole numbers, and n is at least 1."""
|
||||
parts = (text or "").strip().split(":")
|
||||
if len(parts) != 3 or parts[0] != "webrtc":
|
||||
raise ValueError("%s is %r: expected webrtc:<seed>:<n>" % (HUNT_ENV, text))
|
||||
try:
|
||||
seed, n = int(parts[1]), int(parts[2])
|
||||
except ValueError:
|
||||
raise ValueError("%s is %r: the seed and n are whole numbers" % (HUNT_ENV, text)) from None
|
||||
if n < 1:
|
||||
raise ValueError("%s is %r: n is at least 1" % (HUNT_ENV, text))
|
||||
return parts[0], seed, n
|
||||
|
||||
|
||||
def hunt_counts(evidence: Optional[Dict[str, Any]]) -> Dict[str, int]:
|
||||
"""Datagrams to the TURN server in a repetition: ``counted`` as the summary of the walk (what the A/A compares) took them, ``all`` with the ones that came after."""
|
||||
turn = [d for d in (evidence or {}).get("datagrams") or [] if d.get("target") == TURN_TARGET]
|
||||
return {"counted": sum(1 for d in turn if d.get("counted")), "all": len(turn)}
|
||||
|
||||
|
||||
def hunt_repetition(binary: str, label: str, i: int, seed: int, patch: Any, out_dir: Optional[Path] = None) -> Dict[str, Any]:
|
||||
"""One repetition: a launch behind a lab as the main launch has it, the WebRTC walk only, the close, and what the lab saw of it. A failure is the ``error`` of the record."""
|
||||
record: Dict[str, Any] = {"format": HUNT_FORMAT, "engine": label, "i": i, "seed": seed, "error": None, "evidence": None}
|
||||
if out_dir is not None:
|
||||
# The engine logs to ``<out_dir>/<engine>-<i>-mozlog`` (its child processes to the same name with ``.child-N``): the launch inherits this process's environment.
|
||||
record["mozlog"] = "%s-%d-mozlog" % (label, i)
|
||||
patch.setenv("MOZ_LOG", HUNT_MOZ_LOG)
|
||||
patch.setenv("MOZ_LOG_FILE", str(Path(out_dir) / record["mozlog"]))
|
||||
try:
|
||||
with open_lab(journey=True, wire=True) as lab:
|
||||
begin_launch(seed, "hunt")
|
||||
session = launch(binary, seed, lab, patch)
|
||||
with session as browser:
|
||||
browser.new_context(ignore_https_errors=True).new_page() # Glean is born when a window opens (``glean_ready``); the walk opens its own context
|
||||
record.update(glean_ready(session, seed, "hunt"))
|
||||
record["walk"] = guarded(lambda: walk_webrtc(browser, lab))
|
||||
record["evidence"] = webrtc_evidence(lab) # after the close: the datagrams the close leaves in flight are in it
|
||||
except Exception as exc: # noqa: BLE001 - evidence, never a verdict
|
||||
record["error"] = _first_line(exc)
|
||||
finally:
|
||||
if out_dir is not None:
|
||||
patch.delenv("MOZ_LOG", raising=False)
|
||||
patch.delenv("MOZ_LOG_FILE", raising=False)
|
||||
record["counts"] = hunt_counts(record["evidence"])
|
||||
return record
|
||||
|
||||
|
||||
def hunt_run(binary: str, label: str, seed: int, n: int, out_dir: Path) -> int:
|
||||
"""``n`` repetitions of the WebRTC walk of ``seed`` with one engine, each written to ``<out_dir>/<label>-<i>.json``. Exits 0: it decides nothing."""
|
||||
import pytest
|
||||
|
||||
patch = pytest.MonkeyPatch()
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-network-hunt-"))
|
||||
try:
|
||||
import _lab_egress
|
||||
|
||||
_lab_egress.install(patch, work)
|
||||
global RUN_LABEL
|
||||
RUN_LABEL = label
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
for i in range(1, n + 1):
|
||||
record = hunt_repetition(binary, label, i, seed, patch, out_dir)
|
||||
write_json(out_dir / ("%s-%d.json" % (label, i)), record)
|
||||
print("hunt %s %d/%d: %d datagrams to the TURN server (%d with the late ones)%s" % (
|
||||
label, i, n, record["counts"]["counted"], record["counts"]["all"], "" if record["error"] is None else ", ERROR " + record["error"]))
|
||||
sys.stdout.flush()
|
||||
return 0
|
||||
finally:
|
||||
patch.undo()
|
||||
shutil.rmtree(work, ignore_errors=True)
|
||||
|
||||
|
||||
def hunt_summary(records: List[Dict[str, Any]]) -> Dict[str, Any]:
|
||||
"""The summary of the repetition files: per repetition the count of datagrams to the TURN server (``count_3478``: as the A/A counts them; ``count_3478_all``: with the late ones) and, per
|
||||
target, the transaction ids in the order they first appeared with the number of datagrams each carried (``[tid, n]``: a retransmission repeats its request's id); per engine, how often
|
||||
each count came."""
|
||||
repetitions = []
|
||||
distribution: Dict[str, collections.Counter] = {}
|
||||
for record in records:
|
||||
counts = hunt_counts(record.get("evidence"))
|
||||
groups: Dict[str, Dict[Any, int]] = {}
|
||||
for d in (record.get("evidence") or {}).get("datagrams") or []:
|
||||
tids = groups.setdefault(d["target"], {})
|
||||
tids[d.get("tid")] = tids.get(d.get("tid"), 0) + 1
|
||||
repetitions.append({"engine": record["engine"], "i": record["i"], "count_3478": counts["counted"], "count_3478_all": counts["all"],
|
||||
"targets": {t: [[tid, n] for tid, n in groups[t].items()] for t in sorted(groups)}, "error": record.get("error")})
|
||||
distribution.setdefault(record["engine"], collections.Counter())[counts["counted"]] += 1
|
||||
return {"format": HUNT_SUMMARY_FORMAT, "target": TURN_TARGET, "repetitions": repetitions,
|
||||
"count_3478_by_engine": {engine: {str(k): v for k, v in sorted(c.items())} for engine, c in sorted(distribution.items())}}
|
||||
|
||||
|
||||
def read_hunt_records(folder: Path) -> List[Dict[str, Any]]:
|
||||
"""The repetition files of a folder, by engine and repetition."""
|
||||
records = []
|
||||
for path in sorted(Path(folder).glob("*.json")):
|
||||
document = json.loads(path.read_text(encoding="utf-8"))
|
||||
if document.get("format") == HUNT_FORMAT:
|
||||
records.append(document)
|
||||
return sorted(records, key=lambda r: (r["engine"], r["i"]))
|
||||
|
||||
|
||||
#: The safety net of a hunt's engine run, in seconds: a base and a share per repetition (a launch, Glean, the gather's own 30 s). Never a verdict.
|
||||
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:
|
||||
"""``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)]
|
||||
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
|
||||
|
||||
try:
|
||||
with tempfile.TemporaryDirectory(prefix="ab-network-cache-") as cache:
|
||||
return subprocess.run(command, env=own_cache_env(env, cache), timeout=HUNT_BASE_S + n * HUNT_PER_REPETITION_S).returncode
|
||||
except subprocess.TimeoutExpired:
|
||||
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."""
|
||||
if args.published_binary:
|
||||
return str(args.published_binary), (str(args.published_seal) if args.published_seal else None)
|
||||
import ci_ab_oracle as oracle
|
||||
|
||||
binary, seal = oracle.fetch_published(args.engine_tag, work)
|
||||
return binary, str(seal)
|
||||
|
||||
|
||||
def cmd_hunt(args: argparse.Namespace, spec: str) -> int:
|
||||
"""``ab`` with ``AB_NETWORK_HUNT=webrtc:<seed>:<n>``: the WebRTC walk of that seed, ``n`` times, for each engine of the A/A (the published engine twice), written to ``<out>/hunt``:
|
||||
``<engine>-<i>.json`` per repetition and ``summary.json``. It decides nothing and exits 0 (2 only for a spec that does not read)."""
|
||||
try:
|
||||
_walk, seed, n = parse_hunt(spec)
|
||||
except ValueError as exc:
|
||||
print("FAIL " + str(exc))
|
||||
return 2
|
||||
out = Path(args.out) / "hunt"
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-network-"))
|
||||
try:
|
||||
binary, seal = published_engine(args, work)
|
||||
for label in (args.engine_tag, args.engine_tag + "-again"):
|
||||
code = hunt_engine(binary, seal, label, seed, n, out)
|
||||
if code != 0:
|
||||
print("hunt %s ended with %s" % (label, code))
|
||||
summary = hunt_summary(read_hunt_records(out))
|
||||
write_json(out / "summary.json", summary)
|
||||
for r in summary["repetitions"]:
|
||||
print("hunt %s %d: %d to the TURN server (%d with the late ones); %s" % (r["engine"], r["i"], r["count_3478"], r["count_3478_all"], r["targets"].get(TURN_TARGET)))
|
||||
print("hunt summary written: %s" % (out / "summary.json"))
|
||||
return 0
|
||||
finally:
|
||||
shutil.rmtree(work, ignore_errors=True)
|
||||
|
||||
|
||||
def compare_files(a: Path, b: Path, out: Optional[Path], floor: int, volatile_path: Path, control: bool) -> Dict[str, Any]:
|
||||
ta, tb = read_transcript(a), read_transcript(b)
|
||||
report = compare_transcripts(ta, tb, load_volatile(volatile_path), floor, ta.get("label", "A"), tb.get("label", "B"))
|
||||
@@ -1757,6 +2224,9 @@ def compare_files(a: Path, b: Path, out: Optional[Path], floor: int, volatile_pa
|
||||
|
||||
|
||||
def cmd_ab(args: argparse.Namespace) -> int:
|
||||
spec = os.environ.get(HUNT_ENV)
|
||||
if spec:
|
||||
return cmd_hunt(args, spec)
|
||||
out = Path(args.out)
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
seeds = parse_seeds(args.seeds)
|
||||
@@ -1768,13 +2238,7 @@ def cmd_ab(args: argparse.Namespace) -> int:
|
||||
return 2
|
||||
work = Path(tempfile.mkdtemp(prefix="ab-network-"))
|
||||
try:
|
||||
if args.published_binary:
|
||||
binary, seal = str(args.published_binary), (str(args.published_seal) if args.published_seal else None)
|
||||
else:
|
||||
import ci_ab_oracle as oracle
|
||||
|
||||
binary, seal = oracle.fetch_published(args.engine_tag, work)
|
||||
seal = str(seal)
|
||||
binary, seal = 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 = []
|
||||
@@ -1810,6 +2274,12 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
r.add_argument("--label", default="engine")
|
||||
r.add_argument("--seeds", default=None)
|
||||
r.add_argument("--out", type=Path, required=True)
|
||||
h = sub.add_parser("hunt-run", help="one engine: the WebRTC walk of one seed, n times (what AB_NETWORK_HUNT makes `ab` run)")
|
||||
h.add_argument("--binary", required=True)
|
||||
h.add_argument("--label", required=True)
|
||||
h.add_argument("--seed", type=int, required=True)
|
||||
h.add_argument("--n", type=int, required=True)
|
||||
h.add_argument("--out", type=Path, required=True)
|
||||
c = sub.add_parser("compare", help="two transcripts: the diff and the leaf count")
|
||||
c.add_argument("a", type=Path)
|
||||
c.add_argument("b", type=Path)
|
||||
@@ -1835,6 +2305,8 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
args = ap.parse_args(argv)
|
||||
if args.cmd == "run":
|
||||
return run(args.binary, args.label, parse_seeds(args.seeds), args.out)
|
||||
if args.cmd == "hunt-run":
|
||||
return hunt_run(args.binary, args.label, args.seed, args.n, args.out)
|
||||
if args.cmd == "compare":
|
||||
return judge(compare_files(args.a, args.b, args.out, args.floor, args.volatile, args.a_a), args.a_a)
|
||||
if args.cmd == "judge":
|
||||
|
||||
@@ -7,7 +7,9 @@ THIRD-PARTY distribution the gate installs from the wrapper:
|
||||
|
||||
* the wrapper's dependencies (`[project].dependencies` of pyproject.toml, without `invisible_core`, which is built as a wheel of ours) and its `dev` extra;
|
||||
* the dependencies of the core the wrapper pins (`invisible_core==X`: the `[project].dependencies` of the core's pyproject.toml at the tag vX);
|
||||
* playwright at scripts/playwright_pin.txt (the stock client the gate drives the engine with) and cryptography at CRYPTOGRAPHY (the lab's PKI).
|
||||
* playwright at scripts/playwright_pin.txt (the stock client the gate drives the engine with) and cryptography at CRYPTOGRAPHY (the lab's PKI);
|
||||
* the installer the install-from-index job needs beside pytest (HARNESS: `uv`, which the release test installs the package with and the wait asks), so that
|
||||
job installs its test harness from this lock and from nothing else (tests/test_the_install_job_has_every_module_its_tests_import.py).
|
||||
|
||||
One command regenerates both files after a dependency change or a bump of the core pin:
|
||||
|
||||
@@ -36,6 +38,8 @@ PLAYWRIGHT_PIN = ROOT / "scripts" / "playwright_pin.txt"
|
||||
|
||||
#: What the lab's PKI needs, as the series' gate installs it today.
|
||||
CRYPTOGRAPHY = "cryptography==44.0.3"
|
||||
#: Installers the install-from-index job (user-install.yml) needs and no dependency of the wrapper brings: the README's way in (`uv`) and the wait on the index.
|
||||
HARNESS = ["uv>=0.5"]
|
||||
#: The floor of the lock: the Python the unit job judges; `--universal` covers every Linux and Windows wheel of every Python from it.
|
||||
PYTHON_VERSION = "3.11"
|
||||
DEFAULT_EXCLUDE_NEWER = "2026-11-25T00:00:00Z"
|
||||
@@ -124,7 +128,7 @@ def core_dependencies(core_pyproject_text: str) -> list:
|
||||
def expected_requirements(pyproject_text: str, core_requires: list, playwright_pin: str) -> list:
|
||||
"""The requirements the lock must cover, in the order the input prints them."""
|
||||
src = wrapper_sources(pyproject_text)
|
||||
reqs = set(src["dependencies"]) | set(src["dev"]) | set(core_requires) | {"playwright==%s" % playwright_pin.strip(), CRYPTOGRAPHY}
|
||||
reqs = set(src["dependencies"]) | set(src["dev"]) | set(core_requires) | set(HARNESS) | {"playwright==%s" % playwright_pin.strip(), CRYPTOGRAPHY}
|
||||
return sorted(reqs, key=lambda r: (base_name(r), r))
|
||||
|
||||
|
||||
@@ -141,6 +145,7 @@ def make_in(pyproject_text: str, core_pyproject_text: str, playwright_pin: str,
|
||||
"# core-requires: %s" % SEP.join(core_requires),
|
||||
"# playwright: %s from scripts/playwright_pin.txt (the stock client the gate drives the engine with)" % playwright_pin.strip(),
|
||||
"# cryptography: %s (the lab's PKI)" % CRYPTOGRAPHY.split("==")[1],
|
||||
"# harness: %s (the installers of the install-from-index job)" % SEP.join(HARNESS),
|
||||
]
|
||||
return "\n".join(head + expected_requirements(pyproject_text, core_requires, playwright_pin)) + "\n"
|
||||
|
||||
|
||||
+93
-11
@@ -24,6 +24,11 @@ pytest wrote and fails on every one of them.
|
||||
The one exception is `retired-tests.json` NEXT TO main's list (read from main, never from the judged branch): a file it names that
|
||||
no longer exists in the checkout may leave the rows, and the minimum of a row may go down by the tests main counted for it in that
|
||||
row (`tests: {row id: n}`), and by no more. A retired file still on disk, or any other lost test, stays red.
|
||||
The same file may also retire single tests whose file stays: {"nodeid": "<file>::<test>", "suite": <row id>, "count": n, "reason",
|
||||
"decided_by", "date", "from_min_tests"}. The minimum of that row may go down by the sum of the `count` of its entries and by no more, and
|
||||
only for a nodeid whose file the row of main lists, and only while main's minimum of that row still equals `from_min_tests` (once the removal
|
||||
is on main and its floor is lower, the entry is inert); a declared nodeid that the judged leg still collects is red, and so is any test that
|
||||
goes without an entry.
|
||||
What the file of main is can be said only by the gate, which checks main out (a failed download is not
|
||||
"main has no list"): the file exists -> it is compared; it does not exist and the gate passed
|
||||
--main-has-no-list (main was checked out and has no such file) -> passed, declared; it does not exist
|
||||
@@ -333,17 +338,25 @@ def _int(value):
|
||||
RETIRED_NAME = "retired-tests.json"
|
||||
|
||||
|
||||
def validate_retired(data):
|
||||
"""-> the reasons why `data` is not a well-formed list of retired files (empty if it is). An entry: the file, why it went, the date, and
|
||||
for each row id the number of tests the file had in that row on main (counted with the row's marker)."""
|
||||
def validate_retired(data, suite_ids=None):
|
||||
"""-> the reasons why `data` is not a well-formed list of retired tests (empty if it is). Two kinds of entry, in one list:
|
||||
a FILE that is gone ({file, reason, date, tests: {row id: number of tests the file had in that row on main, counted with the row's marker}}), and
|
||||
a single TEST whose file stays ({nodeid: "<file>::<test>", suite: row id, count > 0, reason, decided_by, date, from_min_tests: the minimum of
|
||||
the row on main when the entry was written, an integer >= count, the same for every entry of a suite}). `suite_ids`, when given, are the row
|
||||
ids of main's list: the suite of a nodeid entry must be one of them."""
|
||||
if not isinstance(data, list):
|
||||
return ["the retired list must be a JSON list"]
|
||||
problems, seen = [], set()
|
||||
problems, seen, seen_nodes, froms = [], set(), set(), {}
|
||||
for i, e in enumerate(data):
|
||||
where = "retired entry %d" % i
|
||||
if not isinstance(e, dict):
|
||||
problems.append("%s is not an object" % where)
|
||||
continue
|
||||
if "nodeid" in e or "suite" in e:
|
||||
problems += _validate_retired_node(e, where, suite_ids, seen_nodes)
|
||||
if isinstance(e.get("suite"), str) and _is_int(e.get("from_min_tests")):
|
||||
froms.setdefault(e["suite"], set()).add(e["from_min_tests"])
|
||||
continue
|
||||
f = e.get("file")
|
||||
if not isinstance(f, str) or not f.strip():
|
||||
problems.append("%s has no file" % where)
|
||||
@@ -358,12 +371,44 @@ def validate_retired(data):
|
||||
counts = e.get("tests")
|
||||
if not (isinstance(counts, dict) and counts and all(isinstance(k, str) and _is_int(v) and v > 0 for k, v in counts.items())):
|
||||
problems.append("%s: tests must be {row id: number of tests of the file in that row (> 0)}" % where)
|
||||
for suite, values in sorted(froms.items()):
|
||||
if len(values) > 1:
|
||||
problems.append("the retired tests of %s disagree on from_min_tests (%s): one suite, one floor of main" % (suite, sorted(values)))
|
||||
return problems
|
||||
|
||||
|
||||
def _validate_retired_node(e, where, suite_ids, seen):
|
||||
problems = []
|
||||
nid, suite = e.get("nodeid"), e.get("suite")
|
||||
if "file" in e or "tests" in e:
|
||||
problems.append("%s: an entry is a retired file (file, tests) or a retired test (nodeid, suite, count), not both" % where)
|
||||
parts = nid.split("::", 1) if isinstance(nid, str) else []
|
||||
if len(parts) != 2 or not parts[0].strip() or not parts[1].strip():
|
||||
problems.append("%s: nodeid must be \"<file>::<test>\"" % where)
|
||||
else:
|
||||
where = "retired test %s" % nid
|
||||
if not isinstance(suite, str) or not suite.strip():
|
||||
problems.append("%s: suite must be a non-empty string (the id of a row)" % where)
|
||||
elif suite_ids is not None and suite not in suite_ids:
|
||||
problems.append("%s: the suite %s is not a row of main's required list" % (where, suite))
|
||||
if isinstance(nid, str) and isinstance(suite, str):
|
||||
if (nid, suite) in seen:
|
||||
problems.append("%s: appears more than once for the suite %s" % (where, suite))
|
||||
seen.add((nid, suite))
|
||||
if not _is_int(e.get("count")) or e.get("count") < 1:
|
||||
problems.append("%s: count must be an integer >= 1 (the tests the suite loses)" % where)
|
||||
for key in ("reason", "decided_by", "date"):
|
||||
if not isinstance(e.get(key), str) or not e.get(key).strip():
|
||||
problems.append("%s: %s must be a non-empty string" % (where, key))
|
||||
frm = e.get("from_min_tests")
|
||||
if not _is_int(frm) or frm < 1 or (_is_int(e.get("count")) and frm < e["count"]):
|
||||
problems.append("%s: from_min_tests must be an integer >= count (the minimum of the suite on main when the entry was written)" % where)
|
||||
return problems
|
||||
|
||||
|
||||
def retired_of_main(main_required):
|
||||
"""The retired files of main: ``ci/retired-tests.json`` next to main's list, read from main and never from the judged branch. It may not
|
||||
exist (main older than the format): nothing is retired. A malformed one is a problem, never an empty list. -> (entries, problems)."""
|
||||
"""The retired files and tests of main: ``ci/retired-tests.json`` next to main's list, read from main and never from the judged branch. It may
|
||||
not exist (main older than the format): nothing is retired. A malformed one is a problem, never an empty list. -> (entries, problems)."""
|
||||
path = Path(main_required).with_name(RETIRED_NAME)
|
||||
if not path.is_file():
|
||||
return [], []
|
||||
@@ -371,22 +416,55 @@ def retired_of_main(main_required):
|
||||
data = json.loads(path.read_text(encoding="utf-8"))
|
||||
except (OSError, ValueError) as exc:
|
||||
return [], ["the retired list of main %s cannot be read: %s" % (path, exc)]
|
||||
bad = validate_retired(data)
|
||||
try:
|
||||
rows = json.loads(Path(main_required).read_text(encoding="utf-8"))
|
||||
suite_ids = {r.get("id") for r in rows if isinstance(r, dict)} if isinstance(rows, list) else None
|
||||
except (OSError, ValueError):
|
||||
suite_ids = None # the list of main itself is read (and refused) by the caller
|
||||
bad = validate_retired(data, suite_ids)
|
||||
if bad:
|
||||
return [], ["the retired list of main %s is malformed: %s" % (path, "; ".join(bad))]
|
||||
return data, []
|
||||
|
||||
|
||||
def against_main(current, main, retired=(), exists=os.path.exists):
|
||||
def _retired_tests_of(row, retired, collected, judged):
|
||||
"""-> (the number of tests the row may lose because main retired them one by one, problems). An entry counts only if the file of its nodeid is
|
||||
in the row of main (a nodeid that the row does not run is not a test the row loses). The judge has the junit of the leg it judges and only
|
||||
counts of main, so a declared nodeid that the judged leg still collects is red (and counts for nothing), and the nodeid of another row is taken
|
||||
on its count, the leg of that row checking it. An entry counts only while the minimum of the row on main is still its `from_min_tests`: once
|
||||
the removal is on main the floor is lower and the entry is inert (it allows nothing and asks nothing)."""
|
||||
allowed, problems = 0, []
|
||||
listed = row.get("tests", [])
|
||||
for e in retired:
|
||||
if not (isinstance(e, dict) and isinstance(e.get("nodeid"), str) and e.get("suite") == row.get("id")):
|
||||
continue
|
||||
nid = e["nodeid"]
|
||||
if _int(row.get("min_tests")) != e.get("from_min_tests"):
|
||||
continue
|
||||
if nid not in listed and nid.split("::", 1)[0] not in listed:
|
||||
continue
|
||||
if collected is not None and judged == row.get("id") and any(n == nid or _base(n) == nid for n in collected):
|
||||
problems.append("the test %s is declared retired for %s, but the suite still collects it: it did not leave" % (nid, row.get("id")))
|
||||
continue
|
||||
allowed += _int(e.get("count"))
|
||||
return allowed, problems
|
||||
|
||||
|
||||
def against_main(current, main, retired=(), exists=os.path.exists, collected=None, judged=None):
|
||||
"""The list only grows: every suite of main is still here, with no lower minimum, no exact turned off, no lost
|
||||
test or OS and the same marker. `main` is read leniently (it may be older than the current format).
|
||||
|
||||
The one way a test leaves a row is `retired` (the list of MAIN, never of the branch): a file that main retired and that no longer exists
|
||||
(`exists`, in the checkout judged) is not a lost test, and the minimum of the row may go down by exactly the tests main counted for that file
|
||||
in that row (``tests[row id]``), and by no more. A retired file that is still on disk is not excused: it must stay in its rows."""
|
||||
in that row (``tests[row id]``), and by no more. A retired file that is still on disk is not excused: it must stay in its rows.
|
||||
|
||||
The other way is a single retired test (``nodeid``, ``suite``, ``count``) whose file stays in the row: the minimum of the suite may go down by
|
||||
the ``count`` of its entries, and by no more. ``collected`` (the node ids of the junit of the judged leg) and ``judged`` (that leg's suite) let
|
||||
the judge see that a declared nodeid is gone from the leg; of the collection of main it has only the count."""
|
||||
problems = []
|
||||
if not isinstance(main, list):
|
||||
return ["the list of main is not a JSON list: it cannot be compared"]
|
||||
retired = list(retired)
|
||||
gone = {e["file"]: e["tests"] for e in retired if isinstance(e, dict) and isinstance(e.get("file"), str)
|
||||
and isinstance(e.get("tests"), dict) and not exists(e["file"])}
|
||||
by_id = {s.get("id"): s for s in current if isinstance(s, dict)}
|
||||
@@ -402,10 +480,13 @@ def against_main(current, main, retired=(), exists=os.path.exists):
|
||||
excused = [t for t in lost if t in gone]
|
||||
lost = [t for t in lost if t not in gone]
|
||||
allowed = sum(_int(gone[t].get(sid)) for t in excused)
|
||||
by_test, why = _retired_tests_of(old, retired, collected, judged)
|
||||
allowed += by_test
|
||||
problems += why
|
||||
if _int(new.get("min_tests")) < _int(old.get("min_tests")) - allowed:
|
||||
problems.append("the minimum of %s went down: %s on main, %s here%s"
|
||||
% (sid, old.get("min_tests"), new.get("min_tests"),
|
||||
" (retired files account for %d of it)" % allowed if allowed else ""))
|
||||
" (retired files and tests account for %d of it)" % allowed if allowed else ""))
|
||||
if old.get("exact") is True and new.get("exact") is not True:
|
||||
problems.append("the suite %s is no longer exact, as it is on main" % sid)
|
||||
if lost:
|
||||
@@ -547,7 +628,8 @@ def cmd_judge(ns):
|
||||
try:
|
||||
retired, retired_problems = retired_of_main(ns.main_required)
|
||||
problems += retired_problems
|
||||
problems += against_main(suites, _read_json_list(ns.main_required), retired)
|
||||
problems += against_main(suites, _read_json_list(ns.main_required), retired,
|
||||
collected={n for n, _o in cases}, judged=ns.suite)
|
||||
except Usage as exc:
|
||||
problems.append(str(exc))
|
||||
elif ns.main_has_no_list:
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
r"""Read the full user-mode dumps Windows Error Reporting left for a python.exe that died, and say what each one holds (CI evidence, no debugger needed).
|
||||
|
||||
The Windows e2e jobs set ``HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\python.exe`` (full dump, folder ``<evidence>/dumps/python``)
|
||||
before their tests; when a pytest-xdist worker dies from an unhandled exception ("node down: Not properly terminated", "Windows fatal exception: access violation")
|
||||
WER writes ``python.exe.<pid>.dmp`` there and the evidence artifact carries it. This script runs after the tests (``if: always()``): it lists every dump with its size
|
||||
and reads the header of the MINIDUMP file, with ``struct`` only, to name what a debugger would name first: the thread that raised, the exception code, the faulting
|
||||
address and the module that holds it (with the offset in it), plus the access that failed for an access violation. The summary goes to stdout and to
|
||||
``summary.txt`` beside the dumps. It never fails the job: no dump is the normal case.
|
||||
|
||||
Format of the file: https://learn.microsoft.com/windows/win32/api/minidumpapiset/ (MINIDUMP_HEADER, MINIDUMP_DIRECTORY, MINIDUMP_EXCEPTION_STREAM,
|
||||
MINIDUMP_MODULE). Dump types and the LocalDumps key: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import struct
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
SIGNATURE = b"MDMP"
|
||||
MODULE_LIST_STREAM = 4
|
||||
EXCEPTION_STREAM = 6
|
||||
MODULE_SIZE = 108 # sizeof(MINIDUMP_MODULE)
|
||||
|
||||
EXCEPTION_NAMES = {
|
||||
0xC0000005: "EXCEPTION_ACCESS_VIOLATION",
|
||||
0xC0000374: "STATUS_HEAP_CORRUPTION",
|
||||
0xC0000409: "STATUS_STACK_BUFFER_OVERRUN (fail fast)",
|
||||
0xC00000FD: "EXCEPTION_STACK_OVERFLOW",
|
||||
0xC000001D: "EXCEPTION_ILLEGAL_INSTRUCTION",
|
||||
0xC0000094: "EXCEPTION_INT_DIVIDE_BY_ZERO",
|
||||
0xC0000026: "STATUS_INVALID_DISPOSITION",
|
||||
0xC0000096: "EXCEPTION_PRIV_INSTRUCTION",
|
||||
0xC0000006: "EXCEPTION_IN_PAGE_ERROR",
|
||||
0x80000003: "EXCEPTION_BREAKPOINT",
|
||||
0xE06D7363: "C++ exception",
|
||||
}
|
||||
ACCESS = {0: "read", 1: "write", 8: "execute (DEP)"}
|
||||
|
||||
|
||||
def read_dump(path: Path) -> dict:
|
||||
"""The facts of one minidump: thread id, exception code and address, the module holding the address. Raises ValueError on a file that is not a minidump."""
|
||||
with open(path, "rb") as f:
|
||||
head = f.read(32)
|
||||
if len(head) < 32 or head[:4] != SIGNATURE:
|
||||
raise ValueError("not a minidump (no MDMP signature)")
|
||||
_sig, _version, n_streams, dir_rva = struct.unpack_from("<4sIII", head, 0)
|
||||
f.seek(dir_rva)
|
||||
directory = [struct.unpack("<III", f.read(12)) for _ in range(n_streams)]
|
||||
out: dict = {"streams": n_streams}
|
||||
modules: list[tuple[int, int, str]] = []
|
||||
for kind, size, rva in directory:
|
||||
if kind == MODULE_LIST_STREAM:
|
||||
f.seek(rva)
|
||||
(count,) = struct.unpack("<I", f.read(4))
|
||||
records = f.read(count * MODULE_SIZE)
|
||||
for i in range(count):
|
||||
base, image_size, _cs, _ts, name_rva = struct.unpack_from("<QIIII", records, i * MODULE_SIZE)
|
||||
here = f.tell()
|
||||
f.seek(name_rva)
|
||||
(nbytes,) = struct.unpack("<I", f.read(4))
|
||||
name = f.read(nbytes).decode("utf-16-le", "replace")
|
||||
f.seek(here)
|
||||
modules.append((base, image_size, name))
|
||||
elif kind == EXCEPTION_STREAM:
|
||||
f.seek(rva)
|
||||
raw = f.read(8 + 8 + 8 + 8 + 8 + 15 * 8)
|
||||
tid, _pad, code, flags, _chain, address, n_params, _pad2 = struct.unpack_from("<IIIIQQII", raw, 0)
|
||||
params = struct.unpack_from("<15Q", raw, 8 + 32)
|
||||
out.update(thread_id=tid, code=code, flags=flags, address=address, params=list(params[:n_params]))
|
||||
out["module_count"] = len(modules)
|
||||
if "address" in out:
|
||||
for base, image_size, name in modules:
|
||||
if base <= out["address"] < base + image_size:
|
||||
out["module"] = name
|
||||
out["offset"] = out["address"] - base
|
||||
break
|
||||
return out
|
||||
|
||||
|
||||
def describe(path: Path) -> str:
|
||||
size = path.stat().st_size
|
||||
head = "%s: %.1f MB" % (path.name, size / 1e6)
|
||||
try:
|
||||
d = read_dump(path)
|
||||
except (ValueError, OSError, struct.error) as e:
|
||||
return "%s, unreadable header: %s" % (head, e)
|
||||
if "code" not in d:
|
||||
return "%s, %d modules, no exception stream (a dump taken on request, not on a fault)" % (head, d["module_count"])
|
||||
name = EXCEPTION_NAMES.get(d["code"], "unknown")
|
||||
lines = [
|
||||
head,
|
||||
" exception 0x%08X %s on thread %d" % (d["code"], name, d["thread_id"]),
|
||||
" at 0x%016X in %s" % (d["address"], ("%s+0x%X" % (d["module"], d["offset"])) if "module" in d else "no module of the dump (JIT or freed code)"),
|
||||
]
|
||||
p = d["params"]
|
||||
if d["code"] in (0xC0000005, 0xC0000006) and len(p) >= 2:
|
||||
lines.append(" failed access: %s of 0x%016X" % (ACCESS.get(p[0], str(p[0])), p[1]))
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def summarize(folder: Path) -> str:
|
||||
dumps = sorted(folder.glob("*.dmp")) if folder.is_dir() else []
|
||||
cdb = shutil.which("cdb") or shutil.which("windbg")
|
||||
lines = ["WER dumps of python.exe in %s: %d" % (folder, len(dumps)), "debugger on the runner: %s" % (cdb or "none (the header reader above is all there is)")]
|
||||
for p in dumps:
|
||||
lines.append(describe(p) + "\n written %s" % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(p.stat().st_mtime)))
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
def main(argv: list[str]) -> int:
|
||||
folder = Path(argv[1]) if len(argv) > 1 else Path(".")
|
||||
text = summarize(folder)
|
||||
sys.stdout.write(text)
|
||||
if folder.is_dir():
|
||||
(folder / "summary.txt").write_text(text, encoding="utf-8", newline="\n")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -10,7 +10,9 @@ seeds. This computes them from the prefs themselves, never from a list of the ta
|
||||
is a seed dimension);
|
||||
* every pref whose value differs between two seeds must belong to a DIMENSION below (a group of prefs read
|
||||
together: the renderer, the screen panel, the audio chain...) or be named in EXCLUDED with its reason. A pref
|
||||
that varies and is in neither is an error, so a new pref of a later core cannot go uncovered unnoticed;
|
||||
that varies and is in neither is an error, so a new pref of a later core cannot go uncovered unnoticed. A pref that
|
||||
is a function of a dimension (the bar of a maximized window is of the panel) is in DERIVED instead: it is checked to
|
||||
take one value per value of its dimension, and it is no part of the stored features;
|
||||
* a dimension's value for a seed is the joint value of its prefs; the reachable values of a dimension are the
|
||||
ones some seed in range produces.
|
||||
|
||||
@@ -56,7 +58,7 @@ DIMENSIONS = {
|
||||
"gfx_feature_status": (P + "gfx.feature_status",),
|
||||
"screen_panel": (P + "screen.width", P + "screen.height", P + "screen.avail_device_width",
|
||||
P + "screen.avail_device_height", "layout.css.devPixelsPerPx"),
|
||||
"dpr": ("layout.css.devPixelsPerPx", P + "screen.frame_border", P + "screen.maximized_ui", P + "screen.popup_ui"),
|
||||
"dpr": ("layout.css.devPixelsPerPx", P + "screen.frame_border", P + "screen.popup_ui", P + "screen.popup_client_top"),
|
||||
"cores": (P + "hw_concurrency",),
|
||||
"audio": (P + "audio.sample_rate", P + "audio.output_latency_ms", P + "audio.max_channel_count"),
|
||||
"codecs": ("media.av1.enabled", "media.encoder.webm.enabled", "media.mp4.enabled", "media.webm.enabled",
|
||||
@@ -73,6 +75,15 @@ EXCLUDED = {
|
||||
P + "media.enumeration_ms": "the time of the first enumerateDevices(): a draw from its own stream, hundreds of values, "
|
||||
"no class of seeds to cover",
|
||||
}
|
||||
#: Prefs that are a function of a dimension: {pref: the dimension}. They are not part of the dimension's value (so the
|
||||
#: stored features do not depend on which core emits them) and compute() CHECKS that, across the seeds, each takes exactly
|
||||
#: one value per value of its dimension, like the webgl prefs per renderer. A derived pref the core does not emit at all is
|
||||
#: 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).
|
||||
DERIVED = {
|
||||
P + "screen.maximized_ui": "screen_panel",
|
||||
}
|
||||
#: What the candidate run visits: the smallest set that reaches every one of these dimensions' values.
|
||||
CANDIDATE_DIMENSIONS = ("webgl_renderer", "dpr")
|
||||
WEBGL = P + "webgl."
|
||||
@@ -106,6 +117,7 @@ def seed_features(seed: int) -> tuple:
|
||||
features["gfx_device"] = profile.gpu.device or "<none>"
|
||||
webgl = {k: json.dumps(v, sort_keys=True) for k, v in prefs.items() if k.startswith(WEBGL)}
|
||||
features["_webgl"] = hashlib.sha256(json.dumps(webgl, sort_keys=True).encode()).hexdigest()[:12]
|
||||
features["_derived"] = {k: json.dumps(prefs.get(k, "<absent>"), sort_keys=True) for k in DERIVED}
|
||||
return features, {k: json.dumps(v, sort_keys=True) for k, v in prefs.items()}
|
||||
|
||||
|
||||
@@ -125,11 +137,25 @@ def _range(bounds: tuple) -> tuple:
|
||||
return features, seen
|
||||
|
||||
|
||||
def check_derived(features: dict) -> None:
|
||||
"""Raises when a DERIVED pref takes two values within one value of its dimension. features: {seed: {dimension: value,
|
||||
"_derived": {pref: value}}}. A pref no seed has is skipped (a core that does not emit it)."""
|
||||
for pref, dim in DERIVED.items():
|
||||
seen = {}
|
||||
for seed in sorted(features):
|
||||
value = features[seed]["_derived"][pref]
|
||||
if seen.setdefault(features[seed][dim], (value, seed))[0] != value:
|
||||
first = seen[features[seed][dim]]
|
||||
raise SystemExit("the derived pref %s is not a function of the dimension %s (seed %d: %s, seed %d: %s, "
|
||||
"both with %s): it belongs to a wider dimension" % (
|
||||
pref, dim, first[1], first[0], seed, value, features[seed][dim]))
|
||||
|
||||
|
||||
def compute(max_seed: int = MAX_SEED, workers: int | None = None) -> dict:
|
||||
"""The features of every seed 0..max_seed-1: {seed: {dimension: value}} (the dimensions of ALL_DIMENSIONS).
|
||||
|
||||
Raises when a pref varies across the seeds and is in no dimension and not in EXCLUDED, or when the webgl prefs are
|
||||
not a function of the renderer."""
|
||||
Raises when a pref varies across the seeds and is in no dimension and not in EXCLUDED or DERIVED, when a DERIVED
|
||||
pref is not a function of its dimension, or when the webgl prefs are not a function of the renderer."""
|
||||
workers = workers or max(1, min(os.cpu_count() or 1, 8))
|
||||
step = max(1, -(-max_seed // (workers * 4)))
|
||||
bounds = [(lo, min(lo + step, max_seed)) for lo in range(0, max_seed, step)]
|
||||
@@ -145,10 +171,12 @@ def compute(max_seed: int = MAX_SEED, workers: int | None = None) -> dict:
|
||||
seen.setdefault(k, set()).update(vs)
|
||||
covered = {k for keys in DIMENSIONS.values() for k in keys}
|
||||
varying = sorted(k for k, vs in seen.items() if len(vs) > 1)
|
||||
loose = [k for k in varying if k not in covered and k not in EXCLUDED and not k.startswith(WEBGL)]
|
||||
loose = [k for k in varying if k not in covered and k not in EXCLUDED and k not in DERIVED and not k.startswith(WEBGL)]
|
||||
if loose:
|
||||
raise SystemExit("prefs that vary across seeds and belong to no dimension and are not excluded: %s\n"
|
||||
"add each to a DIMENSION or to EXCLUDED (with the reason) in scripts/persona_cover.py" % loose)
|
||||
"add each to a DIMENSION, to DERIVED (a function of one) or to EXCLUDED (with the reason) in "
|
||||
"scripts/persona_cover.py" % loose)
|
||||
check_derived(features)
|
||||
byrenderer = {}
|
||||
for seed in sorted(features):
|
||||
f = features[seed]
|
||||
@@ -156,6 +184,8 @@ def compute(max_seed: int = MAX_SEED, workers: int | None = None) -> dict:
|
||||
raise SystemExit("the webgl prefs are not a function of the renderer (seed %d, %s): split the dimension"
|
||||
% (seed, f["webgl_renderer"]))
|
||||
del f["_webgl"]
|
||||
for f in features.values():
|
||||
del f["_derived"]
|
||||
stale = [k for k in EXCLUDED if k not in seen or len(seen[k]) < 2]
|
||||
if stale:
|
||||
raise SystemExit("excluded prefs that no longer vary: %s: remove them from EXCLUDED" % stale)
|
||||
|
||||
@@ -215,3 +215,45 @@ def refusal(operation):
|
||||
"invisible_playwright does not implement: the package covers the "
|
||||
"automation core, and " + feature + " is outside it by decision, "
|
||||
"not by omission. See 32-stacco-da-playwright.md section 5.4.")
|
||||
|
||||
|
||||
#: ⛔ A PARAMETER OF A SERVED OPERATION THAT IS REFUSED, keyed by (operation, parameter), and the sentence a caller reads.
|
||||
#: The operations above are refused whole; these are refused one parameter (or one value of it) at a time, and the call
|
||||
#: without them is served. They are raised in `server.py` by `_refuse_parameter(operation, parameter)`, the one function
|
||||
#: that reads this table, and `tests/test_every_refusal_is_declared.py` holds the two sides to each other.
|
||||
#:
|
||||
#: ⛔ WHY THESE FIVE. Stock Playwright honours `mask`, `style` and `animations="disabled"` by MODIFYING THE PAGE (an overlay,
|
||||
#: an injected `<style>`, animations finished or cancelled) before the picture and putting it back after. This package does
|
||||
#: not touch a page to photograph it, and until now it did not read them either: the call succeeded and the picture was as
|
||||
#: if they had not been written, which a caller cannot see. `caret="initial"` asks for the text caret to be drawn, and the
|
||||
#: engine never draws it (the capture does not set the flag that draws it), so the picture it takes is the one `"hide"`
|
||||
#: asks for, which is also Playwright's default: `"hide"` and an absent `caret` are served. `omitBackground` with png is
|
||||
#: Firefox's own `Not implemented` in stock (`FFPage.setBackgroundColor`), word for word; with jpeg stock does nothing and
|
||||
#: neither do we.
|
||||
REFUSED_PARAMETERS = {
|
||||
("screenshot", "mask"):
|
||||
"screenshot(mask=...) is not served: Playwright covers the masked elements by modifying the page (an overlay is "
|
||||
"put on it before the picture), and this package does not touch a page to take a picture. maskColor goes with "
|
||||
"mask and is refused with it. Hide the elements yourself before the screenshot (for example set their "
|
||||
"visibility to hidden in your own script) and restore them after.",
|
||||
("screenshot", "style"):
|
||||
"screenshot(style=...) is not served: Playwright applies it by modifying the page (a <style> element is "
|
||||
"injected before the picture and removed after), and this package does not touch a page to take a picture. Add "
|
||||
"the style yourself with page.add_style_tag() before the screenshot and remove the element it returns after.",
|
||||
("screenshot", "animations"):
|
||||
'screenshot(animations="disabled") is not served: Playwright does it by modifying the page (the finite '
|
||||
"animations are finished and the infinite ones cancelled), and this package does not touch a page to take a "
|
||||
"picture. Wait for the animations to end, or pause them in your own script (document.getAnimations()), before "
|
||||
'the screenshot. animations="allow" is what is served.',
|
||||
("screenshot", "caret"):
|
||||
'screenshot(caret="initial") is not served: it asks for the text caret to be drawn in the picture, and the '
|
||||
'engine never draws it (the picture is the one caret="hide" asks for, which is the default of Playwright). Leave '
|
||||
'caret out or pass "hide".',
|
||||
("screenshot", "omitBackground"):
|
||||
"Not implemented",
|
||||
}
|
||||
|
||||
|
||||
def parameter_refusal(operation, parameter):
|
||||
"""The sentence for a refused (operation, parameter): `KeyError` for one that is not declared."""
|
||||
return REFUSED_PARAMETERS[(operation, parameter)]
|
||||
@@ -47,7 +47,7 @@ from invisible_core.juggler import PageActs, popup_number
|
||||
from invisible_core.juggler import connection as juggler
|
||||
from invisible_core.juggler.actions import Actions
|
||||
from invisible_core.juggler.deadline import Deadline
|
||||
from . import _bindings, dialogs
|
||||
from . import _bindings, dialogs, perimeter
|
||||
from ._reaped import SessionRemoval
|
||||
from ._threads import ThreadStarterLease
|
||||
from .pointer import Pointer
|
||||
@@ -676,6 +676,37 @@ def _run_callers_code(injected: InjectedScript, frame_id: str, params: Dict,
|
||||
argument.release()
|
||||
|
||||
|
||||
def _refuse_parameter(operation: str, parameter: str):
|
||||
"""Refuse one parameter of a served operation with the sentence `perimeter.REFUSED_PARAMETERS` holds for it.
|
||||
|
||||
⛔ THE ONLY WAY A PARAMETER IS REFUSED, so that the inventory and the code cannot drift: the test of the refusals reads
|
||||
every call of this function in the file and holds it to that table, both ways."""
|
||||
raise ProtocolException(perimeter.parameter_refusal(operation, parameter))
|
||||
|
||||
|
||||
def _refuse_unserved_screenshot_parameters(params: Dict) -> None:
|
||||
"""⛔ WHAT STOCK DOES BY MODIFYING THE PAGE IS REFUSED, NOT IGNORED, AND BEFORE THE PAGE IS TOUCHED. `mask`, `style` and
|
||||
`animations="disabled"` change the page before the picture in Playwright; this server took them without reading them, and the
|
||||
picture came back as if they had not been written. `caret="initial"` asks for the text caret to be drawn, which the engine never
|
||||
does. `omitBackground` with png is Firefox's own `Not implemented` (stock reaches it only for png). The sentences are
|
||||
`perimeter.REFUSED_PARAMETERS`'.
|
||||
|
||||
⛔ THE ONE CHECK, CALLED FIRST BY THE PAGE'S SCREENSHOT AND BY THE ELEMENT'S (a locator's is the element's): the element's call
|
||||
scrolls the element into view and measures it, and a call that is going to be refused must not have done either. It reads
|
||||
`params` and nothing else, so calling it again with the same parameters, as the element's call does through the page's, answers
|
||||
the same."""
|
||||
if params.get("mask"):
|
||||
_refuse_parameter("screenshot", "mask")
|
||||
if params.get("style"):
|
||||
_refuse_parameter("screenshot", "style")
|
||||
if params.get("animations") == "disabled":
|
||||
_refuse_parameter("screenshot", "animations")
|
||||
if params.get("caret") == "initial":
|
||||
_refuse_parameter("screenshot", "caret")
|
||||
if params.get("omitBackground") and params.get("type") != "jpeg":
|
||||
_refuse_parameter("screenshot", "omitBackground")
|
||||
|
||||
|
||||
def _round_px(value: float) -> int:
|
||||
"""To the nearest whole pixel, halves up (Python's `round` goes to even: 0.5 -> 0, 1.5 -> 2)."""
|
||||
import math
|
||||
@@ -1071,6 +1102,8 @@ class ElementHandleDispatcher(Dispatcher):
|
||||
Playwright's screenshotter does: the left and top edges to the nearest
|
||||
pixel, the size from the rounded right and bottom edges.
|
||||
"""
|
||||
# ⛔ THE REFUSAL COMES BEFORE THE SCROLL AND THE MEASURE: a call that is refused must not have moved the page.
|
||||
_refuse_unserved_screenshot_parameters(params)
|
||||
# An element with no layout object (display: none, detached) cannot be scrolled to: the engine says so
|
||||
# with an exception of its own. For the caller that is the same answer as an empty box.
|
||||
try:
|
||||
@@ -4477,6 +4510,10 @@ class PageDispatcher(Dispatcher):
|
||||
# A clip the CALLER supplied is passed through untouched. Playwright
|
||||
# documents it in page coordinates, which is what the engine wants, so
|
||||
# there is nothing to translate.
|
||||
# ⛔ THE REFUSALS ARE `_refuse_unserved_screenshot_parameters`, THE FIRST THING HERE AND THE FIRST THING IN THE ELEMENT'S SCREENSHOT.
|
||||
# It is idempotent, so the element's call, which hands its rectangle and the caller's parameters to this one, passes it twice
|
||||
# and the second pass is the same answer.
|
||||
_refuse_unserved_screenshot_parameters(params)
|
||||
clip = params.get("clip")
|
||||
if not clip:
|
||||
box = self.injected.evaluate(
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
"""A test that is not e2e never leaves the machine: every connection, datagram and name lookup it makes goes to this host or is refused.
|
||||
|
||||
The markers say it already (pyproject.toml: ``unit`` is "no network", ``integration`` is "no network"), and nothing enforced it:
|
||||
``tests/unit/test_config_public.py`` composed the default prefs with no declared exit, the core asked api.ipify.org and icanhazip.com
|
||||
where it leaves from, and the test failed on a machine whose network refused them. A test cannot fail for the reasons of a third party.
|
||||
|
||||
:func:`install` patches the four doors of the standard library that every client in the process goes through (``socket.socket.connect``,
|
||||
``connect_ex`` and ``sendto``, and ``socket.getaddrinfo``): a destination on this host passes, anything else is refused with
|
||||
:class:`LeftTheMachine` (a ``ConnectionRefusedError``, so the code under test sees what an offline machine shows it) AND recorded, so the test
|
||||
fails at its teardown even when the code under test swallowed the refusal. The record names the test, the door and the destination.
|
||||
|
||||
asyncio has doors of its own, and on Windows they skip the four above: the Proactor loop connects with ``ConnectEx`` and sends datagrams with
|
||||
``WSASendTo`` (``_overlapped``), never through ``socket.socket``. So the guard also patches the loop methods every asyncio client goes through, for
|
||||
both loop kinds: ``BaseEventLoop.create_connection`` and ``create_datagram_endpoint`` (``remote_addr``), ``sock_connect`` and ``sock_sendto`` of the
|
||||
selector and of the Proactor loop, and the Proactor datagram transport's ``sendto``.
|
||||
|
||||
What it cannot see, on any system: a socket made from ``_socket`` directly or used through ``_overlapped`` by hand (no library of this project
|
||||
does), native code in the same process, and a child process (a subprocess has its own interpreter: the e2e are where a browser runs).
|
||||
|
||||
On this host: a loopback address (127/8, ::1), the unspecified address (0.0.0.0, ::, which a connect reaches on this host), a name that is
|
||||
``localhost`` or ends in ``.localhost``, and an AF_UNIX path. The documentation ranges (192.0.2/24, 198.51.100/24, 203.0.113/24, 2001:db8::/32)
|
||||
pass too: they are never routed, and the lab gives one of them to an interface of this host (the exit of the lab, tests/_lab_egress.py).
|
||||
And the address this host sends from (its default route's, tests/_host_address.py): a relay of the tests that leaves from the address of the
|
||||
host is on this host, and a datagram to it never leaves the machine.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ipaddress
|
||||
import socket
|
||||
import threading
|
||||
from typing import Any, List, Optional, Sequence, Tuple
|
||||
|
||||
_DOCUMENTATION = tuple(ipaddress.ip_network(n) for n in ("192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24", "2001:db8::/32"))
|
||||
|
||||
RULE = ("a test that is not e2e never leaves the machine (pyproject.toml markers: unit and integration are 'no network'): "
|
||||
"a test cannot fail for the reasons of a third party")
|
||||
FIX = ("declare the value the code would ask the network for (timezone=, locale=, proxy= with a local gateway), use a server of the tests "
|
||||
"on loopback (tests/_servers.py, the local_egress_echo fixture), or mark the test e2e if it is one")
|
||||
|
||||
|
||||
#: The ONE file whose job is to ask a third party, and the hosts it may ask. Nothing else is declared, and a new entry is a decision, not a fix.
|
||||
#: ``tests/test_version_is_not_taken.py`` is the version gate of a pull request: it asks the index whether the version the change proposes
|
||||
#: is already published, which only the index can answer. It is skipped unless ``IPW_CHECK_VERSION`` is set, which only the ``version`` job
|
||||
#: of tests.yml does. Its host is allowed for its name lookup and for the addresses that lookup answered, nothing else.
|
||||
DECLARED_THIRD_PARTIES = {
|
||||
"tests/test_version_is_not_taken.py": ("pypi.org",),
|
||||
}
|
||||
|
||||
|
||||
class LeftTheMachine(ConnectionRefusedError):
|
||||
"""A destination outside this host, refused by the guard of the tests."""
|
||||
|
||||
|
||||
def own_addresses() -> Tuple[str, ...]:
|
||||
"""The addresses this host sends from, IPv4 and IPv6 (the source its default route picks). A UDP connect sends no packet; a family with
|
||||
no route has none. Read BEFORE the doors are patched."""
|
||||
found = []
|
||||
for family, probe in ((socket.AF_INET, ("192.0.2.1", 9)), (socket.AF_INET6, ("2001:db8::1", 9))):
|
||||
try:
|
||||
with socket.socket(family, socket.SOCK_DGRAM) as s:
|
||||
s.connect(probe)
|
||||
found.append(s.getsockname()[0].split("%", 1)[0])
|
||||
except OSError:
|
||||
pass
|
||||
return tuple(found)
|
||||
|
||||
|
||||
def is_on_this_host(host: Any, own: Sequence[str] = ()) -> bool:
|
||||
"""Whether ``host`` (an address, a name, or None) is on this host, the way the guard decides it; ``own`` are the addresses of this host
|
||||
(:func:`own_addresses`)."""
|
||||
if host is None:
|
||||
return True
|
||||
if isinstance(host, bytes):
|
||||
host = host.decode("ascii", "replace")
|
||||
host = str(host).strip("[]").split("%", 1)[0]
|
||||
if host == "" or host.lower() == "localhost" or host.lower().endswith(".localhost"):
|
||||
return True
|
||||
try:
|
||||
address = ipaddress.ip_address(host)
|
||||
except ValueError:
|
||||
return False # a name: resolving it is already a question to the network
|
||||
if getattr(address, "ipv4_mapped", None) is not None:
|
||||
address = address.ipv4_mapped
|
||||
return (address.is_loopback or address.is_unspecified or any(address in net for net in _DOCUMENTATION)
|
||||
or any(address == ipaddress.ip_address(mine) for mine in own))
|
||||
|
||||
|
||||
def _destination(address: Any, own: Sequence[str] = ()) -> Optional[str]:
|
||||
"""``host:port`` of a socket address that leaves the machine, or None when it does not (AF_UNIX paths and this host)."""
|
||||
if not isinstance(address, tuple) or not address:
|
||||
return None # an AF_UNIX path or an abstract name: this host
|
||||
host = address[0]
|
||||
if is_on_this_host(host, own):
|
||||
return None
|
||||
return "%s:%s" % (host, address[1] if len(address) > 1 else "?")
|
||||
|
||||
|
||||
class Guard:
|
||||
"""The record of one test: what it tried outside the machine. Thread-safe: a client thread of the test is recorded too."""
|
||||
|
||||
def __init__(self, test: str) -> None:
|
||||
self.test = test
|
||||
self.attempts: List[str] = []
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def refuse(self, door: str, destination: str) -> LeftTheMachine:
|
||||
sentence = "%s %s" % (door, destination)
|
||||
with self._lock:
|
||||
if sentence not in self.attempts:
|
||||
self.attempts.append(sentence)
|
||||
return LeftTheMachine("WHERE: %s. WHAT: %s, outside this host, refused. FIX: %s. RULE: %s." % (self.test, sentence, FIX, RULE))
|
||||
|
||||
def verdict(self) -> Optional[str]:
|
||||
"""The failure of the test, or None when it stayed on this host."""
|
||||
if not self.attempts:
|
||||
return None
|
||||
return ("WHERE: %s. WHAT: the test tried to leave the machine: %s (each was refused). FIX: %s. RULE: %s."
|
||||
% (self.test, "; ".join(self.attempts), FIX, RULE))
|
||||
|
||||
|
||||
def install(monkeypatch: Any, test: str) -> Guard:
|
||||
"""Patch the four doors for the duration of ``monkeypatch``; return the record of ``test``."""
|
||||
guard = Guard(test)
|
||||
declared_hosts = DECLARED_THIRD_PARTIES.get(test.split("::", 1)[0].replace("\\", "/"), ())
|
||||
answered = set() # the addresses a lookup of a declared host answered: a connection to them is that host
|
||||
own = tuple(own_addresses())
|
||||
|
||||
def mine():
|
||||
return own + tuple(answered)
|
||||
connect, connect_ex, sendto, getaddrinfo = (socket.socket.connect, socket.socket.connect_ex, socket.socket.sendto,
|
||||
socket.getaddrinfo)
|
||||
|
||||
def guarded_connect(self, address):
|
||||
where = _destination(address, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("connect to", where)
|
||||
return connect(self, address)
|
||||
|
||||
def guarded_connect_ex(self, address):
|
||||
where = _destination(address, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("connect to", where)
|
||||
return connect_ex(self, address)
|
||||
|
||||
def guarded_sendto(self, data, *rest):
|
||||
where = _destination(rest[-1] if rest else None, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("datagram to", where)
|
||||
return sendto(self, data, *rest)
|
||||
|
||||
def guarded_getaddrinfo(host, *args, **kwargs):
|
||||
if isinstance(host, str) and host.lower() in declared_hosts:
|
||||
found = getaddrinfo(host, *args, **kwargs)
|
||||
answered.update(info[4][0] for info in found)
|
||||
return found
|
||||
if not is_on_this_host(host, mine()):
|
||||
raise guard.refuse("name lookup of", str(host))
|
||||
return getaddrinfo(host, *args, **kwargs)
|
||||
|
||||
_install_asyncio(monkeypatch, guard, mine)
|
||||
monkeypatch.setattr(socket.socket, "connect", guarded_connect)
|
||||
monkeypatch.setattr(socket.socket, "connect_ex", guarded_connect_ex)
|
||||
monkeypatch.setattr(socket.socket, "sendto", guarded_sendto)
|
||||
monkeypatch.setattr(socket, "getaddrinfo", guarded_getaddrinfo)
|
||||
return guard
|
||||
|
||||
|
||||
def _install_asyncio(monkeypatch: Any, guard: Guard, mine: Any) -> None:
|
||||
"""The asyncio doors (module docstring), for the selector loop and, where it exists, the Proactor loop."""
|
||||
import asyncio.base_events as base_events
|
||||
import asyncio.selector_events as selector_events
|
||||
|
||||
loops = [selector_events.BaseSelectorEventLoop]
|
||||
datagram_transports = []
|
||||
try:
|
||||
import asyncio.proactor_events as proactor_events
|
||||
loops.append(proactor_events.BaseProactorEventLoop)
|
||||
datagram_transports.append(proactor_events._ProactorDatagramTransport)
|
||||
except ImportError: # pragma: no cover - the module exists on every system; its loop runs only on Windows
|
||||
pass
|
||||
|
||||
create_connection = base_events.BaseEventLoop.create_connection
|
||||
create_datagram_endpoint = base_events.BaseEventLoop.create_datagram_endpoint
|
||||
|
||||
async def guarded_create_connection(self, protocol_factory, host=None, port=None, *args, **kwargs):
|
||||
if host is not None and kwargs.get("sock") is None and not is_on_this_host(host, mine()):
|
||||
raise guard.refuse("asyncio connect to", "%s:%s" % (host, port))
|
||||
return await create_connection(self, protocol_factory, host, port, *args, **kwargs)
|
||||
|
||||
async def guarded_create_datagram_endpoint(self, protocol_factory, local_addr=None, remote_addr=None, **kwargs):
|
||||
where = _destination(remote_addr, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("asyncio datagram endpoint to", where)
|
||||
return await create_datagram_endpoint(self, protocol_factory, local_addr=local_addr, remote_addr=remote_addr, **kwargs)
|
||||
|
||||
monkeypatch.setattr(base_events.BaseEventLoop, "create_connection", guarded_create_connection)
|
||||
monkeypatch.setattr(base_events.BaseEventLoop, "create_datagram_endpoint", guarded_create_datagram_endpoint)
|
||||
|
||||
for loop in loops:
|
||||
sock_connect, sock_sendto = loop.sock_connect, loop.sock_sendto
|
||||
|
||||
def make(sock_connect=sock_connect, sock_sendto=sock_sendto):
|
||||
async def guarded_sock_connect(self, sock, address):
|
||||
where = _destination(address, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("asyncio connect to", where)
|
||||
return await sock_connect(self, sock, address)
|
||||
|
||||
async def guarded_sock_sendto(self, sock, data, address):
|
||||
where = _destination(address, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("asyncio datagram to", where)
|
||||
return await sock_sendto(self, sock, data, address)
|
||||
return guarded_sock_connect, guarded_sock_sendto
|
||||
|
||||
guarded_sock_connect, guarded_sock_sendto = make()
|
||||
monkeypatch.setattr(loop, "sock_connect", guarded_sock_connect)
|
||||
monkeypatch.setattr(loop, "sock_sendto", guarded_sock_sendto)
|
||||
|
||||
for transport in datagram_transports:
|
||||
def make_sendto(sendto=transport.sendto):
|
||||
def guarded_sendto(self, data, addr=None):
|
||||
where = _destination(addr, mine())
|
||||
if where is not None:
|
||||
raise guard.refuse("asyncio datagram to", where)
|
||||
return sendto(self, data, addr)
|
||||
return guarded_sendto
|
||||
monkeypatch.setattr(transport, "sendto", make_sendto())
|
||||
@@ -0,0 +1,200 @@
|
||||
"""Where the operating system's own cursor is while a headed browser window is on the desktop the test runs on.
|
||||
|
||||
A real window that appears under the OS cursor receives a native ``WM_MOUSEMOVE`` for it, and the first native move of a process always passes Gecko's
|
||||
``LastMouseMoveData`` filter, so the page sees ``mousemove`` at the cursor's place with ``buttons=0``, at a moment the test does not choose. On a GitHub
|
||||
Windows runner the cursor sits at (512, 384) and the headed window covers (-8, -8) to (1928, 1040): the move reached the page once in the middle of a drag
|
||||
(``test_drag_motion.py::test_a_real_page_sees_a_drag_that_travelled`` saw ``mousemove 512,299 buttons=0`` after the press). The engine keeps delivering native
|
||||
input to content, so the arrangement is the test's: the cursor is parked on a point of the desktop that no window of the browser covers, before the browser
|
||||
starts, and a test that records pointer events checks it still is when its gesture begins.
|
||||
|
||||
* Windows: ``user32`` through ctypes. The windows are the visible top-level ones of the processes below the test process (the browsers it launched), seen from
|
||||
the desktop the test runs on: a ``headless=True`` browser runs on a Win32 desktop of its own (``make_virtual_display``), is not enumerated here and cannot
|
||||
receive the interactive cursor.
|
||||
* Linux and macOS: nothing to do. The Linux e2e run under ``xvfb-run``: an X server with virtual pointer and keyboard devices (XTEST) and no physical one,
|
||||
so nothing moves a pointer there; every function answers "outside" and ``park`` does nothing.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
from typing import List, Optional, Sequence, Tuple
|
||||
|
||||
#: ``(left, top, right, bottom)`` as ``GetWindowRect`` gives it: ``right`` and ``bottom`` are the first pixel outside.
|
||||
Rect = Tuple[int, int, int, int]
|
||||
Point = Tuple[int, int]
|
||||
|
||||
#: How far from every window the parked cursor is, in pixels: a window is moved or grown by a border or a shadow, and the cursor must stay outside of it.
|
||||
MARGIN = 8
|
||||
|
||||
|
||||
class TheCursorIsInside(AssertionError):
|
||||
"""The OS cursor is over a window of the browser while a gesture is about to start."""
|
||||
|
||||
|
||||
class TheCursorCannotBeParked(RuntimeError):
|
||||
"""No point of the desktop is free of the browser's windows, or the system did not move the cursor."""
|
||||
|
||||
|
||||
def _inflate(rect: Rect, margin: int) -> Rect:
|
||||
return (rect[0] - margin, rect[1] - margin, rect[2] + margin, rect[3] + margin)
|
||||
|
||||
|
||||
def _contains(rect: Rect, point: Point) -> bool:
|
||||
return rect[0] <= point[0] < rect[2] and rect[1] <= point[1] < rect[3]
|
||||
|
||||
|
||||
def cursor_is_outside(window_rects: Sequence[Rect], cursor: Optional[Point] = None, margin: int = 0, *,
|
||||
api: Optional["_Win32"] = None) -> bool:
|
||||
"""True when ``cursor`` (read from the system when None) is outside every rectangle, ``margin`` pixels beyond its edge included.
|
||||
|
||||
Not Windows: True, there is no OS cursor that reaches a window."""
|
||||
if cursor is None:
|
||||
api = api or _api()
|
||||
if api is None:
|
||||
return True
|
||||
cursor = api.cursor_position()
|
||||
return not any(_contains(_inflate(r, margin), cursor) for r in window_rects)
|
||||
|
||||
|
||||
def park_outside(window_rects: Sequence[Rect], screen_rect: Rect, margin: int = MARGIN) -> Point:
|
||||
"""A pixel of the virtual screen that is at least ``margin`` pixels from every window rectangle: the bottom-right corner when it is free.
|
||||
|
||||
``screen_rect`` is ``(left, top, right, bottom)`` of the virtual screen, ``right`` and ``bottom`` exclusive (its origin is negative when a monitor lies left of or
|
||||
above the primary one). The candidates are the screen's edges and the places just beyond each window's inflated edges; a free pixel exists only if one
|
||||
of them is free (the free pixel can be slid left and up until it touches an edge, and it stays free), so a ``TheCursorCannotBeParked`` is exact."""
|
||||
left, top, right, bottom = screen_rect
|
||||
if right <= left or bottom <= top:
|
||||
raise TheCursorCannotBeParked(
|
||||
"park_outside: the virtual screen %r is empty. Where: the screen rectangle read from the system. What: no pixel to put the cursor on. "
|
||||
"Fix: run the e2e on an interactive desktop session." % (screen_rect,))
|
||||
inflated = [_inflate(r, margin) for r in window_rects]
|
||||
xs = sorted({right - 1, left, *(min(max(r[2], left), right - 1) for r in inflated), *(min(max(r[0] - 1, left), right - 1) for r in inflated)},
|
||||
reverse=True)
|
||||
ys = sorted({bottom - 1, top, *(min(max(r[3], top), bottom - 1) for r in inflated), *(min(max(r[1] - 1, top), bottom - 1) for r in inflated)},
|
||||
reverse=True)
|
||||
for y in ys:
|
||||
for x in xs:
|
||||
if not any(_contains(r, (x, y)) for r in inflated):
|
||||
return (x, y)
|
||||
raise TheCursorCannotBeParked(
|
||||
"park_outside: the windows %r cover every pixel of the screen %r with a margin of %d. Where: the headed browser window the test launched. What: the "
|
||||
"OS cursor would be over the page whatever the point, and a native mouse move would reach it. Fix: shrink the window below the screen (the test's own "
|
||||
"geometry; it is not this helper's to change) or run the test on a bigger desktop." % (list(window_rects), screen_rect, margin))
|
||||
|
||||
|
||||
class _Win32:
|
||||
"""What the desktop answers, by ``user32``. One object so a test can stand a fake in for it."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
from ctypes import wintypes
|
||||
|
||||
self.wintypes = wintypes
|
||||
self.user32 = ctypes.WinDLL("user32", use_last_error=True)
|
||||
u = self.user32
|
||||
u.GetCursorPos.argtypes = (ctypes.POINTER(wintypes.POINT),)
|
||||
u.GetCursorPos.restype = wintypes.BOOL
|
||||
u.SetCursorPos.argtypes = (ctypes.c_int, ctypes.c_int)
|
||||
u.SetCursorPos.restype = wintypes.BOOL
|
||||
u.GetSystemMetrics.argtypes = (ctypes.c_int,)
|
||||
u.GetSystemMetrics.restype = ctypes.c_int
|
||||
u.GetWindowRect.argtypes = (wintypes.HWND, ctypes.POINTER(wintypes.RECT))
|
||||
u.GetWindowRect.restype = wintypes.BOOL
|
||||
u.IsWindowVisible.argtypes = (wintypes.HWND,)
|
||||
u.IsWindowVisible.restype = wintypes.BOOL
|
||||
u.IsIconic.argtypes = (wintypes.HWND,)
|
||||
u.IsIconic.restype = wintypes.BOOL
|
||||
u.GetWindowThreadProcessId.argtypes = (wintypes.HWND, ctypes.POINTER(wintypes.DWORD))
|
||||
u.GetWindowThreadProcessId.restype = wintypes.DWORD
|
||||
self.enum_proc = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
|
||||
u.EnumWindows.argtypes = (self.enum_proc, wintypes.LPARAM)
|
||||
u.EnumWindows.restype = wintypes.BOOL
|
||||
|
||||
def cursor_position(self) -> Point:
|
||||
point = self.wintypes.POINT()
|
||||
if not self.user32.GetCursorPos(ctypes.byref(point)):
|
||||
raise TheCursorCannotBeParked(
|
||||
"GetCursorPos failed (error %d). Where: user32, on the desktop the test runs on. What: the OS cursor cannot be read. Fix: run the e2e on an "
|
||||
"interactive desktop session (not a locked screen or a service)." % ctypes.get_last_error())
|
||||
return (point.x, point.y)
|
||||
|
||||
def set_cursor_position(self, x: int, y: int) -> None:
|
||||
self.user32.SetCursorPos(x, y)
|
||||
|
||||
def screen(self) -> Rect:
|
||||
"""The virtual screen: ``SM_XVIRTUALSCREEN``, ``SM_YVIRTUALSCREEN``, ``SM_CXVIRTUALSCREEN``, ``SM_CYVIRTUALSCREEN``."""
|
||||
x, y, w, h = (self.user32.GetSystemMetrics(n) for n in (76, 77, 78, 79))
|
||||
return (x, y, x + w, y + h)
|
||||
|
||||
def windows_below(self, root_pid: int) -> List[Rect]:
|
||||
"""The rectangles of the visible, not minimised, top-level windows of the processes below ``root_pid``."""
|
||||
import psutil
|
||||
|
||||
try:
|
||||
pids = {p.pid for p in psutil.Process(root_pid).children(recursive=True)}
|
||||
except psutil.Error:
|
||||
return []
|
||||
found: List[Rect] = []
|
||||
|
||||
def each(hwnd, _):
|
||||
owner = self.wintypes.DWORD()
|
||||
self.user32.GetWindowThreadProcessId(hwnd, ctypes.byref(owner))
|
||||
if owner.value in pids and self.user32.IsWindowVisible(hwnd) and not self.user32.IsIconic(hwnd):
|
||||
rect = self.wintypes.RECT()
|
||||
if self.user32.GetWindowRect(hwnd, ctypes.byref(rect)) and rect.right > rect.left and rect.bottom > rect.top:
|
||||
found.append((rect.left, rect.top, rect.right, rect.bottom))
|
||||
return True
|
||||
|
||||
self.user32.EnumWindows(self.enum_proc(each), 0)
|
||||
return found
|
||||
|
||||
|
||||
def _is_windows() -> bool:
|
||||
return sys.platform == "win32"
|
||||
|
||||
|
||||
def _api() -> Optional[_Win32]:
|
||||
return _Win32() if _is_windows() else None
|
||||
|
||||
|
||||
def browser_windows(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None) -> List[Rect]:
|
||||
"""The rectangles of the windows of the browsers below ``root_pid`` (the test process by default) on this desktop; empty when not Windows."""
|
||||
api = api or _api()
|
||||
if api is None:
|
||||
return []
|
||||
return api.windows_below(os.getpid() if root_pid is None else root_pid)
|
||||
|
||||
|
||||
def park(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None) -> Optional[Point]:
|
||||
"""Windows: put the OS cursor on a point no window of the browsers below ``root_pid`` covers and read it back. Returns the point; None when not Windows.
|
||||
|
||||
Called before the browser starts there is no window yet and the point is the bottom-right corner of the virtual screen, where the engine places no window."""
|
||||
api = api or _api()
|
||||
if api is None:
|
||||
return None
|
||||
target = park_outside(api.windows_below(os.getpid() if root_pid is None else root_pid), api.screen())
|
||||
api.set_cursor_position(*target)
|
||||
read_back = api.cursor_position()
|
||||
if read_back != target:
|
||||
raise TheCursorCannotBeParked(
|
||||
"SetCursorPos(%d, %d) left the cursor at %r. Where: user32, on the desktop the test runs on. What: the OS cursor cannot be moved, so a native "
|
||||
"mouse move for it can reach a window of the browser mid-gesture. Fix: run the e2e on an interactive desktop session (not a locked screen "
|
||||
"or a service), with no other program holding the cursor." % (target[0], target[1], read_back))
|
||||
return target
|
||||
|
||||
|
||||
def require_outside(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None, margin: int = 0) -> None:
|
||||
"""The precondition of a gesture a test judges by the pointer events the page records: the OS cursor is outside every window of the browsers.
|
||||
|
||||
Raises ``TheCursorIsInside`` otherwise, with the cursor and the windows. Not Windows: nothing."""
|
||||
api = api or _api()
|
||||
if api is None:
|
||||
return
|
||||
windows = api.windows_below(os.getpid() if root_pid is None else root_pid)
|
||||
cursor = api.cursor_position()
|
||||
if not cursor_is_outside(windows, cursor, margin):
|
||||
raise TheCursorIsInside(
|
||||
"the OS cursor is at %r, inside the browser window(s) %r, when a pointer gesture is about to start. Where: the desktop the test runs on. What: "
|
||||
"a native WM_MOUSEMOVE for it passes Gecko's first-move filter and reaches the page as a mousemove with buttons=0 at a moment of the "
|
||||
"system's choosing, in the middle of the gesture the test records. Fix: park the cursor outside the window before the browser starts "
|
||||
"(the autouse fixture `_the_os_cursor_is_outside_the_browser_window` of tests/conftest.py does it for every e2e test on Windows)." % (cursor, windows))
|
||||
@@ -20,11 +20,12 @@ from _waits import wait_until
|
||||
#: position 4 (device pixels, and CSS pixels at 1.0). The screen is the one the other surface tests pin.
|
||||
PIN = {"screen.width": 1920, "screen.height": 1080, "screen.dpr": 1.0}
|
||||
|
||||
#: A second declared window frame that no runner has: a border of 6, a popup UI of 53 above the content, a default position of 9. The declared frame at scale 1.0
|
||||
#: (8, 72, 4) is the frame of a retail Windows window, so a Windows runner's own popup has it too (outer - inner = 16 x 80) and a launch with the engine off
|
||||
#: cannot tell the declaration from the host there; a launch declared with ANOTHER frame can (the prefs are applied last, over the core's declaration).
|
||||
OTHER_FRAME = {"zoom.stealth.screen.frame_border": 6, "zoom.stealth.screen.popup_ui": 53, "zoom.stealth.screen.popup_position": 9}
|
||||
OTHER_BORDER, OTHER_POPUP_UI, OTHER_POSITION = 6, 53, 9
|
||||
#: A second declared window frame that no runner has: a border of 6 and a popup UI of 53 above the content. The declared frame at scale 1.0 (8, 72) is the frame
|
||||
#: of a retail Windows window, so a Windows runner's own popup has it too (outer - inner = 16 x 80) and a launch with the engine off cannot tell the declaration from
|
||||
#: the host there; a launch declared with ANOTHER frame can (the prefs are applied last, over the core's declaration). The position of an unpositioned popup is not
|
||||
#: declared: it is Firefox's own rule (browser.xhtml screenX/screenY = 4, the stagger, the clamp), the same under every frame.
|
||||
OTHER_FRAME = {"zoom.stealth.screen.frame_border": 6, "zoom.stealth.screen.popup_ui": 53}
|
||||
OTHER_BORDER, OTHER_POPUP_UI = 6, 53
|
||||
|
||||
READ = """() => ({iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight,
|
||||
sx: screenX, sy: screenY, mx: mozInnerScreenX, my: mozInnerScreenY})"""
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
"""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.
|
||||
|
||||
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
|
||||
element, the tooltip against the pointer) are read in the same way on both sides, from chrome scope through Marionette; the page and its input are driven by one small interface (``Driver``):
|
||||
``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
|
||||
--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).
|
||||
|
||||
HOW IT IS LAUNCHED (what ``scripts/retail/window_geometry/run_scale.py`` does for the captures): ``firefox -no-remote -profile <empty directory> -marionette``, with ``-remote-allow-system-access`` for the
|
||||
chrome scope; the profile holds only ``user.js`` with ``marionette.port`` 0 (a free port, written to ``MarionetteActivePort``) and ``layout.css.devPixelsPerPx`` (the display scale of the case, the pref
|
||||
ours and stock are launched with), and the prefs that stop the first-run pages. No policy file. The browser is closed with its whole tree when the block ends.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
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 _waits import wait_until
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case
|
||||
|
||||
ENV_VARIABLE = "INVPW_RETAIL_FIREFOX"
|
||||
|
||||
#: What the profile of the retail browser holds besides the two prefs of the case: the first-run pages and the updater are off, nothing else.
|
||||
PROFILE_PREFS = {
|
||||
"marionette.port": 0,
|
||||
"browser.shell.checkDefaultBrowser": False,
|
||||
"browser.aboutwelcome.enabled": False,
|
||||
"browser.startup.page": 0,
|
||||
"browser.startup.homepage": "about:blank",
|
||||
"startup.homepage_welcome_url": "",
|
||||
"startup.homepage_override_url": "",
|
||||
"browser.startup.homepage_override.mstone": "ignore",
|
||||
"datareporting.policy.dataSubmissionPolicyBypassNotification": True,
|
||||
"toolkit.telemetry.reportingpolicy.firstRun": False,
|
||||
"app.update.auto": False,
|
||||
"app.update.checkInstallTime": False,
|
||||
"browser.tabs.warnOnClose": False,
|
||||
}
|
||||
|
||||
PAGE_SCALES_EXPR = "({devicePixelRatio: window.devicePixelRatio, inner: [innerWidth, innerHeight], screen: [screen.width, screen.height]})"
|
||||
|
||||
|
||||
class MissingReference(AssertionError):
|
||||
"""No retail binary to compare with: red, and no finding about ours."""
|
||||
|
||||
|
||||
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 "
|
||||
"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
|
||||
|
||||
|
||||
def _user_js(prefs: Dict[str, Any]) -> str:
|
||||
return "".join("user_pref(%s, %s);\n" % (json.dumps(name), json.dumps(value)) for name, value in sorted(prefs.items()))
|
||||
|
||||
|
||||
class Driver:
|
||||
"""What a twin does with a page, on any browser. ``chrome.script(js, args)`` is chrome scope through Marionette."""
|
||||
|
||||
chrome: Any
|
||||
|
||||
def goto(self, url: str) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def eval(self, expression: str) -> Any:
|
||||
"""The value of a JavaScript expression in the top document (a JSON-able value)."""
|
||||
raise NotImplementedError
|
||||
|
||||
def move(self, x: float, y: float, steps: int = 1) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def click(self, x: float, y: float) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def wait_for_timeout(self, ms: int) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
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": self.eval(PAGE_SCALES_EXPR)}
|
||||
out.update(self.chrome.script(SCALES_JS))
|
||||
return out
|
||||
|
||||
|
||||
class PlaywrightDriver(Driver):
|
||||
"""Ours: a page of the wrapper's client, and the chrome of the engine through Marionette."""
|
||||
|
||||
def __init__(self, page, chrome: Chrome) -> None:
|
||||
self.page, self.chrome = page, chrome
|
||||
|
||||
def goto(self, url: str) -> None:
|
||||
self.page.goto(url, wait_until="load", timeout=30000)
|
||||
|
||||
def eval(self, expression: str) -> Any:
|
||||
return self.page.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:
|
||||
self.page.mouse.click(x, y)
|
||||
|
||||
def wait_for_timeout(self, ms: int) -> None:
|
||||
self.page.wait_for_timeout(ms)
|
||||
|
||||
|
||||
class RetailChrome:
|
||||
def __init__(self, session: "RetailSession") -> None:
|
||||
self._session = session
|
||||
|
||||
def script(self, script: str, args: Tuple[Any, ...] = ()) -> Dict[str, Any]:
|
||||
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.
|
||||
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});
|
||||
"""
|
||||
|
||||
|
||||
SIZE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
return JSON.stringify({outer: [win.outerWidth, win.outerHeight], inner: [win.innerWidth, win.innerHeight]});
|
||||
"""
|
||||
|
||||
|
||||
class RetailSession:
|
||||
"""Retail Firefox 159 with Marionette, headed, one profile; closed with its whole tree."""
|
||||
|
||||
def __init__(self, executable: str, dpr: float) -> None:
|
||||
self.executable, self.dpr = executable, dpr
|
||||
self._context: Optional[str] = None
|
||||
self._process: Optional[subprocess.Popen] = None
|
||||
self._profile: Optional[str] = None
|
||||
self._marionette = 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:
|
||||
port = webfont_probe.marionette_active_port(Path(self._profile), timeout=120)
|
||||
self._marionette = webfont_probe._Marionette(port)
|
||||
self._marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
except BaseException:
|
||||
self.__exit__(None, None, None)
|
||||
raise
|
||||
return self
|
||||
|
||||
def call(self, context: str, command: str, params: Dict[str, Any]) -> Any:
|
||||
if self._context != context:
|
||||
self._marionette.call("Marionette:SetContext", {"value": context})
|
||||
self._context = context
|
||||
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])})
|
||||
read = SIZE_JS
|
||||
out: Dict[str, Any] = {}
|
||||
for _ in range(int(DEADLINE_S * 10)):
|
||||
out = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": read, "args": []})["value"])
|
||||
if out["outer"] == [outer[0], outer[1]]:
|
||||
break
|
||||
time.sleep(0.1)
|
||||
return out
|
||||
|
||||
def __exit__(self, *exc) -> None:
|
||||
if self._marionette is not None:
|
||||
self._marionette.close()
|
||||
if self._process is not None:
|
||||
try:
|
||||
import psutil
|
||||
|
||||
root = psutil.Process(self._process.pid)
|
||||
for child in root.children(recursive=True):
|
||||
try:
|
||||
child.kill()
|
||||
except psutil.Error:
|
||||
pass
|
||||
root.kill()
|
||||
except Exception: # the process is gone already
|
||||
pass
|
||||
try:
|
||||
self._process.wait(30)
|
||||
except Exception:
|
||||
pass
|
||||
if self._profile is not None:
|
||||
shutil.rmtree(self._profile, ignore_errors=True)
|
||||
|
||||
|
||||
class RetailDriver(Driver):
|
||||
def __init__(self, session: RetailSession) -> None:
|
||||
self.session = session
|
||||
self.chrome = RetailChrome(session)
|
||||
|
||||
def goto(self, url: str) -> None:
|
||||
self.session.call("content", "WebDriver:Navigate", {"url": url})
|
||||
wait_until(lambda: self.eval("document.readyState") == "complete", DEADLINE_S, lambda: self.wait_for_timeout(100))
|
||||
|
||||
def eval(self, expression: str) -> Any:
|
||||
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 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)
|
||||
last = getattr(self, "_at", (x - 1, y - 1))
|
||||
for i in range(1, steps + 1):
|
||||
self._send("mousemove", last[0] + (x - last[0]) * i / steps, last[1] + (y - last[1]) * i / steps)
|
||||
self._at = (x, y)
|
||||
|
||||
def click(self, x: float, y: float) -> None:
|
||||
self.move(x, y)
|
||||
self._send("mousedown", x, y, 0, 1)
|
||||
self._send("mouseup", x, y, 0, 1)
|
||||
|
||||
def wait_for_timeout(self, ms: int) -> None:
|
||||
time.sleep(ms / 1000.0)
|
||||
|
||||
|
||||
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``)."""
|
||||
executable = retail_executable()
|
||||
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
|
||||
chrome = Chrome()
|
||||
try:
|
||||
ours = measure(PlaywrightDriver(browser.new_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))
|
||||
retail = measure(RetailDriver(session))
|
||||
retail["scales"]["window_asked_outer"] = asked
|
||||
return retail, ours
|
||||
@@ -0,0 +1,155 @@
|
||||
"""What the stock twins share: the same steps on Playwright's own Firefox and on our engine, one browser at a time, and a record of each.
|
||||
|
||||
A twin test measures a relation (the dropdown of a select against its element, the drop of a real drag, what an observer reads of a scrolled frame) and its
|
||||
verdict is "the same as stock Firefox with stock Playwright", never a number of ours: an expected value comes from a capture of retail or from stock in the same job.
|
||||
|
||||
HOW STOCK RUNS. The mechanism is the one of the fake web (``scripts/run_fakeweb.py``, ``tests/fakeweb/profile_p2.py::run_on_stock``): the stock Playwright client
|
||||
(``playwright.sync_api``, imported by name: the fork's guard forbids a static import), ``p.firefox.launch()``, which starts Playwright's own Firefox build that
|
||||
``python -m playwright install firefox`` put on the runner. That is a row with ``"stock_firefox": true`` of ``ci/required-suites.json``, whose leg the gate gives the
|
||||
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
|
||||
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``).
|
||||
|
||||
THE RECORD. Each twin saves, for each browser, what it measured with the scales that could make the two differ: ``scales.page`` (``window.devicePixelRatio`` of the page, its
|
||||
inner size, ``screen.width/height``: the DECLARED ones of ours) and ``scales.chrome`` read from chrome scope through Marionette (``devicePixelRatio`` of the browser window,
|
||||
the inner and outer size of the window, and the REAL scale of the screen: ``nsIScreen.contentsScaleFactor`` and ``defaultCSSScaleFactor``, ``windowUtils.displayDPI``). The failure message
|
||||
prints both records whole. A stock browser that cannot be driven (no Marionette, no dropdown, no drag) is a BROKEN CONTROL: red, and the message says it is no finding about ours.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import json
|
||||
from typing import Any, Callable, Dict, List, Tuple
|
||||
|
||||
from _popup_geometry import in_a_thread_of_its_own
|
||||
from _window_origin import CASES, launch_case
|
||||
from test_the_maximized_window_frames_and_popups_read_retail_e2e import CASES as RETAIL_CASES
|
||||
|
||||
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
|
||||
|
||||
SCALES_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const screen = Cc["@mozilla.org/gfx/screenmanager;1"].getService(Ci.nsIScreenManager).primaryScreen;
|
||||
return JSON.stringify({
|
||||
chrome_devicePixelRatio: win.devicePixelRatio,
|
||||
chrome_inner: [win.innerWidth, win.innerHeight],
|
||||
chrome_outer: [win.outerWidth, win.outerHeight],
|
||||
real_screen_contentsScaleFactor: screen.contentsScaleFactor,
|
||||
real_screen_defaultCSSScaleFactor: screen.defaultCSSScaleFactor,
|
||||
real_displayDPI: win.windowUtils.displayDPI,
|
||||
});
|
||||
"""
|
||||
PAGE_SCALES = """() => ({devicePixelRatio: window.devicePixelRatio, inner: [innerWidth, innerHeight], screen: [screen.width, screen.height]})"""
|
||||
|
||||
|
||||
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``)."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
import webfont_probe
|
||||
|
||||
self._m = webfont_probe._Marionette(webfont_probe.marionette_active_port())
|
||||
self._m.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
self._m.call("Marionette:SetContext", {"value": "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]:
|
||||
"""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.update(self.script(SCALES_JS))
|
||||
return out
|
||||
|
||||
def close(self) -> None:
|
||||
self._m.close()
|
||||
|
||||
|
||||
def stock_client():
|
||||
"""The stock Playwright client, imported by name."""
|
||||
try:
|
||||
return importlib.import_module("playwright.sync_api").sync_playwright
|
||||
except ImportError as exc: # a broken environment, not a reason to skip: a skipped gate checks nothing
|
||||
raise BrokenControl("the stock Playwright client is missing (%s): install the wrapper with its dev extra" % exc) from exc
|
||||
|
||||
|
||||
def viewport(case: str) -> Dict[str, int]:
|
||||
"""The inner size retail reads for the maximized window of ``case``, CSS pixels."""
|
||||
maximized = RETAIL_CASES[case]["maximized"]
|
||||
return {"width": int(maximized["iw"]), "height": int(maximized["ih"])}
|
||||
|
||||
|
||||
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})
|
||||
chrome = None
|
||||
try:
|
||||
page = browser.new_context(viewport=viewport(case)).new_page()
|
||||
chrome = Chrome()
|
||||
return measure(page, chrome)
|
||||
finally:
|
||||
if chrome is not None:
|
||||
chrome.close()
|
||||
browser.close()
|
||||
|
||||
try:
|
||||
return in_a_thread_of_its_own(run)
|
||||
except BrokenControl:
|
||||
raise
|
||||
except Exception as exc:
|
||||
raise BrokenControl("BROKEN CONTROL, no finding about ours: stock Firefox (Playwright's own build) could not be driven through the steps of %s: %s: %s"
|
||||
% (case, type(exc).__name__, exc)) from exc
|
||||
|
||||
|
||||
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()
|
||||
try:
|
||||
return measure(browser.new_page(), chrome)
|
||||
finally:
|
||||
chrome.close()
|
||||
|
||||
|
||||
def run_twin(case: str, firefox_binary: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
||||
"""(stock's record, ours): the same ``measure(page, chrome)`` on Playwright's own Firefox first and on our engine second. Needs MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1."""
|
||||
stock = _on_stock(case, measure)
|
||||
ours = _on_ours(case, firefox_binary, measure)
|
||||
return stock, ours
|
||||
|
||||
|
||||
def both(case: str, stock: Dict[str, Any], ours: Dict[str, Any], reference: str = "stock") -> str:
|
||||
"""The two records whole, for the message of a red twin (``reference`` names the first: stock, or retail)."""
|
||||
return "\n case %s\n %s: %s\n ours: %s" % (case, reference, json.dumps(stock, sort_keys=True), json.dumps(ours, sort_keys=True))
|
||||
|
||||
|
||||
def differences(stock: Any, ours: Any, tolerances: Dict[str, float] = None, path: str = "") -> List[str]:
|
||||
"""Every place where the two records differ, as ``path: stock X, ours Y``. A number differs by more than the tolerance of its key (the last name of its path; 0 when none);
|
||||
everything else must be equal."""
|
||||
tolerances = tolerances or {}
|
||||
out: List[str] = []
|
||||
if isinstance(stock, dict) and isinstance(ours, dict):
|
||||
for key in sorted(set(stock) | set(ours)):
|
||||
if key not in stock or key not in ours:
|
||||
out.append("%s.%s: only %s has it" % (path, key, "stock" if key in stock else "ours"))
|
||||
else:
|
||||
out += differences(stock[key], ours[key], tolerances, "%s.%s" % (path, key))
|
||||
elif isinstance(stock, list) and isinstance(ours, list) and len(stock) == len(ours):
|
||||
for i, (a, b) in enumerate(zip(stock, ours)):
|
||||
out += differences(a, b, tolerances, "%s[%d]" % (path, i))
|
||||
elif isinstance(stock, (int, float)) and isinstance(ours, (int, float)) and not isinstance(stock, bool) and not isinstance(ours, bool):
|
||||
tolerance = tolerances.get(path.rsplit(".", 1)[-1].split("[", 1)[0], 0.0)
|
||||
if abs(stock - ours) > tolerance:
|
||||
out.append("%s: stock %r, ours %r (tolerance %r)" % (path, stock, ours, tolerance))
|
||||
elif stock != ours:
|
||||
out.append("%s: stock %r, ours %r" % (path, stock, ours))
|
||||
return out
|
||||
+70
-6
@@ -93,6 +93,15 @@ def _attrs(data: bytes) -> Dict[int, bytes]:
|
||||
return out
|
||||
|
||||
|
||||
def is_deallocation(data: bytes) -> bool:
|
||||
"""Whether a datagram is a TURN deallocation, by what it means (RFC 5766 section 7.1): a STUN Refresh (0x0004) whose LIFETIME (0x000D) is 0. A Refresh with a lifetime above 0, with
|
||||
none, or any other message type, is not one. The one reading of it: the TURN server of the lab and the gateway of the lab both use it."""
|
||||
if len(data) < 20 or struct.unpack("!I", data[4:8])[0] != MAGIC or struct.unpack("!H", data[:2])[0] != 0x0004:
|
||||
return False
|
||||
lifetime = _attrs(data).get(0x000D)
|
||||
return lifetime is not None and len(lifetime) == 4 and struct.unpack("!I", lifetime)[0] == 0
|
||||
|
||||
|
||||
def _attr(t: int, v: bytes) -> bytes:
|
||||
return struct.pack("!HH", t, len(v)) + v + b"\x00" * (-len(v) % 4)
|
||||
|
||||
@@ -111,11 +120,39 @@ def _message(mtype: int, tid: bytes, attrs: bytes, key: Optional[bytes] = None)
|
||||
return head + attrs + _attr(0x0008, mac)
|
||||
|
||||
|
||||
def long_term_key(user: str) -> bytes:
|
||||
"""The long-term credential key of RFC 5389 section 15.4: md5(username:realm:password)."""
|
||||
return hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
|
||||
|
||||
def integrity_valid(data: bytes, user: str) -> bool:
|
||||
"""Whether the MESSAGE-INTEGRITY of a request is the HMAC-SHA1 under the long-term key of ``user`` (RFC 5389 section 15.4): over the message up to the
|
||||
attribute, with the length field of the header set as if the message ended with that attribute (24 bytes more than what came before it). A request
|
||||
with no MESSAGE-INTEGRITY, or a truncated one, is not valid."""
|
||||
i = 20
|
||||
while i + 4 <= len(data):
|
||||
t, n = struct.unpack("!HH", data[i:i + 4])
|
||||
if t == 0x0008:
|
||||
if n != 20 or i + 24 > len(data):
|
||||
return False
|
||||
head = data[:2] + struct.pack("!H", i + 24 - 20) + data[4:20]
|
||||
return hmac.compare_digest(hmac.new(long_term_key(user), head + data[20:i], hashlib.sha1).digest(), data[i + 4:i + 24])
|
||||
i += 4 + ((n + 3) & ~3)
|
||||
return False
|
||||
|
||||
|
||||
class TurnServer:
|
||||
"""UDP TURN server on 127.0.0.1. ``seen`` is every datagram as (source ip, source port, STUN type), in order;
|
||||
``requests`` the same datagrams as (monotonic time, transaction id, STUN type, carries credentials): a retransmission has the
|
||||
transaction id of the request it repeats, so the TRANSACTIONS of a road are the distinct ids (:meth:`transactions`);
|
||||
``allocations`` the successful Allocates as (source ip, source port, username, time)."""
|
||||
``allocations`` the successful Allocates as (source ip, source port, username, time); ``deallocations`` the requests that END an allocation as (source ip, source
|
||||
port, transaction id, time, index in ``allocations`` of the allocation they end, or None when that source has none): a deallocation is recognised by what it means, a
|
||||
Refresh (0x0004) whose LIFETIME (0x000D) is 0 (RFC 5766 section 7.1), not by its type: a Refresh with a lifetime above 0 keeps the allocation and is not one. The server
|
||||
answers it as it answers any Refresh; a retransmission is another datagram of the same transaction (:meth:`deallocation_transactions`).
|
||||
|
||||
A request that carries USERNAME is checked: its MESSAGE-INTEGRITY must be the HMAC under the long-term key of that user (``PASSWORD``).
|
||||
A missing or wrong one is answered 401 with the realm and the nonce, makes no allocation, and is written in ``refused`` as
|
||||
(source ip, source port, username, transaction id, time): a client with the wrong password never gets a relay here, as on a real server."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
@@ -124,6 +161,8 @@ class TurnServer:
|
||||
self.seen: List[Tuple[str, int, int]] = []
|
||||
self.allocations: List[Tuple[str, int, str, float]] = []
|
||||
self.requests: List[Tuple[float, bytes, int, bool]] = []
|
||||
self.deallocations: List[Tuple[str, int, bytes, float, Optional[int]]] = []
|
||||
self.refused: List[Tuple[str, int, str, bytes, float]] = []
|
||||
self._closed = False
|
||||
threading.Thread(target=self._serve, daemon=True).start()
|
||||
|
||||
@@ -135,6 +174,17 @@ class TurnServer:
|
||||
first.setdefault(request[1], request)
|
||||
return sorted(first.values(), key=lambda r: r[0])
|
||||
|
||||
def deallocation_transactions(self) -> List[Tuple[str, int, bytes, float, Optional[int]]]:
|
||||
"""The first datagram of each deallocation transaction, in order: a retransmission of it is not another deallocation."""
|
||||
first: Dict[bytes, Tuple[str, int, bytes, float, Optional[int]]] = {}
|
||||
for record in list(self.deallocations):
|
||||
first.setdefault(record[2], record)
|
||||
return sorted(first.values(), key=lambda r: r[3])
|
||||
|
||||
def deallocation_tids(self) -> set:
|
||||
"""The transaction ids (bytes) of every deallocation received: what ties its datagrams on the wire to the server's record of it."""
|
||||
return {record[2] for record in list(self.deallocations)}
|
||||
|
||||
def close(self) -> None:
|
||||
self._closed = True
|
||||
self.sock.close()
|
||||
@@ -148,26 +198,40 @@ class TurnServer:
|
||||
if len(data) < 20 or struct.unpack("!I", data[4:8])[0] != MAGIC:
|
||||
continue
|
||||
mtype, tid = struct.unpack("!H", data[:2])[0], data[8:20]
|
||||
self.seen.append((src[0], src[1], mtype))
|
||||
attrs = _attrs(data)
|
||||
if is_deallocation(data): # recorded BEFORE the request: whoever reads `requests` already knows which of them it ended
|
||||
held = [i for i, a in enumerate(self.allocations) if a[:2] == (src[0], src[1])]
|
||||
self.deallocations.append((src[0], src[1], tid, time.monotonic(), held[-1] if held else None))
|
||||
self.seen.append((src[0], src[1], mtype))
|
||||
self.requests.append((time.monotonic(), tid, mtype, 0x0008 in attrs and 0x0006 in attrs))
|
||||
user_raw = attrs.get(0x0006)
|
||||
if mtype in (0x0003, 0x0004, 0x0008, 0x0009) and user_raw is not None:
|
||||
user = user_raw.decode(errors="replace")
|
||||
if not integrity_valid(data, user): # the wrong password, or no MESSAGE-INTEGRITY: 401, no allocation
|
||||
self.refused.append((src[0], src[1], user, tid, time.monotonic()))
|
||||
self.sock.sendto(_message(mtype | 0x0110, tid, self._unauthorized()), src)
|
||||
continue
|
||||
if mtype == 0x0003: # Allocate
|
||||
if 0x0008 not in attrs or 0x0006 not in attrs: # no credentials: 401 with a realm and a nonce
|
||||
err = _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
|
||||
self.sock.sendto(_message(0x0113, tid, err), src)
|
||||
self.sock.sendto(_message(0x0113, tid, self._unauthorized()), src)
|
||||
continue
|
||||
user = attrs[0x0006].decode(errors="replace")
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
key = long_term_key(user)
|
||||
body = (_attr(0x0016, _xor_addr(*RELAYED)) + _attr(0x0020, _xor_addr(src[0], src[1])) +
|
||||
_attr(0x000D, struct.pack("!I", 600)))
|
||||
self.allocations.append((src[0], src[1], user, time.monotonic()))
|
||||
self.sock.sendto(_message(0x0103, tid, body, key), src)
|
||||
elif mtype in (0x0004, 0x0008, 0x0009): # Refresh, CreatePermission, ChannelBind
|
||||
user = attrs.get(0x0006, b"").decode(errors="replace")
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
key = long_term_key(user)
|
||||
body = _attr(0x000D, struct.pack("!I", 600)) if mtype == 0x0004 else b""
|
||||
self.sock.sendto(_message(mtype | 0x0100, tid, body, key), src)
|
||||
|
||||
@staticmethod
|
||||
def _unauthorized() -> bytes:
|
||||
"""The attributes of a 401: ERROR-CODE, the realm and the nonce of the long-term credential."""
|
||||
return _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
|
||||
|
||||
|
||||
# ── the gateway ────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
"""What a test that cannot get a WebGL context writes down, so that the red says why (a pure helper, no browser).
|
||||
|
||||
A page asks for a context and gets ``null``: the page learns nothing more unless it listens for ``webglcontextcreationerror`` on the canvas
|
||||
before it asks (``statusMessage``). The probe of the test returns an object with ``unavailable: true`` and what it heard instead of ``null``;
|
||||
``split_probe`` turns that into the old ``None`` (so that the assertion stays as it was) and the record of the attempt, and ``unavailable_message``
|
||||
is the sentence of the assertion with both attempts appended.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
#: The pause, in milliseconds, between the first attempt and the second one (a diagnostic: the verdict is the first attempt's).
|
||||
SECOND_ATTEMPT_AFTER_MS = 2000
|
||||
UNAVAILABLE = "webgl is unavailable: a WebGL canvas cannot be read"
|
||||
|
||||
|
||||
def split_probe(result: Any) -> Tuple[Optional[Any], Optional[dict]]:
|
||||
"""``(got, first)``: ``got`` is what the test reads (``None`` when there was no context, exactly as the old probe returned), ``first`` the
|
||||
record of the failed attempt (``None`` when a context was made)."""
|
||||
if isinstance(result, dict) and result.get("unavailable") is True:
|
||||
return None, result
|
||||
return result, None
|
||||
|
||||
|
||||
def unavailable_message(first: Optional[dict], second: Any) -> str:
|
||||
"""The message of the assertion: the old sentence, then what the first attempt and the second one (2 s later) reported."""
|
||||
return "%s | first: %r; second after 2 s: %r" % (UNAVAILABLE, first, second)
|
||||
@@ -0,0 +1,70 @@
|
||||
"""What the window-origin e2e files share: the four display cases, a browser pinned to one of them, and waits on a reading of a page.
|
||||
|
||||
The four cases are the ones of the window tests against retail (``test_the_maximized_window_frames_and_popups_read_retail_e2e.py``): scale 1.0, 1.25 and 1.5
|
||||
on a 1920x1080 panel (device pixels) and 2.0 on a 1600x1200 one. The engine declares the window, so the page reads the same on Linux and on Windows.
|
||||
|
||||
Waits are CONDITIONS with a deadline (``_waits``), never a pause; ``observe`` is the one bounded look at a value that must NOT change, and it says so.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
from typing import Any, Callable, Dict, List, Tuple
|
||||
|
||||
from _waits import wait_until
|
||||
|
||||
#: The deadline of a wait for something that must happen, in seconds.
|
||||
DEADLINE_S = 30
|
||||
#: Floats of a page (``mozInnerScreenY`` 72.667 is 72.6666...).
|
||||
FLOAT = 0.001
|
||||
|
||||
#: case id -> (display scale, panel in device pixels).
|
||||
CASES: Dict[str, Tuple[float, Tuple[int, int]]] = {
|
||||
"1920x1080-dpr1.0": (1.0, (1920, 1080)),
|
||||
"1920x1080-dpr1.25": (1.25, (1920, 1080)),
|
||||
"1920x1080-dpr1.5": (1.5, (1920, 1080)),
|
||||
"1600x1200-dpr2.0": (2.0, (1600, 1200)),
|
||||
}
|
||||
|
||||
|
||||
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``)."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
dpr, panel = CASES[case]
|
||||
pin = {"screen.width": panel[0], "screen.height": panel[1], "screen.dpr": dpr}
|
||||
return InvisiblePlaywright(seed=42, pin=pin, binary_path=firefox_binary, headless=True, humanize=False, **extra)
|
||||
|
||||
|
||||
def settled(page, read: Callable[[], Any], seconds: float = DEADLINE_S) -> Any:
|
||||
"""``read()`` once two looks in a row, 100 ms apart, give the same value (or the last one at the deadline: a window that never settles is red where
|
||||
the caller's assertion names what was read)."""
|
||||
seen: Dict[str, Any] = {"now": None, "before": None}
|
||||
|
||||
def look() -> bool:
|
||||
seen["before"], seen["now"] = seen["now"], read()
|
||||
return seen["now"] == seen["before"]
|
||||
|
||||
wait_until(look, seconds, lambda: page.wait_for_timeout(100))
|
||||
return seen["now"]
|
||||
|
||||
|
||||
def wait_for(page, condition: Callable[[], Any], seconds: float = DEADLINE_S) -> bool:
|
||||
"""Until ``condition()`` is true, reading the client's events between two looks; False at the deadline."""
|
||||
return wait_until(condition, seconds, lambda: page.wait_for_timeout(100))
|
||||
|
||||
|
||||
def observe(page, read: Callable[[], Any], seconds: float) -> List[Any]:
|
||||
"""The distinct values ``read()`` gives over ``seconds``, in the order they were seen (the first look is always taken).
|
||||
|
||||
The ONE bounded look of these files: for a value that must stay as it is (a window after ``resizeBy(0, 0)``, a frame that must not have loaded yet).
|
||||
A change that comes later than ``seconds`` is not seen; a change inside it always is, so the check can be late to catch a bug and never red for nothing."""
|
||||
values: List[Any] = []
|
||||
end = time.monotonic() + seconds
|
||||
while True:
|
||||
value = read()
|
||||
if not values or values[-1] != value:
|
||||
values.append(value)
|
||||
if time.monotonic() >= end:
|
||||
return values
|
||||
page.wait_for_timeout(100)
|
||||
@@ -177,6 +177,22 @@ def _offline_session_geo(request, monkeypatch):
|
||||
monkeypatch.setattr(_session, "session_geo", lambda *_a, **_k: geo)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _a_test_that_is_not_e2e_never_leaves_the_machine(request, monkeypatch):
|
||||
"""Outside the e2e, every connection, datagram and name lookup goes to this host or is refused, and the test fails naming each
|
||||
destination it tried (tests/_no_network.py), even when the code under test swallowed the refusal."""
|
||||
if request.node.get_closest_marker("e2e") is not None:
|
||||
yield
|
||||
return
|
||||
import _no_network
|
||||
|
||||
guard = _no_network.install(monkeypatch, request.node.nodeid)
|
||||
yield
|
||||
failure = guard.verdict()
|
||||
if failure:
|
||||
pytest.fail(failure, pytrace=False)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _what_the_core_declares_for_a_proxy_is_recorded(monkeypatch):
|
||||
"""The core keeps no UDP verdict in memory, so a test that wants to know what the launch declared reads it where it is
|
||||
@@ -254,6 +270,64 @@ 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)
|
||||
|
||||
|
||||
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":
|
||||
import _os_cursor
|
||||
|
||||
_os_cursor.park()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", autouse=True)
|
||||
def _the_os_cursor_is_outside_the_browser_window_of_a_module(request):
|
||||
"""A browser a module-scoped fixture starts opens its window before any test of the module runs: the cursor is parked before that, once per module that has an
|
||||
e2e test (``tests/_os_cursor.py``; Windows only, the Linux e2e run under xvfb-run whose pointer is virtual)."""
|
||||
if sys.platform == "win32" and any(getattr(item, "module", None) is request.module and item.get_closest_marker("e2e") is not None
|
||||
for item in request.session.items):
|
||||
_park_the_os_cursor()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _the_os_cursor_is_outside_the_browser_window(request):
|
||||
"""A headed window that opens under the real cursor gets a native mouse move for it (the runner's cursor is at 512,384, inside the window), and the first
|
||||
native move of a process passes Gecko's filter: the page sees a ``mousemove`` with ``buttons=0`` in the middle of the gesture a test records. Every e2e
|
||||
test on Windows starts with the cursor parked outside the window the engine opens, before its browser starts. A ``headless=True`` browser runs on a desktop of
|
||||
its own and never receives it; the parking is the same for it and costs one system call. The gestures that record pointer events then call
|
||||
``_os_cursor.require_outside()`` at their start."""
|
||||
if request.node.get_closest_marker("e2e") is not None:
|
||||
_park_the_os_cursor()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lab_exit(monkeypatch, tmp_path):
|
||||
"""The exit of the lab and its GeoIP database, declared for one test that is not e2e (``tests/_lab_egress.py``, as the e2e have it).
|
||||
|
||||
With no proxy the core asks where this machine leaves from once per composition (``prepare_session_geo``: zone, language and position
|
||||
come from the exit, even when the zone is given), and a test that is not e2e never leaves the machine (``tests/_no_network.py``). A test
|
||||
that composes prefs or a session through the core takes this fixture."""
|
||||
import _lab_egress
|
||||
|
||||
return _lab_egress.install(monkeypatch, tmp_path / "lab-geoip")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def declared_engine(monkeypatch, tmp_path):
|
||||
"""An engine executable declared for one test that is not e2e, instead of the one the core resolves.
|
||||
|
||||
Without ``binary_path=`` the launch resolves the engine through ``ensure_binary`` (``_engine.resolve_executable``): with an engine in
|
||||
the cache of the machine it answers at once, and with none it asks GitHub's release index and downloads the archive. So a unit test that
|
||||
composes a launch passed on a machine that had run ``fetch`` and went to the internet on a fresh runner, and a test that is not e2e
|
||||
never leaves the machine (``tests/_no_network.py``). The file is never run: the tests that take this fixture stop at the environment,
|
||||
the arguments or a fake ``launch``. Returns its path."""
|
||||
from invisible_playwright import _engine
|
||||
|
||||
executable = tmp_path / "declared-engine" / ("firefox.exe" if sys.platform == "win32" else "firefox")
|
||||
executable.parent.mkdir(parents=True)
|
||||
executable.write_bytes(b"")
|
||||
monkeypatch.setattr(_engine, "ensure_binary", lambda *a, **k: executable)
|
||||
return executable
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def local_egress_echo(monkeypatch):
|
||||
"""The REAL discovery of the exit, for the test that must prove it, against an echo service of its own on loopback: the three services of the
|
||||
|
||||
@@ -12,6 +12,8 @@ folder and a `view` of the machine (the real one, or a stand-in in the unit test
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
|
||||
@@ -52,3 +54,39 @@ def maps_of_the_engine_below(root: int, binary_dir: str, machine: Optional[Machi
|
||||
if exe and exe.startswith(binary_dir):
|
||||
found[pid] = machine.maps(pid)
|
||||
return found
|
||||
|
||||
|
||||
def ships_its_own_gl(binary_dir: str) -> bool:
|
||||
"""The engine's own GL is in the package from firefox-59: a test follows the package under
|
||||
test, not the core's version (the gate runs a candidate under the published core)."""
|
||||
return os.path.isfile(os.path.join(binary_dir, "llvmpipe", "libEGL.so.1"))
|
||||
|
||||
|
||||
def gl_maps_of_this_test(firefox_binary: str) -> Optional[Dict[int, List[str]]]:
|
||||
"""The maps of the engine's processes below this test, to be read while the browser is up and a
|
||||
page has had its WebGL context; None where the verdict on the GL does not apply (not Linux,
|
||||
or an engine with no GL of its own)."""
|
||||
if not sys.platform.startswith("linux"):
|
||||
return None
|
||||
binary_dir = os.path.dirname(os.path.realpath(firefox_binary))
|
||||
if not ships_its_own_gl(binary_dir):
|
||||
return None
|
||||
return maps_of_the_engine_below(os.getpid(), binary_dir)
|
||||
|
||||
|
||||
def assert_the_gl_is_the_engines_own(firefox_binary: str, below: Optional[Dict[int, List[str]]]) -> None:
|
||||
"""The rule of the verdict on the GL, written once: some engine process maps the engine's own
|
||||
libEGL.so.1 and its own libgallium-*, and none maps a libEGL that is not under the engine's
|
||||
`llvmpipe/` folder. (GTK still opens the host's GLX at startup to choose its X11 visuals;
|
||||
nothing of it reaches WebGL or a page, so only libEGL is held against the host's.) With
|
||||
`below` None the verdict does not apply."""
|
||||
if below is None:
|
||||
return
|
||||
own = os.path.join(os.path.dirname(os.path.realpath(firefox_binary)), "llvmpipe") + os.sep
|
||||
assert below, "no engine process below this test"
|
||||
drew = [pid for pid, maps in below.items()
|
||||
if own + "libEGL.so.1" in maps and any(m.startswith(own + "libgallium-") for m in maps)]
|
||||
assert drew, {pid: [m for m in maps if "EGL" in m or "gallium" in m] for pid, maps in below.items()}
|
||||
foreign = {pid: [m for m in maps if "libEGL" in os.path.basename(m) and not m.startswith(own)]
|
||||
for pid, maps in below.items()}
|
||||
assert not any(foreign.values()), foreign
|
||||
@@ -28,8 +28,10 @@
|
||||
{"file": "test_a_popup_of_a_link_reaches_the_client_e2e.py", "scope": "_router.route", "rule": "sleep", "nth": 1, "kind": "stimulus", "reason": "Slowness on purpose: this test server, relay or client answers late as the input of the test, and the product waits for it under a deadline; nothing here judges the machine."},
|
||||
{"file": "test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py", "scope": "<module>._PROBE_JS", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "A timer of the test's own page is the stimulus (the thing appears later); the product waits for it with a deadline and the verdict does not read when it fired."},
|
||||
{"file": "test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "scope": "<module>.TURN_PORT", "rule": "port", "nth": 1, "kind": "virtual-port", "reason": "A port number that nothing binds: the gateway of the test answers for the name or address by itself, so no worker can collide on it."},
|
||||
{"file": "test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "scope": "_go_back_and_record", "rule": "sleep", "nth": 1, "kind": "instrument", "reason": "Runs only after go_back has already raised: the pause dates a restore that lands after the wait, for the evidence of the red run; the error is raised unchanged and the pause decides nothing."},
|
||||
{"file": "test_caller_world_handles_e2e.py", "scope": "test_a_node_that_appears_later_ends_the_wait", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "A timer of the test's own page is the stimulus (the thing appears later); the product waits for it with a deadline and the verdict does not read when it fired."},
|
||||
{"file": "test_caller_world_handles_e2e.py", "scope": "test_a_wait_for_function_object_handle_reads_in_the_page_world", "rule": "js-timer", "nth": 1, "kind": "stimulus", "reason": "A timer of the test's own page is the stimulus (the thing appears later); the product waits for it with a deadline and the verdict does not read when it fired."},
|
||||
{"file": "test_canvas_reads_as_drawn.py", "scope": "_non_premultiplied", "rule": "sleep", "nth": 1, "kind": "instrument", "reason": "A diagnostic pause that decides nothing: after a first attempt that gave no WebGL context the test waits 2 s and makes a second attempt only to record what it heard; the assert fails on the first attempt whatever the second says."},
|
||||
{"file": "test_declared_host_network_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_declared_host_network_e2e.py", "scope": "<module>._LOOPBACK_JS", "rule": "js-timer", "nth": 1, "kind": "hang-detector", "reason": "The 5 ms step of the page's own wait for the data channel to open and echo, which ends at 30 s; the same 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_detectors_e2e.py", "scope": "test_enumerate_devices_resolves_promptly", "rule": "bound", "nth": 1, "kind": "hang-detector", "reason": "The limit is the larger of 30 s and 2000 times a load reference (microtasks) measured in the same page just before, and never reaches the 120 s at which the call is held to be hung, so it ends a call that never comes and is relative to the machine's own load."},
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
"""A real drag from the top document into a frame of another site ends as it does on stock Firefox with stock Playwright.
|
||||
|
||||
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
|
||||
element that gets the drop, and ``dragend`` carries a point that is not the last one the drag reported.
|
||||
|
||||
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:
|
||||
|
||||
* ``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).
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _stock_twin import Chrome, both, differences, run_twin
|
||||
from _window_origin import CASES, DEADLINE_S, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The box that is dragged: 80x50 at (20, 20) of the top document; the mouse goes down at its centre.
|
||||
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)
|
||||
STEPS = 12
|
||||
|
||||
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}
|
||||
#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});
|
||||
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>"""
|
||||
|
||||
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>"""
|
||||
|
||||
|
||||
def _drag(page) -> 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.up()
|
||||
|
||||
|
||||
def _steps(sites, page, chrome: Chrome) -> Dict[str, Any]:
|
||||
"""What one browser does and what the page reads of it. {"scales": ..., "measured": {...}}."""
|
||||
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)
|
||||
|
||||
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"])}}
|
||||
|
||||
|
||||
@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):
|
||||
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)))
|
||||
@@ -0,0 +1,128 @@
|
||||
"""A frame reads its ``mozInnerScreen`` only as (0, 0), as the client origin of the window, or as its settled value, from the first line of its script to ``load``.
|
||||
|
||||
Retail Firefox 159.0 on Windows, round 7 of the window-geometry capture (RetailCaptures ``captures/WINDOW_GEOMETRY_FRAME_EARLY.csv``, steps ``iframes_max``
|
||||
and ``iframes_transformed``, columns ``moment``, ``mozInnerScreenX/Y``, ``settled_mozInnerScreenX/Y``, ``client_origin_css_x/y``): in a maximized window every
|
||||
reading of a frame, at parse, ``DOMContentLoaded``, the first two animation frames and ``load``, is one of
|
||||
three values and no other:
|
||||
|
||||
* (0, 0): the frame has no place yet (a frame of another process before the parent has sent the first matrix, and any frame before its first layout);
|
||||
* the window's client origin, ``client_origin_css_x/y``: (0, 0) in every row of the maximized window (the popup of the same round has (12, 4) at scale 1.0,
|
||||
and is not read here);
|
||||
* the value the frame settles at.
|
||||
|
||||
A reading that is none of them is a value the page can tell from retail: a frame of another process that, before its first matrix, reads the real offset of the
|
||||
browser chrome in the host's window, or the real window origin, instead of what the declaration gives. Those values are what the host's window has, and they
|
||||
are not the declared ones.
|
||||
|
||||
What it does, per display case (the four of the window tests): a page of the top site loads a frame of the same site and a frame of another site, and the same two
|
||||
inside a container under ``transform: scale(1.5)`` and ``rotate(10deg)`` (``transform-origin: 0 0``), the six kinds of round 7. The frame's page has an inline
|
||||
script FIRST in ``<head>``: it records ``mozInnerScreenX/Y`` at parse, at ``DOMContentLoaded``, in the first two ``requestAnimationFrame`` callbacks it asked for at
|
||||
parse, and at ``load``. Each kind loads three times (a new frame each time: the reading at parse is a race the first load can win by luck). The settled value is the
|
||||
frame's reading once two looks 100 ms apart are equal, after ``load``. The assertion names the case, the kind, the moment and the three values it allowed.
|
||||
|
||||
The engine that answers these values is not released yet: on the engine of the pin this test is RED where the frame reads the real offsets, on purpose. It enters
|
||||
the suite with the engine release.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _window_origin import CASES, DEADLINE_S, FLOAT, launch_case, settled, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The window's client origin in CSS pixels: ``client_origin_css_x/y`` of every ``iframes_max`` and ``iframes_transformed`` row of round 7 (maximized: the client
|
||||
#: area starts at the window's origin).
|
||||
CLIENT_ORIGIN: Tuple[float, float] = (0.0, 0.0)
|
||||
#: The moments of the capture, and the frames each load must have recorded before it is read.
|
||||
MOMENTS = ("parse", "dcl", "raf1", "raf2", "load")
|
||||
#: Loads of each kind.
|
||||
LOADS = 3
|
||||
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>early</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}</style><body></body>"""
|
||||
|
||||
# The page of every frame. The script is the first thing in <head>, as in the capture.
|
||||
EARLY = """<!doctype html><html><head><script>
|
||||
window.__early = [];
|
||||
function rec(moment) { window.__early.push({m: moment, x: mozInnerScreenX, y: mozInnerScreenY}); }
|
||||
rec('parse');
|
||||
document.addEventListener('DOMContentLoaded', function () { rec('dcl'); });
|
||||
requestAnimationFrame(function () { rec('raf1'); requestAnimationFrame(function () { rec('raf2'); }); });
|
||||
window.addEventListener('load', function () { rec('load'); });
|
||||
</script><meta charset=utf-8><style>html,body{margin:0;padding:0;height:100%}</style></head><body></body></html>"""
|
||||
|
||||
#: A frame in the page, 300x120 at (10, 60) (same site) or (10, 200) (another site), or in a container at (10, 200) under a transform.
|
||||
ADD = """([src, top, transform]) => {
|
||||
const f = document.createElement('iframe');
|
||||
f.src = src;
|
||||
f.style.cssText = 'display:block;width:300px;height:120px;border:0;margin:0;padding:0';
|
||||
const box = document.createElement('div');
|
||||
box.className = 'early-box';
|
||||
if (transform) {
|
||||
box.style.cssText = 'position:fixed;left:10px;top:200px;width:300px;height:120px;margin:0;padding:0;transform-origin:0 0;transform:' + transform;
|
||||
} else {
|
||||
box.style.cssText = 'position:absolute;left:10px;top:' + top + 'px;width:300px;height:120px;margin:0;padding:0';
|
||||
}
|
||||
box.appendChild(f);
|
||||
document.body.appendChild(box);
|
||||
}"""
|
||||
REMOVE = "() => { document.querySelectorAll('.early-box').forEach(b => b.remove()); }"
|
||||
|
||||
#: kind -> (site of the frame, top in the page, transform)
|
||||
KINDS: Dict[str, Tuple[str, int, str]] = {
|
||||
"same": ("A", 60, ""),
|
||||
"cross": ("B", 200, ""),
|
||||
"same_scale": ("A", 200, "scale(1.5)"),
|
||||
"cross_scale": ("B", 200, "scale(1.5)"),
|
||||
"same_rotate": ("A", 200, "rotate(10deg)"),
|
||||
"cross_rotate": ("B", 200, "rotate(10deg)"),
|
||||
}
|
||||
|
||||
|
||||
def _near(reading: Tuple[float, float], other: Tuple[float, float]) -> bool:
|
||||
return abs(reading[0] - other[0]) <= FLOAT and abs(reading[1] - other[1]) <= FLOAT
|
||||
|
||||
|
||||
def _recorded(frame) -> List[Dict[str, Any]]:
|
||||
try:
|
||||
return frame.evaluate("() => window.__early || []")
|
||||
except Exception: # the frame is between two documents: not recorded yet
|
||||
return []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_frame_reads_only_declared_origins_while_it_loads(firefox_binary, case):
|
||||
problems: List[str] = []
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", TOP)
|
||||
sites.route("A", "/early", EARLY)
|
||||
sites.route("B", "/early", EARLY)
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
for kind, (site, top, transform) in KINDS.items():
|
||||
for load in range(LOADS):
|
||||
path = "/early?%s&load=%d" % (kind, load)
|
||||
page.evaluate(ADD, [sites.url(site, path), top, transform])
|
||||
try:
|
||||
frame = wait_frame(page, sites.origin[site], path, seconds=DEADLINE_S)
|
||||
wait_for(page, lambda: {r["m"] for r in _recorded(frame)} >= set(MOMENTS))
|
||||
records = {r["m"]: r for r in _recorded(frame)}
|
||||
missing = [m for m in MOMENTS if m not in records]
|
||||
if missing:
|
||||
problems.append("%s, %s, load %d: the frame never recorded %s (recorded %r)" % (case, kind, load, missing, _recorded(frame)))
|
||||
continue
|
||||
final = settled(page, lambda: tuple(frame.evaluate("() => [mozInnerScreenX, mozInnerScreenY]")))
|
||||
allowed = [(0.0, 0.0), CLIENT_ORIGIN, final]
|
||||
for moment in MOMENTS:
|
||||
reading = (records[moment]["x"], records[moment]["y"])
|
||||
if not any(_near(reading, a) for a in allowed):
|
||||
problems.append(
|
||||
"%s, %s frame, load %d, at %s: mozInnerScreen reads (%r, %r); allowed (0, 0), the client origin %r, or the settled value %r"
|
||||
% (case, kind, load, moment, reading[0], reading[1], CLIENT_ORIGIN, final))
|
||||
finally:
|
||||
page.evaluate(REMOVE)
|
||||
assert not problems, "a frame read a value that is not declared while it loaded (%d):\n %s" % (len(problems), "\n ".join(problems))
|
||||
@@ -3,9 +3,9 @@
|
||||
`new Worker("chrome://<name>/...")` returns for a chrome package the browser
|
||||
registers and throws SecurityError at once for one it does not: the parent sends
|
||||
every registered package to each content process. Every engine until firefox-47
|
||||
registered `juggler`, and captcha vendors probed it from 2026-10-06 (hCaptcha's
|
||||
hsw.js runs `new Worker("chrome://juggler/content/content/WorkerMain.js")`,
|
||||
camoufox #847): a challenge solved by hand was refused on our engine while
|
||||
registered `juggler`, and captcha vendors probed it from 2026-10-06 (the script of a
|
||||
captcha vendor runs `new Worker("chrome://juggler/content/content/WorkerMain.js")`,
|
||||
reported on another project's tracker): a challenge solved by hand was refused on our engine while
|
||||
retail Firefox passed. Measured from a page on firefox-46 and on retail Firefox
|
||||
151 under geckodriver, 2026-10-14: of the 65 chrome packages and resource
|
||||
substitutions the engine registers, `juggler` was the one retail does not; retail
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
"""A popup of the maximized window moves, resizes and clamps in the DECLARED window, not in the host's.
|
||||
|
||||
The page's ``moveBy``, ``moveTo``, ``resizeBy`` and ``resizeTo`` read the declared position and size of the window, add what the page asked, and send the
|
||||
absolute result to the parent, which applies it to the real window. A popup whose declared position or frame is not its real one (on Linux the window manager
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
The engine that answers these values is not released yet: on the engine of the pin the clamp and the moves are the host's where the declared and the real window
|
||||
differ, so this test is RED there, on purpose. It enters the suite with the engine release.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, observe, settled, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: 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"
|
||||
#: How long the window is watched after a call that must change nothing, in seconds.
|
||||
WATCH_S = 1.5
|
||||
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>popup</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, '_blank', window.__popupFeatures); });
|
||||
</script>"""
|
||||
|
||||
POPUP = "<!doctype html><meta charset=utf-8><title>popup</title><body style=margin:0>x"
|
||||
|
||||
READ = """() => ({iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight, sx: screenX, sy: screenY,
|
||||
availL: screen.availLeft, availW: screen.availWidth})"""
|
||||
SIZE = "() => [innerWidth, innerHeight, outerWidth, outerHeight]"
|
||||
POSITION = "() => [screenX, screenY]"
|
||||
|
||||
|
||||
def _open(page, sites) -> Any:
|
||||
"""``window.open`` from a real click on the page's button; the popup, loaded."""
|
||||
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
|
||||
popup.wait_for_load_state("load", timeout=30000)
|
||||
return popup
|
||||
|
||||
|
||||
def _settled_popup(popup) -> Dict[str, Any]:
|
||||
"""The popup once it is the size it was asked and two looks in a row agree."""
|
||||
return settled(popup, lambda: popup.evaluate(READ))
|
||||
|
||||
|
||||
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)
|
||||
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))
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
def _phase_move_by(page, sites, case: str) -> None:
|
||||
popup = _open(page, sites)
|
||||
try:
|
||||
before = _settled_popup(popup)
|
||||
popup.evaluate("() => { window.moveBy(10, 10); }")
|
||||
expected: Tuple[int, int] = (before["sx"] + 10, before["sy"] + 10)
|
||||
wait_for(popup, lambda: tuple(popup.evaluate(POSITION)) == expected, DEADLINE_S)
|
||||
after = settled(popup, lambda: tuple(popup.evaluate(POSITION)))
|
||||
assert tuple(after) == expected, (
|
||||
"%s: moveBy(10, 10) from (screenX, screenY) = (%r, %r) leaves it at %r, it must be exactly %r" % (case, before["sx"], before["sy"], tuple(after), expected))
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
def _phase_move_to_the_far_right(page, sites, case: str) -> None:
|
||||
popup = _open(page, sites)
|
||||
try:
|
||||
before = _settled_popup(popup)
|
||||
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))
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_popup_moves_and_resizes_as_declared(firefox_binary, case):
|
||||
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()
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
_phase_resize_by_zero(page, sites, case)
|
||||
_phase_move_by(page, sites, case)
|
||||
_phase_move_to_the_far_right(page, sites, case)
|
||||
@@ -0,0 +1,198 @@
|
||||
"""A screenshot parameter that Playwright honours by MODIFYING THE PAGE is refused by name, not silently ignored.
|
||||
|
||||
Stock Playwright 1.61 takes `mask` (an overlay painted on the page), `style` (a `<style>` element injected), `animations="disabled"` (finite animations finished,
|
||||
infinite ones cancelled) and `caret` (hidden with `caret-color: transparent`, drawn only for `"initial"`) by changing the page before the picture and putting it back
|
||||
after. `PageDispatcher.op_screenshot` never read any of them: the call succeeded and the picture came back as if the parameter had not been written. The caller cannot tell
|
||||
a masked picture from an unmasked one, and the picture is the one thing that must not lie. They are refused now, each by its name, with what to do instead.
|
||||
|
||||
The single check is `_refuse_unserved_screenshot_parameters`, the first thing in `PageDispatcher.op_screenshot` and in `ElementHandleDispatcher.op_screenshot` (a locator's is the
|
||||
element's), so the page, the full page, a clip, an element and a locator are checked at the wire, and the element's refusal comes before it scrolls or measures. What passes: `animations="allow"`, `caret="hide"` (the engine never draws the caret, which is what stock's
|
||||
default produces), an empty `mask`, an empty `style`, a `maskColor` with no mask, and `omitBackground` with jpeg (stock does nothing there).
|
||||
|
||||
`omitBackground` with png is Firefox's own: stock's `setBackgroundColor` throws `Not implemented` there (`FFPage.setBackgroundColor`, reached from `Screenshotter._screenshot`
|
||||
for png only), and the text is the same here.
|
||||
|
||||
No browser: the dispatchers are built as tests/test_a_screenshot_sends_its_scale_to_the_engine.py builds them.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.juggler.connection import EventListeners
|
||||
from invisible_core.juggler.lifecycle import Lifecycle
|
||||
from invisible_playwright._juggler.dispatcher import Dispatcher, ProtocolException
|
||||
from invisible_playwright._juggler.server import (
|
||||
ElementHandleDispatcher,
|
||||
FrameDispatcher,
|
||||
JugglerServer,
|
||||
PageDispatcher,
|
||||
)
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
BOX = {"x": 0, "y": 0, "width": 1280, "height": 720, "fullWidth": 1280, "fullHeight": 3000}
|
||||
|
||||
# what the vendored client puts on the wire for `mask=[page.locator("#a")]`
|
||||
MASK = [{"frame": "frame@1", "selector": "#a"}]
|
||||
|
||||
|
||||
def make_page():
|
||||
server = JugglerServer()
|
||||
server.attach(SimpleNamespace(emit_message=lambda m: None))
|
||||
context = Dispatcher(server, None)
|
||||
context.options = {}
|
||||
page = object.__new__(PageDispatcher)
|
||||
page.context = context
|
||||
page.lifecycle = Lifecycle(EventListeners(), "session")
|
||||
page.injected = Mock()
|
||||
page.injected.evaluate.return_value = dict(BOX)
|
||||
page.actions = Mock()
|
||||
page._frames = {}
|
||||
page._navigation_requests = {}
|
||||
page._announced_closed = False
|
||||
Dispatcher.__init__(page, server, context)
|
||||
page.frame = FrameDispatcher(server, page, "main")
|
||||
page.lifecycle._on_event("Page.frameAttached", {"frameId": "main", "parentFrameId": None})
|
||||
page.send = Mock(return_value={"data": "AAAA"})
|
||||
return page
|
||||
|
||||
|
||||
def _page_shot(page, params):
|
||||
return page.op_screenshot(params)
|
||||
|
||||
|
||||
def _full_page_shot(page, params):
|
||||
return page.op_screenshot(dict(params, fullPage=True))
|
||||
|
||||
|
||||
def _clip_shot(page, params):
|
||||
return page.op_screenshot(dict(params, clip={"x": 5, "y": 6, "width": 100, "height": 50}))
|
||||
|
||||
|
||||
def _element_shot(page, params):
|
||||
handle = ElementHandleDispatcher(page.server, page.frame, "object-1")
|
||||
page.injected.bounding_box.return_value = {"x": 10, "y": 20, "width": 30, "height": 40}
|
||||
return handle.op_screenshot(params)
|
||||
|
||||
|
||||
# a locator's screenshot is the element handle's (`Locator.screenshot` -> `_with_element` -> `ElementHandle.screenshot`), with the same parameters
|
||||
KINDS = [_page_shot, _full_page_shot, _clip_shot, _element_shot]
|
||||
KIND_IDS = ["page", "full_page", "clip", "element_or_locator"]
|
||||
|
||||
REFUSED = [
|
||||
({"mask": MASK}, "mask"),
|
||||
({"mask": MASK, "maskColor": "#00f"}, "mask"),
|
||||
({"style": "* { color: red }"}, "style"),
|
||||
({"animations": "disabled"}, "animations"),
|
||||
({"caret": "initial"}, "caret"),
|
||||
]
|
||||
REFUSED_IDS = ["mask", "mask_with_color", "style", "animations_disabled", "caret_initial"]
|
||||
|
||||
ACCEPTED = [
|
||||
{},
|
||||
{"animations": "allow"},
|
||||
{"caret": "hide"},
|
||||
{"mask": []},
|
||||
{"mask": [], "maskColor": "#00f"},
|
||||
{"maskColor": "#00f"},
|
||||
{"style": ""},
|
||||
{"omitBackground": False},
|
||||
{"omitBackground": True, "type": "jpeg"},
|
||||
{"animations": "allow", "caret": "hide", "mask": [], "style": "", "scale": "css"},
|
||||
]
|
||||
ACCEPTED_IDS = ["nothing", "animations_allow", "caret_hide", "empty_mask", "empty_mask_with_color", "color_alone", "empty_style",
|
||||
"omit_background_false", "omit_background_jpeg", "all_the_harmless_ones"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", KINDS, ids=KIND_IDS)
|
||||
@pytest.mark.parametrize("params,name", REFUSED, ids=REFUSED_IDS)
|
||||
def test_a_parameter_that_would_modify_the_page_is_refused_by_name(kind, params, name):
|
||||
page = make_page()
|
||||
with pytest.raises(ProtocolException) as refused:
|
||||
kind(page, params)
|
||||
message = str(refused.value)
|
||||
assert "screenshot(%s" % name in message
|
||||
assert "not served" in message
|
||||
page.send.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("params,name,instead", [
|
||||
({"mask": MASK}, "mask", "Hide the elements yourself"),
|
||||
({"style": "p { color: red }"}, "style", "add_style_tag"),
|
||||
({"animations": "disabled"}, "animations", "document.getAnimations"),
|
||||
({"caret": "initial"}, "caret", 'Leave caret out or pass "hide"'),
|
||||
], ids=["mask", "style", "animations", "caret"])
|
||||
def test_the_refusal_says_why_and_what_to_do_instead(params, name, instead):
|
||||
page = make_page()
|
||||
with pytest.raises(ProtocolException) as refused:
|
||||
page.op_screenshot(params)
|
||||
message = str(refused.value)
|
||||
if name != "caret":
|
||||
assert "modifying the page" in message
|
||||
assert instead in message
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", KINDS, ids=KIND_IDS)
|
||||
@pytest.mark.parametrize("params", ACCEPTED, ids=ACCEPTED_IDS)
|
||||
def test_what_does_not_modify_the_page_is_taken(kind, params):
|
||||
page = make_page()
|
||||
assert kind(page, params) == {"binary": "AAAA"}
|
||||
(method, sent), _kw = page.send.call_args
|
||||
assert method == "Page.screenshot"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", KINDS, ids=KIND_IDS)
|
||||
@pytest.mark.parametrize("params", [{"omitBackground": True}, {"omitBackground": True, "type": "png"}], ids=["default_type", "png"])
|
||||
def test_omit_background_with_png_answers_firefoxs_own_error(kind, params):
|
||||
page = make_page()
|
||||
with pytest.raises(ProtocolException) as refused:
|
||||
kind(page, params)
|
||||
assert str(refused.value) == "Not implemented"
|
||||
page.send.assert_not_called()
|
||||
|
||||
|
||||
def test_the_first_refusal_wins_and_nothing_is_sent_when_several_are_asked():
|
||||
page = make_page()
|
||||
with pytest.raises(ProtocolException):
|
||||
page.op_screenshot({"mask": MASK, "style": "p {}", "animations": "disabled", "caret": "initial", "omitBackground": True})
|
||||
page.send.assert_not_called()
|
||||
|
||||
|
||||
# ── the refusal comes FIRST: a refused element's or locator's call neither scrolls nor measures the page ────────────────────
|
||||
REFUSED_ELEMENT = REFUSED + [({"omitBackground": True}, "omitBackground")]
|
||||
REFUSED_ELEMENT_IDS = REFUSED_IDS + ["omit_background_png"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("params,name", REFUSED_ELEMENT, ids=REFUSED_ELEMENT_IDS)
|
||||
def test_a_refused_element_screenshot_sends_nothing_to_the_engine_not_even_a_scroll_or_a_measure(params, name):
|
||||
page = make_page()
|
||||
handle = ElementHandleDispatcher(page.server, page.frame, "object-1")
|
||||
page.injected.bounding_box.return_value = {"x": 10, "y": 20, "width": 30, "height": 40}
|
||||
with pytest.raises(ProtocolException):
|
||||
handle.op_screenshot(params)
|
||||
# the scroll (`scroll_into_view`), the box (`bounding_box`) and the document's scroll (`evaluate`) all go through `injected`,
|
||||
# the picture through `send`: not one of them was called
|
||||
assert page.injected.mock_calls == []
|
||||
page.send.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("params,name", REFUSED_ELEMENT, ids=REFUSED_ELEMENT_IDS)
|
||||
def test_a_refused_page_screenshot_measures_nothing_either(params, name):
|
||||
page = make_page()
|
||||
with pytest.raises(ProtocolException):
|
||||
page.op_screenshot(params)
|
||||
assert page.injected.mock_calls == []
|
||||
page.send.assert_not_called()
|
||||
|
||||
|
||||
def test_the_element_screenshot_that_is_taken_still_scrolls_and_measures_first():
|
||||
page = make_page()
|
||||
page.injected.bounding_box.return_value = {"x": 10, "y": 20, "width": 30, "height": 40}
|
||||
handle = ElementHandleDispatcher(page.server, page.frame, "object-1")
|
||||
handle.op_screenshot({})
|
||||
names = [call[0] for call in page.injected.mock_calls]
|
||||
assert names[:2] == ["scroll_into_view", "bounding_box"]
|
||||
assert page.send.call_args[0][0] == "Page.screenshot"
|
||||
@@ -0,0 +1,221 @@
|
||||
"""A screenshot parameter that Playwright honours by modifying the page is refused with a clear error, and a caret is not in our picture.
|
||||
|
||||
Stock Playwright takes `mask`, `style` and `animations="disabled"` by changing the page before the picture and putting it back after, hides the caret by default
|
||||
(`caret-color: transparent`) and draws it for `caret="initial"`, and its Firefox throws `Not implemented` for `omitBackground` with png. This package never read those
|
||||
parameters and answered a picture as if they had not been written. Here the real server is asked, through the client, on a page, a locator and an element handle:
|
||||
|
||||
* `mask` (with `maskColor`), `style`, `animations="disabled"` and `caret="initial"` raise an `Error` that names the parameter, and the page is left as it was (no `<style>`, no
|
||||
overlay, the next screenshot works);
|
||||
* `omitBackground` with png raises `Not implemented`; with jpeg it takes the picture;
|
||||
* `animations="allow"`, `caret="hide"`, an empty `mask` and an empty `style` take the picture;
|
||||
* the caret: the client sends `caret` only when the caller writes it, so a call that does not write it takes the picture the way `caret="hide"` does. Measured: a focused `<input>` with
|
||||
`caret-color: red` photographed with `caret` absent and with `"hide"` has no red pixel in it; a red border on the same input is found by the same reading, so the reading is not blind.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import _page_bytes
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
HTML = (
|
||||
"<!doctype html><html style='background:#fff'><body style='margin:20px;background:#fff'>"
|
||||
"<p id='a' style='margin:0;width:200px;height:40px;background:#0a0'>masked</p>"
|
||||
"<input id='i' value='' style='display:block;margin-top:20px;width:200px;height:40px;border:0;outline:0;background:#fff;color:#000;caret-color:#f00;font-size:24px'>"
|
||||
"<input id='b' value='' style='display:block;margin-top:20px;width:200px;height:40px;border:0;border-right:6px solid #f00;background:#fff;color:#000;font-size:24px'>"
|
||||
"</body></html>"
|
||||
)
|
||||
|
||||
JPEG, PNG = b"\xff\xd8", b"\x89PNG"
|
||||
_SET = [None] # the document as the page serialises it right after set_content
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def page(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4281, binary_path=firefox_binary, headless=True) as browser:
|
||||
context = browser.new_context(viewport={"width": 800, "height": 400})
|
||||
page = context.new_page()
|
||||
page.set_content(HTML, wait_until="load")
|
||||
_SET[0] = page.content()
|
||||
yield page
|
||||
context.close()
|
||||
|
||||
|
||||
def _red_pixels(png: bytes) -> int:
|
||||
image = _page_bytes.unfiltered(png)
|
||||
w, channels, data = image["w"], image["channels"], image["data"]
|
||||
count = 0
|
||||
for at in range(0, len(data), channels):
|
||||
r, g, b = data[at], data[at + 1], data[at + 2]
|
||||
if r > 200 and g < 60 and b < 60:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
def _the_page_is_as_it_was(page):
|
||||
"""No `<style>` was injected, no overlay was added, the document is the one that was set, and the next screenshot works."""
|
||||
assert page.evaluate("document.querySelectorAll('style').length") == 0
|
||||
assert page.content() == _SET[0]
|
||||
assert page.screenshot()[:4] == PNG
|
||||
|
||||
|
||||
def _calls(page):
|
||||
"""Each way of asking: the page, a locator, an element handle. Every one is a function of the keyword arguments."""
|
||||
handle = page.query_selector("#a")
|
||||
return {
|
||||
"page": lambda **k: page.screenshot(**k),
|
||||
"locator": lambda **k: page.locator("#a").screenshot(**k),
|
||||
"handle": lambda **k: handle.screenshot(**k),
|
||||
}
|
||||
|
||||
|
||||
WAYS = ("page", "locator", "handle")
|
||||
|
||||
# The first line of stock Playwright's error for `omitBackground` with png on Firefox, read from Playwright 1.61.1's own code: the server's
|
||||
# `FFPage.setBackgroundColor` throws `new Error("Not implemented")` (driver `coreBundle.js`, called when `options.omitBackground && format === "png"`),
|
||||
# and the Python client prefixes the API name (`playwright/_impl/_connection.py`: `rewrite_error(error, f"{apiName}: {error}")`).
|
||||
NOT_IMPLEMENTED = {
|
||||
"page": "Page.screenshot: Not implemented",
|
||||
"locator": "Locator.screenshot: Not implemented",
|
||||
"handle": "ElementHandle.screenshot: Not implemented",
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_a_mask_is_refused_by_name_and_the_page_is_untouched(page, way):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
shoot = _calls(page)[way]
|
||||
with pytest.raises(Error, match=r"screenshot\(mask=") as refused:
|
||||
shoot(mask=[page.locator("#a")])
|
||||
assert "maskColor" in str(refused.value)
|
||||
with pytest.raises(Error, match=r"screenshot\(mask="):
|
||||
shoot(mask=[page.locator("#a")], mask_color="#00f")
|
||||
_the_page_is_as_it_was(page)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_a_style_is_refused_by_name_and_the_page_is_untouched(page, way):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
with pytest.raises(Error, match=r"screenshot\(style=.*add_style_tag"):
|
||||
_calls(page)[way](style="p { visibility: hidden }")
|
||||
_the_page_is_as_it_was(page)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_animations_disabled_is_refused_by_name_and_the_page_is_untouched(page, way):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
with pytest.raises(Error, match=r'screenshot\(animations="disabled"\)'):
|
||||
_calls(page)[way](animations="disabled")
|
||||
_the_page_is_as_it_was(page)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_a_caret_that_is_asked_to_be_drawn_is_refused_by_name(page, way):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
with pytest.raises(Error, match=r'screenshot\(caret="initial"\)'):
|
||||
_calls(page)[way](caret="initial")
|
||||
_the_page_is_as_it_was(page)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_omit_background_with_png_is_firefoxs_not_implemented(page, way):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
with pytest.raises(Error) as refused:
|
||||
_calls(page)[way](omit_background=True)
|
||||
assert str(refused.value).split("\n")[0] == NOT_IMPLEMENTED[way]
|
||||
with pytest.raises(Error) as refused:
|
||||
_calls(page)[way](omit_background=True, type="png")
|
||||
assert str(refused.value).split("\n")[0] == NOT_IMPLEMENTED[way]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_omit_background_with_jpeg_takes_the_picture(page, way):
|
||||
assert _calls(page)[way](omit_background=True, type="jpeg")[:2] == JPEG
|
||||
|
||||
|
||||
@pytest.mark.parametrize("way", WAYS)
|
||||
def test_what_does_not_modify_the_page_takes_the_picture(page, way):
|
||||
shoot = _calls(page)[way]
|
||||
assert shoot(animations="allow")[:4] == PNG
|
||||
assert shoot(caret="hide")[:4] == PNG
|
||||
assert shoot(mask=[])[:4] == PNG
|
||||
assert shoot(style="")[:4] == PNG
|
||||
assert shoot()[:4] == PNG
|
||||
|
||||
|
||||
def _caret_shots(page, **kwargs):
|
||||
page.locator("#i").focus()
|
||||
assert page.evaluate("document.activeElement.id") == "i"
|
||||
return [page.locator("#i").screenshot(**kwargs) for _ in range(3)]
|
||||
|
||||
|
||||
def test_the_reading_of_red_is_not_blind(page):
|
||||
"""The control: a red border on an input of the same size is found by the same reading, so `0` in the two tests below is a measurement."""
|
||||
assert _red_pixels(page.locator("#b").screenshot()) > 100
|
||||
|
||||
|
||||
def test_no_caret_is_in_the_picture_when_the_caller_does_not_write_caret(page):
|
||||
assert [_red_pixels(png) for png in _caret_shots(page)] == [0, 0, 0]
|
||||
|
||||
|
||||
def test_no_caret_is_in_the_picture_with_caret_hide(page):
|
||||
assert [_red_pixels(png) for png in _caret_shots(page, caret="hide")] == [0, 0, 0]
|
||||
|
||||
|
||||
# ── a refused call does not touch the page's scroll: the refusal comes before the element is scrolled into view ────────────────
|
||||
TALL = (
|
||||
"<!doctype html><html style='background:#fff'><body style='margin:0;background:#fff'>"
|
||||
"<div style='height:3000px;background:#eee'>above the fold</div>"
|
||||
"<p id='below' style='margin:0;width:200px;height:40px;background:#0a0'>below the fold</p>"
|
||||
"<div style='height:3000px;background:#eee'>after</div>"
|
||||
"</body></html>"
|
||||
)
|
||||
SCROLLED_TO = 100
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def scrolled(page):
|
||||
"""A page scrolled to a known position with the element well below the fold."""
|
||||
other = page.context.new_page()
|
||||
other.set_content(TALL, wait_until="load")
|
||||
other.evaluate("window.scrollTo(0, %d)" % SCROLLED_TO)
|
||||
assert other.evaluate("window.scrollY") == SCROLLED_TO
|
||||
assert other.evaluate("document.getElementById('below').getBoundingClientRect().top") > 400
|
||||
yield other
|
||||
other.close()
|
||||
|
||||
|
||||
REFUSALS = [
|
||||
("mask", r"screenshot\(mask=", lambda p: {"mask": [p.locator("#below")]}),
|
||||
("style", r"screenshot\(style=", lambda p: {"style": "p { visibility: hidden }"}),
|
||||
("animations", r'screenshot\(animations="disabled"\)', lambda p: {"animations": "disabled"}),
|
||||
("caret", r'screenshot\(caret="initial"\)', lambda p: {"caret": "initial"}),
|
||||
("omit_background", None, lambda p: {"omit_background": True}),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,pattern,kwargs", REFUSALS, ids=[r[0] for r in REFUSALS])
|
||||
@pytest.mark.parametrize("way", ["locator", "handle"])
|
||||
def test_a_refused_element_screenshot_does_not_scroll_the_page(scrolled, way, name, pattern, kwargs):
|
||||
from invisible_playwright.sync_api import Error
|
||||
|
||||
shoot = {
|
||||
"locator": lambda **k: scrolled.locator("#below").screenshot(**k),
|
||||
"handle": lambda **k: scrolled.query_selector("#below").screenshot(**k),
|
||||
}[way]
|
||||
with pytest.raises(Error, match=pattern) as refused:
|
||||
shoot(**kwargs(scrolled))
|
||||
if pattern is None:
|
||||
assert str(refused.value).split("\n")[0] == NOT_IMPLEMENTED[way]
|
||||
assert scrolled.evaluate("window.scrollY") == SCROLLED_TO
|
||||
# the control: the same call without the refused parameter DOES scroll the element in, so the unchanged scroll above is a measurement
|
||||
assert shoot()[:4] == PNG
|
||||
assert scrolled.evaluate("window.scrollY") != SCROLLED_TO
|
||||
@@ -0,0 +1,148 @@
|
||||
"""The dropdown of a ``<select>`` opens at its element as it does on retail Firefox 159, in the top document and in a frame of another site.
|
||||
|
||||
THIS IS A PRODUCT MEASUREMENT, NOT A PAGE-VISIBLE ONE. A page cannot read where a dropdown opens. But the engine declares to the content process the window origin and the
|
||||
chrome offset the page reads (not the host's), and the chrome actors of the browser that anchor a popup on screen (the select dropdown, the autocomplete list, the pickers,
|
||||
the form validation bubble) compute their anchor in the content process with ``windowUtils.getElementBoundingScreenRect``: the declared window origin plus the box of the
|
||||
element. The parent then opens the popup at those numbers, on the REAL screen. Unless the parent maps the declared point back to the real one, the dropdown opens away
|
||||
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 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
|
||||
``<select>`` (160x28 at (30, 20), page margin 0) and a frame of another site, 420x200 at (30, 120), with the same ``<select>`` at (40, 20) of its document. The rectangles are the ones the CSS of
|
||||
the pages gives (everything is absolute, the margins are 0, nothing scrolls). For each of the two selects:
|
||||
|
||||
* a real click at its centre (the client's mouse on ours, a mouse event through the window's widget from chrome scope on retail) opens the dropdown, and the test waits for the menulist popup of
|
||||
``ContentSelectDropdown`` to be ``open``;
|
||||
* from chrome, two rectangles are read, in the CSS pixels of the chrome: the popup's real screen rectangle (``popup.getOuterScreenRect()``, the bounds of the popup's own widget) and the select's REAL
|
||||
screen rectangle, computed in the parent from the real geometry of the browser: the content-area rectangle of the ``<browser>`` plus the select's rectangle in the page, converted with the chrome
|
||||
window's ``windowUtils.toScreenRectInCSSUnits``;
|
||||
* ``dx`` and ``dy`` are the popup's left less the element's left and the popup's top less the element's bottom, in DEVICE pixels (the chrome's CSS pixels times the chrome's ``devicePixelRatio``,
|
||||
so the two browsers are compared in one unit); ours equals retail's within ONE device pixel, in the top document and in the frame.
|
||||
|
||||
THE RECORD: for each browser, the rectangles, and the scales: the page's ``devicePixelRatio`` (declared), the chrome's ``devicePixelRatio``, and the real scale of the screen read from chrome
|
||||
(``nsIScreen.contentsScaleFactor``, ``defaultCSSScaleFactor``, ``displayDPI``). The element's rectangle is computed in the chrome's CSS pixels from the page's CSS pixels, so a page whose scale is
|
||||
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 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
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _retail_reference import Driver, run_retail_twin
|
||||
from _stock_twin import both, differences
|
||||
from _window_origin import CASES, DEADLINE_S, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>select</title>
|
||||
<style>html,body{margin:0;padding:0}
|
||||
select{position:absolute;box-sizing:border-box;width:160px;height:28px;margin:0}
|
||||
#s{left:30px;top:20px}#f{position:absolute;left:30px;top:120px;width:420px;height:200px;border:0}</style>
|
||||
<body><select id=s><option>one</option><option>two</option><option>three</option></select><iframe id=f src="%s"></iframe>"""
|
||||
|
||||
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>"""
|
||||
|
||||
#: 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}}
|
||||
|
||||
# The reads of the browser chrome, in the script of Marionette (chrome scope).
|
||||
POPUP_STATE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
|
||||
return JSON.stringify({state: popup ? popup.state : "no popup"});
|
||||
"""
|
||||
|
||||
MEASURE_JS = """
|
||||
const [rect] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
|
||||
const browser = win.gBrowser.selectedBrowser;
|
||||
const b = browser.getBoundingClientRect();
|
||||
const el = win.windowUtils.toScreenRectInCSSUnits(b.left + rect.x, b.top + rect.y, rect.w, rect.h);
|
||||
const p = popup.getOuterScreenRect();
|
||||
const plain = r => ({left: r.left, top: r.top, right: r.right, bottom: r.bottom});
|
||||
return JSON.stringify({state: popup.state, element: plain(el), popup: plain(p), dpr: win.devicePixelRatio});
|
||||
"""
|
||||
|
||||
CLOSE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
|
||||
popup.hidePopup();
|
||||
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] = {}
|
||||
|
||||
def look() -> bool:
|
||||
seen.update(driver.chrome.script(POPUP_STATE_JS))
|
||||
return seen["state"] == state
|
||||
|
||||
wait_for(driver, look, DEADLINE_S)
|
||||
return seen
|
||||
|
||||
|
||||
def _measure(driver: Driver, rect: Dict[str, float]) -> Dict[str, Any]:
|
||||
"""Opens nothing: reads the open popup and the select's real screen rectangle, both in CSS pixels of the chrome, once two looks agree."""
|
||||
read = driver.chrome.script(MEASURE_JS, (rect,))
|
||||
for _ in range(int(DEADLINE_S * 10)):
|
||||
driver.wait_for_timeout(100)
|
||||
again = driver.chrome.script(MEASURE_JS, (rect,))
|
||||
if again == read:
|
||||
return again
|
||||
read = again
|
||||
return read
|
||||
|
||||
|
||||
def _relation(read: Dict[str, Any], page_dpr: float) -> Dict[str, Any]:
|
||||
"""The rectangles and the relation between them: dx and dy in device pixels of the chrome, and the same against the element scaled by page ratio over chrome ratio."""
|
||||
chrome_dpr = read["dpr"]
|
||||
element, popup = read["element"], read["popup"]
|
||||
ratio = page_dpr / chrome_dpr
|
||||
scaled_left = element["left"] * ratio
|
||||
scaled_bottom = element["bottom"] * ratio
|
||||
return {"element": element, "popup": popup,
|
||||
"dx": round((popup["left"] - element["left"]) * chrome_dpr, 3), "dy": round((popup["top"] - element["bottom"]) * chrome_dpr, 3),
|
||||
"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}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_select_dropdown_opens_at_its_element_as_on_retail(firefox_binary, monkeypatch, case):
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
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")))
|
||||
@@ -0,0 +1,234 @@
|
||||
"""The guard of tests/_no_network.py: a destination on this host passes, anything else is refused and recorded, and the record fails the test.
|
||||
|
||||
Each case installs its own guard on top of the one the conftest gives every test that is not e2e; the inner guard refuses first, so nothing
|
||||
reaches the outer one and nothing leaves the machine: a refused connect never sends a packet.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import socket
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
|
||||
import _no_network
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
OUTSIDE = ("1.1.1.1", 443) # never contacted: the guard refuses before the system call
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["127.0.0.1", "127.8.9.10", "::1", "0.0.0.0", "::", "localhost", "LocalHost", "a.localhost", None, "",
|
||||
"198.51.100.9", "192.0.2.1", "203.0.113.7", "2001:db8::1", "::ffff:127.0.0.1", "[::1]"])
|
||||
def test_this_host_is_this_host(host):
|
||||
assert _no_network.is_on_this_host(host)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["1.1.1.1", "8.8.8.8", "10.0.0.1", "192.168.1.1", "2606:4700::1111", "api.ipify.org", "example.com",
|
||||
b"icanhazip.com", "::ffff:8.8.8.8", "fe80::1%lo"])
|
||||
def test_outside_is_outside(host):
|
||||
assert not _no_network.is_on_this_host(host)
|
||||
|
||||
|
||||
def test_a_connect_outside_is_refused_named_and_fails_the_test(monkeypatch):
|
||||
guard = _no_network.install(monkeypatch, "tests/test_x.py::test_y")
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
with pytest.raises(ConnectionRefusedError) as refused:
|
||||
s.connect(OUTSIDE)
|
||||
message = str(refused.value)
|
||||
for part in ("WHERE: tests/test_x.py::test_y", "WHAT: connect to 1.1.1.1:443", "FIX:", "RULE:"):
|
||||
assert part in message, message
|
||||
assert guard.verdict() is not None and "connect to 1.1.1.1:443" in guard.verdict()
|
||||
|
||||
|
||||
def test_a_refusal_the_code_swallowed_still_fails_the_test(monkeypatch):
|
||||
"""The code under test may catch the refusal and carry on (an offline fallback): the record is what fails the test."""
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
try:
|
||||
s.connect_ex(OUTSIDE)
|
||||
except OSError:
|
||||
pass
|
||||
assert guard.verdict() is not None
|
||||
|
||||
|
||||
def test_a_datagram_and_a_name_lookup_outside_are_refused(monkeypatch):
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
s.sendto(b"x", ("8.8.8.8", 53))
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
socket.getaddrinfo("api.ipify.org", 443)
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
socket.create_connection(("icanhazip.com", 443), timeout=1)
|
||||
assert guard.attempts == ["datagram to 8.8.8.8:53", "name lookup of api.ipify.org", "name lookup of icanhazip.com"]
|
||||
|
||||
|
||||
def test_a_client_thread_of_the_test_is_recorded(monkeypatch):
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
|
||||
def client():
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
try:
|
||||
s.connect(OUTSIDE)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
worker = threading.Thread(target=client)
|
||||
worker.start()
|
||||
worker.join(10)
|
||||
assert guard.attempts == ["connect to 1.1.1.1:443"]
|
||||
|
||||
|
||||
def test_this_host_passes_and_leaves_no_record(monkeypatch):
|
||||
"""The control: a server on loopback is reached through the same doors, by address and by name, and the test stays green."""
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server:
|
||||
server.bind(("127.0.0.1", 0))
|
||||
server.listen(1)
|
||||
port = server.getsockname()[1]
|
||||
with socket.create_connection(("localhost", port), timeout=5) as client:
|
||||
accepted, _ = server.accept()
|
||||
accepted.close()
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as other:
|
||||
assert other.connect_ex(("127.0.0.1", port)) == 0
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as receiver, socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sender:
|
||||
receiver.bind(("127.0.0.1", 0))
|
||||
sender.sendto(b"x", receiver.getsockname())
|
||||
assert guard.verdict() is None
|
||||
|
||||
|
||||
def test_the_address_this_host_sends_from_is_this_host(monkeypatch):
|
||||
"""A relay of the tests that leaves from the address of the host (tests/_host_address.py) is on this host: a datagram to it stays here."""
|
||||
own = _no_network.own_addresses()
|
||||
if not own:
|
||||
pytest.skip("this host has no default route, so no address of its own beside loopback")
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
with socket.socket(socket.AF_INET if ":" not in own[0] else socket.AF_INET6, socket.SOCK_DGRAM) as receiver:
|
||||
receiver.bind((own[0], 0))
|
||||
with socket.socket(receiver.family, socket.SOCK_DGRAM) as sender:
|
||||
sender.sendto(b"x", receiver.getsockname()[:2])
|
||||
assert guard.verdict() is None
|
||||
assert all(_no_network.is_on_this_host(a, own) for a in own)
|
||||
|
||||
|
||||
# The asyncio doors, for every loop kind this system has: the selector loop everywhere, and on Windows the Proactor loop too (the default
|
||||
# there), which connects with ConnectEx and sends with WSASendTo, never through socket.socket: the unit tier of the round runs on both systems.
|
||||
import asyncio # noqa: E402
|
||||
import sys # noqa: E402
|
||||
|
||||
LOOPS = ["selector"] + (["proactor"] if sys.platform == "win32" else [])
|
||||
|
||||
|
||||
def _run(kind, coroutine_function):
|
||||
loop = asyncio.SelectorEventLoop() if kind == "selector" else asyncio.ProactorEventLoop()
|
||||
try:
|
||||
return loop.run_until_complete(coroutine_function())
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", LOOPS)
|
||||
def test_an_asyncio_connection_to_a_numeric_address_outside_is_refused(monkeypatch, kind):
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
|
||||
async def go():
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
await asyncio.open_connection(*OUTSIDE)
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
s.setblocking(False)
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
await asyncio.get_running_loop().sock_connect(s, OUTSIDE)
|
||||
|
||||
_run(kind, go)
|
||||
assert guard.attempts == ["asyncio connect to 1.1.1.1:443"], guard.attempts
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", LOOPS)
|
||||
def test_an_asyncio_datagram_outside_is_refused(monkeypatch, kind):
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
|
||||
async def go():
|
||||
loop = asyncio.get_running_loop()
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
await loop.create_datagram_endpoint(asyncio.DatagramProtocol, remote_addr=("8.8.8.8", 53))
|
||||
transport, _ = await loop.create_datagram_endpoint(asyncio.DatagramProtocol, local_addr=("127.0.0.1", 0))
|
||||
try:
|
||||
# the selector transport hands a refused send to its protocol (error_received) instead of raising it: the record is what counts
|
||||
try:
|
||||
transport.sendto(b"x", ("8.8.4.4", 53))
|
||||
except ConnectionRefusedError:
|
||||
pass
|
||||
finally:
|
||||
transport.close()
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
|
||||
s.setblocking(False)
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
await loop.sock_sendto(s, b"x", ("8.8.8.8", 5353))
|
||||
|
||||
_run(kind, go)
|
||||
assert guard.attempts == ["asyncio datagram endpoint to 8.8.8.8:53", "asyncio datagram to 8.8.4.4:53", "asyncio datagram to 8.8.8.8:5353"] \
|
||||
or guard.attempts == ["asyncio datagram endpoint to 8.8.8.8:53", "datagram to 8.8.4.4:53", "asyncio datagram to 8.8.8.8:5353"], guard.attempts
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", LOOPS)
|
||||
def test_asyncio_on_this_host_passes(monkeypatch, kind):
|
||||
"""The control: a server on loopback, reached through asyncio by address and a datagram to a loopback receiver, leave no record."""
|
||||
guard = _no_network.install(monkeypatch, "t")
|
||||
|
||||
async def go():
|
||||
loop = asyncio.get_running_loop()
|
||||
server = await asyncio.start_server(lambda r, w: w.close(), "127.0.0.1", 0)
|
||||
port = server.sockets[0].getsockname()[1]
|
||||
reader, writer = await asyncio.open_connection("127.0.0.1", port)
|
||||
writer.close()
|
||||
server.close()
|
||||
await server.wait_closed()
|
||||
receiver, _ = await loop.create_datagram_endpoint(asyncio.DatagramProtocol, local_addr=("127.0.0.1", 0))
|
||||
sender, _ = await loop.create_datagram_endpoint(asyncio.DatagramProtocol, remote_addr=receiver.get_extra_info("sockname"))
|
||||
sender.sendto(b"x")
|
||||
sender.close()
|
||||
receiver.close()
|
||||
|
||||
_run(kind, go)
|
||||
assert guard.verdict() is None
|
||||
|
||||
|
||||
# The one declared third party: the version gate asks the index. Faked below the guard, so nothing leaves the machine here either.
|
||||
INDEX_ADDRESS = "8.8.4.4" # stands for the index: faked, never contacted
|
||||
|
||||
|
||||
def _fake_index(monkeypatch):
|
||||
"""The system lookup answers the index's address for pypi.org, and the system connect records instead of connecting."""
|
||||
reached = []
|
||||
monkeypatch.setattr(socket, "getaddrinfo", lambda host, port, *a, **k: [(socket.AF_INET, socket.SOCK_STREAM, 6, "", (INDEX_ADDRESS, port))])
|
||||
monkeypatch.setattr(socket.socket, "connect", lambda self, address: reached.append(address))
|
||||
return reached
|
||||
|
||||
|
||||
def test_the_version_gate_may_ask_the_index_and_only_the_index(monkeypatch):
|
||||
reached = _fake_index(monkeypatch)
|
||||
guard = _no_network.install(monkeypatch, "tests/test_version_is_not_taken.py::test_the_declared_version_is_not_already_published")
|
||||
(family, kind, proto, _name, address), = socket.getaddrinfo("pypi.org", 443)
|
||||
with socket.socket(family, kind) as s:
|
||||
s.connect(address)
|
||||
assert [a for a in reached if a[1] == 443] == [(INDEX_ADDRESS, 443)] # (the guard's own probe of this host's address is recorded too)
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
socket.getaddrinfo("files.example.net", 443)
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s, pytest.raises(ConnectionRefusedError):
|
||||
s.connect(OUTSIDE)
|
||||
assert guard.attempts == ["name lookup of files.example.net", "connect to 1.1.1.1:443"]
|
||||
|
||||
|
||||
def test_no_other_file_may_ask_the_index(monkeypatch):
|
||||
reached = _fake_index(monkeypatch)
|
||||
guard = _no_network.install(monkeypatch, "tests/test_x.py::test_y")
|
||||
with pytest.raises(ConnectionRefusedError):
|
||||
socket.getaddrinfo("pypi.org", 443)
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s, pytest.raises(ConnectionRefusedError):
|
||||
s.connect((INDEX_ADDRESS, 443))
|
||||
assert [a for a in reached if a[1] == 443] == [] and guard.attempts == ["name lookup of pypi.org", "connect to %s:443" % INDEX_ADDRESS]
|
||||
|
||||
|
||||
def test_the_declared_third_parties_are_the_version_gate_alone():
|
||||
"""A new entry is a decision: this test changes with it, in the same diff, where a reviewer sees it."""
|
||||
assert _no_network.DECLARED_THIRD_PARTIES == {"tests/test_version_is_not_taken.py": ("pypi.org",)}
|
||||
@@ -0,0 +1,166 @@
|
||||
"""The tooltip of an element with a ``title`` opens at the pointer as it does on retail Firefox 159, in the top document and in a frame of another site.
|
||||
|
||||
THIS IS A PRODUCT MEASUREMENT, NOT A PAGE-VISIBLE ONE: a page cannot read where a tooltip opens. But the point the browser opens it at is the event's screen point
|
||||
(``ChromeTooltipListener::MouseMove`` keeps ``ScreenPointLayoutDevicePix`` of the mouse event, ``nsDocShellTreeOwner.cpp``, and ``XULBrowserWindow.showTooltip`` in the parent
|
||||
calls ``#remoteBrowserTooltip.openPopupAtScreen(x / devicePixelRatio, y / devicePixelRatio)``). The engine declares the window origin and the chrome offset to the content
|
||||
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
|
||||
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
|
||||
(``rule_dy``) and is not the verdict: a record whose retail offset is not the rule is a finding about the rule, printed with both.
|
||||
|
||||
What it does, per display case (the four of the window tests), on each browser (launched with Marionette so that the test can read its chrome): a page of the top site has a 120x40 box with a
|
||||
``title`` at (40, 40), and a frame of another site, 420x200 at (30, 120), with the same box at (40, 40) of its document. For each of the two boxes:
|
||||
|
||||
* the pointer goes away from the box and then onto its centre (the client's own mouse on ours, mouse events through the window's widget from chrome scope on retail); the test waits for
|
||||
``#remoteBrowserTooltip`` of the browser window to be ``open`` (after ``ui.tooltip.delay_ms``); the chrome window is focused first, because ``showTooltip`` shows nothing in a window that
|
||||
has no focus;
|
||||
* from chrome, the popup's real screen rectangle (``getOuterScreenRect()``) and the REAL screen position of the pointer are read, in CSS pixels of the chrome: the content-area rectangle of the
|
||||
``<browser>`` plus the point in the page, converted with the chrome window's ``windowUtils.toScreenRectInCSSUnits`` (the widget as it really is);
|
||||
* ``dx`` and ``dy`` are the popup's left less the pointer's x and its top less the pointer's y, in DEVICE pixels of the chrome.
|
||||
|
||||
RED WITHOUT THE TOOLTIP MAP. With the declared point opened as it is, the popup is at the pointer plus (declared window origin - real window origin) (and, in the frame, plus the
|
||||
declared chrome offset less the real one): on Linux the window manager's frame and the host's chrome are not retail's, on Windows the real chrome has other heights, so at least one
|
||||
of the two offsets is more than two device pixels away from retail's at every case, and the assertion prints both records.
|
||||
|
||||
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, on purpose.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
import sys
|
||||
from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _retail_reference import Driver, run_retail_twin
|
||||
from _stock_twin import both, differences
|
||||
from _window_origin import CASES, DEADLINE_S, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: ``LookAndFeel::kDefaultTooltipOffset`` (widget/LookAndFeel.h:349): how far below the pointer an unanchored tooltip opens, CSS pixels, at the default cursor size.
|
||||
DEFAULT_TOOLTIP_OFFSET = 21
|
||||
#: ``kDefaultCursorSize`` of ``GetTooltipOffsetVertical`` (widget/windows/nsLookAndFeel.cpp:44).
|
||||
DEFAULT_CURSOR_SIZE = 32
|
||||
#: ``MOZ_SPI_CURSORSIZE`` (widget/windows/nsLookAndFeel.h:44).
|
||||
SPI_GETCURSORSIZE = 0x2028
|
||||
|
||||
|
||||
def tooltip_offset() -> int:
|
||||
"""The vertical tooltip offset Firefox computes on this host, by its own rule (widget/windows/nsLookAndFeel.cpp:43-51 on Windows; the default elsewhere)."""
|
||||
if sys.platform != "win32":
|
||||
return DEFAULT_TOOLTIP_OFFSET
|
||||
import ctypes
|
||||
from ctypes import wintypes
|
||||
size = wintypes.DWORD(DEFAULT_CURSOR_SIZE)
|
||||
if not ctypes.windll.user32.SystemParametersInfoW(SPI_GETCURSORSIZE, 0, ctypes.byref(size), 0):
|
||||
size = wintypes.DWORD(DEFAULT_CURSOR_SIZE)
|
||||
if size.value == DEFAULT_CURSOR_SIZE:
|
||||
return DEFAULT_TOOLTIP_OFFSET
|
||||
return math.ceil(DEFAULT_TOOLTIP_OFFSET * size.value / DEFAULT_CURSOR_SIZE)
|
||||
|
||||
|
||||
#: The box that has the title: 120x40 at (40, 40) of its document.
|
||||
BOX = (40, 40, 120, 40)
|
||||
#: Where the mouse waits before it comes onto the box, in the top document.
|
||||
AWAY = (700, 500)
|
||||
FRAME_AT = (30, 120)
|
||||
|
||||
BOX_CSS = ("#b{position:absolute;box-sizing:border-box;left:40px;top:40px;width:120px;height:40px;background:#9bd}"
|
||||
"html,body{margin:0;padding:0}")
|
||||
TOP = """<!doctype html><meta charset=utf-8><title>tooltip</title>
|
||||
<style>%s #f{position:absolute;left:30px;top:120px;width:420px;height:200px;border:0}</style>
|
||||
<body><div id=b title="the tooltip of the top document">box</div><iframe id=f src="%%s"></iframe>""" % BOX_CSS
|
||||
FRAME = """<!doctype html><meta charset=utf-8><title>tooltip in a frame</title>
|
||||
<style>%s</style><body><div id=b title="the tooltip of the frame">box</div>""" % BOX_CSS
|
||||
|
||||
FOCUS_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
win.focus();
|
||||
return JSON.stringify({focus: win.document.hasFocus()});
|
||||
"""
|
||||
STATE_JS = """
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
return JSON.stringify({state: win.document.getElementById("remoteBrowserTooltip").state});
|
||||
"""
|
||||
MEASURE_JS = """
|
||||
const [point] = arguments;
|
||||
const win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const tip = win.document.getElementById("remoteBrowserTooltip");
|
||||
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
|
||||
const p = win.windowUtils.toScreenRectInCSSUnits(b.left + point.x, b.top + point.y, 0, 0);
|
||||
const r = tip.getOuterScreenRect();
|
||||
return JSON.stringify({state: tip.state, pointer: {x: p.left, y: p.top}, popup: {left: r.left, top: r.top, right: r.right, bottom: r.bottom}, dpr: win.devicePixelRatio});
|
||||
"""
|
||||
|
||||
|
||||
def _wait_state(driver: Driver, state: str) -> Dict[str, Any]:
|
||||
seen: Dict[str, Any] = {}
|
||||
|
||||
def look() -> bool:
|
||||
seen.update(driver.chrome.script(STATE_JS))
|
||||
return seen["state"] == state
|
||||
|
||||
wait_for(driver, look, DEADLINE_S)
|
||||
return seen
|
||||
|
||||
|
||||
def _measured(driver: Driver, point: Dict[str, float]) -> Dict[str, Any]:
|
||||
"""The popup and the pointer once two looks 100 ms apart agree."""
|
||||
read = driver.chrome.script(MEASURE_JS, (point,))
|
||||
for _ in range(int(DEADLINE_S * 10)):
|
||||
driver.wait_for_timeout(100)
|
||||
again = driver.chrome.script(MEASURE_JS, (point,))
|
||||
if again == read:
|
||||
return again
|
||||
read = again
|
||||
return read
|
||||
|
||||
|
||||
def _relation(read: Dict[str, Any], rule: int) -> Dict[str, Any]:
|
||||
"""The popup and the pointer, the offset between them in device pixels of the chrome, and the rule's offset as a cross-check."""
|
||||
dpr = read["dpr"]
|
||||
dx = (read["popup"]["left"] - read["pointer"]["x"]) * dpr
|
||||
dy = (read["popup"]["top"] - read["pointer"]["y"]) * dpr
|
||||
return {"popup": read["popup"], "pointer": read["pointer"], "dx": round(dx, 3), "dy": round(dy, 3), "rule_dy": round(rule * dpr, 3)}
|
||||
|
||||
|
||||
def _steps(sites, driver: Driver) -> Dict[str, Any]:
|
||||
"""What one browser does: the pointer onto each box, the tooltip against the pointer, the pointer away. {"scales": ..., "measured": {top, frame}}."""
|
||||
driver.goto(sites.url("A", "/page"))
|
||||
scales = driver.scales()
|
||||
wait_for(driver, lambda: driver.chrome.script(FOCUS_JS)["focus"], DEADLINE_S)
|
||||
focus = driver.chrome.script(FOCUS_JS)
|
||||
rule = tooltip_offset()
|
||||
measured: Dict[str, Any] = {}
|
||||
for name, origin in (("top", (0, 0)), ("frame", FRAME_AT)):
|
||||
point = {"x": origin[0] + BOX[0] + BOX[2] // 2, "y": origin[1] + BOX[1] + BOX[3] // 2}
|
||||
driver.move(*AWAY)
|
||||
driver.move(point["x"] - 20, point["y"] - 10)
|
||||
driver.move(point["x"], point["y"], steps=4)
|
||||
opened = _wait_state(driver, "open")
|
||||
assert opened["state"] == "open", "no tooltip opened over the box with a title of the %s document (popup state %r; the chrome window had focus: %r)" % (name, opened, focus)
|
||||
measured[name] = _relation(_measured(driver, point), rule)
|
||||
driver.move(*AWAY)
|
||||
closed = _wait_state(driver, "closed")
|
||||
assert closed["state"] == "closed", "the tooltip of the %s document did not close when the pointer left (popup state %r)" % (name, closed)
|
||||
return {"scales": scales, "measured": measured}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_a_tooltip_opens_at_the_pointer_as_on_retail(firefox_binary, monkeypatch, case):
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/tip"))
|
||||
sites.route("B", "/tip", FRAME)
|
||||
retail, ours = run_retail_twin(case, firefox_binary, lambda driver: _steps(sites, driver))
|
||||
# two device pixels: the point is a device pixel and the popup's position is rounded once more
|
||||
relation = lambda record: {name: {key: value[key] for key in ("dx", "dy")} for name, value in record["measured"].items()} # noqa: E731
|
||||
differing = differences(relation(retail), relation(ours), {"dx": 2.0, "dy": 2.0}, "measured")
|
||||
assert not differing, (
|
||||
"%s: the tooltip of ours is not where retail's is against the pointer (dx, dy in device pixels of each chrome; rule_dy is the offset Firefox's own rule gives on this host):\n %s%s"
|
||||
% (case, "\n ".join(differing), both(case, retail, ours, "retail")))
|
||||
@@ -29,6 +29,7 @@ from http.server import BaseHTTPRequestHandler
|
||||
import pytest
|
||||
|
||||
from _bfcache_evidence import decide_outcome, read_after_go_back, wait_cacheable
|
||||
from _evidence_on_failure import FailureEvidence
|
||||
from _servers import LocalServer
|
||||
|
||||
STRATEGY_1 = {
|
||||
@@ -160,13 +161,30 @@ def _ask(page, where):
|
||||
return target.evaluate("window.__ask()")
|
||||
|
||||
|
||||
#: The engine's own log of the session history and the back-forward cache, kept with the evidence of a red run (one file per process): whether
|
||||
#: the restore happened, in which process, and what the parent did with the history entry. Run 45691494388 (job 139520127265) saw go_back
|
||||
#: end with "no new navigation on frame mainframe-11 in 30s" for top/other-site/goto and kept nothing to say whether the engine restored the
|
||||
#: page. A diagnostic no page reads.
|
||||
BFCACHE_LOG = "timestamp,SHIPBFCache:5,nsSHistory:5,SessionHistory:4,BCWebProgress:4,DocumentChannel:4,BrowsingContext:4"
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.parametrize("how", ["goto", "location"])
|
||||
@pytest.mark.parametrize("away", ["same-site", "other-site"])
|
||||
@pytest.mark.parametrize("where", ["top", "oop-frame"])
|
||||
def test_a_worker_leaves_with_its_page_for_the_cache_and_comes_back_the_same(firefox_binary, sites, events, where,
|
||||
away, how, engine_at_least):
|
||||
"""When it fails it saves, under ``invpw-evidence/worker-back-from-the-cache-<where>-<away>-<how>/``, the Juggler wire, the engine trace,
|
||||
the engine log BFCACHE_LOG and ``after-go-back.jsonl`` (what the page said when go_back raised, and 2 s later)."""
|
||||
engine_at_least("firefox-62")
|
||||
reads = _Reads()
|
||||
with FailureEvidence("worker-back-from-the-cache-%s-%s-%s" % (where, away, how)) as evidence:
|
||||
evidence.note_records("after-go-back", reads)
|
||||
evidence.arm(moz_log=BFCACHE_LOG)
|
||||
_the_case(firefox_binary, sites, events, where, away, how, reads)
|
||||
|
||||
|
||||
def _the_case(firefox_binary, sites, events, where, away, how, reads):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary, humanize=False,
|
||||
@@ -206,7 +224,7 @@ def test_a_worker_leaves_with_its_page_for_the_cache_and_comes_back_the_same(fir
|
||||
|
||||
# 3. back from the cache: the same worker, told once, after the restored document's contexts are cleared
|
||||
back = len(events)
|
||||
page.go_back(wait_until="load")
|
||||
_go_back_and_record(page, reads)
|
||||
# What it knows is written down BEFORE anything is asserted. A goto is started by the PARENT and Firefox may refuse the cache for it,
|
||||
# to the same site or to another (measured: the navigation's own channel is still in the old document's loadgroup when the parent
|
||||
# checks: SHIPBFCache log, CanonicalBrowsingContext::AllowedInBFCache); then the document is built again and the contract is the one
|
||||
@@ -276,3 +294,34 @@ def _assert_a_new_page_with_a_new_worker(page, events, where, old, back):
|
||||
elif m == "Page.workerDestroyed":
|
||||
live.pop(p["workerId"], None)
|
||||
assert list(live) == [new[0]], "live workers after the page was built again: %r" % list(live.values())
|
||||
|
||||
|
||||
class _Reads:
|
||||
"""What the page says right after a go_back that raised, and once more later (``FailureEvidence.note_records`` shape)."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.lock = threading.Lock()
|
||||
self.records = []
|
||||
|
||||
def read(self, page, when):
|
||||
record = {"when": when, "t": time.time(), "client_url": page.url}
|
||||
try:
|
||||
record.update(page.evaluate(
|
||||
"() => ({url: location.href, shown: window.__shown || null, history: history.length,"
|
||||
" type: (performance.getEntriesByType('navigation')[0] || {}).type || null, state: document.readyState})"))
|
||||
except Exception as problem: # the page may be gone or changing: that is what is being recorded
|
||||
record["read_error"] = "%s: %s" % (type(problem).__name__, problem)
|
||||
with self.lock:
|
||||
self.records.append(record)
|
||||
|
||||
|
||||
def _go_back_and_record(page, reads):
|
||||
"""``page.go_back(wait_until="load")``; when it raises, what the page says then and after a short pause is recorded first (the error is raised
|
||||
unchanged: the pause only dates a restore that lands after the wait, it decides nothing)."""
|
||||
try:
|
||||
page.go_back(wait_until="load")
|
||||
except Exception:
|
||||
reads.read(page, "right after the go_back raised")
|
||||
page.wait_for_timeout(2000)
|
||||
reads.read(page, "2 s later")
|
||||
raise
|
||||
@@ -37,7 +37,7 @@ def transcript(label="a", seeds=(11, 12)):
|
||||
"requests": {"GET A/": {"count": 1, "headers": [["Host", "journey-a.test:A"], ["Accept", "*/*"]], "name_orders": ["Host,Accept"],
|
||||
"body_length": 0}}}}},
|
||||
"https": {"h2": {"v1": {"connections": [{"alpn": "h2", "tls": wc.parse_client_hello(build_hello())}]}}},
|
||||
"webrtc": {"candidates": ["udp comp1 prio100 srflx <exit>"], "gathering": "complete"},
|
||||
"webrtc": {"candidates": ["udp comp1 prio100 srflx <exit>"], "candidate_types": ["relay", "srflx"], "gathering": "complete"},
|
||||
"idle": {"c1": {"destinations": {"connects": [], "dns": []}}},
|
||||
"lab": {"direct": {"witness_tcp": [], "witness_udp": [], "watcher": [], "doh_direct": [], "resolver_trap": [], "blind": []}},
|
||||
}
|
||||
@@ -1261,7 +1261,7 @@ def minimal_run():
|
||||
"end_stream": True}]}
|
||||
body = {"journey": {"steps": {"%02d" % i: step for i in range(17)}, "connects": ab.connect_summary(["127.0.0.1:7000"], norm),
|
||||
"dns": ab.dns_summary([("journey-a.test", 1, "lab")])}, "https": {"h2": {"v1": {"connections": [{"alpn": "h2", "tls": tls, "h2": h2}]}}},
|
||||
"webrtc": {"candidates": ["udp comp1 prio1 srflx <exit>"], "gathering": "complete"}, "idle": {"c1": {"destinations": {"connects": [], "dns": []}}},
|
||||
"webrtc": {"candidates": ["udp comp1 prio1 srflx <exit>"], "candidate_types": ["relay", "srflx"], "gathering": "complete"}, "idle": {"c1": {"destinations": {"connects": [], "dns": []}}},
|
||||
"lab": {"direct": {"witness_tcp": [], "witness_udp": [], "watcher": [], "doh_direct": [], "resolver_trap": [], "blind": []}}}
|
||||
leaves = ab.flatten({"11": body})
|
||||
by_category = {}
|
||||
@@ -2069,9 +2069,14 @@ time.sleep(60)
|
||||
|
||||
|
||||
def _alive(pid):
|
||||
"""Whether ``pid`` still runs. A process that exits between the two questions (it exists, then it is read) is gone, not an error: ``Process(pid)`` raises
|
||||
``NoSuchProcess`` for it (wrapper #603's round, pytest ubuntu py3.13: ``process PID not found`` from the grandchild the guard had just killed)."""
|
||||
import psutil
|
||||
|
||||
return psutil.pid_exists(pid) and psutil.Process(pid).status() != psutil.STATUS_ZOMBIE
|
||||
try:
|
||||
return psutil.pid_exists(pid) and psutil.Process(pid).status() != psutil.STATUS_ZOMBIE
|
||||
except psutil.NoSuchProcess:
|
||||
return False
|
||||
|
||||
|
||||
def _wait_gone(pid, seconds=10.0):
|
||||
@@ -2141,12 +2146,77 @@ def test_the_tree_guard_returns_at_the_timeout_kills_the_grandchild_and_names_th
|
||||
message = run.timeout_message("the network oracle", 3)
|
||||
assert message.startswith("the network oracle did not end within 3 s: the launch exit-pings of seed 11 (firefox-68-again) was alive for ")
|
||||
assert message.endswith(" s; its tree was killed")
|
||||
assert 2 <= run.launch["alive_s"] < 3 + 5
|
||||
_assert_alive_since_its_line(run, spent)
|
||||
finally:
|
||||
if pidfile.is_file():
|
||||
_kill_if_alive(int(pidfile.read_text()))
|
||||
|
||||
|
||||
def _assert_alive_since_its_line(run, spent):
|
||||
"""The time the message gives is measured from the launch line the oracle wrote to the moment the run was read, and it is what the message says.
|
||||
|
||||
⛔ NOT A WINDOW OF SECONDS. This used to assert ``2 <= alive_s < 8``: a child that a loaded machine starts late writes its launch line late, so the launch was alive for
|
||||
less than 2 s when the tree was killed, and the check failed although the guard had done everything right (the wrapper's pre-push under the load of the whole suite:
|
||||
``2 <= 1.75824``). What can be said whatever the load: the line cannot have been written before the run began nor after it was read, and its ``at`` is whole seconds
|
||||
(``launch_line``: ``timespec="seconds"``), so ``0 <= alive_s <= spent + 1``; and the message gives that number, not another."""
|
||||
alive = run.launch["alive_s"]
|
||||
assert alive is not None, "the launch line's time does not read: %r" % run.launch
|
||||
assert 0 <= alive <= spent + 1, "the launch was alive for %.2f s, outside what its line and the run allow (0 to %.2f s)" % (alive, spent + 1)
|
||||
assert ("was alive for %d s;" % alive) in run.timeout_message("the network oracle", 3)
|
||||
|
||||
|
||||
def test_a_process_that_exits_between_being_listed_and_being_read_is_gone(monkeypatch):
|
||||
"""The race at its source, made on purpose: the process is there when it is listed and gone when it is read. The old helper let ``NoSuchProcess`` out of
|
||||
``_alive`` and the test failed on a grandchild the guard had killed; now it is gone. A process that is really there is still alive (the control)."""
|
||||
import os
|
||||
|
||||
import psutil
|
||||
|
||||
def vanished(pid, *a, **k):
|
||||
raise psutil.NoSuchProcess(pid)
|
||||
|
||||
monkeypatch.setattr(psutil, "pid_exists", lambda pid: True)
|
||||
monkeypatch.setattr(psutil, "Process", vanished)
|
||||
assert _alive(424242) is False
|
||||
assert _wait_gone(424242, seconds=1.0) is True
|
||||
monkeypatch.undo()
|
||||
assert _alive(os.getpid()) is True
|
||||
|
||||
|
||||
def test_a_launch_that_began_late_is_named_with_the_time_since_its_own_line(tmp_path):
|
||||
"""The case the old check got wrong, made on purpose: a child slowed by a loaded machine writes its launch line one second before the tree is killed. The guard
|
||||
still names that launch and the time since ITS line (1 s); the old window ``2 <= alive_s < 8`` called that a failure, the check above accepts it."""
|
||||
import datetime
|
||||
|
||||
import ci_crash_evidence as crash
|
||||
|
||||
killed = datetime.datetime(2026, 11, 26, 12, 0, 3, tzinfo=datetime.timezone.utc)
|
||||
began = killed - datetime.timedelta(seconds=1)
|
||||
text = crash.launch_line(11, "exit-pings", "firefox-68-again", at=began) + "\nthe grandchild is alive\n"
|
||||
run = crash.TreeRun(None, text, "", 3.0, True)
|
||||
run.launch = crash.last_launch(text, now=killed)
|
||||
assert run.launch["alive_s"] == 1.0
|
||||
assert not (2 <= run.launch["alive_s"] < 3 + 5), "the old window rejects this launch: that was the defect"
|
||||
_assert_alive_since_its_line(run, spent=3.0)
|
||||
assert run.timeout_message("the network oracle", 3).startswith(
|
||||
"the network oracle did not end within 3 s: the launch exit-pings of seed 11 (firefox-68-again) was alive for 1 s;")
|
||||
|
||||
|
||||
def test_the_check_refuses_a_time_its_line_cannot_give(tmp_path):
|
||||
"""The control: a launch line from before the run (or a clock that went back) gives a time the run could not have had, and the check says so."""
|
||||
import datetime
|
||||
|
||||
import ci_crash_evidence as crash
|
||||
|
||||
killed = datetime.datetime(2026, 11, 26, 12, 0, 3, tzinfo=datetime.timezone.utc)
|
||||
for began, wrong in ((killed - datetime.timedelta(seconds=30), "30 s before a run of 3 s"), (killed + datetime.timedelta(seconds=5), "after the read")):
|
||||
text = crash.launch_line(11, "exit-pings", "firefox-68-again", at=began)
|
||||
run = crash.TreeRun(None, text, "", 3.0, True)
|
||||
run.launch = crash.last_launch(text, now=killed)
|
||||
with pytest.raises(AssertionError):
|
||||
_assert_alive_since_its_line(run, spent=3.0)
|
||||
|
||||
|
||||
def test_the_tree_guard_is_silent_when_the_run_ends_by_itself_and_keeps_stdout_stderr_and_the_code_apart(tmp_path):
|
||||
import ci_crash_evidence as crash
|
||||
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
"""The probe of the WebRTC walk must hold the credential the lab's TURN server signs with, and the A/A must not count retransmissions (scripts/ci_ab_network.py, tests/_turn_chain.py), no browser.
|
||||
|
||||
Two defects of the oracle, each held here:
|
||||
|
||||
* The probe gave the TURN server ``lab``/``lab`` while the server signs its answers with the long-term key of its own password: the browser found the MESSAGE-INTEGRITY of every
|
||||
Allocate success invalid, dropped it, retransmitted up to the engine's maximum and ended in error 701, so no relay candidate was ever made. And the fake server never checked the
|
||||
request's own MESSAGE-INTEGRITY, so it "allocated" for a client with the wrong password. The probe now takes the credential as an argument (the walk passes the server's own
|
||||
constant) and the server refuses a request whose integrity is wrong, as a real one does.
|
||||
* The leaf ``seeds/<seed>/webrtc/udp/counts/<target>`` counted DATAGRAMS. A retransmission is network timing (the first RTO is 100 ms and doubles; a late 401 on a loaded host adds
|
||||
one), so 1+7 became 2+7 and the A/A of one engine read 8 against 9. The leaf now counts STUN TRANSACTIONS; a transaction with more transmits than the engine's maximum is a problem
|
||||
of the run, not a compared leaf.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
import inspect
|
||||
import json
|
||||
import re
|
||||
import socket
|
||||
import struct
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _turn_chain # noqa: E402
|
||||
import ci_ab_network as ab # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
COOKIE = 0x2112A442
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the count of transactions
|
||||
def walk_transcript(label, tids):
|
||||
"""A transcript of seed 4 whose WebRTC walk sent ``tids`` (one entry per datagram, in order) to the TURN server, summarised as ``run`` summarises them."""
|
||||
events = [{"target": ab.TURN_TARGET, "message": "stun-0x0003", "tid": tid, "opener": None} for tid in tids]
|
||||
return {"format": ab.FORMAT, "label": label, "platform": "linux",
|
||||
"seeds": {"4": {"webrtc": {"candidates": ["udp comp1 prio1 relay <exit>"], "candidate_types": ["relay"], "gathering": "complete", "udp": ab.udp_summary(events, ab.Normalizer({}))}}}}
|
||||
|
||||
|
||||
A, B = "aa" * 12, "bb" * 12
|
||||
#: The recorded shape: the first Allocate once and the second seven times, against the first twice (a late 401) and the second seven times.
|
||||
FIRST_RUN, SECOND_RUN = [A] + [B] * 7, [A] * 2 + [B] * 7
|
||||
|
||||
|
||||
def test_a_late_401_that_adds_a_retransmission_is_not_a_difference_of_the_engine():
|
||||
a, b = walk_transcript("a", FIRST_RUN), walk_transcript("b", SECOND_RUN)
|
||||
assert len(FIRST_RUN) == 8 and len(SECOND_RUN) == 9, "the recorded 8 against 9"
|
||||
counts = lambda t: t["seeds"]["4"]["webrtc"]["udp"]["counts"][ab.TURN_TARGET] # noqa: E731
|
||||
assert (counts(a), counts(b)) == (2, 2), "two transactions on both sides"
|
||||
report = ab.compare_transcripts(a, b, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["problems"] == [] and report["verdict"] == "green"
|
||||
|
||||
|
||||
def test_a_transaction_that_one_run_did_not_make_is_still_a_difference():
|
||||
a = walk_transcript("a", FIRST_RUN)
|
||||
c = walk_transcript("c", [A] + [B] * 7 + ["cc" * 12]) # a third transaction: the engine asked for something more
|
||||
report = ab.compare_transcripts(a, c, [], 0, "a", "c")
|
||||
assert [d["path"] for d in report["differences"]] == ["seeds/4/webrtc/udp/counts/%s" % ab.TURN_TARGET]
|
||||
assert (report["differences"][0]["a"], report["differences"][0]["b"]) == (2, 3) and report["verdict"] == "red"
|
||||
|
||||
|
||||
def test_a_datagram_that_is_not_stun_counts_one_each_and_the_messages_and_the_order_are_kept():
|
||||
events = [{"target": "127.0.0.1:5555", "message": "quic-long", "tid": None}] * 3 + [
|
||||
{"target": ab.TURN_TARGET, "message": "stun-0x0003", "tid": A}, {"target": ab.TURN_TARGET, "message": "stun-0x0113", "tid": A}]
|
||||
summary = ab.udp_summary(events, ab.Normalizer({}))
|
||||
assert summary == {"order": ["127.0.0.1:5555", ab.TURN_TARGET], "messages": {"127.0.0.1:5555": ["quic-long"], ab.TURN_TARGET: ["stun-0x0003", "stun-0x0113"]},
|
||||
"counts": {"127.0.0.1:5555": 3, ab.TURN_TARGET: 1}}
|
||||
|
||||
|
||||
def test_the_engines_maximum_is_the_pref_of_the_engine_and_a_transaction_over_it_is_a_problem_while_one_at_it_is_not():
|
||||
assert ab.STUN_MAX_TRANSMITS == 7
|
||||
source = (ROOT / "scripts" / "ci_ab_network.py").read_text(encoding="utf-8")
|
||||
assert "media.peerconnection.ice.stun_client_maximum_transmits" in source and "modules/libpref/init/all.js" in source
|
||||
|
||||
at_most = walk_transcript("a", [A] * 7)
|
||||
assert "over_limit" not in at_most["seeds"]["4"]["webrtc"]["udp"]
|
||||
assert ab.compare_transcripts(at_most, at_most, [], 0, "a", "a")["problems"] == []
|
||||
|
||||
over = walk_transcript("b", [A] * 8)
|
||||
assert over["seeds"]["4"]["webrtc"]["udp"]["over_limit"] == {ab.TURN_TARGET: [8]}
|
||||
report = ab.compare_transcripts(at_most, over, [], 0, "a", "b")
|
||||
assert report["verdict"] == "red" and len(report["problems"]) == 1 and "8 times" in report["problems"][0] and "maximum of 7" in report["problems"][0]
|
||||
assert report["problems"][0].startswith("b: ") and report["differences"] == [], "a problem of the run, not a compared leaf"
|
||||
both = ab.compare_transcripts(over, over, [], 0, "a", "b")
|
||||
assert len(both["problems"]) == 2 and both["differences"] == [], "each side that did it is named"
|
||||
|
||||
|
||||
def test_the_a_a_prints_a_transaction_over_the_maximum_as_a_fail_line_and_counts_it_among_the_problems(capsys):
|
||||
over = walk_transcript("a", [A] * 8)
|
||||
report = ab.compare_transcripts(over, walk_transcript("b", [A] * 7), [], 0, "a", "b")
|
||||
ab.print_report(report, True)
|
||||
out = capsys.readouterr().out
|
||||
assert re.search(r"^FAIL a: a STUN transaction to 198\.51\.100\.7:3478 was sent 8 times, more than the engine's maximum of 7 transmits", out, re.M), out
|
||||
assert "AB NETWORK A/A FAILED: 0 differences, 1 problems" in out and "\nDIFF " not in "\n" + out
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the credential of the probe
|
||||
def test_the_probe_has_no_credential_written_in_it_and_the_walk_passes_the_one_of_the_lab_server():
|
||||
js = ab.RTC_JS
|
||||
assert not re.search(r"""credential\s*:\s*['"]""", js) and not re.search(r"""username\s*:\s*['"]""", js), "no literal credential or user name in the page's script"
|
||||
assert "'lab'" not in js and _turn_chain.PASSWORD not in js
|
||||
assert "async (args) =>" in js and "const [stunUrl, turnUrl, username, credential] = args;" in js
|
||||
assert "{urls: [turnUrl], username, credential}" in js and "{urls: [stunUrl]}" in js, "the STUN entry has no credential, the TURN entry has the arguments"
|
||||
walk = inspect.getsource(ab.walk_webrtc)
|
||||
assert "from _turn_chain import PASSWORD" in walk and "[STUN_URL, TURN_URL, TURN_USERNAME, TURN_PASSWORD]" in walk
|
||||
assert _turn_chain.PASSWORD not in (ROOT / "scripts" / "ci_ab_network.py").read_text(encoding="utf-8"), "the password is written once, in tests/_turn_chain.py"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the TURN server refuses a wrong integrity
|
||||
def attribute(kind, value):
|
||||
return struct.pack("!HH", kind, len(value)) + value + b"\x00" * (-len(value) % 4)
|
||||
|
||||
|
||||
def signed(mtype, tid, user, password, extra=b""):
|
||||
"""A request as a client builds it (RFC 5389 section 15.4), written here and not taken from the server's module: USERNAME, REALM, NONCE, then MESSAGE-INTEGRITY, the
|
||||
HMAC-SHA1 under md5(user:realm:password) over the message with the length of the header counting the attribute itself."""
|
||||
body = attribute(0x0006, user.encode()) + attribute(0x0014, _turn_chain.REALM.encode()) + attribute(0x0015, _turn_chain.NONCE.encode()) + extra
|
||||
head = struct.pack("!HHI", mtype, len(body) + 24, COOKIE) + tid
|
||||
key = hashlib.md5(("%s:%s:%s" % (user, _turn_chain.REALM, password)).encode(), usedforsecurity=False).digest()
|
||||
return head + body + attribute(0x0008, hmac.new(key, head + body, hashlib.sha1).digest())
|
||||
|
||||
|
||||
def unsigned(mtype, tid):
|
||||
return struct.pack("!HHI", mtype, 0, COOKIE) + tid
|
||||
|
||||
|
||||
def ask(server, request):
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
client.settimeout(5)
|
||||
try:
|
||||
client.sendto(request, server.address)
|
||||
answer, _ = client.recvfrom(65536)
|
||||
finally:
|
||||
client.close()
|
||||
return struct.unpack("!H", answer[:2])[0], _turn_chain._attrs(answer)
|
||||
|
||||
|
||||
def error_code(attrs):
|
||||
return attrs[0x0009][2] * 100 + attrs[0x0009][3]
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def turn():
|
||||
server = _turn_chain.TurnServer()
|
||||
try:
|
||||
yield server
|
||||
finally:
|
||||
server.close()
|
||||
|
||||
|
||||
def test_with_the_right_credential_an_allocate_is_answered_401_and_then_with_the_relay_and_nothing_is_refused(turn):
|
||||
kind, attrs = ask(turn, unsigned(0x0003, b"\x01" * 12))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401 and attrs[0x0014] == _turn_chain.REALM.encode() and attrs[0x0015] == _turn_chain.NONCE.encode()
|
||||
kind, attrs = ask(turn, signed(0x0003, b"\x02" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0103 and 0x0016 in attrs and 0x0008 in attrs, "the success carries XOR-RELAYED-ADDRESS and is signed"
|
||||
assert [a[2] for a in turn.allocations] == ["lab"] and turn.refused == []
|
||||
assert len(turn.seen) == 2 and [r[3] for r in turn.requests] == [False, True], "requests and seen keep their meaning"
|
||||
|
||||
|
||||
def test_with_a_wrong_credential_both_allocates_are_answered_401_and_nothing_is_allocated(turn):
|
||||
kind, attrs = ask(turn, unsigned(0x0003, b"\x01" * 12))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401
|
||||
kind, attrs = ask(turn, signed(0x0003, b"\x02" * 12, "lab", "not-the-password"))
|
||||
assert kind == 0x0113 and error_code(attrs) == 401 and 0x0016 not in attrs, "no relay for a client with the wrong password"
|
||||
assert attrs[0x0014] == _turn_chain.REALM.encode() and attrs[0x0015] == _turn_chain.NONCE.encode(), "the 401 asks again, with the realm and the nonce"
|
||||
assert turn.allocations == []
|
||||
assert len(turn.refused) == 1 and turn.refused[0][2:4] == ("lab", b"\x02" * 12), turn.refused
|
||||
assert [r[3] for r in turn.requests] == [False, True], "the request still carried credentials: `requests` says what arrived, `refused` what was turned away"
|
||||
|
||||
|
||||
def test_a_request_with_a_user_name_and_no_integrity_or_a_changed_message_is_refused_too(turn):
|
||||
body = attribute(0x0006, b"lab")
|
||||
kind, _ = ask(turn, struct.pack("!HHI", 0x0003, len(body), COOKIE) + b"\x03" * 12 + body)
|
||||
assert kind == 0x0113 and turn.allocations == [] and len(turn.refused) == 1
|
||||
good = signed(0x0003, b"\x04" * 12, "lab", _turn_chain.PASSWORD)
|
||||
tampered = good[:20] + attribute(0x0006, b"lbb") + good[20 + len(attribute(0x0006, b"lab")):]
|
||||
assert len(tampered) == len(good) and ask(turn, tampered)[0] == 0x0113 and turn.allocations == [] and len(turn.refused) == 2
|
||||
assert ask(turn, good)[0] == 0x0103 and len(turn.allocations) == 1
|
||||
|
||||
|
||||
def test_a_refresh_with_a_wrong_integrity_is_refused_and_one_with_the_right_one_is_answered(turn):
|
||||
kind, attrs = ask(turn, signed(0x0004, b"\x05" * 12, "lab", "wrong"))
|
||||
assert kind == 0x0114 and error_code(attrs) == 401 and len(turn.refused) == 1
|
||||
kind, _ = ask(turn, signed(0x0004, b"\x06" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0104 and len(turn.refused) == 1 and turn.allocations == []
|
||||
|
||||
|
||||
def test_the_integrity_check_is_the_one_of_rfc_5389_with_the_length_adjusted():
|
||||
good = signed(0x0003, b"\x07" * 12, "lab", _turn_chain.PASSWORD)
|
||||
assert _turn_chain.integrity_valid(good, "lab") and not _turn_chain.integrity_valid(good, "other")
|
||||
# an attribute after MESSAGE-INTEGRITY (a FINGERPRINT) does not change what is signed
|
||||
assert _turn_chain.integrity_valid(good + attribute(0x8028, b"\x00" * 4), "lab")
|
||||
assert not _turn_chain.integrity_valid(unsigned(0x0003, b"\x07" * 12), "lab") and not _turn_chain.integrity_valid(good[:-4], "lab")
|
||||
assert _turn_chain.long_term_key("lab") == hashlib.md5(("lab:%s:%s" % (_turn_chain.REALM, _turn_chain.PASSWORD)).encode(), usedforsecurity=False).digest()
|
||||
|
||||
|
||||
def test_the_server_of_the_lab_keeps_the_list_of_refusals_too():
|
||||
_gateway, turn_class, _page = ab.make_lab_classes()
|
||||
server = turn_class("127.0.0.1")
|
||||
try:
|
||||
assert server.refused == [] and isinstance(server, _turn_chain.TurnServer)
|
||||
kind, _ = ask(server, signed(0x0003, b"\x08" * 12, "lab", "wrong"))
|
||||
assert kind == 0x0113 and len(server.refused) == 1 and server.allocations == []
|
||||
kind, _ = ask(server, signed(0x0003, b"\x09" * 12, "lab", _turn_chain.PASSWORD))
|
||||
assert kind == 0x0103 and len(server.allocations) == 1
|
||||
json.dumps(server.exchanges)
|
||||
finally:
|
||||
server.close()
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the A/A proves the TURN path it compares
|
||||
def with_walk(transcript, **fields):
|
||||
"""The same transcript with fields of its seed-4 WebRTC walk replaced."""
|
||||
out = json.loads(json.dumps(transcript))
|
||||
out["seeds"]["4"]["webrtc"].update(fields)
|
||||
return out
|
||||
|
||||
|
||||
def turn_lines(report):
|
||||
"""The problems that say the TURN path did not work (a leaf that differs because of it is reported too, as a difference: that is not what is held here)."""
|
||||
return [p for p in report["problems"] if p.startswith("seeds/4/webrtc: ")]
|
||||
|
||||
|
||||
def test_a_transcript_whose_walk_made_no_relay_candidate_is_a_problem_on_both_sides_of_the_a_a():
|
||||
good = walk_transcript("a", FIRST_RUN)
|
||||
assert ab.compare_transcripts(good, walk_transcript("b", SECOND_RUN), [], 0, "a", "b")["problems"] == []
|
||||
no_relay = with_walk(walk_transcript("b", FIRST_RUN), candidate_types=["host", "srflx"])
|
||||
report = ab.compare_transcripts(good, no_relay, [], 0, "a", "b")
|
||||
assert report["verdict"] == "red" and len(turn_lines(report)) == 1
|
||||
assert report["problems"][0].startswith("seeds/4/webrtc: b made no relay candidate through the lab TURN (no error). Fix: the probe's credential must be the lab TURN's (tests/_turn_chain.py PASSWORD)")
|
||||
assert report["problems"][0].endswith("Rule: the A/A proves the TURN path it compares")
|
||||
both = ab.compare_transcripts(no_relay, with_walk(good, candidate_types=[]), [], 0, "a", "b")
|
||||
assert [p.split(" made")[0] for p in turn_lines(both)] == ["seeds/4/webrtc: a", "seeds/4/webrtc: b"], "each side that has none is named"
|
||||
|
||||
|
||||
def test_a_701_for_the_lab_turn_is_a_problem_even_when_a_relay_candidate_is_there_and_one_for_another_server_is_not(capsys):
|
||||
good = walk_transcript("a", FIRST_RUN)
|
||||
broken = with_walk(good, errors=["701 turn:%s?transport=udp" % ab.TURN_TARGET])
|
||||
report = ab.compare_transcripts(good, broken, [], 0, "a", "b")
|
||||
assert report["verdict"] == "red" and len(turn_lines(report)) == 1 and "701 turn:198.51.100.7:3478" in turn_lines(report)[0] and turn_lines(report)[0].startswith("seeds/4/webrtc: b ")
|
||||
ab.print_report(report, True)
|
||||
out = capsys.readouterr().out
|
||||
assert re.search(r"^FAIL seeds/4/webrtc: b made no relay candidate through the lab TURN \(701 turn:", out, re.M) and "AB NETWORK A/A FAILED:" in out and "2 problems" in out
|
||||
other = with_walk(good, errors=["701 stun:198.51.100.5:19302"])
|
||||
assert turn_lines(ab.compare_transcripts(good, other, [], 0, "a", "b")) == []
|
||||
|
||||
|
||||
def test_a_transcript_with_a_relay_candidate_and_no_error_is_not_a_problem_and_one_with_no_walk_says_nothing():
|
||||
good = walk_transcript("a", FIRST_RUN)
|
||||
assert ab.turn_path_problems(good, "a") == []
|
||||
assert ab.turn_path_problems({"seeds": {"4": {"journey": {}}}}, "a") == []
|
||||
assert ab.turn_path_problems({"seeds": {}}, "a") == []
|
||||
|
||||
|
||||
def test_a_request_the_lab_turn_refused_is_a_problem_and_the_count_is_not_a_compared_leaf():
|
||||
good = with_walk(walk_transcript("a", FIRST_RUN), turn={"messages": ["0x0003"], "allocated": True, "refused": 0})
|
||||
refused = with_walk(good, turn={"messages": ["0x0003"], "allocated": True, "refused": 2})
|
||||
report = ab.compare_transcripts(good, refused, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and len(report["problems"]) == 1 and len(turn_lines(report)) == 1 and "the lab TURN refused 2 request(s)" in report["problems"][0]
|
||||
assert ab.compare_transcripts(good, good, [], 0, "a", "b")["problems"] == []
|
||||
walk = inspect.getsource(ab.walk_webrtc)
|
||||
assert '"refused": len(lab.turn.refused)' in walk, "the walk writes what the lab TURN refused"
|
||||
@@ -0,0 +1,263 @@
|
||||
"""The TURN deallocation is evidence of the network oracle, never a compared leaf (scripts/ci_ab_network.py, tests/_turn_chain.py), no browser.
|
||||
|
||||
The engine ends an allocation with ONE Refresh whose LIFETIME is 0, best effort, while it shuts the TURN client down (nICEr ``nr_turn_client_deallocate``: "we are only sending a single
|
||||
request here because we are in the process of shutting everything down"). It reaches the lab in some walks and not in others for the same engine (the A/A of PR 611: two seeds whose
|
||||
``webrtc/turn/messages`` differed only by ``0x0004``). So it is recognised by what it MEANS (a Refresh, 0x0004, with LIFETIME, 0x000D, equal to 0), by the lab's TURN server, and the walk
|
||||
leaves it out of the messages and of the transactions the gateway counted for the TURN address; it goes to the evidence. More than one for one allocation, or one for an address that has
|
||||
no allocation, is a problem of the run. A Refresh that keeps the allocation alive (a lifetime above 0) is a message of the walk like any other.
|
||||
|
||||
The walks below are the real ``walk_webrtc`` on a real lab: a fake browser whose page sends the datagrams a TURN client sends to the lab's TURN server, over a socket on loopback, and
|
||||
whose gateway events are written as the gateway writes them.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import socket
|
||||
import struct
|
||||
import sys
|
||||
import time
|
||||
import types
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _turn_chain # noqa: E402
|
||||
import ci_ab_network as ab # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ALLOCATE, REFRESH_A, REFRESH_B, REFRESH_C = (bytes([n]) * 12 for n in (1, 2, 3, 4))
|
||||
RELAY_CANDIDATE = "candidate:1 1 udp 100 192.0.2.1 5000 typ relay"
|
||||
RULE = "Rule: the TURN deallocation is one best-effort send at teardown (nICEr nr_turn_client_deallocate)"
|
||||
|
||||
|
||||
def signed_refresh(tid, lifetime, user=b"lab"):
|
||||
"""A Refresh as a TURN client sends it after the 401: USERNAME and LIFETIME, signed with the long-term key."""
|
||||
body = _turn_chain._attr(0x0006, user) + _turn_chain._attr(0x000D, struct.pack("!I", lifetime))
|
||||
return _turn_chain._message(0x0004, tid, body, _turn_chain.long_term_key(user.decode()))
|
||||
|
||||
|
||||
def signed_allocate(tid, user=b"lab"):
|
||||
return _turn_chain._message(0x0003, tid, _turn_chain._attr(0x0006, user), _turn_chain.long_term_key(user.decode()))
|
||||
|
||||
|
||||
def wait_for(condition, what):
|
||||
for _ in range(200):
|
||||
if condition():
|
||||
return
|
||||
time.sleep(0.025)
|
||||
raise AssertionError("never happened: " + what)
|
||||
|
||||
|
||||
class Client:
|
||||
"""A TURN client's socket (one 5-tuple) that talks to the lab's TURN server and tells the recorder what the gateway would have written."""
|
||||
|
||||
def __init__(self, lab):
|
||||
self.lab = lab
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
self.sock.settimeout(5)
|
||||
self.sock.bind(("127.0.0.1", 0))
|
||||
|
||||
def send(self, datagram, message):
|
||||
before = len(self.lab.turn.requests)
|
||||
self.lab.gateway._route(_turn_chain.TURN_IP, _turn_chain.TURN_PORT, 1, datagram, 1, None) # the gateway writes the event, as it does for a browser's datagram
|
||||
self.sock.sendto(datagram, self.lab.turn.address)
|
||||
wait_for(lambda: len(self.lab.turn.requests) > before, "the lab TURN heard the datagram")
|
||||
self.sock.recvfrom(2048) # every request here is answered
|
||||
return self
|
||||
|
||||
def close(self):
|
||||
self.sock.close()
|
||||
|
||||
|
||||
def walk(label, script, times=None):
|
||||
"""The WebRTC walk of seed 4 on a lab, as ``run`` makes it, whose page does ``script(lab, clients)`` (the datagrams during the page, and at the close of the context, as the engine
|
||||
ends its allocations when the page closes), and the transcript of that seed."""
|
||||
clients = []
|
||||
|
||||
class Page:
|
||||
def goto(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def evaluate(self, js, arg):
|
||||
script(lab, clients, "page")
|
||||
result = {"candidates": [RELAY_CANDIDATE], "errors": [], "sdp": "v=0", "gathering": "complete"}
|
||||
return result if times is None else dict(result, times=times)
|
||||
|
||||
class Browser:
|
||||
def new_context(self, **kwargs):
|
||||
return types.SimpleNamespace(new_page=lambda: Page(), close=lambda: script(lab, clients, "close"))
|
||||
|
||||
try:
|
||||
with ab.Lab(host="127.0.0.1") as lab:
|
||||
out = ab.walk_webrtc(Browser(), lab)
|
||||
evidence = ab.webrtc_evidence(lab)
|
||||
finally:
|
||||
for client in clients:
|
||||
client.close()
|
||||
transcript = {"format": ab.FORMAT, "label": label, "platform": "linux", "seeds": {"4": {"webrtc": out}}}
|
||||
return transcript, evidence
|
||||
|
||||
|
||||
def allocation_then(*closing):
|
||||
"""A script: the allocation during the page, and ``closing`` (pairs of tid and lifetime sent from the allocation's own socket) when the context closes."""
|
||||
def script(lab, clients, stage):
|
||||
if stage == "page":
|
||||
clients.append(Client(lab).send(_turn_chain._message(0x0003, ALLOCATE, b""), "stun-0x0003"))
|
||||
clients[0].send(signed_allocate(ALLOCATE), "stun-0x0003")
|
||||
else:
|
||||
for tid, lifetime in closing:
|
||||
clients[0].send(signed_refresh(tid, lifetime), "stun-0x0004")
|
||||
return script
|
||||
|
||||
|
||||
def test_a_deallocation_seen_on_one_side_and_not_on_the_other_is_no_difference_of_the_walk():
|
||||
with_it, evidence_with = walk("a", allocation_then((REFRESH_A, 0)))
|
||||
without_it, evidence_without = walk("b", allocation_then())
|
||||
for transcript in (with_it, without_it):
|
||||
turn = transcript["seeds"]["4"]["webrtc"]["turn"]
|
||||
assert turn["messages"] == ["0x0003"], "the deallocation is not a message of the walk"
|
||||
assert transcript["seeds"]["4"]["webrtc"]["udp"]["counts"] == {ab.TURN_TARGET: 1}, "nor a transaction of the TURN address (the Allocate was one: its 401 and its retry share the id)"
|
||||
assert transcript["seeds"]["4"]["webrtc"]["udp"]["messages"] == {ab.TURN_TARGET: ["stun-0x0003"]}
|
||||
report = ab.compare_transcripts(with_it, without_it, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["problems"] == [] and report["verdict"] == "green", report["problems"]
|
||||
assert evidence_with["deallocation"]["seen"] is True and evidence_without["deallocation"] == {"seen": False, "records": []}
|
||||
|
||||
|
||||
def test_a_refresh_with_a_lifetime_above_zero_stays_in_the_messages_and_in_the_count():
|
||||
kept, evidence = walk("a", allocation_then((REFRESH_A, 600)))
|
||||
walk_of = kept["seeds"]["4"]["webrtc"]
|
||||
assert walk_of["turn"]["messages"] == ["0x0003", "0x0004"] and walk_of["udp"]["counts"] == {ab.TURN_TARGET: 2}
|
||||
assert walk_of["udp"]["messages"] == {ab.TURN_TARGET: ["stun-0x0003", "stun-0x0004"]}
|
||||
assert evidence["deallocation"] == {"seen": False, "records": []}
|
||||
assert walk_of["turn"]["deallocation"] == {"repeated": 0, "unallocated": 0, "early": 0}
|
||||
gone, _ = walk("b", allocation_then())
|
||||
differing = [d["path"] for d in ab.compare_transcripts(kept, gone, [], 0, "a", "b")["differences"]]
|
||||
assert "seeds/4/webrtc/turn/messages/1" in differing and "seeds/4/webrtc/udp/counts/%s" % ab.TURN_TARGET in differing, "a keep-alive IS the engine's doing, and is compared"
|
||||
|
||||
|
||||
def test_the_deallocation_goes_to_the_evidence_with_its_time_and_its_transaction_id():
|
||||
transcript, evidence = walk("a", allocation_then((REFRESH_A, 0)))
|
||||
json.dumps(evidence)
|
||||
(record,) = evidence["deallocation"]["records"]
|
||||
assert evidence["deallocation"]["seen"] is True
|
||||
assert record["tid"] == REFRESH_A.hex() and record["allocation"] == 0 and record["src"].startswith("127.0.0.1:")
|
||||
assert isinstance(record["t"], float) and record["t"] >= evidence["phase_t"]["webrtc"], "the time is the recorder's, the one of the other evidence"
|
||||
assert [d["tid"] for d in evidence["datagrams"]].count(REFRESH_A.hex()) == 1, "the datagram itself is still in the evidence, as every datagram is"
|
||||
assert transcript["seeds"]["4"]["webrtc"]["turn"]["deallocation"] == {"repeated": 0, "unallocated": 0, "early": 0}
|
||||
|
||||
|
||||
def test_two_deallocations_of_one_allocation_are_a_problem_and_no_leaf(capsys):
|
||||
twice, _ = walk("b", allocation_then((REFRESH_A, 0), (REFRESH_B, 0)))
|
||||
once, _ = walk("a", allocation_then((REFRESH_A, 0)))
|
||||
assert twice["seeds"]["4"]["webrtc"]["turn"]["deallocation"] == {"repeated": 1, "unallocated": 0, "early": 0}
|
||||
assert twice["seeds"]["4"]["webrtc"]["turn"]["messages"] == ["0x0003"]
|
||||
report = ab.compare_transcripts(once, twice, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["verdict"] == "red" and len(report["problems"]) == 1
|
||||
(line,) = report["problems"]
|
||||
assert line.startswith("seeds/4/webrtc: b: 1 allocation(s) of the lab TURN were ended by more than one deallocation") and ". Fix: " in line and line.endswith(RULE)
|
||||
ab.print_report(report, True)
|
||||
assert "FAIL " + line in capsys.readouterr().out
|
||||
assert ab.compare_transcripts(once, once, [], 0, "a", "a")["problems"] == []
|
||||
|
||||
|
||||
def test_a_deallocation_for_an_address_that_has_no_allocation_is_a_problem():
|
||||
def script(lab, clients, stage):
|
||||
if stage == "page":
|
||||
clients.append(Client(lab).send(signed_allocate(ALLOCATE), "stun-0x0003"))
|
||||
else:
|
||||
clients.append(Client(lab).send(signed_refresh(REFRESH_C, 0), "stun-0x0004")) # another socket: another address, which was never allocated
|
||||
|
||||
orphan, evidence = walk("b", script)
|
||||
assert orphan["seeds"]["4"]["webrtc"]["turn"]["deallocation"] == {"repeated": 0, "unallocated": 1, "early": 0}
|
||||
assert evidence["deallocation"]["records"][0]["allocation"] is None
|
||||
report = ab.compare_transcripts(orphan, orphan, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and len(report["problems"]) == 2, "each side that did it is named"
|
||||
assert all("from an address that has no allocation. Fix: " in p and p.endswith(RULE) for p in report["problems"])
|
||||
assert [p.split(": ")[1] for p in report["problems"]] == ["a", "b"]
|
||||
|
||||
|
||||
def serve_one(request_after_allocation):
|
||||
"""A TurnServer on loopback that heard an allocation and then ``request_after_allocation`` from the same socket; what it recorded."""
|
||||
server = _turn_chain.TurnServer()
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
client.settimeout(5)
|
||||
try:
|
||||
client.sendto(signed_allocate(ALLOCATE), server.address)
|
||||
assert struct.unpack("!H", client.recvfrom(2048)[0][:2])[0] == 0x0103
|
||||
client.sendto(request_after_allocation, server.address)
|
||||
answer, _ = client.recvfrom(2048)
|
||||
port = client.getsockname()[1]
|
||||
finally:
|
||||
client.close()
|
||||
server.close()
|
||||
return server, answer, port
|
||||
|
||||
|
||||
def test_the_turn_server_records_a_signed_refresh_with_lifetime_zero_as_a_deallocation_and_answers_it_as_it_always_did():
|
||||
server, answer, port = serve_one(signed_refresh(REFRESH_A, 0))
|
||||
assert struct.unpack("!H", answer[:2])[0] == 0x0104, "the answer to a Refresh is what it was"
|
||||
assert server.deallocations == [("127.0.0.1", port, REFRESH_A, server.deallocations[0][3], 0)]
|
||||
assert server.deallocation_tids() == {REFRESH_A} and [r[2] for r in server.deallocation_transactions()] == [REFRESH_A]
|
||||
assert len(server.allocations) == 1 and server.refused == []
|
||||
|
||||
|
||||
def test_the_turn_server_does_not_record_a_refresh_with_lifetime_600_or_any_other_message_as_a_deallocation():
|
||||
server, answer, _ = serve_one(signed_refresh(REFRESH_A, 600))
|
||||
assert struct.unpack("!H", answer[:2])[0] == 0x0104 and server.deallocations == [] and server.deallocation_tids() == set()
|
||||
server, _, _ = serve_one(_turn_chain._message(0x0008, REFRESH_B, _turn_chain._attr(0x0006, b"lab") + _turn_chain._attr(0x000D, struct.pack("!I", 0)),
|
||||
_turn_chain.long_term_key("lab")))
|
||||
assert server.deallocations == [], "a lifetime of 0 in another message type (CreatePermission) is not a deallocation: the type counts too"
|
||||
server, _, _ = serve_one(signed_refresh(REFRESH_C, 0)[:20] + _turn_chain._attr(0x0006, b"lab"))
|
||||
assert server.deallocations == [], "a Refresh with no LIFETIME is not one"
|
||||
|
||||
|
||||
def test_the_gateway_marks_a_deallocation_from_its_payload_and_the_mark_alone_takes_it_out_of_the_count():
|
||||
"""The datagram can be at the gateway before the lab's TURN server has recorded it: the count does not wait for the server."""
|
||||
def script(lab, clients, stage):
|
||||
if stage == "page":
|
||||
clients.append(Client(lab).send(signed_allocate(ALLOCATE), "stun-0x0003"))
|
||||
else:
|
||||
for tid, lifetime in ((REFRESH_A, 600), (REFRESH_B, 0)):
|
||||
lab.gateway._route(_turn_chain.TURN_IP, _turn_chain.TURN_PORT, 1, signed_refresh(tid, lifetime), 1, None) # never sent to the server
|
||||
|
||||
transcript, _ = walk("a", script)
|
||||
walk_of = transcript["seeds"]["4"]["webrtc"]
|
||||
assert walk_of["udp"]["counts"] == {ab.TURN_TARGET: 2} and walk_of["udp"]["messages"] == {ab.TURN_TARGET: ["stun-0x0003", "stun-0x0004"]}, "the 600 stays, the 0 goes, by the mark"
|
||||
with ab.Lab(host="127.0.0.1") as lab:
|
||||
lab.rec.set_phase("webrtc")
|
||||
for tid, lifetime in ((REFRESH_A, 600), (REFRESH_B, 0)):
|
||||
lab.gateway._route(_turn_chain.TURN_IP, _turn_chain.TURN_PORT, 1, signed_refresh(tid, lifetime), 1, None)
|
||||
lab.gateway._route("127.0.0.1", 5555, 1, signed_refresh(REFRESH_C, 0), 1, None)
|
||||
events = lab.rec.of("webrtc", "udp")
|
||||
assert [e["deallocation"] for e in events] == [False, True, True], "marked by meaning, whoever the datagram is for (the walk counts only the TURN address's)"
|
||||
|
||||
|
||||
def test_a_deallocation_before_the_page_began_closing_is_evidence_and_never_a_problem():
|
||||
"""The page's own times on the recorder's clock (the call of the page plus (closing - start) of its performance.now()) give ``early``. It stays in the facts as evidence, and is no problem:
|
||||
the page's clock is the engine's reduced-precision timer, and on Windows the published engine against itself came out "early" (wrapper #612's round), so it cannot order the two events."""
|
||||
def at_page(lab, clients, stage):
|
||||
if stage == "page":
|
||||
clients.append(Client(lab).send(signed_allocate(ALLOCATE), "stun-0x0003"))
|
||||
clients[0].send(signed_refresh(REFRESH_A, 0), "stun-0x0004") # the deallocation comes, by the page's clock, while the page is still open
|
||||
before, _ = walk("b", at_page, times={"start": 100.0, "closing": 100.0 + 600000.0}) # the page closes ten minutes after the call
|
||||
assert before["seeds"]["4"]["webrtc"]["turn"]["deallocation"] == {"repeated": 0, "unallocated": 0, "early": 1}
|
||||
report = ab.compare_transcripts(before, before, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["problems"] == []
|
||||
|
||||
after, _ = walk("b", allocation_then((REFRESH_A, 0)), times={"start": 100.0, "closing": 100.0})
|
||||
assert after["seeds"]["4"]["webrtc"]["turn"]["deallocation"] == {"repeated": 0, "unallocated": 0, "early": 0}
|
||||
assert ab.compare_transcripts(after, after, [], 0, "a", "b")["problems"] == []
|
||||
assert ab.closing_began(5.0, {"start": 250.0, "closing": 1750.0}) == 6.5 and ab.closing_began(5.0, None) is None and ab.closing_began(5.0, {"start": 1.0}) is None
|
||||
|
||||
|
||||
def test_the_recorded_windows_case_of_the_published_engine_against_itself_is_no_problem():
|
||||
"""Wrapper #612's round, e2e (network, windows): seeds 63 (firefox-68) and 6 (firefox-68-again) each had one deallocation "before the page began closing" by the page's clock."""
|
||||
def side(seed):
|
||||
return {"seeds": {seed: {"webrtc": {"turn": {"deallocation": {"repeated": 0, "unallocated": 0, "early": 1}}}}}}
|
||||
assert ab.turn_deallocation_problems(side("63"), "firefox-68") == []
|
||||
assert ab.turn_deallocation_problems(side("6"), "firefox-68-again") == []
|
||||
still = {"seeds": {"6": {"webrtc": {"turn": {"deallocation": {"repeated": 1, "unallocated": 1, "early": 1}}}}}}
|
||||
assert len(ab.turn_deallocation_problems(still, "firefox-68")) == 2
|
||||
@@ -0,0 +1,594 @@
|
||||
"""The WebRTC walk of the network oracle keeps its evidence OUTSIDE the leaves that are compared, and the hunt repeats that walk alone (scripts/ci_ab_network.py), no browser.
|
||||
|
||||
The A/A of the oracle found the published engine sending 8 or 9 TURN Allocate datagrams to 198.51.100.7:3478 in the WebRTC walk of one seed. The two readings are told apart by
|
||||
what each datagram carried and when: a STUN transaction id repeats on a retransmission, and the page's own ICE times and the moments of the stages say where the close fell. This file holds
|
||||
that evidence to its rules: it is in ``transcript["evidence"]`` (which ``compare_transcripts`` never reads), what the page returns for the compared fields is what it returned before, the
|
||||
transaction id comes from the header of the datagram, the gateway's summary is the one it was, and the hunt (``AB_NETWORK_HUNT=webrtc:<seed>:<n>``, wired into e2e-hunt.yml) writes one file
|
||||
per repetition and a summary and decides nothing.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import types
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_ab_network as ab # noqa: E402
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import _turn_chain # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
HUNT_WORKFLOW = ROOT / ".github" / "workflows" / "e2e-hunt.yml"
|
||||
|
||||
COOKIE = b"\x21\x12\xa4\x42"
|
||||
TID = bytes(range(1, 13))
|
||||
|
||||
|
||||
def stun(message_type: int, tid: bytes = TID) -> bytes:
|
||||
"""A STUN header (RFC 8489): type, length 0, the magic cookie and a 12-byte transaction id."""
|
||||
return message_type.to_bytes(2, "big") + b"\x00\x00" + COOKIE + tid
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the transaction id
|
||||
def test_the_transaction_id_is_bytes_8_to_20_of_a_stun_header():
|
||||
allocate = stun(0x0003)
|
||||
assert len(allocate) == 20
|
||||
assert ab.stun_tid(allocate) == TID.hex() == "0102030405060708090a0b0c"
|
||||
assert ab.stun_tid(allocate + b"\x00\x06\x00\x04lab\x00") == TID.hex(), "the attributes after the header change nothing"
|
||||
assert ab.stun_tid(stun(0x0113, b"\xff" * 12)) == "ff" * 12
|
||||
|
||||
|
||||
@pytest.mark.parametrize("payload", [b"", b"\xc3" + b"\x00" * 40, b"\x40" + b"\x01" * 30, b"\x00\x03\x00\x00" + b"\x00" * 16, stun(0x0003)[:19], b"hello world" * 3])
|
||||
def test_a_datagram_that_is_not_stun_has_no_transaction_id(payload):
|
||||
assert ab.stun_tid(payload) is None
|
||||
|
||||
|
||||
def test_the_gateway_writes_the_transaction_id_of_each_datagram_and_the_summary_of_the_phase_does_not_change():
|
||||
from _doh_servers import FakeDoh
|
||||
from _turn_chain import TURN_IP, TURN_PORT
|
||||
|
||||
assert "%s:%d" % (TURN_IP, TURN_PORT) == ab.TURN_TARGET, "the target the hunt counts is the TURN server of the lab"
|
||||
gateway_class, turn_class, _page = ab.make_lab_classes()
|
||||
rec = ab.Recorder()
|
||||
doh = FakeDoh({})
|
||||
turn = turn_class("127.0.0.1")
|
||||
gateway = gateway_class(rec, doh, turn, "127.0.0.1", "198.51.100.9")
|
||||
try:
|
||||
rec.set_phase("webrtc")
|
||||
gateway._route(TURN_IP, TURN_PORT, 1, stun(0x0003), 1, None)
|
||||
gateway._route(TURN_IP, TURN_PORT, 1, stun(0x0003), 1, None)
|
||||
gateway._route(TURN_IP, TURN_PORT, 1, stun(0x0003, b"\x09" * 12), 1, None)
|
||||
gateway._route("127.0.0.1", 5555, 1, b"\xc3" + b"\x00" * 20, 1, None)
|
||||
finally:
|
||||
gateway.close()
|
||||
turn.close()
|
||||
doh.close()
|
||||
events = rec.of("webrtc", "udp")
|
||||
assert [(e["target"], e["message"], e["tid"]) for e in events] == [
|
||||
(ab.TURN_TARGET, "stun-0x0003", TID.hex()), (ab.TURN_TARGET, "stun-0x0003", TID.hex()), (ab.TURN_TARGET, "stun-0x0003", "09" * 12), ("127.0.0.1:5555", "quic-long", None)]
|
||||
norm = ab.Normalizer({})
|
||||
# the count is of TRANSACTIONS: the first Allocate was sent twice (one transaction), the second once, and the QUIC datagram has no transaction id (one)
|
||||
assert ab.udp_summary(events, norm)["counts"] == {ab.TURN_TARGET: 2, "127.0.0.1:5555": 1}
|
||||
without = [{k: v for k, v in e.items() if k != "tid"} for e in events]
|
||||
assert ab.udp_summary(without, norm)["counts"] == {ab.TURN_TARGET: 3, "127.0.0.1:5555": 1}, "with no transaction id every datagram counts one"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the evidence key
|
||||
def lab_with(rec, **webrtc):
|
||||
return types.SimpleNamespace(rec=rec, webrtc=webrtc)
|
||||
|
||||
|
||||
def recorded_walk():
|
||||
"""A recorder that went through the stages of the walk, with the datagrams a TURN server's client sends: the first Allocate three times, the authenticated one twice, one late."""
|
||||
rec = ab.Recorder()
|
||||
rec.set_phase("webrtc")
|
||||
for target, message, tid in [(ab.TURN_TARGET, "stun-0x0003", "aa" * 12), (ab.TURN_TARGET, "stun-0x0003", "aa" * 12), ("198.51.100.5:19302", "stun-0x0001", "bb" * 12),
|
||||
(ab.TURN_TARGET, "stun-0x0003", "cc" * 12), ("127.0.0.1:5555", "quic-long", None)]:
|
||||
rec.event("udp", target=target, message=message, tid=tid, opener=None)
|
||||
counted = len(rec.of("webrtc", "udp"))
|
||||
rec.set_phase("webrtc.end")
|
||||
rec.event("udp", target=ab.TURN_TARGET, message="stun-0x0003", tid="cc" * 12, opener=None)
|
||||
return rec, counted
|
||||
|
||||
|
||||
def test_the_evidence_of_the_walk_lists_every_datagram_with_its_time_target_message_and_transaction_and_the_moments_of_the_stages():
|
||||
rec, counted = recorded_walk()
|
||||
page = {"start": 1.0, "offer": 2.0, "candidates": [{"t": 3.0, "type": "host"}], "errors": [{"t": 4.0, "code": 701, "url": "turn:x"}], "gathered": 5.0, "closing": 6.0, "closed": 6.5}
|
||||
evidence = ab.webrtc_evidence(lab_with(rec, counted=counted, evaluate={"called": 0.5, "returned": 7.0}, page=page))
|
||||
json.dumps(evidence)
|
||||
assert set(evidence) == {"phase_t", "evaluate", "page", "datagrams", "turn", "returned", "send_errors", "deallocation"}
|
||||
assert evidence["page"] == page and evidence["evaluate"] == {"called": 0.5, "returned": 7.0}
|
||||
assert set(evidence["phase_t"]) == {"webrtc", "webrtc.end"} and evidence["phase_t"]["webrtc"] <= evidence["phase_t"]["webrtc.end"]
|
||||
datagrams = evidence["datagrams"]
|
||||
assert [(d["target"], d["message"], d["tid"], d["phase"], d["counted"]) for d in datagrams] == [
|
||||
(ab.TURN_TARGET, "stun-0x0003", "aa" * 12, "webrtc", True), (ab.TURN_TARGET, "stun-0x0003", "aa" * 12, "webrtc", True), ("198.51.100.5:19302", "stun-0x0001", "bb" * 12, "webrtc", True),
|
||||
(ab.TURN_TARGET, "stun-0x0003", "cc" * 12, "webrtc", True), ("127.0.0.1:5555", "quic-long", None, "webrtc", True),
|
||||
(ab.TURN_TARGET, "stun-0x0003", "cc" * 12, "webrtc.end", False)]
|
||||
assert all(isinstance(d["t"], float) for d in datagrams) and [d["t"] for d in datagrams] == sorted(d["t"] for d in datagrams)
|
||||
|
||||
|
||||
def test_the_evidence_of_the_walk_leaves_out_the_datagrams_of_other_stages_and_says_nothing_when_the_walk_never_ran():
|
||||
rec = ab.Recorder()
|
||||
rec.set_phase("h3")
|
||||
rec.event("udp", target="127.0.0.1:1", message="quic-long", tid=None, opener=None)
|
||||
empty = ab.webrtc_evidence(lab_with(rec))
|
||||
assert empty == {"phase_t": {"webrtc": None, "webrtc.end": None}, "evaluate": None, "page": None, "datagrams": [], "turn": [], "returned": [], "send_errors": [], "deallocation": {"seen": False, "records": []}}
|
||||
|
||||
|
||||
def evidence_transcript(label, datagrams):
|
||||
"""A transcript as ``run`` writes it: ``seeds`` (compared) and ``evidence`` (not), with the webrtc evidence of a real recorder in it."""
|
||||
rec = ab.Recorder()
|
||||
rec.set_phase("webrtc")
|
||||
for tid in datagrams:
|
||||
rec.event("udp", target=ab.TURN_TARGET, message="stun-0x0003", tid=tid, opener=None)
|
||||
rec.set_phase("webrtc.end")
|
||||
evidence = ab.webrtc_evidence(lab_with(rec, counted=len(datagrams), page={"gathered": float(len(datagrams))}))
|
||||
return {"format": ab.FORMAT, "label": label, "platform": "linux",
|
||||
"seeds": {"4": {"webrtc": {"candidates": ["udp comp1 prio1 srflx <exit>"], "candidate_types": ["relay", "srflx"], "gathering": "complete", "udp": {"counts": {ab.TURN_TARGET: 8}}}}},
|
||||
"evidence": {"format": ab.EVIDENCE_FORMAT, "seeds": {"4": {"journey": [], "https": {}, "h3": [], "webrtc": evidence}}}}
|
||||
|
||||
|
||||
def test_two_transcripts_that_differ_only_in_the_evidence_of_the_walk_have_no_difference():
|
||||
a = evidence_transcript("a", ["aa" * 12] * 8)
|
||||
b = evidence_transcript("b", ["aa" * 12] * 7 + ["bb" * 12, "cc" * 12])
|
||||
assert a["evidence"] != b["evidence"] and a["seeds"] == b["seeds"]
|
||||
report = ab.compare_transcripts(a, b, [], 0, "a", "b")
|
||||
assert report["differences"] == [] and report["problems"] == [] and report["verdict"] == "green"
|
||||
assert report["leaves"] == ab.compare_transcripts(a, a, [], 0, "a", "a")["leaves"]
|
||||
assert ab.flatten(a["seeds"]).keys().isdisjoint({p for p in ab.flatten(a["evidence"]["seeds"], "evidence")}), "no leaf of the evidence is a leaf of the seeds"
|
||||
# and the same difference in the compared part IS one: the control of the test above
|
||||
c = json.loads(json.dumps(a))
|
||||
c["seeds"]["4"]["webrtc"]["udp"]["counts"][ab.TURN_TARGET] = 9
|
||||
assert [d["path"] for d in ab.compare_transcripts(a, c, [], 0, "a", "c")["differences"]] == ["seeds/4/webrtc/udp/counts/198.51.100.7:3478"]
|
||||
|
||||
|
||||
def test_a_run_writes_the_evidence_of_the_walk_under_the_evidence_of_its_seed(tmp_path, monkeypatch):
|
||||
import _lab_egress
|
||||
import ci_crash_evidence as crash
|
||||
|
||||
def walk_seed(binary, seed, with_idle, patch):
|
||||
ab.EVIDENCE[str(seed)] = evidence_transcript("x", ["aa" * 12] * 2)["evidence"]["seeds"]["4"]
|
||||
return {"webrtc": {}}
|
||||
|
||||
monkeypatch.setattr(ab, "walk_seed", walk_seed)
|
||||
monkeypatch.setattr(_lab_egress, "install", lambda patch, work: None)
|
||||
monkeypatch.setenv(crash.CRASH_DIR_ENV, str(tmp_path / "t.crash"))
|
||||
try:
|
||||
assert ab.run("/e/firefox", "firefox-68", (4,), tmp_path / "t.json") == 0
|
||||
finally:
|
||||
crash.stop_probe()
|
||||
document = json.loads((tmp_path / "t.json").read_text(encoding="utf-8"))
|
||||
assert [d["tid"] for d in document["evidence"]["seeds"]["4"]["webrtc"]["datagrams"]] == ["aa" * 12] * 2
|
||||
assert set(document) >= {"seeds", "evidence", "exits"} and "webrtc" not in document["evidence"], "the evidence is under the seed, not beside the seeds"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the page's probe
|
||||
def test_the_probe_returns_what_it_returned_and_its_times_beside_it():
|
||||
js = ab.RTC_JS
|
||||
assert "return {candidates: cands, errors, sdp, gathering, times: T};" in js, "the four fields that are compared come first and unchanged; `times` is the only addition"
|
||||
assert "cands.push(e.candidate.candidate)" in js and "errors.push({code: e.errorCode, url: e.url})" in js
|
||||
for what in ("T.offer = performance.now()", "T.gathered = performance.now()", "T.closing = performance.now()", "T.closed = performance.now()"):
|
||||
assert what in js, what
|
||||
assert re.search(r"T\.candidates\.push\(\{t: performance\.now\(\), type: ", js), "each icecandidate, with its type"
|
||||
assert re.search(r"T\.errors\.push\(\{t: performance\.now\(\), code: e\.errorCode, url: e\.url\}\)", js), "each icecandidateerror, with its code and url"
|
||||
assert js.index("T.closing = performance.now()") < js.index("pc.close()") < js.index("T.closed = performance.now()"), "the close is bracketed by its two times"
|
||||
|
||||
|
||||
def test_what_the_page_measures_of_itself_is_in_the_evidence_and_the_summary_of_the_walk_is_the_same_with_any_times():
|
||||
class Page:
|
||||
def __init__(self, result):
|
||||
self.result = result
|
||||
|
||||
def goto(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def evaluate(self, js, arg):
|
||||
assert js == ab.RTC_JS and arg == [ab.STUN_URL, ab.TURN_URL, ab.TURN_USERNAME, _turn_chain.PASSWORD]
|
||||
return json.loads(json.dumps(self.result))
|
||||
|
||||
class Browser:
|
||||
def __init__(self, result):
|
||||
self.page = Page(result)
|
||||
|
||||
def new_context(self, **kwargs):
|
||||
return types.SimpleNamespace(new_page=lambda: self.page, close=lambda: None)
|
||||
|
||||
base = {"candidates": ["candidate:1 1 udp 100 192.0.2.1 5000 typ host"], "errors": [{"code": 701, "url": "turn:198.51.100.7:3478"}], "sdp": "v=0\r\n", "gathering": "complete"}
|
||||
outs, labs = [], []
|
||||
for times in ({"start": 1.0, "gathered": 2.0}, {"start": 5.5, "gathered": 9.25, "closed": 11.0}, None):
|
||||
result = dict(base) if times is None else dict(base, times=times)
|
||||
with ab.Lab(host="127.0.0.1") as lab:
|
||||
outs.append(json.dumps(ab.walk_webrtc(Browser(result), lab), sort_keys=True))
|
||||
labs.append(lab.webrtc)
|
||||
assert outs[0] == outs[1] == outs[2], "the walk's summary does not depend on the page's times"
|
||||
assert '"times"' not in outs[0] and "gathered" not in outs[0]
|
||||
assert [x["page"] for x in labs] == [{"start": 1.0, "gathered": 2.0}, {"start": 5.5, "gathered": 9.25, "closed": 11.0}, None]
|
||||
assert all(x["evaluate"]["called"] <= x["evaluate"]["returned"] for x in labs) and all(isinstance(x["counted"], int) for x in labs)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the TURN server's answers and the relay's return path
|
||||
def signed_allocate(tid, user=b"lab"):
|
||||
"""An Allocate with USERNAME and the MESSAGE-INTEGRITY of the long-term key (the server of the lab checks it)."""
|
||||
from _turn_chain import _attr, _message, long_term_key
|
||||
|
||||
return _message(0x0003, tid, _attr(0x0006, user), long_term_key(user.decode()))
|
||||
|
||||
|
||||
def test_the_turn_server_of_the_lab_writes_every_request_with_what_it_carried_and_every_answer_with_where_it_went_and_answers_as_it_always_did():
|
||||
import socket
|
||||
|
||||
from _turn_chain import RELAYED, TurnServer
|
||||
|
||||
_gateway, turn_class, _page = ab.make_lab_classes()
|
||||
turn = turn_class("127.0.0.1")
|
||||
assert isinstance(turn, TurnServer) and isinstance(turn.sock, ab.ExchangeSocket)
|
||||
ticks = iter(x / 10 for x in range(1, 100))
|
||||
turn.clock = lambda: next(ticks)
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
client.settimeout(5)
|
||||
client.bind(("127.0.0.1", 0))
|
||||
first, second = b"\x01" * 12, b"\x02" * 12
|
||||
try:
|
||||
client.sendto(stun(0x0003, first), turn.address)
|
||||
unauthorized, _ = client.recvfrom(2048)
|
||||
client.sendto(signed_allocate(second), turn.address)
|
||||
success, _ = client.recvfrom(2048)
|
||||
client.sendto(b"not stun at all, twenty-odd bytes", turn.address)
|
||||
client.sendto(stun(0x0001, b"\x03" * 12), turn.address) # a Binding request: the server of the lab does not answer it
|
||||
port = client.getsockname()[1]
|
||||
for _ in range(100):
|
||||
if len(turn.exchanges) == 3:
|
||||
break
|
||||
time.sleep(0.05)
|
||||
finally:
|
||||
client.close()
|
||||
turn.close()
|
||||
assert int.from_bytes(unauthorized[:2], "big") == 0x0113 and int.from_bytes(success[:2], "big") == 0x0103, "what the server answers is what it answered"
|
||||
assert len(turn.seen) == 3 and [a[2] for a in turn.allocations] == ["lab"] and turn.allocations[0][:2] == ("127.0.0.1", port)
|
||||
one, two, three = turn.exchanges
|
||||
json.dumps(turn.exchanges)
|
||||
assert (one["t"], one["src"], one["tid"], one["type"], one["username"], one["integrity"]) == (0.1, "127.0.0.1:%d" % port, first.hex(), "0x0003", False, False)
|
||||
assert one["responses"] == [{"t": 0.2, "tid": first.hex(), "type": "0x0113", "to": "127.0.0.1:%d" % port, "relayed": None, "mapped": None, "error": 401}]
|
||||
assert (two["tid"], two["type"], two["username"], two["integrity"]) == (second.hex(), "0x0003", True, True)
|
||||
(answer,) = two["responses"]
|
||||
assert answer["type"] == "0x0103" and answer["to"] == "127.0.0.1:%d" % port and answer["error"] is None
|
||||
assert answer["relayed"] == "%s:%d" % RELAYED and answer["mapped"] == "127.0.0.1:%d" % port, "the XOR-RELAYED-ADDRESS and XOR-MAPPED-ADDRESS the server put in, decoded"
|
||||
assert (three["type"], three["responses"]) == ("0x0001", []), "a request the server does not answer has no answer in its record"
|
||||
|
||||
|
||||
def test_a_failure_of_the_record_never_reaches_the_server():
|
||||
class Owner:
|
||||
exchanges = None # append on None: the record fails
|
||||
|
||||
def clock(self):
|
||||
raise RuntimeError("no clock")
|
||||
|
||||
class Raw:
|
||||
def __init__(self):
|
||||
self.sent = []
|
||||
|
||||
def recvfrom(self, size):
|
||||
return stun(0x0003), ("127.0.0.1", 9)
|
||||
|
||||
def sendto(self, data, address):
|
||||
self.sent.append((data, address))
|
||||
return len(data)
|
||||
|
||||
def close(self):
|
||||
self.closed = True
|
||||
|
||||
raw = Raw()
|
||||
sock = ab.ExchangeSocket(raw, Owner())
|
||||
assert sock.recvfrom(10) == (stun(0x0003), ("127.0.0.1", 9))
|
||||
assert sock.sendto(stun(0x0113), ("127.0.0.1", 9)) == 20 and raw.sent == [(stun(0x0113), ("127.0.0.1", 9))]
|
||||
sock.close()
|
||||
assert raw.closed is True
|
||||
|
||||
|
||||
def test_an_xor_address_is_decoded_and_an_answer_with_no_request_has_a_record_of_its_own():
|
||||
from _turn_chain import _attr, _xor_addr
|
||||
|
||||
assert ab.xor_address(_xor_addr("198.51.100.7", 50000)) == "198.51.100.7:50000"
|
||||
assert ab.xor_address(None) is None and ab.xor_address(b"\x00\x02" + b"\x00" * 18) is None
|
||||
assert ab.stun_attributes(stun(0x0003) + _attr(0x0006, b"lab") + _attr(0x0008, b"\x00" * 20)) == {0x0006: b"lab", 0x0008: b"\x00" * 20}
|
||||
assert ab.stun_attributes(stun(0x0003) + b"\x00\x06\x00\x40ab") == {}, "a truncated attribute says nothing"
|
||||
owner = types.SimpleNamespace(exchanges=[], clock=lambda: 1.5)
|
||||
ab.ExchangeSocket(types.SimpleNamespace(sendto=lambda data, address: 0), owner).sendto(stun(0x0113, b"\x07" * 12), ("127.0.0.1", 5))
|
||||
assert owner.exchanges == [{"t": 1.5, "src": None, "tid": "07" * 12, "type": None, "username": None, "integrity": None,
|
||||
"responses": [{"t": 1.5, "tid": "07" * 12, "type": "0x0113", "to": "127.0.0.1:5", "relayed": None, "mapped": None, "error": None}]}]
|
||||
|
||||
|
||||
def test_the_relay_writes_each_datagram_it_sends_back_with_the_address_it_claims_and_the_five_tuple_it_goes_to_and_still_sends_it():
|
||||
import socket
|
||||
import struct
|
||||
|
||||
from _doh_servers import FakeDoh
|
||||
|
||||
gateway_class, turn_class, _page = ab.make_lab_classes()
|
||||
rec = ab.Recorder()
|
||||
doh = FakeDoh({})
|
||||
turn = turn_class("127.0.0.1")
|
||||
gateway = gateway_class(rec, doh, turn, "127.0.0.1", "198.51.100.9")
|
||||
receiver = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
receiver.settimeout(5)
|
||||
receiver.bind(("127.0.0.1", 0))
|
||||
relay = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
relay.bind(("127.0.0.1", 0))
|
||||
try:
|
||||
rec.set_phase("webrtc")
|
||||
gateway._deliver(relay, receiver.getsockname(), "198.51.100.7", 3478, stun(0x0103, b"\x05" * 12))
|
||||
gateway._deliver(relay, receiver.getsockname(), "198.51.100.5", 19302, b"\xc3" + b"\x00" * 5)
|
||||
first, _ = receiver.recvfrom(2048)
|
||||
second, _ = receiver.recvfrom(2048)
|
||||
relay_address = relay.getsockname()
|
||||
client_address = receiver.getsockname()
|
||||
finally:
|
||||
receiver.close()
|
||||
relay.close()
|
||||
gateway.close()
|
||||
turn.close()
|
||||
doh.close()
|
||||
assert first == b"\x00\x00\x00\x01" + socket.inet_aton("198.51.100.7") + struct.pack("!H", 3478) + stun(0x0103, b"\x05" * 12), "the datagram is sent as it always was"
|
||||
assert second.endswith(b"\xc3" + b"\x00" * 5)
|
||||
back = rec.of("webrtc", "udp_back")
|
||||
assert [(e["claimed"], e["to"], e["relay"], e["message"], e["tid"]) for e in back] == [
|
||||
("198.51.100.7:3478", "%s:%d" % client_address, "%s:%d" % relay_address, "stun-0x0103", "05" * 12),
|
||||
("198.51.100.5:19302", "%s:%d" % client_address, "%s:%d" % relay_address, "quic-long", None)]
|
||||
assert rec.of("webrtc", "udp") == [], "a datagram back is not a datagram of the browser: the compared UDP summary does not see it"
|
||||
|
||||
|
||||
def test_the_evidence_keeps_the_turn_exchanges_of_the_walk_and_the_return_datagrams_and_the_gateways_send_errors():
|
||||
rec = ab.Recorder()
|
||||
rec.set_phase("webrtc")
|
||||
rec.event("udp_back", claimed="198.51.100.7:3478", to="127.0.0.1:40000", relay="127.0.0.1:41000", message="stun-0x0103", tid="aa" * 12)
|
||||
rec.set_phase("webrtc.end")
|
||||
rec.phase_t["webrtc"] = 5.0 # the stage began at 5 s on the recorder's clock
|
||||
before = {"t": 1.0, "src": "x:1", "tid": "00" * 12, "type": "0x0003", "username": False, "integrity": False, "responses": []}
|
||||
inside = {"t": 5.5, "src": "127.0.0.1:40000", "tid": "aa" * 12, "type": "0x0003", "username": True, "integrity": True, "responses": []}
|
||||
lab = types.SimpleNamespace(rec=rec, webrtc={}, turn=types.SimpleNamespace(exchanges=[before, inside]), gateway=types.SimpleNamespace(send_errors=["the answer to the client: OSError x"]))
|
||||
evidence = ab.webrtc_evidence(lab)
|
||||
json.dumps(evidence)
|
||||
assert evidence["turn"] == [inside], "the exchanges of the walk, not what the server heard before its stage"
|
||||
assert [(e["claimed"], e["to"], e["relay"], e["tid"], e["phase"]) for e in evidence["returned"]] == [("198.51.100.7:3478", "127.0.0.1:40000", "127.0.0.1:41000", "aa" * 12, "webrtc")]
|
||||
assert evidence["send_errors"] == ["the answer to the client: OSError x"]
|
||||
|
||||
|
||||
def test_a_lab_gives_its_turn_server_the_clock_of_its_recorder():
|
||||
with ab.Lab(host="127.0.0.1") as lab:
|
||||
assert lab.turn.clock == lab.rec.now and lab.turn.exchanges == []
|
||||
|
||||
|
||||
def test_a_hunt_repetition_launches_the_engine_with_its_own_log_and_the_variables_are_gone_after(tmp_path, monkeypatch):
|
||||
import os
|
||||
|
||||
seen = []
|
||||
|
||||
def launch(binary, seed, lab, patch):
|
||||
seen.append((os.environ.get("MOZ_LOG"), os.environ.get("MOZ_LOG_FILE")))
|
||||
raise RuntimeError("stop here")
|
||||
|
||||
monkeypatch.setattr(ab, "launch", launch)
|
||||
monkeypatch.setattr(ab, "begin_launch", lambda seed, name: None)
|
||||
monkeypatch.delenv("MOZ_LOG", raising=False)
|
||||
monkeypatch.delenv("MOZ_LOG_FILE", raising=False)
|
||||
patch = pytest.MonkeyPatch()
|
||||
try:
|
||||
record = ab.hunt_repetition("/e/firefox", "firefox-68-again", 7, 4, patch, tmp_path)
|
||||
assert "MOZ_LOG" not in os.environ and "MOZ_LOG_FILE" not in os.environ, "the variables are the launch's: a repetition leaves none"
|
||||
without = ab.hunt_repetition("/e/firefox", "firefox-68", 1, 4, patch)
|
||||
finally:
|
||||
patch.undo()
|
||||
assert seen == [("sync,timestamp,nicer:5,signaling:5", str(tmp_path / "firefox-68-again-7-mozlog")), (None, None)] and ab.HUNT_MOZ_LOG == "sync,timestamp,nicer:5,signaling:5"
|
||||
assert record["mozlog"] == "firefox-68-again-7-mozlog" and "mozlog" not in without
|
||||
|
||||
|
||||
def test_the_run_of_a_normal_a_a_does_not_log_the_engine():
|
||||
import inspect
|
||||
|
||||
for function in (ab.run_main, ab.run, ab.run_engine, ab.launch, ab.engine_env):
|
||||
assert "HUNT_MOZ_LOG" not in inspect.getsource(function) and "setenv" not in inspect.getsource(function), function.__name__
|
||||
assert "MOZ_LOG" in inspect.getsource(ab.engine_env), "an engine's own environment still has the log variables taken out: only the hunt's repetition sets them"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the hunt
|
||||
def repetition(engine, i, tids, late=0, error=None):
|
||||
"""A repetition file as ``hunt_repetition`` writes it: ``tids`` are the transaction ids of the datagrams to the TURN server in order, the first ``late`` of the last ones after the close."""
|
||||
datagrams = [{"t": 0.1 * n, "phase": "webrtc.end" if n >= len(tids) - late else "webrtc", "target": ab.TURN_TARGET, "message": "stun-0x0003", "tid": tid, "counted": n < len(tids) - late}
|
||||
for n, tid in enumerate(tids)]
|
||||
datagrams.append({"t": 0.05, "phase": "webrtc", "target": "198.51.100.5:19302", "message": "stun-0x0001", "tid": "dd" * 12, "counted": True})
|
||||
record = {"format": ab.HUNT_FORMAT, "engine": engine, "i": i, "seed": 4, "error": error, "evidence": {"phase_t": {}, "evaluate": None, "page": None, "datagrams": datagrams}}
|
||||
record["counts"] = ab.hunt_counts(record["evidence"])
|
||||
return record
|
||||
|
||||
|
||||
def test_the_hunt_summary_counts_the_datagrams_to_the_turn_server_and_lists_the_transactions_of_each_target():
|
||||
a, b = "aa" * 12, "bb" * 12
|
||||
records = [repetition("firefox-68", 1, [a, a, a, b, b]), repetition("firefox-68", 2, [a, a, b, b, b, b], late=1), repetition("firefox-68-again", 1, [a] * 4 + [b] * 4),
|
||||
repetition("firefox-68-again", 2, [], error="Error: launch")]
|
||||
summary = ab.hunt_summary(records)
|
||||
json.dumps(summary)
|
||||
assert summary["format"] == ab.HUNT_SUMMARY_FORMAT and summary["target"] == "198.51.100.7:3478"
|
||||
first, second, third, failed = summary["repetitions"]
|
||||
assert (first["engine"], first["i"], first["count_3478"], first["count_3478_all"]) == ("firefox-68", 1, 5, 5)
|
||||
assert first["targets"] == {"198.51.100.5:19302": [["dd" * 12, 1]], ab.TURN_TARGET: [[a, 3], [b, 2]]}
|
||||
assert (second["count_3478"], second["count_3478_all"]) == (5, 6), "a datagram after the close is in `all` and not in the count the A/A makes"
|
||||
assert second["targets"][ab.TURN_TARGET] == [[a, 2], [b, 4]]
|
||||
assert (third["count_3478"], third["targets"][ab.TURN_TARGET]) == (8, [[a, 4], [b, 4]])
|
||||
assert failed["error"] == "Error: launch" and failed["count_3478"] == 0
|
||||
assert summary["count_3478_by_engine"] == {"firefox-68": {"5": 2}, "firefox-68-again": {"0": 1, "8": 1}}
|
||||
|
||||
|
||||
def test_the_hunt_summary_is_read_from_the_repetition_files_and_does_not_read_itself(tmp_path):
|
||||
for record in (repetition("firefox-68-again", 2, ["aa" * 12]), repetition("firefox-68", 10, ["aa" * 12]), repetition("firefox-68", 2, ["aa" * 12] * 2)):
|
||||
ab.write_json(tmp_path / ("%s-%d.json" % (record["engine"], record["i"])), record)
|
||||
ab.write_json(tmp_path / "summary.json", ab.hunt_summary(ab.read_hunt_records(tmp_path)))
|
||||
(tmp_path / "notes.txt").write_text("not json", encoding="utf-8")
|
||||
records = ab.read_hunt_records(tmp_path)
|
||||
assert [(r["engine"], r["i"]) for r in records] == [("firefox-68", 2), ("firefox-68", 10), ("firefox-68-again", 2)], "by engine, then by number (10 after 2)"
|
||||
assert len(ab.hunt_summary(records)["repetitions"]) == 3
|
||||
|
||||
|
||||
@pytest.mark.parametrize("text, expected", [("webrtc:4:20", ("webrtc", 4, 20)), (" webrtc:11:1 ", ("webrtc", 11, 1))])
|
||||
def test_the_hunt_spec_names_the_walk_the_seed_and_the_count(text, expected):
|
||||
assert ab.parse_hunt(text) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize("text", ["", "webrtc", "webrtc:4", "webrtc:four:3", "webrtc:4:0", "webrtc:4:-1", "h3:4:3", "webrtc:4:3:1", "4:3"])
|
||||
def test_a_hunt_spec_that_does_not_read_is_refused(text):
|
||||
with pytest.raises(ValueError, match=ab.HUNT_ENV):
|
||||
ab.parse_hunt(text)
|
||||
|
||||
|
||||
|
||||
def test_ab_with_the_hunt_variable_runs_only_the_walk_n_times_for_each_engine_of_the_a_a_and_exits_0(tmp_path, monkeypatch, capsys):
|
||||
calls = []
|
||||
|
||||
def hunt_engine(binary, seal, label, seed, n, out_dir):
|
||||
calls.append((binary, seal, label, seed, n))
|
||||
for i in range(1, n + 1):
|
||||
ab.write_json(out_dir / ("%s-%d.json" % (label, i)), repetition(label, i, ["aa" * 12] * (8 + i % 2)))
|
||||
return 0
|
||||
|
||||
def never(*a, **k):
|
||||
raise AssertionError("the A/A, the A/B and the volatile list are not part of a hunt")
|
||||
|
||||
monkeypatch.setattr(ab, "hunt_engine", hunt_engine)
|
||||
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
|
||||
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"
|
||||
assert sorted(p.name for p in hunt.iterdir()) == sorted(["summary.json"] + ["%s-%d.json" % (e, i) for e in ("firefox-68", "firefox-68-again") for i in (1, 2, 3)])
|
||||
summary = json.loads((hunt / "summary.json").read_text(encoding="utf-8"))
|
||||
assert [(r["engine"], r["i"], r["count_3478"]) for r in summary["repetitions"]] == [("firefox-68", 1, 9), ("firefox-68", 2, 8), ("firefox-68", 3, 9), ("firefox-68-again", 1, 9), ("firefox-68-again", 2, 8),
|
||||
("firefox-68-again", 3, 9)]
|
||||
assert summary["repetitions"][0]["targets"][ab.TURN_TARGET] == [["aa" * 12, 9]]
|
||||
assert not (tmp_path / "network" / "diff-a-a.json").exists()
|
||||
assert "hunt summary written" in capsys.readouterr().out
|
||||
|
||||
|
||||
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 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 "FAIL AB_NETWORK_HUNT" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_without_the_hunt_variable_ab_is_the_a_a_it_was(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv(ab.HUNT_ENV, raising=False)
|
||||
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 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"
|
||||
|
||||
|
||||
def test_the_engine_of_a_hunt_runs_in_a_process_of_its_own_with_its_seal_and_its_own_cache(tmp_path, monkeypatch):
|
||||
seen = {}
|
||||
|
||||
class Done:
|
||||
returncode = 0
|
||||
|
||||
monkeypatch.setattr(ab.subprocess, "run", lambda cmd, env, timeout: seen.update(cmd=cmd, env=env, timeout=timeout) or Done())
|
||||
assert ab.hunt_engine("/e/firefox", "/e/seal.json", "firefox-68-again", 4, 20, tmp_path / "hunt") == 0
|
||||
cmd = seen["cmd"]
|
||||
assert cmd[3:] == ["hunt-run", "--binary", "/e/firefox", "--label", "firefox-68-again", "--seed", "4", "--n", "20", "--out", str(tmp_path / "hunt")]
|
||||
assert seen["env"]["INVISIBLE_SEAL_FILE"] == "/e/seal.json" and seen["env"]["INVISIBLE_CORE_AUTOFIX"] == "off"
|
||||
assert seen["timeout"] == ab.HUNT_BASE_S + 20 * ab.HUNT_PER_REPETITION_S
|
||||
|
||||
|
||||
def test_a_repetition_is_one_launch_the_walk_alone_and_the_evidence_read_after_the_close(monkeypatch):
|
||||
order = []
|
||||
|
||||
class Session:
|
||||
def __enter__(self):
|
||||
order.append("open")
|
||||
return types.SimpleNamespace(new_context=lambda **k: types.SimpleNamespace(new_page=lambda: order.append("page")))
|
||||
|
||||
def __exit__(self, *exc):
|
||||
order.append("closed")
|
||||
|
||||
monkeypatch.setattr(ab, "launch", lambda binary, seed, lab, patch: Session())
|
||||
monkeypatch.setattr(ab, "begin_launch", lambda seed, name: order.append("begin " + name))
|
||||
monkeypatch.setattr(ab, "glean_ready", lambda session, seed, name: order.append("glean") or {})
|
||||
monkeypatch.setattr(ab, "walk_webrtc", lambda browser, lab: order.append("walk") or {"udp": {}})
|
||||
for walker in ("walk_journey", "walk_h3", "walk_https"):
|
||||
monkeypatch.setattr(ab, walker, lambda *a, **k: pytest.fail("a hunt walks nothing but the WebRTC page"))
|
||||
monkeypatch.setattr(ab, "webrtc_evidence", lambda lab: order.append("evidence") or {"datagrams": [{"target": ab.TURN_TARGET, "counted": True}, {"target": ab.TURN_TARGET, "counted": False}]})
|
||||
record = ab.hunt_repetition("/e/firefox", "firefox-68", 3, 4, object())
|
||||
assert order == ["begin hunt", "open", "page", "glean", "walk", "closed", "evidence"]
|
||||
assert (record["engine"], record["i"], record["seed"], record["error"], record["counts"]) == ("firefox-68", 3, 4, None, {"counted": 1, "all": 2})
|
||||
|
||||
|
||||
def test_a_repetition_that_fails_is_a_record_with_its_error_and_the_hunt_goes_on(monkeypatch):
|
||||
def broken(binary, seed, lab, patch):
|
||||
raise RuntimeError("the engine did not start 17")
|
||||
|
||||
monkeypatch.setattr(ab, "launch", broken)
|
||||
monkeypatch.setattr(ab, "begin_launch", lambda seed, name: None)
|
||||
record = ab.hunt_repetition("/e/firefox", "firefox-68", 1, 4, object())
|
||||
assert record["error"] == "RuntimeError: the engine did not start N" and record["evidence"] is None and record["counts"] == {"counted": 0, "all": 0}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- e2e-hunt.yml
|
||||
def steps_of(text):
|
||||
"""The steps of the hunt job: ``{name: block}`` (the blocks of the lines that start with `` - ``)."""
|
||||
job = text[text.index("\n hunt:\n"):]
|
||||
blocks = re.split(r"\n(?= - )", job)
|
||||
return {b.split("name:", 1)[1].split("\n", 1)[0].strip(): b for b in blocks if b.startswith(" - name:")}
|
||||
|
||||
|
||||
def test_the_hunt_workflow_has_the_input_that_chooses_the_walk_and_stays_a_manual_one():
|
||||
text = HUNT_WORKFLOW.read_text(encoding="utf-8")
|
||||
on = text[text.index("\non:\n"):text.index("\npermissions:")]
|
||||
assert " workflow_dispatch:\n" in on and "push:" not in on and "pull_request" not in on and "schedule:" not in on
|
||||
inputs = on[on.index(" inputs:\n"):]
|
||||
block = inputs[inputs.index(" ab_network_webrtc_seed:\n"):]
|
||||
block = block[:block.index("\n os:")]
|
||||
assert 'default: ""' in block and "required: false" in block, "empty is today's behaviour"
|
||||
assert " runs:\n" in inputs and " os:\n" in inputs, "the inputs it had are still there"
|
||||
|
||||
|
||||
def test_the_step_of_the_walk_runs_the_hunt_mode_only_when_the_input_is_set_and_the_e2e_loop_only_when_it_is_not():
|
||||
steps = steps_of(HUNT_WORKFLOW.read_text(encoding="utf-8"))
|
||||
walk = next(b for n, b in steps.items() if n.startswith("The network oracle's WebRTC walk of one seed"))
|
||||
loop = steps["Loop until it catches one"]
|
||||
assert "if: inputs.ab_network_webrtc_seed != ''" in walk and "if: inputs.ab_network_webrtc_seed == ''" in loop
|
||||
assert "AB_NETWORK_HUNT: webrtc:${{ inputs.ab_network_webrtc_seed }}:${{ inputs.runs }}" in walk, "the seed and the number of repetitions come from the inputs, through the environment"
|
||||
assert "${{ inputs." not in walk.split("run: |")[1], "no input is written into the script text"
|
||||
assert "scripts/ci_ab_network.py ab --a-a --out network --published-binary \"$FF\"" in walk
|
||||
assert "xvfb-run -a" in walk and 'RUNNER_OS" = "Linux"' in walk
|
||||
assert "scripts/run_e2e.py" in loop and "run_e2e" not in walk
|
||||
for name in ("The security state (a fixed directory of the repository)", "The GeoIP database (made by the repository, same bytes every run)"):
|
||||
assert "if: inputs.ab_network_webrtc_seed != ''" in steps[name], "what only the hunt needs is made only for it"
|
||||
names = list(steps)
|
||||
assert names.index("The security state (a fixed directory of the repository)") < names.index("Fetch the published firefox binary") < names.index(next(n for n in names if n.startswith("The network oracle's WebRTC walk")))
|
||||
|
||||
|
||||
def test_the_hunt_uploads_network_hunt_as_an_artifact_and_every_action_it_uses_is_pinned_by_sha():
|
||||
text = HUNT_WORKFLOW.read_text(encoding="utf-8")
|
||||
steps = steps_of(text)
|
||||
upload = next(b for n, b in steps.items() if n.startswith("Upload the hunt of the network oracle's WebRTC walk"))
|
||||
assert "if: always() && inputs.ab_network_webrtc_seed != ''" in upload and "path: network/hunt" in upload
|
||||
assert re.search(r"uses: actions/upload-artifact@[0-9a-f]{40} # v4", upload)
|
||||
for line in text.splitlines():
|
||||
m = re.match(r"\s*- uses: (\S+)|\s+uses: (\S+)", line)
|
||||
if m and not (m.group(1) or m.group(2)).startswith("./"):
|
||||
assert re.search(r"@[0-9a-f]{40}\b", line), line
|
||||
@@ -85,7 +85,7 @@ def test_async_default_context_kwargs_match_sync():
|
||||
|
||||
# ── parity with the sync launcher, driven rather than declared ───────────────
|
||||
|
||||
def test_the_async_api_stamps_the_session_token_into_the_browser_env():
|
||||
def test_the_async_api_stamps_the_session_token_into_the_browser_env(declared_engine):
|
||||
"""The gap that shipped a "fixed" leak to half the users.
|
||||
|
||||
The Windows process-leak fix went into 0.4.0 and was described as fixed. It
|
||||
|
||||
@@ -7,17 +7,20 @@ CreatePattern`` used to read its source canvas through the pattern's own context
|
||||
projected ones: a page compared the two and read the difference. On firefox-68 two lines of ``CreatePattern`` (the HTMLCanvasElement and the
|
||||
OffscreenCanvas overloads; folder ``fingerprint/canvas/text-metrics`` of the series, ``dom/canvas/CanvasRenderingContext2D.cpp``) read the snapshot
|
||||
from the element, so the pattern carries the projection. A 2D canvas is not projected at all (a 2D canvas reads back exactly as drawn,
|
||||
``tests/test_canvas_reads_as_drawn.py``), so a pattern of a 2D canvas is the same pixels with the engine on and off.
|
||||
``tests/test_canvas_reads_as_drawn.py``), so a pattern of a 2D canvas is the same pixels with the noise on and off.
|
||||
|
||||
What the test reads. One page builds a source (a WebGL canvas, a WebGL OffscreenCanvas, or a 2D canvas), fills a 2D canvas with
|
||||
``createPattern(source, 'no-repeat')`` and reads it back with ``getImageData``, then clears it and draws the source with ``drawImage`` and reads that.
|
||||
The WebGL render is a triangle with per-vertex colours and antialiased edges on a white clear (what a fingerprinting page draws, and where the
|
||||
projection acts: ``tests/test_webgl_noise_active.py``); the 2D source is a gradient, an antialiased arc and a rotated rectangle.
|
||||
|
||||
The negative control, in the same module. The same page runs with the engine not declared (``zoom.stealth.fpp.hw_seed`` = 0: no projection): the
|
||||
WebGL pattern pixels with the engine declared must DIFFER from those (the projection is what changed them), and the 2D pattern pixels must be the
|
||||
SAME bytes with the engine on and off. A render that is not drawn (a blank source) fails the test: the pixels are checked to hold more than one
|
||||
colour. WebGL being unavailable on the runner is a failure, not a skip.
|
||||
The negative control, in the same module. The same page runs with the canvas noise declared off and the engine still on (``zoom.stealth.canvas.
|
||||
substitute_pixels`` false, the same declared GPU, the engine's own GL: no projection, because the noise is off, not because the engine is):
|
||||
the WebGL pattern pixels with the noise on must DIFFER from those (the projection is what changed them), and the 2D pattern pixels must be the
|
||||
SAME bytes with the noise on and off. A control with the engine off (``zoom.stealth.fpp.hw_seed`` 0) would draw the WebGL source on the host's
|
||||
GL, which a runner may not serve (no context, once in 3083 launches), so no launch of this file has the engine off. On Linux, in both launches,
|
||||
the maps of the engine's processes hold the engine's own GL and no libEGL of the host's. A render that is not drawn (a blank source) fails the
|
||||
test: the pixels are checked to hold more than one colour. WebGL being unavailable on the runner is a failure, not a skip.
|
||||
|
||||
Run: pytest tests/test_canvas_create_pattern_projection_e2e.py -m e2e -v
|
||||
"""
|
||||
@@ -25,6 +28,9 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from engine_process_tree import assert_the_gl_is_the_engines_own, gl_maps_of_this_test
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SIZE = 64
|
||||
@@ -78,58 +84,73 @@ READ = """(args) => {
|
||||
KINDS = ["webgl", "offscreen-webgl", "2d"]
|
||||
|
||||
|
||||
def _read(firefox_binary, engine_declared):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
#: A hw_seed no runner has by accident (the engine is on when it is positive), the one both launches of this file declare: the same GPU, so
|
||||
#: the engine's own GL in both. The control declares only the canvas noise off.
|
||||
_HW_SEED = 12345
|
||||
|
||||
prefs = {} if engine_declared else {"zoom.stealth.fpp.hw_seed": 0}
|
||||
|
||||
def _launch_prefs(noise_on: bool) -> dict:
|
||||
"""The prefs of one launch of this file: the engine always on (the same declared GPU, the engine's own GL), with the canvas noise on, or
|
||||
with only the canvas noise declared off (``zoom.stealth.canvas.substitute_pixels`` false: no projection, the bytes as that GPU drew them)."""
|
||||
prefs = {"zoom.stealth.fpp.hw_seed": _HW_SEED}
|
||||
if not noise_on:
|
||||
prefs["zoom.stealth.canvas.substitute_pixels"] = False
|
||||
return prefs
|
||||
|
||||
|
||||
def _read(firefox_binary, noise_on):
|
||||
out = {}
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True, extra_prefs=prefs) as browser:
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True,
|
||||
extra_prefs=_launch_prefs(noise_on)) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("about:blank", timeout=30_000)
|
||||
for kind in KINDS:
|
||||
got = page.evaluate(READ, [kind, SIZE])
|
||||
assert "error" not in got, got["error"]
|
||||
out[kind] = {name: bytes(values) for name, values in got.items()}
|
||||
gl_maps = gl_maps_of_this_test(firefox_binary)
|
||||
assert_the_gl_is_the_engines_own(firefox_binary, gl_maps)
|
||||
return out
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def readings(firefox_binary):
|
||||
"""kind -> {viaPattern, viaDraw} bytes, with the engine declared and not declared. The browsers are closed before the tests run."""
|
||||
declared = _read(firefox_binary, True)
|
||||
stock = _read(firefox_binary, False)
|
||||
for mode, rows in (("engine declared", declared), ("engine not declared", stock)):
|
||||
"""kind -> {viaPattern, viaDraw} bytes, with the canvas noise on and off (the engine on in both). The browsers are closed before the tests run."""
|
||||
noised = _read(firefox_binary, True)
|
||||
control = _read(firefox_binary, False)
|
||||
for mode, rows in (("noise on", noised), ("noise off", control)):
|
||||
for kind, row in rows.items():
|
||||
assert len(row["viaPattern"]) == SIZE * SIZE * 4 and len(set(row["viaPattern"])) > 1, (
|
||||
"%s: the %s pattern read back is blank or has the wrong size: the source was not drawn" % (mode, kind))
|
||||
return {"declared": declared, "stock": stock}
|
||||
return {"noised": noised, "control": control}
|
||||
|
||||
|
||||
def test_create_pattern_from_a_webgl_canvas_carries_the_projection(readings):
|
||||
declared, stock = readings["declared"]["webgl"], readings["stock"]["webgl"]
|
||||
assert declared["viaPattern"] != stock["viaPattern"], (
|
||||
"createPattern(webglCanvas) reads the same pixels with the engine declared and not declared: the pattern is the clean render, the "
|
||||
noised, control = readings["noised"]["webgl"], readings["control"]["webgl"]
|
||||
assert noised["viaPattern"] != control["viaPattern"], (
|
||||
"createPattern(webglCanvas) reads the same pixels with the noise on and off: the pattern is the clean render, the "
|
||||
"projection does not reach it")
|
||||
|
||||
|
||||
def test_create_pattern_from_an_offscreen_webgl_canvas_carries_the_projection(readings):
|
||||
declared, stock = readings["declared"]["offscreen-webgl"], readings["stock"]["offscreen-webgl"]
|
||||
assert declared["viaPattern"] != stock["viaPattern"], (
|
||||
"createPattern(offscreenWebglCanvas) reads the same pixels with the engine declared and not declared: the pattern is the clean render, "
|
||||
noised, control = readings["noised"]["offscreen-webgl"], readings["control"]["offscreen-webgl"]
|
||||
assert noised["viaPattern"] != control["viaPattern"], (
|
||||
"createPattern(offscreenWebglCanvas) reads the same pixels with the noise on and off: the pattern is the clean render, "
|
||||
"the projection does not reach it")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", ["webgl", "offscreen-webgl"])
|
||||
def test_a_pattern_of_a_webgl_canvas_reads_what_drawimage_of_it_reads(readings, kind):
|
||||
declared = readings["declared"][kind]
|
||||
assert declared["viaPattern"] == declared["viaDraw"], (
|
||||
"%s: the pixels of createPattern + fill and of drawImage differ with the engine declared: the two reads of one canvas carry "
|
||||
noised = readings["noised"][kind]
|
||||
assert noised["viaPattern"] == noised["viaDraw"], (
|
||||
"%s: the pixels of createPattern + fill and of drawImage differ with the noise on: the two reads of one canvas carry "
|
||||
"different projections" % kind)
|
||||
|
||||
|
||||
def test_create_pattern_from_a_2d_canvas_reads_the_same_with_the_engine_on_and_off(readings):
|
||||
declared, stock = readings["declared"]["2d"], readings["stock"]["2d"]
|
||||
assert declared["viaPattern"] == stock["viaPattern"], (
|
||||
"createPattern(2dCanvas) differs between the engine declared and not declared: a 2D source must be read as drawn")
|
||||
assert declared["viaDraw"] == stock["viaDraw"], "drawImage(2dCanvas) differs between the engine declared and not declared"
|
||||
assert declared["viaPattern"] == declared["viaDraw"], "a pattern of a 2D canvas is not the pixels drawImage reads"
|
||||
"""A 2D source is untouched whether the canvas noise is on or off (the engine is on in both launches): it is read as drawn."""
|
||||
noised, control = readings["noised"]["2d"], readings["control"]["2d"]
|
||||
assert noised["viaPattern"] == control["viaPattern"], (
|
||||
"createPattern(2dCanvas) differs between the noise on and off: a 2D source must be read as drawn")
|
||||
assert noised["viaDraw"] == control["viaDraw"], "drawImage(2dCanvas) differs between the noise on and off"
|
||||
assert noised["viaPattern"] == noised["viaDraw"], "a pattern of a 2D canvas is not the pixels drawImage reads"
|
||||
@@ -16,8 +16,12 @@ known-bad:
|
||||
per-seed change at readback.
|
||||
* A toDataURL PNG carries the deBG chunk retail 151 writes.
|
||||
* A WebGL canvas that is not premultiplied (premultipliedAlpha:false, half
|
||||
transparent) reads the same pixels through toDataURL and toBlob, noised with the
|
||||
engine on (hw_seed > 0); the control is the engine off (hw_seed 0: as drawn).
|
||||
transparent) reads the same pixels through toDataURL and toBlob, noised (the
|
||||
engine on, hw_seed > 0); the control is the same engine, the same declared GPU
|
||||
and the same GL, the engine's own, with only the canvas noise declared off
|
||||
(zoom.stealth.canvas.substitute_pixels false), so a defect of our hook that
|
||||
changed the bytes with the noise off shows in the control. In both launches, on
|
||||
Linux, the engine's processes map the engine's own GL and no libEGL of the host's.
|
||||
|
||||
Runs against about:blank and a local http page, no network/proxy. Part of the
|
||||
e2e release gate.
|
||||
@@ -26,9 +30,14 @@ Run: pytest tests/test_canvas_reads_as_drawn.py -m e2e -v
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import threading
|
||||
import types
|
||||
|
||||
import pytest
|
||||
|
||||
from _evidence_on_failure import FailureEvidence
|
||||
from engine_process_tree import assert_the_gl_is_the_engines_own, gl_maps_of_this_test
|
||||
from _webgl_unavailable import SECOND_ATTEMPT_AFTER_MS, split_probe, unavailable_message
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
_GRID_JS = """(offscreen) => {
|
||||
@@ -161,9 +170,12 @@ def test_two_seeds_on_the_same_machine_draw_the_same_text(firefox_binary):
|
||||
|
||||
_NON_PREMULTIPLIED_JS = """async () => {
|
||||
const c = document.createElement('canvas'); c.width = 128; c.height = 128;
|
||||
const statusMessages = [];
|
||||
c.addEventListener('webglcontextcreationerror', e => statusMessages.push(e.statusMessage));
|
||||
const gl = c.getContext('webgl', {premultipliedAlpha: false, alpha: true,
|
||||
preserveDrawingBuffer: true, antialias: true});
|
||||
if (!gl) return null;
|
||||
if (!gl) return {unavailable: true, statusMessages,
|
||||
webglInterface: typeof WebGLRenderingContext, webgl2Interface: typeof WebGL2RenderingContext};
|
||||
const alpha = 128 / 255;
|
||||
const vs = gl.createShader(gl.VERTEX_SHADER);
|
||||
gl.shaderSource(vs, 'attribute vec2 p; attribute vec3 c; varying vec3 v;'
|
||||
@@ -192,22 +204,79 @@ _NON_PREMULTIPLIED_JS = """async () => {
|
||||
}"""
|
||||
|
||||
|
||||
def _non_premultiplied(firefox_binary, hw_seed):
|
||||
#: A second attempt at a context, on a fresh canvas, made 2 s after a first one that gave none: it only records (what the page heard, and the
|
||||
#: renderer if a context exists); the verdict stays the first attempt's.
|
||||
_SECOND_ATTEMPT_JS = """() => {
|
||||
const out = {};
|
||||
try {
|
||||
const c = document.createElement('canvas'); c.width = 128; c.height = 128;
|
||||
const statusMessages = [];
|
||||
c.addEventListener('webglcontextcreationerror', e => statusMessages.push(e.statusMessage));
|
||||
const gl = c.getContext('webgl', {premultipliedAlpha: false, alpha: true,
|
||||
preserveDrawingBuffer: true, antialias: true});
|
||||
out.statusMessages = statusMessages;
|
||||
out.created = !!gl;
|
||||
if (gl) {
|
||||
out.renderer = gl.getParameter(gl.RENDERER);
|
||||
out.vendor = gl.getParameter(gl.VENDOR);
|
||||
const info = gl.getExtension('WEBGL_debug_renderer_info');
|
||||
if (info) {
|
||||
out.unmaskedRenderer = gl.getParameter(info.UNMASKED_RENDERER_WEBGL);
|
||||
out.unmaskedVendor = gl.getParameter(info.UNMASKED_VENDOR_WEBGL);
|
||||
}
|
||||
}
|
||||
} catch (e) { out.error = String(e); }
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
#: A hw_seed no runner has by accident (the engine is on when it is positive). Both launches of the test below keep the engine ON with the
|
||||
#: same declared GPU, so on the engine's own GL: a launch with hw_seed 0 would run WebGL on the host's Mesa, which a runner may not serve.
|
||||
_HW_SEED = 12345
|
||||
|
||||
|
||||
def _launch_prefs(noise_on: bool) -> dict:
|
||||
"""The prefs of one launch of the test below: the engine always on (the same declared GPU, the engine's own GL), with the canvas noise
|
||||
on, or with only the canvas noise declared off (``zoom.stealth.canvas.substitute_pixels`` false: the bytes as that GPU drew them)."""
|
||||
prefs = {"zoom.stealth.fpp.hw_seed": _HW_SEED}
|
||||
if not noise_on:
|
||||
prefs["zoom.stealth.canvas.substitute_pixels"] = False
|
||||
return prefs
|
||||
|
||||
|
||||
def _non_premultiplied(firefox_binary, noise_on, attempts=None):
|
||||
"""(the pixels of toDataURL, the pixels of toBlob) of one half-transparent, non-premultiplied WebGL canvas,
|
||||
as 128x128 RGBA bytes, with the engine on (hw_seed > 0) or off (0)."""
|
||||
as 128x128 RGBA bytes, with the canvas noise on or off (``_launch_prefs``): the engine is on in both.
|
||||
|
||||
When the page gets no context the first time, the assertion carries why: what the page heard on
|
||||
`webglcontextcreationerror` and, after a pause of 2 s, what a second attempt on a fresh canvas heard (and its
|
||||
renderer if it got one). The second attempt changes no verdict. `attempts`, a record the evidence keeps, gets both.
|
||||
On Linux, once the page has its context, the maps of the engine's processes say the GL is the engine's own."""
|
||||
import base64
|
||||
|
||||
from _page_bytes import unfiltered
|
||||
|
||||
with InvisiblePlaywright(
|
||||
seed=7, binary_path=firefox_binary, headless=True,
|
||||
extra_prefs={"zoom.stealth.fpp.hw_seed": hw_seed},
|
||||
extra_prefs=_launch_prefs(noise_on),
|
||||
) as b:
|
||||
p = b.new_context().new_page()
|
||||
p.goto("about:blank", timeout=30_000)
|
||||
got = p.evaluate(_NON_PREMULTIPLIED_JS)
|
||||
assert got is not None, "webgl is unavailable: a WebGL canvas cannot be read"
|
||||
got, first = split_probe(p.evaluate(_NON_PREMULTIPLIED_JS))
|
||||
second = None
|
||||
if got is None:
|
||||
p.wait_for_timeout(SECOND_ATTEMPT_AFTER_MS)
|
||||
try:
|
||||
second = p.evaluate(_SECOND_ATTEMPT_JS)
|
||||
except Exception as problem: # only a note: the first attempt is the verdict
|
||||
second = {"error": repr(problem)}
|
||||
gl_maps = gl_maps_of_this_test(firefox_binary)
|
||||
if attempts is not None:
|
||||
with attempts.lock:
|
||||
attempts.records.append({"noise_on": noise_on, "context": got is not None, "first": first, "second": second})
|
||||
assert got is not None, unavailable_message(first, second)
|
||||
assert got["premultipliedAlpha"] is False, "the context is premultiplied: %r" % got["premultipliedAlpha"]
|
||||
assert_the_gl_is_the_engines_own(firefox_binary, gl_maps)
|
||||
images = [unfiltered(base64.b64decode(got["url"].split(",", 1)[1])), unfiltered(base64.b64decode(got["blob"]))]
|
||||
for png in images:
|
||||
assert (png["w"], png["h"], png["channels"]) == (128, 128, 4), png
|
||||
@@ -216,25 +285,40 @@ def _non_premultiplied(firefox_binary, hw_seed):
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_non_premultiplied_webgl_canvas_reads_the_same_through_todataurl_and_toblob(firefox_binary):
|
||||
"""toDataURL and toBlob of a premultipliedAlpha:false WebGL canvas give the same pixels, noised with the engine on.
|
||||
"""toDataURL and toBlob of a premultipliedAlpha:false WebGL canvas give the same pixels, noised.
|
||||
|
||||
The canvas noise is applied to the snapshot with its alpha type: a context that is not premultiplied stores
|
||||
the colours as drawn, and a reader that took it for premultiplied would noise (or convert) them wrongly.
|
||||
Both PNG readers go through the same hook (GetImageBuffer, GetInputStream in ClientWebGLContext.cpp). The
|
||||
canvas is half transparent (alpha 128/255, colours as drawn), so a premultiplied reading changes the bytes.
|
||||
Negative control, in the same test: with the engine off the two readers are the bytes as drawn, their alpha is
|
||||
the 128 drawn, and the engine-on PNG differs from them."""
|
||||
on_url, on_blob = _non_premultiplied(firefox_binary, 12345)
|
||||
off_url, off_blob = _non_premultiplied(firefox_binary, 0)
|
||||
Negative control, in the same test: the same engine, the same declared GPU and the engine's own GL, with only
|
||||
the canvas noise declared off (``zoom.stealth.canvas.substitute_pixels`` false): the two readers are the bytes
|
||||
as drawn, their alpha is the 128 drawn, and the noised PNG differs from them. So a defect of our hook that
|
||||
changed the bytes with the noise off shows in the control, and no runner's Mesa is in either launch (on Linux
|
||||
the maps of both launches hold the engine's own GL and no libEGL of the host's)."""
|
||||
with FailureEvidence("canvas-webgl-non-premultiplied") as evidence:
|
||||
attempts = types.SimpleNamespace(lock=threading.Lock(), records=[])
|
||||
evidence.note_records("webgl-attempts", attempts)
|
||||
# One arming before both launches (noise on, then off): the variables it sets stay for the second launch, and the
|
||||
# engine writes one log file per process (MOZ_LOG_FILE has %PID), so both are covered; a second arm() would lose
|
||||
# the first one's patch. gfx2d is the module of gfxCriticalNote (gfx/2d/Factory.cpp, LazyLogModule "gfx2d"); the
|
||||
# engine has no log module named GfxInfo or WebGL (none in widget/ or dom/canvas), so none is asked for.
|
||||
evidence.arm(moz_log="timestamp,gfx2d:5")
|
||||
on_url, on_blob = _non_premultiplied(firefox_binary, True, attempts)
|
||||
off_url, off_blob = _non_premultiplied(firefox_binary, False, attempts)
|
||||
_the_noise_off_and_on_readings_agree(on_url, on_blob, off_url, off_blob)
|
||||
|
||||
|
||||
def _the_noise_off_and_on_readings_agree(on_url, on_blob, off_url, off_blob):
|
||||
alphas = {off_url[i] for i in range(3, len(off_url), 4)}
|
||||
assert alphas <= set(range(126, 131)), (
|
||||
"engine off: the alpha of the PNG is %s, not the 128 that was drawn" % sorted(alphas))
|
||||
"noise off: the alpha of the PNG is %s, not the 128 that was drawn" % sorted(alphas))
|
||||
differing = lambda a, b: sum(1 for x, y in zip(a, b) if x != y)
|
||||
assert off_blob == off_url, (
|
||||
"engine off: %d of %d bytes of toBlob differ from toDataURL" % (differing(off_blob, off_url), len(off_url)))
|
||||
"noise off: %d of %d bytes of toBlob differ from toDataURL" % (differing(off_blob, off_url), len(off_url)))
|
||||
assert differing(on_url, off_url), (
|
||||
"toDataURL of a non-premultiplied WebGL canvas is the same with the engine on and off: no noise reaches "
|
||||
"toDataURL of a non-premultiplied WebGL canvas is the same with the noise on and off: no noise reaches "
|
||||
"the page, so comparing the two readers says nothing")
|
||||
assert on_blob == on_url, (
|
||||
"engine on: %d of %d bytes of toBlob differ from toDataURL of the same non-premultiplied WebGL canvas"
|
||||
"noise on: %d of %d bytes of toBlob differ from toDataURL of the same non-premultiplied WebGL canvas"
|
||||
% (differing(on_blob, on_url), len(on_url)))
|
||||
@@ -1,8 +1,8 @@
|
||||
"""Canvas / WebGL render-stealth regression test (binary-level, 2026-06-18).
|
||||
|
||||
Guards a patched-binary behaviour that must never regress, needed for the
|
||||
fingerprint to look like a real Windows browser to FOSS detectors (CreepJS,
|
||||
FingerprintJS, BrowserLeaks) and fixed-hash reference checks:
|
||||
fingerprint to look like a real Windows browser to FOSS detectors (a headless
|
||||
detector, a fingerprint library, a public leak-test page) and fixed-hash reference checks:
|
||||
|
||||
Solid WebGL readback purity under render-noise - a fixed solid-colour WebGL
|
||||
readback (which reference checks hash against a universal constant) must stay
|
||||
|
||||
+174
-1
@@ -345,6 +345,153 @@ def test_a_retired_file_does_not_excuse_another_loss_in_the_same_row(tmp_path, m
|
||||
assert code == 1 and "tests/test_e.py" in capsys.readouterr().out
|
||||
|
||||
|
||||
# --- retired tests: a single test of a file that stays, declared by nodeid ----------------------------------------
|
||||
GONE_NODE = FILE_A + "::test_gone"
|
||||
|
||||
|
||||
def _retired_test(nodeid=GONE_NODE, suite="s.one", count=1, from_min_tests=5, **over):
|
||||
entry = {"nodeid": nodeid, "suite": suite, "count": count, "from_min_tests": from_min_tests, "reason": "removed with its bundle", "decided_by": "pm", "date": "2026-11-27"}
|
||||
entry.update(over)
|
||||
return entry
|
||||
|
||||
|
||||
def _main_that_had_the_test(tmp_path, retired, min_tests=5):
|
||||
"""main's row of FILE_A, FILE_B, NODE with one more test (the one that is retired) in the floor."""
|
||||
return _main_with(tmp_path, [_suite(min_tests=min_tests)], retired)
|
||||
|
||||
|
||||
def test_a_declared_test_lets_the_floor_drop_by_exactly_its_count_is_green(tmp_path, monkeypatch):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test()])
|
||||
assert _judge(tmp_path, GREEN, extra=["--main-required", str(main)])[0] == 0 # 5 on main, 4 here, 1 declared
|
||||
|
||||
|
||||
def test_the_counts_of_the_entries_of_a_suite_are_summed(tmp_path, monkeypatch):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
other = FILE_B + "::test_also_gone"
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test(from_min_tests=7), _retired_test(other, from_min_tests=7),
|
||||
_retired_test(nodeid=FILE_A + "::t3", from_min_tests=7)], min_tests=7)
|
||||
assert _judge(tmp_path, GREEN, extra=["--main-required", str(main)])[0] == 0 # 7 -> 4: three declared
|
||||
|
||||
|
||||
def test_a_floor_that_drops_by_more_than_the_declared_count_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test(count=1, from_min_tests=6)], min_tests=6) # 6 -> 4 here: one declared, two lost
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_test_that_goes_with_no_entry_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, None)
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_an_entry_of_another_suite_or_of_a_file_the_row_does_not_run_excuses_nothing(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
for i, entry in enumerate([_retired_test(suite="s.another"), _retired_test(nodeid="tests/test_unlisted.py::test_gone")]):
|
||||
folder = tmp_path / ("case%d" % i)
|
||||
folder.mkdir()
|
||||
main = _main_that_had_the_test(folder, [entry])
|
||||
sub = tmp_path / ("run%d" % i)
|
||||
sub.mkdir()
|
||||
code, _r = _judge(sub, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out, entry
|
||||
|
||||
|
||||
def test_a_declared_test_that_the_suite_still_collects_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test()])
|
||||
still = GREEN + [_case(FILE_A, "test_gone")]
|
||||
code, _r = _judge(tmp_path, still, rows=[_suite(min_tests=5)], extra=["--main-required", str(main)])
|
||||
out = capsys.readouterr().out
|
||||
assert code == 1 and GONE_NODE in out and "still collects it" in out
|
||||
|
||||
|
||||
def test_a_declared_test_still_collected_with_a_parameter_is_red_and_excuses_nothing(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test()])
|
||||
still = GREEN[:3] + [_case(FILE_A, "test_gone[p1]")] # 4 tests, the floor of 4 lowered by the entry
|
||||
code, _r = _judge(tmp_path, still, extra=["--main-required", str(main)])
|
||||
out = capsys.readouterr().out
|
||||
assert code == 1 and "still collects it" in out and "went down" in out
|
||||
|
||||
|
||||
def test_the_retired_tests_of_the_branch_excuse_nothing(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, None)
|
||||
(tmp_path / verdict.RETIRED_NAME).write_text(json.dumps([_retired_test()]), encoding="utf-8")
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
@pytest.mark.parametrize("bad, why", [
|
||||
({"nodeid": FILE_A}, "nodeid must be"),
|
||||
({"nodeid": FILE_A + "::"}, "nodeid must be"),
|
||||
({"nodeid": "::test_gone"}, "nodeid must be"),
|
||||
({"nodeid": 3}, "nodeid must be"),
|
||||
({"suite": "s.unknown"}, "not a row of main"),
|
||||
({"suite": ""}, "suite must be"),
|
||||
({"count": 0}, "count must be"),
|
||||
({"from_min_tests": 0}, "from_min_tests must be"),
|
||||
({"count": 3, "from_min_tests": 2}, "from_min_tests must be"),
|
||||
({"from_min_tests": "5"}, "from_min_tests must be"),
|
||||
({"from_min_tests": None}, "from_min_tests must be"),
|
||||
({"count": True}, "count must be"),
|
||||
({"count": "1"}, "count must be"),
|
||||
({"reason": ""}, "reason must be"),
|
||||
({"decided_by": ""}, "decided_by must be"),
|
||||
({"decided_by": None}, "decided_by must be"),
|
||||
({"date": ""}, "date must be"),
|
||||
({"file": GONE, "tests": {"s.one": 1}}, "not both"),
|
||||
])
|
||||
def test_a_malformed_retired_test_of_main_is_red(tmp_path, monkeypatch, capsys, bad, why):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test(**bad)])
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
out = capsys.readouterr().out
|
||||
assert code == 1 and "retired list of main" in out and why in out, out
|
||||
assert why in " ".join(verdict.validate_retired([_retired_test(**bad)], {"s.one"}))
|
||||
|
||||
|
||||
def test_the_same_test_declared_twice_for_a_suite_is_red():
|
||||
assert any("more than once" in p for p in verdict.validate_retired([_retired_test(), _retired_test()], {"s.one"}))
|
||||
assert verdict.validate_retired([_retired_test(), _retired_test(suite="s.two")], {"s.one", "s.two"}) == []
|
||||
|
||||
|
||||
def test_files_and_tests_may_share_the_list():
|
||||
assert verdict.validate_retired([_retired(), _retired_test()], {"s.one"}) == []
|
||||
|
||||
|
||||
def test_an_entry_allows_the_drop_only_while_main_still_has_the_floor_it_was_written_at(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test(from_min_tests=5)], min_tests=5)
|
||||
assert _judge(tmp_path, GREEN, extra=["--main-required", str(main)])[0] == 0
|
||||
capsys.readouterr()
|
||||
# the removal is on main: its floor is 4, the entry was written at 5 and is inert, so a further drop is red
|
||||
sub = tmp_path / "later"
|
||||
sub.mkdir()
|
||||
main = _main_that_had_the_test(sub, [_retired_test(from_min_tests=5)], min_tests=4)
|
||||
code, _r = _judge(sub, GREEN, rows=[_suite(min_tests=3)], extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_an_inert_entry_asks_nothing_of_a_suite_that_collects_the_test_again(tmp_path, monkeypatch):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_the_test(tmp_path, [_retired_test(from_min_tests=5)], min_tests=4)
|
||||
again = GREEN + [_case(FILE_A, "test_gone")]
|
||||
assert _judge(tmp_path, again, rows=[_suite(min_tests=5)], extra=["--main-required", str(main)])[0] == 0
|
||||
|
||||
|
||||
def test_the_entries_of_one_suite_must_share_one_from_min_tests():
|
||||
both = [_retired_test(from_min_tests=5), _retired_test(FILE_B + "::t", from_min_tests=6)]
|
||||
assert any("disagree on from_min_tests" in p for p in verdict.validate_retired(both, {"s.one"}))
|
||||
assert verdict.validate_retired([_retired_test(from_min_tests=5), _retired_test(FILE_B + "::t", from_min_tests=5)], {"s.one"}) == []
|
||||
other = [_retired_test(from_min_tests=5), _retired_test(FILE_B + "::t", suite="s.two", from_min_tests=9)]
|
||||
assert verdict.validate_retired(other, {"s.one", "s.two"}) == []
|
||||
|
||||
|
||||
# --- args --------------------------------------------------------------------------------------------------------
|
||||
def test_args_prints_the_files_and_node_ids_one_per_line(tmp_path, capsys):
|
||||
required = _write_required(tmp_path / "required.json", [_suite()])
|
||||
@@ -689,7 +836,10 @@ def test_the_real_retired_list_is_well_formed_and_names_rows_that_exist():
|
||||
assert verdict.validate_retired(data) == []
|
||||
ids = {r["id"] for r in _real()}
|
||||
for entry in data:
|
||||
assert set(entry["tests"]) <= ids, entry["file"]
|
||||
if "nodeid" in entry:
|
||||
assert entry["suite"] in ids, entry["nodeid"]
|
||||
else:
|
||||
assert set(entry["tests"]) <= ids, entry["file"]
|
||||
|
||||
|
||||
def test_the_tests_a_retired_file_had_are_what_the_collection_counts_while_it_exists():
|
||||
@@ -699,6 +849,8 @@ def test_the_tests_a_retired_file_had_are_what_the_collection_counts_while_it_ex
|
||||
import sys
|
||||
markers = {r["id"]: r["marker"] for r in _real()}
|
||||
for entry in json.loads(RETIRED.read_text(encoding="utf-8")):
|
||||
if "nodeid" in entry:
|
||||
continue # a retired test is counted by the next test
|
||||
if not (ROOT / entry["file"]).is_file():
|
||||
continue
|
||||
for row, declared in entry["tests"].items():
|
||||
@@ -708,6 +860,27 @@ def test_the_tests_a_retired_file_had_are_what_the_collection_counts_while_it_ex
|
||||
assert counted == declared, "%s in %s: declared %d, collected %d" % (entry["file"], row, declared, counted)
|
||||
|
||||
|
||||
def test_every_retired_test_names_a_file_its_row_runs_and_counts_what_the_collection_counts_while_it_exists():
|
||||
"""A retired test leaves a file that stays, in a row that lists that file or that very node id; while the test is still defined in the tree
|
||||
(the PR that removes it deletes it) its count is the number of tests the row's marker collects under that node id."""
|
||||
import subprocess
|
||||
import sys
|
||||
rows = {r["id"]: r for r in _real()}
|
||||
for entry in json.loads(RETIRED.read_text(encoding="utf-8")):
|
||||
if "nodeid" not in entry:
|
||||
continue
|
||||
nid, row = entry["nodeid"], rows[entry["suite"]]
|
||||
path, _sep, name = nid.partition("::")
|
||||
assert nid in row["tests"] or path in row["tests"], "%s is not run by %s" % (nid, row["id"])
|
||||
assert (ROOT / path).is_file(), "%s: the file of a retired test stays" % nid
|
||||
if _node_problems(row["id"], path, name, ROOT):
|
||||
continue # already out of the tree
|
||||
done = subprocess.run([sys.executable, "-m", "pytest", "--collect-only", "-q", "-p", "no:cacheprovider", "-o", "addopts=",
|
||||
"-m", row["marker"], nid], cwd=str(ROOT), capture_output=True, text=True)
|
||||
counted = sum(1 for line in done.stdout.splitlines() if "::" in line)
|
||||
assert counted == entry["count"], "%s in %s: declared %d, collected %d" % (nid, row["id"], entry["count"], counted)
|
||||
|
||||
|
||||
WHOLE_SUITE_MARKER = "not slow and not e2e" # the exact expression of the unit job of tests.yml (pyproject addopts)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
r"""Every Windows job that launches a browser has TEMP and TMP on D:, set on the job.
|
||||
|
||||
The profile of every Firefox the tests launch is made in TEMP. On the Windows runners of GitHub the default TEMP is on C:, and four browsers at
|
||||
once saturate that disk (a queue up to 144, latencies up to 4 s): the parent's main thread stays still 40-60 s and the e2e fail at random
|
||||
(a `goto` that hangs, a start that never answers). Measured on 20/11 with two hunts: the profiles on C: took 5 of 4 shards, TEMP and TMP on
|
||||
`D:\a\_temp` took none. A test cannot fail for a reason that is not its own, so the fix is at the source: the job's `env` names D:.
|
||||
|
||||
`runner.temp` is not readable in a job's `env` (only `github`, `needs`, `strategy`, `matrix`, `inputs`, `secrets` and `vars` are), so the job
|
||||
names the runner's temp folder itself: `D:\a\_temp`, which the runner makes before the first step. A job that runs on both systems says
|
||||
`startsWith(<where it runs>, 'windows') && 'D:\a\_temp' || '/tmp'` (`/tmp` is what Linux uses anyway).
|
||||
|
||||
PyYAML is not a dependency of this package, so the workflows are read line by line: a job is the block under ` <id>:` below `jobs:`, its
|
||||
fields are the ones at four spaces, its `env` the keys at six, where it runs the values of the matrix key (or workflow input) its `runs-on` names.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
WORKFLOWS = Path(__file__).resolve().parents[1] / ".github" / "workflows"
|
||||
BS = chr(92)
|
||||
D_TEMP = "D:" + BS + "a" + BS + "_temp"
|
||||
|
||||
#: A Windows job that is left alone, and why. Nothing else is. (Empty: every Windows job of this repository launches a browser.)
|
||||
EXEMPT: dict[tuple[str, str], str] = {}
|
||||
|
||||
CONDITIONAL = re.compile(
|
||||
r"^\$\{\{\s*startsWith\((?P<ctx>(?:matrix|inputs)\.\w+),\s*'windows'\)\s*&&\s*'(?P<win>[^']*)'\s*\|\|\s*'(?P<other>[^']*)'\s*\}\}$")
|
||||
CONTEXT = re.compile(r"^\$\{\{\s*(?:matrix|inputs)\.(\w+)\s*\}\}$")
|
||||
JOB = re.compile(r"^ ([\w-]+):\s*$")
|
||||
|
||||
|
||||
def _jobs(text: str) -> dict[str, list[str]]:
|
||||
lines = text.split("\n")
|
||||
start = next(i for i, line in enumerate(lines) if line == "jobs:")
|
||||
jobs, current = {}, None
|
||||
for line in lines[start + 1:]:
|
||||
m = JOB.match(line)
|
||||
if m:
|
||||
current = jobs.setdefault(m.group(1), [])
|
||||
elif current is not None:
|
||||
current.append(line)
|
||||
return jobs
|
||||
|
||||
|
||||
def _field(block: list[str], key: str):
|
||||
for line in block:
|
||||
m = re.match(r"^ %s:\s*(.*?)\s*$" % re.escape(key), line)
|
||||
if m:
|
||||
return m.group(1)
|
||||
return None
|
||||
|
||||
|
||||
def _env(block: list[str]) -> dict[str, str]:
|
||||
out, inside = {}, False
|
||||
for line in block:
|
||||
if re.match(r"^ env:\s*$", line):
|
||||
inside = True
|
||||
elif inside:
|
||||
m = re.match(r"^ ([\w.-]+):\s*(.*?)\s*$", line)
|
||||
if m:
|
||||
out[m.group(1)] = m.group(2)
|
||||
elif line.strip() and not line.strip().startswith("#"):
|
||||
inside = False
|
||||
return out
|
||||
|
||||
|
||||
def _strip(value: str) -> str:
|
||||
return value[1:-1] if len(value) >= 2 and value[0] == value[-1] and value[0] in "'\"" else value
|
||||
|
||||
|
||||
def _values_of(text: str, block: list[str], context: str, key: str) -> list[str]:
|
||||
"""The values `key` takes: in the job's matrix (`key: [a, b]` or `{ key: a, ... }` rows), or the options of the workflow input of that name."""
|
||||
if context == "inputs":
|
||||
options = re.search(r"^ %s:\n(?: .*\n)*? options:\n((?: - .*\n)+)" % re.escape(key), text, re.M)
|
||||
return [_strip(x.strip()) for x in re.findall(r"- (.*)", options.group(1))] if options else []
|
||||
out = []
|
||||
for line in block:
|
||||
m = re.match(r"^\s+%s:\s*\[(.*)\]\s*$" % re.escape(key), line)
|
||||
if m:
|
||||
out += [_strip(x.strip()) for x in m.group(1).split(",") if x.strip()]
|
||||
out += [_strip(x) for x in re.findall(r"[{,]\s*%s:\s*([^,}\s]+)" % re.escape(key), line)]
|
||||
return out
|
||||
|
||||
|
||||
def windows_jobs_without_temp_on_d(name: str, text: str) -> list[str]:
|
||||
"""One line per Windows leg of the workflow whose TEMP or TMP is not on D:."""
|
||||
problems = []
|
||||
for job_id, block in _jobs(text).items():
|
||||
runs_on = _field(block, "runs-on")
|
||||
if runs_on is None or (name, job_id) in EXEMPT:
|
||||
continue
|
||||
m = CONTEXT.match(runs_on)
|
||||
if m:
|
||||
context = re.search(r"(matrix|inputs)", runs_on).group(1)
|
||||
legs = [(v, {context + "." + m.group(1): v}) for v in _values_of(text, block, context, m.group(1))]
|
||||
else:
|
||||
legs = [(runs_on, {})]
|
||||
env = _env(block)
|
||||
for runner, leg in legs:
|
||||
if "windows" not in runner:
|
||||
continue
|
||||
for var in ("TEMP", "TMP"):
|
||||
value = None
|
||||
if var in env:
|
||||
raw = env[var]
|
||||
c = CONDITIONAL.match(_strip(raw)) or CONDITIONAL.match(raw)
|
||||
if c:
|
||||
value = _strip(c.group("win")) if leg.get(c.group("ctx"), "").startswith("windows") else c.group("other")
|
||||
else:
|
||||
value = _strip(raw)
|
||||
if value is None or not value.upper().startswith("D:" + BS):
|
||||
problems.append("%s: job `%s` on %s has %s=%r, not a folder on D:" % (name, job_id, runner, var, value))
|
||||
return problems
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", sorted(WORKFLOWS.glob("*.yml")), ids=lambda p: p.name)
|
||||
def test_every_windows_job_keeps_the_profiles_on_d(path):
|
||||
assert windows_jobs_without_temp_on_d(path.name, path.read_text(encoding="utf-8")) == []
|
||||
|
||||
|
||||
def test_the_windows_jobs_that_launch_a_browser_are_all_seen():
|
||||
"""The check must find the legs it is meant to judge: a parser that sees none says fine to everything."""
|
||||
seen = {}
|
||||
for path in WORKFLOWS.glob("*.yml"):
|
||||
text = path.read_text(encoding="utf-8")
|
||||
for job_id, block in _jobs(text).items():
|
||||
runs_on = _field(block, "runs-on") or ""
|
||||
m = CONTEXT.match(runs_on)
|
||||
values = _values_of(text, block, re.search(r"(matrix|inputs)", runs_on).group(1), m.group(1)) if m else [runs_on]
|
||||
if any("windows" in v for v in values):
|
||||
seen[(path.name, job_id)] = True
|
||||
expected = {("e2e.yml", "e2e-windows"), ("e2e.yml", "e2e-windows-control-a"), ("fakeweb.yml", "walk"), ("tests.yml", "unit"),
|
||||
("firefox-launch-matrix.yml", "smoke"), ("real-sites.yml", "round"), ("real-sites.yml", "admit"),
|
||||
("user-install.yml", "install"), ("e2e-hunt.yml", "hunt")}
|
||||
assert expected <= set(seen), "the check does not see %s" % sorted(expected - set(seen))
|
||||
|
||||
|
||||
def _wf(runs_on, env="", matrix=""):
|
||||
text = "jobs:\n a:\n runs-on: %s\n" % runs_on
|
||||
if env:
|
||||
text += " env:\n" + "".join(" %s: %s\n" % kv for kv in env)
|
||||
return text + matrix + " steps:\n - run: x\n"
|
||||
|
||||
|
||||
def test_the_check_sees_what_it_is_meant_to_see():
|
||||
"""A check that has only ever said fine is not known to say anything else."""
|
||||
check = windows_jobs_without_temp_on_d
|
||||
assert check("x.yml", _wf("windows-2022")), "a Windows job with no TEMP passed"
|
||||
assert len(check("x.yml", _wf("windows-2022", [("TEMP", "C:" + BS + "t"), ("TMP", "'" + D_TEMP + "'")]))) == 1, "TEMP on C: passed"
|
||||
assert len(check("x.yml", _wf("windows-2022", [("TEMP", "'" + D_TEMP + "'")]))) == 1, "a job with TEMP and no TMP passed"
|
||||
assert check("x.yml", _wf("windows-2022", [("TEMP", "'" + D_TEMP + "'"), ("TMP", "'" + D_TEMP + "'")])) == []
|
||||
cond = "${{ startsWith(matrix.os, 'windows') && '" + D_TEMP + "' || '/tmp' }}"
|
||||
matrix = " strategy:\n matrix:\n os: [ubuntu-24.04, windows-latest]\n"
|
||||
assert check("x.yml", _wf("${{ matrix.os }}", [("TEMP", cond), ("TMP", cond)], matrix)) == []
|
||||
wrong_way = cond.replace("'" + D_TEMP + "' || '/tmp'", "'/tmp' || '" + D_TEMP + "'")
|
||||
assert len(check("x.yml", _wf("${{ matrix.os }}", [("TEMP", wrong_way), ("TMP", wrong_way)], matrix))) == 2, "a matrix job on C: on Windows passed"
|
||||
assert len(check("x.yml", _wf("${{ matrix.os }}", None, matrix))) == 2, "a matrix job with no TEMP passed"
|
||||
include = " strategy:\n matrix:\n include:\n - { os: linux, runner: ubuntu-24.04 }\n - { os: windows, runner: windows-2022 }\n"
|
||||
assert len(check("x.yml", _wf("${{ matrix.runner }}", None, include))) == 2, "a Windows leg of an `include` matrix was not seen"
|
||||
assert check("x.yml", _wf("ubuntu-24.04")) == [], "a Linux job was judged"
|
||||
inputs = "on:\n workflow_dispatch:\n inputs:\n os:\n type: choice\n options:\n - ubuntu-24.04\n - windows-latest\n"
|
||||
assert len(check("x.yml", inputs + _wf("${{ inputs.os }}"))) == 2, "a Windows option of a workflow input was not seen"
|
||||
@@ -1020,7 +1020,7 @@ def test_neither_entry_point_decides_the_cursor_default(cls):
|
||||
What the value IS gets asserted where it lives, in the core's own suite,
|
||||
and end to end by `test_the_show_cursor_kwarg_reaches_the_prefs`.
|
||||
|
||||
(Owner decision 2026-08-28: on. Camoufox ships it on too. The argument for
|
||||
(Owner decision 2026-08-28: on. The studied system ships it on too. The argument for
|
||||
off has not gone away and is recorded next to the constant: a pointer
|
||||
gliding across a window with nobody touching the mouse reads as "this is a
|
||||
bot" to any person glancing at the monitor.)
|
||||
|
||||
+53
-136
@@ -1,36 +1,27 @@
|
||||
"""E2E: run the REAL open-source detectors against the patched binary, on CI.
|
||||
"""E2E: run the REAL open-source detector libraries against the patched binary, on CI.
|
||||
|
||||
Instead of our own hand-rolled signal checks, this loads the actual detection
|
||||
libraries and uses their FULL API surface:
|
||||
|
||||
* BotD (@fingerprintjs/botd, MIT) - the client-side bot detector that
|
||||
FingerprintJS Pro itself uses. We assert the aggregate verdict
|
||||
* The client-side bot detector (MIT) - the one a commercial fingerprinting
|
||||
service itself uses. We assert the aggregate verdict
|
||||
(``detect().bot == False``) AND every one of its ~18 individual detectors
|
||||
(``getDetections()``) returns ``bot == False``.
|
||||
* FingerprintJS open-source (MIT) - ``get()`` must return a ``visitorId``
|
||||
* The open-source fingerprint library (MIT) - ``get()`` must return a ``visitorId``
|
||||
that is STABLE across two fresh launches with the same seed, and a RICH
|
||||
component set (the fingerprint surface is real, not a stub).
|
||||
* fpscanner (antoinevastel/fpscanner 1.0.6, MIT) - ``collectFingerprint()``
|
||||
* The automation-rules scanner (version 1.0.6, MIT) - ``collectFingerprint()``
|
||||
runs ~21 bot-detection rules in the browser. We assert the **engine-agnostic**
|
||||
subset (webdriver / selenium / bot-UA / platform / timezone / language) is
|
||||
clean. We deliberately do NOT assert the Chrome/GPU-only rules (hasCDP,
|
||||
hasPlaywright, hasSwiftshaderRenderer, hasMissingChromeObject, …): they're
|
||||
trivially clean on Firefox, and the GPU ones can legitimately fire on a
|
||||
software-WebGL CI host (Xvfb/llvmpipe) - asserting them would false-red.
|
||||
* CreepJS (abrahamjuliot/creepjs, MIT, pinned) - the gold-standard Firefox-aware
|
||||
headless/stealth/lie detector. It exposes its result on ``window.Fingerprint``.
|
||||
We assert ``headlessRating == 0`` (webdriver + headless-UA tells) and the
|
||||
JS-proxy stealth tells are absent. ``stealthRating`` / ``totalLies`` /
|
||||
``likeHeadlessRating`` are LOGGED, not hard-asserted, because some of their
|
||||
sub-signals (hasBadWebGL, prefers-light-color) are GPU/theme-sensitive and
|
||||
differ on a GPU-less CI host.
|
||||
|
||||
Everything is hermetic: the libraries are vendored (tests/vendor/) and served
|
||||
from a localhost HTTP server - no external CDN call. For CreepJS, every non-local
|
||||
request is aborted, so its optional crowd-comparison POST never runs and the
|
||||
verdict is computed purely locally. Runs identically on a dev box and a GH runner.
|
||||
from a localhost HTTP server - no external CDN call. Runs identically on a dev box and a GH runner.
|
||||
|
||||
NOT covered: FingerprintJS *Pro* (commercial, server-side) - stays the local
|
||||
NOT covered: the commercial, server-side service built on the fingerprint library - stays the local
|
||||
realness gate.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -46,17 +37,16 @@ from invisible_playwright import InvisiblePlaywright
|
||||
from _servers import LocalServer
|
||||
|
||||
_VENDOR = Path(__file__).parent / "vendor"
|
||||
_BOTD = "botd-2.0.0.esm.js"
|
||||
_FPJS = "fingerprintjs-5.2.0.umd.min.js"
|
||||
_FPSCANNER = "fpscanner-1.0.6.es.js"
|
||||
_CREEPJS = "creepjs-10aa672.js" # pinned abrahamjuliot/creepjs@10aa6724
|
||||
_BOT_DETECTOR = "bot-detector-2.0.0.esm.js"
|
||||
_FINGERPRINT_LIB = "fingerprint-library-5.2.0.umd.min.js"
|
||||
_RULES_SCANNER = "rules-scanner-1.0.6.es.js"
|
||||
|
||||
# fpscanner rules that are MEANINGFUL on Firefox and GPU-independent - these must
|
||||
# rules-scanner rules that are MEANINGFUL on Firefox and GPU-independent - these must
|
||||
# stay clean. The omitted rules are Chrome-only (hasCDP/hasPlaywright/
|
||||
# hasMissingChromeObject/hasHighCPUCount/hasImpossibleDeviceMemory/
|
||||
# headlessChromeScreenResolution) or GPU-sensitive on a software-WebGL CI host
|
||||
# (hasSwiftshaderRenderer/hasGPUMismatch/hasMismatchWebGLInWorker).
|
||||
_FPSCANNER_AGNOSTIC = [
|
||||
_RULES_SCANNER_AGNOSTIC = [
|
||||
"hasWebdriver", "hasWebdriverIframe", "hasWebdriverWorker", "hasWebdriverWritable",
|
||||
"hasSeleniumProperty", "hasBotUserAgent", "hasPlatformMismatch",
|
||||
"hasMismatchLanguages", "hasUTCTimezone", "hasMismatchPlatformIframe",
|
||||
@@ -65,29 +55,31 @@ _FPSCANNER_AGNOSTIC = [
|
||||
|
||||
_PAGE = f"""<!doctype html><html><head><meta charset="utf-8">
|
||||
<title>detectors</title>
|
||||
<script src="/{_FPJS}"></script>
|
||||
<script>const knownGlobals = new Set(Object.getOwnPropertyNames(window));</script>
|
||||
<script src="/{_FINGERPRINT_LIB}"></script>
|
||||
<script>window.__fpLib = window[Object.getOwnPropertyNames(window).find(n => !knownGlobals.has(n))];</script>
|
||||
</head><body><h1 id="state">loading</h1>
|
||||
<script type="module">
|
||||
window.__botd = null; window.__fp = null; window.__fps = null; window.__err = "";
|
||||
window.__bot_det = null; window.__fp = null; window.__fps = null; window.__err = "";
|
||||
(async () => {{
|
||||
try {{
|
||||
const Botd = await import("/{_BOTD}");
|
||||
const botd = await Botd.load();
|
||||
const verdict = botd.detect();
|
||||
const raw = botd.getDetections() || {{}};
|
||||
const Detector = await import("/{_BOT_DETECTOR}");
|
||||
const bot_det = await Detector.load();
|
||||
const verdict = bot_det.detect();
|
||||
const raw = bot_det.getDetections() || {{}};
|
||||
const detections = {{}};
|
||||
for (const k in raw) detections[k] = {{ bot: raw[k].bot, botKind: raw[k].botKind || null }};
|
||||
window.__botd = {{ bot: verdict.bot, botKind: verdict.botKind || null, detections }};
|
||||
}} catch (e) {{ window.__err += " botd:" + e; }}
|
||||
window.__bot_det = {{ bot: verdict.bot, botKind: verdict.botKind || null, detections }};
|
||||
}} catch (e) {{ window.__err += " bot_det:" + e; }}
|
||||
try {{
|
||||
const fp = await FingerprintJS.load();
|
||||
const fp = await window.__fpLib.load();
|
||||
const r = await fp.get();
|
||||
const keys = Object.keys(r.components || {{}});
|
||||
const errored = keys.filter(k => r.components[k] && "error" in r.components[k]);
|
||||
window.__fp = {{ visitorId: r.visitorId, componentKeys: keys, erroredComponents: errored }};
|
||||
}} catch (e) {{ window.__err += " fp:" + e; }}
|
||||
try {{
|
||||
const M = await import("/{_FPSCANNER}");
|
||||
const M = await import("/{_RULES_SCANNER}");
|
||||
const scanner = new M.default();
|
||||
const fp = await scanner.collectFingerprint({{ encrypt: false }});
|
||||
window.__fps = {{ fastBotDetection: fp.fastBotDetection, details: fp.fastBotDetectionDetails }};
|
||||
@@ -96,20 +88,12 @@ window.__botd = null; window.__fp = null; window.__fps = null; window.__err = ""
|
||||
}})();
|
||||
</script></body></html>"""
|
||||
|
||||
# CreepJS gets its own page: creep.js is a plain `defer` script that runs on load
|
||||
# and populates window.Fingerprint. A minimal DOM is enough (the rich report DOM
|
||||
# is only for the visual page, not the computation).
|
||||
_CREEP_PAGE = f"""<!doctype html><html><head><meta charset="utf-8"><title>creep</title></head>
|
||||
<body><div id="fingerprint-data"></div><script src="/{_CREEPJS}" defer></script></body></html>"""
|
||||
|
||||
|
||||
class _DetectorSite:
|
||||
"""Localhost server: `/` → BotD+FPJS+fpscanner page, `/creepjs` → CreepJS page,
|
||||
"""Localhost server: `/` → bot detector + fingerprint library + rules scanner page,
|
||||
`/<file>` → the vendored bundle."""
|
||||
|
||||
def __init__(self):
|
||||
page = _PAGE.encode()
|
||||
creep_page = _CREEP_PAGE.encode()
|
||||
# Preload the vendored bundle by exact filename. Serving from this map
|
||||
# means a request never builds a filesystem path from its own input, so
|
||||
# there is no path a crafted request could traverse.
|
||||
@@ -120,8 +104,6 @@ class _DetectorSite:
|
||||
p = self.path.split("?")[0]
|
||||
if p == "/":
|
||||
body, ctype = page, "text/html; charset=utf-8"
|
||||
elif p == "/creepjs":
|
||||
body, ctype = creep_page, "text/html; charset=utf-8"
|
||||
else:
|
||||
body = files.get(Path(p.lstrip("/")).name)
|
||||
if body is None:
|
||||
@@ -144,10 +126,6 @@ class _DetectorSite:
|
||||
def url(self):
|
||||
return f"http://127.0.0.1:{self.port}/"
|
||||
|
||||
@property
|
||||
def creep_url(self):
|
||||
return f"http://127.0.0.1:{self.port}/creepjs"
|
||||
|
||||
def close(self):
|
||||
self._srv.shutdown()
|
||||
|
||||
@@ -160,7 +138,7 @@ def detector_site():
|
||||
|
||||
|
||||
def _run_detectors(firefox_binary, url):
|
||||
"""Launch the binary, load the page, return (botd, fp, fps, err)."""
|
||||
"""Launch the binary, load the page, return (bot_det, fp, fps, err)."""
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(url, wait_until="load", timeout=45000)
|
||||
@@ -168,64 +146,31 @@ def _run_detectors(firefox_binary, url):
|
||||
"() => document.getElementById('state').textContent === 'done'",
|
||||
timeout=45000,
|
||||
)
|
||||
botd = page.evaluate("() => window.__botd")
|
||||
bot_det = page.evaluate("() => window.__bot_det")
|
||||
fp = page.evaluate("() => window.__fp")
|
||||
fps = page.evaluate("() => window.__fps")
|
||||
err = page.evaluate("() => window.__err")
|
||||
return botd, fp, fps, err
|
||||
|
||||
|
||||
def _run_creepjs(firefox_binary, creep_url):
|
||||
"""Launch the binary, run CreepJS fully offline, return its headless result."""
|
||||
_EV = """() => {
|
||||
const f = window.Fingerprint;
|
||||
if (!f || !f.headless) return { ready: false };
|
||||
const h = f.headless;
|
||||
return {
|
||||
ready: true,
|
||||
headlessRating: h.headlessRating,
|
||||
stealthRating: h.stealthRating,
|
||||
likeHeadlessRating: h.likeHeadlessRating,
|
||||
headless: h.headless || {},
|
||||
stealth: h.stealth || {},
|
||||
totalLies: (f.lies && f.lies.totalLies) || 0,
|
||||
};
|
||||
}"""
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary) as browser:
|
||||
page = browser.new_page()
|
||||
# NetworkObserver was stripped to the bone on 2026-08-24: page.route()
|
||||
# no longer exists (Network.setRequestInterception refuses), so
|
||||
# blocking CreepJS's optional POST to arh.antoinevastel.com can no
|
||||
# longer be done this way. Verified: without the block the test still
|
||||
# passes, with the same outcome on headlessRating/stealth - that POST
|
||||
# was test-hygiene isolation (speed, no dependency on a third-party
|
||||
# site), not a precondition of the assertions.
|
||||
page.goto(creep_url, wait_until="domcontentloaded", timeout=45000)
|
||||
page.wait_for_function(
|
||||
"() => !!(window.Fingerprint && window.Fingerprint.headless)",
|
||||
timeout=60000,
|
||||
)
|
||||
return page.evaluate(_EV)
|
||||
return bot_det, fp, fps, err
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_botd_no_detector_flags_automation(firefox_binary, detector_site):
|
||||
"""The real BotD must not flag the build - aggregate AND every one of its
|
||||
def test_the_bot_detector_flags_no_automation(firefox_binary, detector_site):
|
||||
"""The real bot detector must not flag the build - aggregate AND every one of its
|
||||
individual detectors (webDriver/userAgent/appVersion/plugins/process/...)."""
|
||||
botd, _fp, _fps, err = _run_detectors(firefox_binary, detector_site.url)
|
||||
assert botd is not None, f"BotD produced no result (err:{err!r})"
|
||||
assert botd.get("bot") is False, (
|
||||
f"BotD aggregate flagged a bot: botKind={botd.get('botKind')!r}"
|
||||
bot_det, _fp, _fps, err = _run_detectors(firefox_binary, detector_site.url)
|
||||
assert bot_det is not None, f"the bot detector produced no result (err:{err!r})"
|
||||
assert bot_det.get("bot") is False, (
|
||||
f"the bot detector aggregate flagged a bot: botKind={bot_det.get('botKind')!r}"
|
||||
)
|
||||
detections = botd.get("detections") or {}
|
||||
assert detections, f"BotD getDetections() returned nothing (err:{err!r})"
|
||||
detections = bot_det.get("detections") or {}
|
||||
assert detections, f"the bot detector getDetections() returned nothing (err:{err!r})"
|
||||
flagged = {k: v.get("botKind") for k, v in detections.items() if v.get("bot")}
|
||||
assert not flagged, f"BotD individual detectors flagged automation: {flagged}"
|
||||
assert not flagged, f"the bot detector individual detectors flagged automation: {flagged}"
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fingerprintjs_visitorid_stable_across_launches(firefox_binary, detector_site):
|
||||
"""FingerprintJS visitorId must be present and identical across two fresh
|
||||
def test_the_fingerprint_library_visitorid_is_stable_across_launches(firefox_binary, detector_site):
|
||||
"""The fingerprint library visitorId must be present and identical across two fresh
|
||||
launches with the same seed - a real browser is stable; an over-randomized
|
||||
spoof drifts (and a drifting fingerprint is itself a bot tell)."""
|
||||
_b1, fp1, _f1, err1 = _run_detectors(firefox_binary, detector_site.url)
|
||||
@@ -233,71 +178,43 @@ def test_fingerprintjs_visitorid_stable_across_launches(firefox_binary, detector
|
||||
assert fp1 and fp1.get("visitorId"), f"no visitorId on run 1 (err:{err1!r})"
|
||||
assert fp2 and fp2.get("visitorId"), f"no visitorId on run 2 (err:{err2!r})"
|
||||
assert fp1["visitorId"] == fp2["visitorId"], (
|
||||
f"FingerprintJS visitorId drifted across launches: "
|
||||
f"the fingerprint library visitorId drifted across launches: "
|
||||
f"{fp1['visitorId']!r} != {fp2['visitorId']!r} (per-session entropy = bot tell)"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fingerprintjs_collects_rich_fingerprint(firefox_binary, detector_site):
|
||||
"""FingerprintJS must collect a RICH component surface (a real browser
|
||||
def test_the_fingerprint_library_collects_a_rich_fingerprint(firefox_binary, detector_site):
|
||||
"""The fingerprint library must collect a RICH component surface (a real browser
|
||||
exposes many signals; a stripped/blocked surface is itself suspicious)."""
|
||||
_b, fp, _f, err = _run_detectors(firefox_binary, detector_site.url)
|
||||
assert fp and fp.get("visitorId"), f"FingerprintJS produced no id (err:{err!r})"
|
||||
assert fp and fp.get("visitorId"), f"the fingerprint library produced no id (err:{err!r})"
|
||||
keys = fp.get("componentKeys") or []
|
||||
assert len(keys) >= 15, (
|
||||
f"FingerprintJS collected only {len(keys)} components - surface too thin "
|
||||
f"the fingerprint library collected only {len(keys)} components - surface too thin "
|
||||
f"(suppressed signals are themselves a tell): {keys}"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpscanner_no_automation_rules(firefox_binary, detector_site):
|
||||
"""fpscanner's engine-agnostic bot rules (webdriver/selenium/bot-UA/platform/
|
||||
def test_the_rules_scanner_flags_no_automation_rule(firefox_binary, detector_site):
|
||||
"""The rules scanner's engine-agnostic bot rules (webdriver/selenium/bot-UA/platform/
|
||||
timezone/language) must all be clean. The Chrome/GPU-only rules are ignored
|
||||
on purpose (see module docstring) - they false-red on a software-WebGL host."""
|
||||
_b, _fp, fps, err = _run_detectors(firefox_binary, detector_site.url)
|
||||
assert fps is not None, f"fpscanner produced no result (err:{err!r})"
|
||||
assert fps is not None, f"the rules scanner produced no result (err:{err!r})"
|
||||
details = fps.get("details") or {}
|
||||
assert details, f"fpscanner returned no detection details (err:{err!r})"
|
||||
assert details, f"the rules scanner returned no detection details (err:{err!r})"
|
||||
flagged = [
|
||||
k for k in _FPSCANNER_AGNOSTIC
|
||||
k for k in _RULES_SCANNER_AGNOSTIC
|
||||
if details.get(k) and details[k].get("detected")
|
||||
]
|
||||
assert not flagged, (
|
||||
f"fpscanner flagged automation on engine-agnostic rules: {flagged} "
|
||||
f"the rules scanner flagged automation on engine-agnostic rules: {flagged} "
|
||||
f"(full details: { {k: v for k, v in details.items() if v.get('detected')} })"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_creepjs_headless_and_proxy_clean(firefox_binary, detector_site):
|
||||
"""CreepJS (Firefox-aware) must see no headless tell and no JS-proxy stealth
|
||||
tell. ``headlessRating`` aggregates webDriverIsOn + headless-UA checks (all
|
||||
GPU-independent). The proxy/runtime stealth sub-signals (hasIframeProxy,
|
||||
hasToStringProxy, hasBadChromeRuntime) must be false - a spoof implemented
|
||||
with a JS Proxy is exactly what CreepJS catches. stealthRating/totalLies/
|
||||
likeHeadlessRating are GPU/theme-sensitive, so we log them, not assert."""
|
||||
r = _run_creepjs(firefox_binary, detector_site.creep_url)
|
||||
assert r and r.get("ready"), f"CreepJS never populated window.Fingerprint: {r!r}"
|
||||
print(
|
||||
f"[creepjs] headlessRating={r['headlessRating']} stealthRating={r['stealthRating']} "
|
||||
f"likeHeadlessRating={r['likeHeadlessRating']} totalLies={r['totalLies']} "
|
||||
f"headless={r['headless']} stealth={r['stealth']}"
|
||||
)
|
||||
assert r["headlessRating"] == 0, (
|
||||
f"CreepJS headless tells fired: headless={r['headless']} "
|
||||
f"(headlessRating={r['headlessRating']})"
|
||||
)
|
||||
stealth = r.get("stealth") or {}
|
||||
proxy_tells = {
|
||||
k: stealth.get(k)
|
||||
for k in ("hasIframeProxy", "hasToStringProxy", "hasBadChromeRuntime")
|
||||
if stealth.get(k)
|
||||
}
|
||||
assert not proxy_tells, f"CreepJS JS-proxy stealth tells fired: {proxy_tells}"
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_enumerate_devices_resolves_promptly(firefox_binary, detector_site):
|
||||
"""navigator.mediaDevices.enumerateDevices() must RESOLVE, and quickly.
|
||||
@@ -306,11 +223,11 @@ def test_enumerate_devices_resolves_promptly(firefox_binary, detector_site):
|
||||
it even though it was the cause of four different failures.
|
||||
|
||||
The symptom that was visible was
|
||||
`test_fingerprintjs_visitorid_stable_across_launches` going red roughly one
|
||||
`test_the_fingerprint_library_visitorid_is_stable_across_launches` going red roughly one
|
||||
time in three - a name that sends you the wrong way, because it had nothing
|
||||
to do with either the identifier or its stability. The detectors page stayed
|
||||
at `state='loading'`: BotD finished, FingerprintJS finished, fpscanner did
|
||||
not. Inside fpscanner:
|
||||
at `state='loading'`: the bot detector finished, the fingerprint library finished, the rules scanner did
|
||||
not. Inside the rules scanner:
|
||||
|
||||
return new Promise(async function(t) {
|
||||
const a = await navigator.mediaDevices.enumerateDevices();
|
||||
|
||||
@@ -422,6 +422,7 @@ def test_a_real_page_sees_a_drag_that_travelled(firefox_binary):
|
||||
"""
|
||||
import urllib.parse
|
||||
|
||||
import _os_cursor
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
html = (
|
||||
@@ -445,6 +446,11 @@ def test_a_real_page_sees_a_drag_that_travelled(firefox_binary):
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("data:text/html," + urllib.parse.quote(html))
|
||||
# ⛔ THE OS CURSOR IS NOT IN THE WINDOW. A window under the real cursor gets a native move for it, the first native move of a process passes Gecko's
|
||||
# filter, and the page saw `mousemove 512,299 buttons=0` after the press (the runner's cursor is at 512,384, the window covers it). The cursor is
|
||||
# parked before the browser starts (`tests/_os_cursor.py`, the autouse fixture of conftest); here the test says it is still outside, so a gesture
|
||||
# judged by the events it records is never judged with the system's own move among them.
|
||||
_os_cursor.require_outside()
|
||||
page.mouse.move(300, 300)
|
||||
page.evaluate("() => { window.__e = []; }")
|
||||
page.drag_and_drop("#a", "#b")
|
||||
|
||||
@@ -137,3 +137,46 @@ def test_every_declared_refusal_is_still_refused():
|
||||
+ "\n ".join(stale)
|
||||
+ "\n\nRemove them: an inventory that describes a gap which has been "
|
||||
"closed is as wrong as one that misses a gap.")
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# Refusals of a PARAMETER of a served operation
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# The operations above are refused whole. A served operation can also refuse one parameter (or one value of it): `screenshot` refuses `mask`, `style`,
|
||||
# `animations="disabled"`, `caret="initial"` and `omitBackground` with png, because Playwright honours them by modifying the page. Those are keyed by
|
||||
# (operation, parameter) in `perimeter.REFUSED_PARAMETERS`, which holds the sentence the caller reads, and raised in `server.py` through
|
||||
# `_refuse_parameter(operation, parameter)`, the one function that reads that table. The wire-method budget is about operations and does not see them.
|
||||
def _parameter_refusals_in_the_server():
|
||||
tree = ast.parse(SERVER.read_text(encoding="utf-8"))
|
||||
found = set()
|
||||
for node in ast.walk(tree):
|
||||
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == "_refuse_parameter"
|
||||
and len(node.args) == 2 and all(isinstance(a, ast.Constant) for a in node.args)):
|
||||
found.add((node.args[0].value, node.args[1].value))
|
||||
return found
|
||||
|
||||
|
||||
def test_the_parameter_refusals_are_readable():
|
||||
"""The safety net: an empty derivation would make the two assertions below compare nothing with nothing."""
|
||||
assert len(_parameter_refusals_in_the_server()) >= 5, "no `_refuse_parameter(operation, parameter)` call found in server.py: the reader is broken"
|
||||
assert len(perimeter.REFUSED_PARAMETERS) >= 5
|
||||
|
||||
|
||||
def test_every_parameter_refusal_is_declared_in_the_perimeter():
|
||||
undeclared = sorted(_parameter_refusals_in_the_server() - set(perimeter.REFUSED_PARAMETERS))
|
||||
assert not undeclared, (
|
||||
"server.py refuses these parameters and perimeter.REFUSED_PARAMETERS does not name them:\n " + "\n ".join("%s.%s" % k for k in undeclared)
|
||||
+ "\nAdd each as (operation, parameter): the sentence a caller reads.")
|
||||
|
||||
|
||||
def test_every_declared_parameter_refusal_is_still_raised():
|
||||
stale = sorted(set(perimeter.REFUSED_PARAMETERS) - _parameter_refusals_in_the_server())
|
||||
assert not stale, (
|
||||
"these are declared in perimeter.REFUSED_PARAMETERS and server.py no longer raises them:\n " + "\n ".join("%s.%s" % k for k in stale)
|
||||
+ "\nRemove them: an inventory that describes a refusal that is gone is as wrong as one that misses one.")
|
||||
|
||||
|
||||
def test_a_parameter_refusal_is_a_sentence_a_person_can_act_on():
|
||||
for key, sentence in perimeter.REFUSED_PARAMETERS.items():
|
||||
assert isinstance(sentence, str) and len(sentence) >= len("Not implemented"), key
|
||||
assert perimeter.parameter_refusal(*key) == sentence
|
||||
@@ -0,0 +1,155 @@
|
||||
"""Every Windows job of e2e.yml that runs pytest keeps a full dump of a python.exe that crashes, inside the evidence it uploads.
|
||||
|
||||
The pytest-xdist worker (python.exe) died on the Windows e2e jobs with ``node down: Not properly terminated`` and ``Windows fatal exception: access violation``
|
||||
(jobs 138402013609 and 138966622085), in a thread Python has no state for, so faulthandler named no native frame. Windows Error Reporting writes a full user-mode
|
||||
dump of a process that dies from an unhandled exception when ``HKLM\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps\\python.exe`` says so
|
||||
(DumpFolder, DumpType 2 = full, DumpCount; https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps). faulthandler's handler on Windows is a vectored
|
||||
one that returns EXCEPTION_CONTINUE_SEARCH, so the exception goes on and WER still sees it.
|
||||
|
||||
For each Windows job that runs pytest (found by ``runs-on: windows-*``, so a new one is covered by itself):
|
||||
|
||||
* 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;
|
||||
* 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
|
||||
summary missing or not ``always()``, an upload that is not ``always()``. The green case is the state of the repository.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
E2E = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "e2e.yml"
|
||||
EXPECTED_WINDOWS_JOBS = {
|
||||
"e2e-windows-control-a", "e2e-windows", "e2e-network-windows", "e2e-host-windows", "e2e-page-windows", "e2e-page-final-windows",
|
||||
}
|
||||
SUMMARY_STEP = " - name: What Windows Error Reporting kept of a crashing python.exe (size, faulting module, in the evidence)\n"
|
||||
WER_STEP = " - name: Windows Error Reporting keeps a full dump of a python.exe that crashes (into the evidence)\n"
|
||||
ALWAYS = " if: always()\n"
|
||||
|
||||
|
||||
def _jobs(text: str) -> dict[str, str]:
|
||||
"""job id -> its text, for the jobs of the file (a job starts at two spaces of indent)."""
|
||||
body = "\n" + text.split("\njobs:\n", 1)[1]
|
||||
starts = [(m.group(1), m.start()) for m in re.finditer(r"\n ([A-Za-z0-9_-]+):[ ]*(?=\n)", body)]
|
||||
out = {}
|
||||
for i, (name, at) in enumerate(starts):
|
||||
out[name] = body[at:starts[i + 1][1] if i + 1 < len(starts) else len(body)]
|
||||
return out
|
||||
|
||||
|
||||
def _windows_jobs(text: str) -> dict[str, str]:
|
||||
return {k: v for k, v in _jobs(text).items() if re.search(r"^ runs-on: windows-", v, re.M)}
|
||||
|
||||
|
||||
def _steps(job: str) -> list[str]:
|
||||
"""The steps of a job, each without its comment lines."""
|
||||
body = job.split("\n steps:\n", 1)[1]
|
||||
chunks = re.split(r"\n(?= - )", "\n" + body)
|
||||
steps = []
|
||||
for c in chunks:
|
||||
lines = [ln for ln in c.split("\n") if not ln.strip().startswith("#")]
|
||||
if any(ln.startswith(" - ") for ln in lines):
|
||||
steps.append("\n".join(lines))
|
||||
return steps
|
||||
|
||||
|
||||
def _problems(name: str, job: str) -> list[str]:
|
||||
steps = _steps(job)
|
||||
runs_pytest = [i for i, s in enumerate(steps) if re.search(r"pytest|run_e2e\.py", s)]
|
||||
if not runs_pytest:
|
||||
return ["%s: no step runs pytest (this test finds them by name: update it with the job)" % name]
|
||||
first, last = runs_pytest[0], runs_pytest[-1]
|
||||
dumps = [i for i, s in enumerate(steps) if "LocalDumps" in s]
|
||||
if len(dumps) != 1:
|
||||
return ["%s: %d steps set LocalDumps, expected 1" % (name, len(dumps))]
|
||||
step = steps[dumps[0]]
|
||||
bad = []
|
||||
if dumps[0] > first:
|
||||
bad.append("%s: LocalDumps is set after the first pytest step" % name)
|
||||
if "shell: pwsh" not in step:
|
||||
bad.append("%s: the LocalDumps step is not PowerShell" % name)
|
||||
if not re.search(r'LocalDumps\\python\.exe"', step):
|
||||
bad.append("%s: LocalDumps is not the key of python.exe" % name)
|
||||
if not re.search(r"-Name DumpType -PropertyType DWord -Value 2\b", step):
|
||||
bad.append("%s: DumpType is not 2 (a full dump)" % name)
|
||||
if not re.search(r"-Name DumpCount -PropertyType DWord -Value 3\b", step):
|
||||
bad.append("%s: DumpCount is not 3" % name)
|
||||
if not re.search(r"-Name DumpFolder -PropertyType ExpandString -Value \$dumps\b", step):
|
||||
bad.append("%s: DumpFolder is not an expandable string" % name)
|
||||
if not re.search(r"\$dumps = Join-Path \$env:RUNNER_TEMP 'invpw-evidence\\dumps\\python'", step):
|
||||
bad.append("%s: the dump folder is not RUNNER_TEMP/invpw-evidence/dumps/python (the folder the evidence upload takes)" % name)
|
||||
if not re.search(r"-Name Disabled -PropertyType DWord -Value 0\b", step):
|
||||
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)
|
||||
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))]
|
||||
up = steps[uploads[0]]
|
||||
if uploads[0] < last:
|
||||
bad.append("%s: the evidence is uploaded before the last pytest step" % name)
|
||||
if not re.search(r"^ if: always\(\)$", up, re.M):
|
||||
bad.append("%s: the upload of the evidence is not if: always()" % name)
|
||||
summaries = [i for i, s in enumerate(steps) if "scripts/ci_wer_dumps.py" in s]
|
||||
if len(summaries) != 1:
|
||||
return bad + ["%s: %d steps run scripts/ci_wer_dumps.py, expected 1" % (name, len(summaries))]
|
||||
s = steps[summaries[0]]
|
||||
if not (last < summaries[0] < uploads[0]):
|
||||
bad.append("%s: the dump summary is not between the last pytest step and the upload" % name)
|
||||
if not re.search(r"^ if: always\(\)$", s, re.M):
|
||||
bad.append("%s: the dump summary is not if: always()" % name)
|
||||
if 'invpw-evidence/dumps/python"' not in s:
|
||||
bad.append("%s: the dump summary does not read the dump folder" % name)
|
||||
return bad
|
||||
|
||||
|
||||
def _job() -> str:
|
||||
return _windows_jobs(E2E.read_text(encoding="utf-8"))["e2e-host-windows"]
|
||||
|
||||
|
||||
def test_the_windows_jobs_are_the_ones_this_test_knows():
|
||||
assert set(_windows_jobs(E2E.read_text(encoding="utf-8"))) == EXPECTED_WINDOWS_JOBS
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", sorted(EXPECTED_WINDOWS_JOBS))
|
||||
def test_the_job_keeps_a_full_dump_of_a_crashing_python_in_its_evidence(name):
|
||||
job = _windows_jobs(E2E.read_text(encoding="utf-8"))[name]
|
||||
assert _problems(name, job) == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mutate, expected",
|
||||
[
|
||||
(lambda t: t.replace("-Name DumpType -PropertyType DWord -Value 2", "-Name DumpType -PropertyType DWord -Value 1"), "DumpType is not 2"),
|
||||
(lambda t: t.replace("LocalDumps\\python.exe", "LocalDumps\\firefox.exe"), "not the key of python.exe"),
|
||||
(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("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()"),
|
||||
],
|
||||
)
|
||||
def test_known_bad_jobs_are_refused(mutate, expected):
|
||||
job = _job()
|
||||
bad = mutate(job)
|
||||
assert bad != job, "the mutation did not apply: this test is stale"
|
||||
assert any(expected in p for p in _problems("e2e-host-windows", bad)), _problems("e2e-host-windows", bad)
|
||||
|
||||
|
||||
def test_the_step_after_the_tests_and_the_missing_step_are_refused():
|
||||
job = _job()
|
||||
start = job.index(WER_STEP)
|
||||
end = job.index("\n - ", start + 1)
|
||||
gone = job[:start] + job[end + 1:]
|
||||
assert not any("LocalDumps" in s for s in _steps(gone))
|
||||
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)
|
||||
@@ -11,11 +11,11 @@ WebGL renderer in the main thread but not in a Web Worker, the
|
||||
inconsistency proves the spoof is fake.
|
||||
|
||||
Sources studied (all FOSS, MIT-licensed):
|
||||
- creepjs/src/lies/index.ts - the canonical lie detector
|
||||
- creepjs/src/worker/index.ts - main-vs-worker scope cross-check
|
||||
- creepjs/src/math/index.ts - Math.x(p) deterministic equality
|
||||
- creepjs/src/navigator/index.ts - UA/platform/oscpu invariants
|
||||
- niespodd/browser-fingerprinting README - worker hwConcurrency,
|
||||
- the headless detector, lies module - the canonical lie detector
|
||||
- the headless detector, worker module - main-vs-worker scope cross-check
|
||||
- the headless detector, math module - Math.x(p) deterministic equality
|
||||
- the headless detector, navigator module - UA/platform/oscpu invariants
|
||||
- a public fingerprinting-notes README - worker hwConcurrency,
|
||||
plugin chain, perf.timeOrigin
|
||||
|
||||
Everything runs against `about:blank` with NO network and NO proxy.
|
||||
@@ -66,7 +66,7 @@ def _ev(page, expr):
|
||||
|
||||
# ===========================================================================
|
||||
# 1. Math determinism - same input MUST yield same output
|
||||
# Source: creepjs/src/math/index.ts
|
||||
# Source: the headless detector, math module
|
||||
# A wrapper that adds noise to Math.* (canvas-spoofing prefs) exposes
|
||||
# itself here: two consecutive calls with the same input must be
|
||||
# byte-identical.
|
||||
@@ -119,7 +119,7 @@ def test_math_pow_two_arg_determinism(page):
|
||||
|
||||
# ===========================================================================
|
||||
# 2. Worker scope vs main thread - navigator properties MUST agree
|
||||
# Source: creepjs/src/worker/index.ts
|
||||
# Source: the headless detector, worker module
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ def test_worker_platform_matches_main(page):
|
||||
|
||||
# ===========================================================================
|
||||
# 3. Iframe scope vs window scope
|
||||
# Source: creepjs/src/lies/index.ts (getBehemothIframe pattern)
|
||||
# Source: the headless detector, lies module (getBehemothIframe pattern)
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ def test_iframe_screen_matches_window(page):
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# 4. UA self-consistency (creepjs/src/navigator/index.ts)
|
||||
# 4. UA self-consistency (the headless detector, navigator module)
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@@ -285,12 +285,12 @@ def test_navigator_oscpu_matches_userAgent(page):
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# 5. Native function self-toString (creepjs/src/lies/index.ts hasKnownToString)
|
||||
# 5. Native function self-toString (the headless detector, lies module, hasKnownToString)
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
def _is_native_toString(text, fn_name):
|
||||
"""Mirror of CreepJS hasKnownToString - accept the engine-specific
|
||||
"""Mirror of the headless detector hasKnownToString - accept the engine-specific
|
||||
native patterns (single-line on V8, multi-line on SpiderMonkey)."""
|
||||
import re as _re
|
||||
name = _re.escape(fn_name)
|
||||
@@ -449,7 +449,7 @@ _DESCRIPTOR_NATIVE_PROPS = [
|
||||
def test_navigator_property_descriptor_is_getter_not_value(page, prop):
|
||||
"""Each spoofable navigator.* property must be defined via a native
|
||||
getter - NOT Object.defineProperty(..., {value: x}). The value-field
|
||||
descriptor is the lazy spoof leak CreepJS catches."""
|
||||
descriptor is the lazy spoof leak the headless detector catches."""
|
||||
has_lie = _ev(page, f"""() => {{
|
||||
let proto = navigator;
|
||||
let descriptor = null;
|
||||
|
||||
@@ -6,16 +6,16 @@ here means our patched build appears human to that detector; a fail
|
||||
means a real stealth hole that anti-bot kits would exploit in production.
|
||||
|
||||
Detector libraries studied (all FOSS, MIT-licensed):
|
||||
- github.com/fingerprintjs/BotD - 19 detectors, the most
|
||||
- a client-side bot detector - 19 detectors, the most
|
||||
widely deployed client-side
|
||||
bot detector
|
||||
- github.com/abrahamjuliot/creepjs - headless / stealth / lies
|
||||
- a headless / stealth / lies detector - headless, stealth and lies
|
||||
modules
|
||||
- github.com/fingerprintjs/fingerprintjs - canvas / audio / color /
|
||||
- an open-source fingerprint library - canvas / audio / color /
|
||||
touch consistency
|
||||
- github.com/antoinevastel/fpscanner - UA / platform / oscpu
|
||||
- an automation-rules scanner - UA / platform / oscpu
|
||||
cross-checks
|
||||
- bot.sannysoft.com - classic Puppeteer harness
|
||||
- a public classic-harness test page - the classic Puppeteer harness
|
||||
|
||||
Everything runs against `about:blank` with NO network and NO proxy. The
|
||||
suite is intended to be part of the release-gate: pre-push hook runs
|
||||
@@ -77,19 +77,19 @@ def _ev(page, expr):
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# sannysoft.com - classic Puppeteer detection harness
|
||||
# The public classic Puppeteer detection harness
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_sannysoft_chrome_object_consistency(page):
|
||||
def test_the_chrome_object_is_consistent(page):
|
||||
"""Firefox UA + window.chrome present = bot-framework leak."""
|
||||
if "Firefox" in _ev(page, "navigator.userAgent"):
|
||||
assert not _ev(page, "typeof window.chrome !== 'undefined'")
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_sannysoft_permissions_query_works(page):
|
||||
def test_the_permissions_query_works(page):
|
||||
"""navigator.permissions.query() must return a proper PermissionStatus."""
|
||||
ok = _ev(page, """async () => {
|
||||
if (!navigator.permissions || !navigator.permissions.query) return false;
|
||||
@@ -102,7 +102,7 @@ def test_sannysoft_permissions_query_works(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_sannysoft_iframe_chrome_not_leaked(page):
|
||||
def test_the_iframe_does_not_leak_the_chrome_object(page):
|
||||
"""iframe.contentWindow.chrome must not leak on Firefox UA."""
|
||||
if "Firefox" not in _ev(page, "navigator.userAgent"):
|
||||
pytest.skip("Firefox-only invariant")
|
||||
@@ -118,7 +118,7 @@ def test_sannysoft_iframe_chrome_not_leaked(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_sannysoft_iframe_languages_not_empty(page):
|
||||
def test_the_iframe_languages_are_not_empty(page):
|
||||
"""Iframe-scope navigator.languages must have ≥1 entry."""
|
||||
n = _ev(page, """() => {
|
||||
const f = document.createElement('iframe');
|
||||
@@ -132,12 +132,12 @@ def test_sannysoft_iframe_languages_not_empty(page):
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# FingerprintJS - fingerprint surface coherence
|
||||
# The open-source fingerprint library - fingerprint surface coherence
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpjs_canvas_2d_context_returns_valid(page):
|
||||
def test_the_canvas_2d_context_returns_a_valid_one(page):
|
||||
ok = _ev(page, """() => {
|
||||
const c = document.createElement('canvas');
|
||||
c.width = 100; c.height = 100;
|
||||
@@ -151,7 +151,7 @@ def test_fpjs_canvas_2d_context_returns_valid(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpjs_audio_context_works(page):
|
||||
def test_the_audio_context_works(page):
|
||||
ok = _ev(page, """async () => {
|
||||
try {
|
||||
const ctx = new (window.OfflineAudioContext ||
|
||||
@@ -167,7 +167,7 @@ def test_fpjs_audio_context_works(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpjs_color_gamut_query_works(page):
|
||||
def test_the_color_gamut_query_works(page):
|
||||
"""matchMedia('(color-gamut: ...)') must match at least srgb."""
|
||||
ok = _ev(page, """matchMedia('(color-gamut: srgb)').matches ||
|
||||
matchMedia('(color-gamut: p3)').matches ||
|
||||
@@ -176,7 +176,7 @@ def test_fpjs_color_gamut_query_works(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpjs_screen_color_depth_realistic(page):
|
||||
def test_the_screen_color_depth_is_realistic(page):
|
||||
"""Atypical color depths are headless-distinctive."""
|
||||
cd = _ev(page, "screen.colorDepth")
|
||||
assert cd in (24, 30, 32)
|
||||
@@ -219,12 +219,12 @@ def test_pin_audio_max_channels_lands_in_destination(page):
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# fpscanner-style cross-checks
|
||||
# Rules-scanner-style cross-checks
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpscanner_ua_vs_platform_consistent(page):
|
||||
def test_the_ua_and_the_platform_agree(page):
|
||||
"""UA OS substring must agree with navigator.platform OS substring."""
|
||||
ua = _ev(page, "navigator.userAgent")
|
||||
platform = _ev(page, "navigator.platform")
|
||||
@@ -237,21 +237,21 @@ def test_fpscanner_ua_vs_platform_consistent(page):
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_fpscanner_no_userAgentData_on_firefox(page):
|
||||
def test_firefox_has_no_userAgentData(page):
|
||||
"""navigator.userAgentData is Chromium-only. Presence on Firefox UA = bot."""
|
||||
if "Firefox" in _ev(page, "navigator.userAgent"):
|
||||
assert not _ev(page, "'userAgentData' in navigator")
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# WebGL masking-detector guard (pixelscan getFixedRedBox / webglHash)
|
||||
# WebGL masking-detector guard (a public fingerprint page, fixed red box / webgl hash)
|
||||
#
|
||||
# pixelscan flags "fingerprint masking" on the WebGL readPixels output. We
|
||||
# reproduce ITS probe locally (the fingerprintjs gradient triangle) and check
|
||||
# A public fingerprint page flags "fingerprint masking" on the WebGL readPixels output. We
|
||||
# reproduce ITS probe locally (the gradient triangle of the fingerprint library) and check
|
||||
# the structural signature it keys on: our stealth readPixels noise MUST be a
|
||||
# coherent, monotonic gamma remap (smooth, ~0 spikes), NOT isolated +-1 flips
|
||||
# (which read as unnatural high-frequency noise and were flagged as masking).
|
||||
# This is the CI-safe local stand-in for pixelscan's server-side check; it
|
||||
# This is the CI-safe local stand-in for the server-side check of that page; it
|
||||
# guards the gamma fix from ever silently regressing to the +-1 algorithm.
|
||||
# ===========================================================================
|
||||
|
||||
@@ -298,7 +298,7 @@ _WEBGL_MASKING_PROBE = """() => {
|
||||
def test_webgl_readpixels_no_masking_signature(page):
|
||||
"""Stealth WebGL readPixels noise must be a coherent gamma remap (smooth),
|
||||
not isolated +-1 flips. +-1 noise on the smooth gradient triangle produced
|
||||
~300+ 'spikes' and pixelscan flagged it as masking; the gamma remap leaves
|
||||
~300+ 'spikes' and that page flagged it as masking; the gamma remap leaves
|
||||
the gradient smooth (~0 spikes). Regression guard for the gamma fix."""
|
||||
res = _ev(page, _WEBGL_MASKING_PROBE)
|
||||
if res.get("error") == "no-webgl" and sys.platform == "darwin":
|
||||
@@ -311,7 +311,7 @@ def test_webgl_readpixels_no_masking_signature(page):
|
||||
# genuine / gamma -> ~0; the rejected +-1 algorithm produced ~320.
|
||||
assert res["spikes"] < 30, (
|
||||
f"WebGL readPixels shows {res['spikes']} high-frequency noise spikes "
|
||||
f"(pixelscan-maskable); the stealth noise must be a smooth gamma remap."
|
||||
f"(flagged as masking by a public page); the stealth noise must be a smooth gamma remap."
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -126,29 +126,35 @@ def worker_pages(sites):
|
||||
return sites
|
||||
|
||||
|
||||
def test_the_frames_are_in_other_processes(page, worker_pages):
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
b = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
assert_other_process(page.main_frame, b)
|
||||
assert_other_process(b, wait_frame(page, worker_pages.url("C"), "/workers-c"))
|
||||
def test_the_frames_are_in_other_processes(page, worker_pages, evidence):
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
b = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
assert_other_process(page.main_frame, b)
|
||||
assert_other_process(b, wait_frame(page, worker_pages.url("C"), "/workers-c"))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", ["blob", "url"])
|
||||
def test_a_dedicated_worker_reports_the_identity_of_the_window_in_every_frame(page, worker_pages, kind):
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frames = {"top": page.main_frame,
|
||||
"frame": wait_frame(page, worker_pages.url("B"), "/workers-b"),
|
||||
"nested": wait_frame(page, worker_pages.url("C"), "/workers-c")}
|
||||
reference = page.main_frame.evaluate(WINDOW_JS)
|
||||
assert not mismatches(reference, reference), reference
|
||||
problems = []
|
||||
for name, frame in frames.items():
|
||||
window = frame.evaluate(WINDOW_JS)
|
||||
worker = frame.evaluate(WORKER_JS, kind)
|
||||
problems += ["%s window: %s" % (name, p) for p in mismatches(reference, window)]
|
||||
problems += ["%s %s worker: %s" % (name, kind, p) for p in mismatches(reference, worker)]
|
||||
problems += ["%s worker against its own window: %s" % (name, p) for p in mismatches(window, worker)]
|
||||
assert not problems, "identity differs between the top window and the frames and workers:\n " + "\n ".join(problems)
|
||||
def test_a_dedicated_worker_reports_the_identity_of_the_window_in_every_frame(page, worker_pages, kind, evidence):
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frames = {"top": page.main_frame,
|
||||
"frame": wait_frame(page, worker_pages.url("B"), "/workers-b"),
|
||||
"nested": wait_frame(page, worker_pages.url("C"), "/workers-c")}
|
||||
reference = page.main_frame.evaluate(WINDOW_JS)
|
||||
assert not mismatches(reference, reference), reference
|
||||
problems = []
|
||||
for name, frame in frames.items():
|
||||
window = frame.evaluate(WINDOW_JS)
|
||||
worker = frame.evaluate(WORKER_JS, kind)
|
||||
problems += ["%s window: %s" % (name, p) for p in mismatches(reference, window)]
|
||||
problems += ["%s %s worker: %s" % (name, kind, p) for p in mismatches(reference, worker)]
|
||||
problems += ["%s worker against its own window: %s" % (name, p) for p in mismatches(window, worker)]
|
||||
assert not problems, "identity differs between the top window and the frames and workers:\n " + "\n ".join(problems)
|
||||
|
||||
|
||||
SHARED_WORKER_JS = """() => new Promise(resolve => {
|
||||
@@ -174,33 +180,39 @@ SERVICE_WORKER_JS = """() => new Promise(resolve => {
|
||||
})"""
|
||||
|
||||
|
||||
def test_a_shared_worker_made_in_a_frame_of_another_site_reports_the_identity_of_the_top(page, worker_pages):
|
||||
def test_a_shared_worker_made_in_a_frame_of_another_site_reports_the_identity_of_the_top(page, worker_pages, evidence):
|
||||
"""As stock Firefox does: a SharedWorker can be made from a frame of another site (its own site's worker
|
||||
script), starts, and answers. What it reports about the browser is what the top window reads."""
|
||||
worker_pages.route("B", "/shared-worker.js", "onconnect = e => { e.ports[0].postMessage(%s); };" % IDENTITY,
|
||||
ctype="text/javascript")
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frame = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
result = frame.evaluate(SHARED_WORKER_JS)
|
||||
assert result["outcome"] == "ok", result
|
||||
assert not mismatches(page.main_frame.evaluate(WINDOW_JS), result["identity"]), result
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
worker_pages.route("B", "/shared-worker.js", "onconnect = e => { e.ports[0].postMessage(%s); };" % IDENTITY,
|
||||
ctype="text/javascript")
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frame = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
result = frame.evaluate(SHARED_WORKER_JS)
|
||||
assert result["outcome"] == "ok", result
|
||||
assert not mismatches(page.main_frame.evaluate(WINDOW_JS), result["identity"]), result
|
||||
|
||||
|
||||
def test_a_service_worker_registered_from_a_frame_of_another_site_reports_the_identity_of_the_top(page, worker_pages):
|
||||
def test_a_service_worker_registered_from_a_frame_of_another_site_reports_the_identity_of_the_top(page, worker_pages, evidence):
|
||||
"""As stock Firefox does: a frame of another site registers a ServiceWorker of its own site (scope the site's
|
||||
root), it becomes active, and answers a message; what it reports about the browser is what the top window
|
||||
reads."""
|
||||
worker_pages.route("B", "/service-worker.js",
|
||||
"self.addEventListener('install', e => self.skipWaiting());"
|
||||
"self.addEventListener('activate', e => e.waitUntil(clients.claim()));"
|
||||
"self.addEventListener('message', e => e.source.postMessage(%s));" % IDENTITY,
|
||||
ctype="text/javascript", headers=[("Service-Worker-Allowed", "/")])
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frame = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
result = frame.evaluate(SERVICE_WORKER_JS)
|
||||
assert result["outcome"] == "registered", result
|
||||
assert result["scope"] == worker_pages.url("B", "/"), result
|
||||
assert not mismatches(page.main_frame.evaluate(WINDOW_JS), result["identity"]), result
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
worker_pages.route("B", "/service-worker.js",
|
||||
"self.addEventListener('install', e => self.skipWaiting());"
|
||||
"self.addEventListener('activate', e => e.waitUntil(clients.claim()));"
|
||||
"self.addEventListener('message', e => e.source.postMessage(%s));" % IDENTITY,
|
||||
ctype="text/javascript", headers=[("Service-Worker-Allowed", "/")])
|
||||
page.goto(worker_pages.url("A", "/workers"), wait_until="load")
|
||||
frame = wait_frame(page, worker_pages.url("B"), "/workers-b")
|
||||
result = frame.evaluate(SERVICE_WORKER_JS)
|
||||
assert result["outcome"] == "registered", result
|
||||
assert result["scope"] == worker_pages.url("B", "/"), result
|
||||
assert not mismatches(page.main_frame.evaluate(WINDOW_JS), result["identity"]), result
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -257,7 +269,7 @@ def test_what_a_frame_of_another_site_stores_is_seen_by_the_frame_and_by_the_con
|
||||
assert answer == {"cookie": "hdrcookie=1; jscookie=2", "ls": "frame-ls", "ss": "frame-ss"}
|
||||
|
||||
|
||||
def test_storage_of_site_b_is_partitioned_between_a_frame_of_a_and_b_as_a_top_page(page, storage_pages):
|
||||
def test_storage_of_site_b_is_partitioned_between_a_frame_of_a_and_b_as_a_top_page(page, storage_pages, evidence):
|
||||
"""The retail outcome, not stock Playwright's: cookies and web storage are partitioned by the top-level site.
|
||||
What site B wrote inside a frame of A is not visible to B opened as a top page: its `document.cookie` is empty
|
||||
and its `localStorage` item is null (`context.cookies()` still lists B's cookies, with B's domain, because it
|
||||
@@ -270,22 +282,25 @@ def test_storage_of_site_b_is_partitioned_between_a_frame_of_a_and_b_as_a_top_pa
|
||||
and shows the stored values to B as a top page (observed with Playwright 1.62: `document.cookie` is
|
||||
`hdrcookie=1; jscookie=2` and the item is `frame-ls`), which is not what a page sees in a real browser, so
|
||||
its answer is not the one asserted."""
|
||||
context = page.context
|
||||
page.goto(storage_pages.url("A", "/storage"), wait_until="load")
|
||||
wait_frame(page, storage_pages.url("B"), "/storage-b")
|
||||
own = context.new_page()
|
||||
own.goto(storage_pages.url("B", "/storage-own"), wait_until="load")
|
||||
assert own.evaluate("window.__r") == {"cookie": "", "ls": None, "ss": None}
|
||||
assert sorted(c["name"] for c in context.cookies(storage_pages.url("B"))) == ["hdrcookie", "jscookie"]
|
||||
# the reverse: B writes as a top page, then is framed by A and reads
|
||||
own.goto(storage_pages.url("B", "/storage-top-writes"), wait_until="load")
|
||||
assert own.evaluate("window.__r") == {"cookie": "topcookie=3", "top": "top-ls"}
|
||||
reader = context.new_page()
|
||||
reader.goto(storage_pages.url("A", "/storage-read"), wait_until="load")
|
||||
frame = wait_frame(reader, storage_pages.url("B"), "/storage-read-b")
|
||||
# B inside A reads its own partition: the two cookies the frame wrote above are there, what B wrote as a top page
|
||||
# (`topcookie`, the `top-only` item) is not.
|
||||
assert frame.evaluate("window.__r") == {"cookie": "hdrcookie=1; jscookie=2", "top": None}
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
context = page.context
|
||||
page.goto(storage_pages.url("A", "/storage"), wait_until="load")
|
||||
wait_frame(page, storage_pages.url("B"), "/storage-b")
|
||||
own = context.new_page()
|
||||
own.goto(storage_pages.url("B", "/storage-own"), wait_until="load")
|
||||
assert own.evaluate("window.__r") == {"cookie": "", "ls": None, "ss": None}
|
||||
assert sorted(c["name"] for c in context.cookies(storage_pages.url("B"))) == ["hdrcookie", "jscookie"]
|
||||
# the reverse: B writes as a top page, then is framed by A and reads
|
||||
own.goto(storage_pages.url("B", "/storage-top-writes"), wait_until="load")
|
||||
assert own.evaluate("window.__r") == {"cookie": "topcookie=3", "top": "top-ls"}
|
||||
reader = context.new_page()
|
||||
reader.goto(storage_pages.url("A", "/storage-read"), wait_until="load")
|
||||
frame = wait_frame(reader, storage_pages.url("B"), "/storage-read-b")
|
||||
# B inside A reads its own partition: the two cookies the frame wrote above are there, what B wrote as a top page
|
||||
# (`topcookie`, the `top-only` item) is not.
|
||||
assert frame.evaluate("window.__r") == {"cookie": "hdrcookie=1; jscookie=2", "top": None}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -322,31 +337,34 @@ def special_pages(sites):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("where", ["top", "inside_b"])
|
||||
def test_special_frames_are_listed_evaluated_and_reached_by_frame_locator(page, special_pages, where):
|
||||
def test_special_frames_are_listed_evaluated_and_reached_by_frame_locator(page, special_pages, where, evidence):
|
||||
"""As stock Firefox does: `srcdoc` and every `sandbox`ed srcdoc frame is `about:srcdoc`, the empty one is
|
||||
`about:blank`, the `data:` one keeps its url; all are in `page.frames` under their parent, named by their id;
|
||||
`evaluate` works in all of them and finds `window.v` where the document's script could run (not in the
|
||||
sandbox without `allow-scripts`, not in the empty frame); `frame_locator` reaches the text inside each, in
|
||||
the empty frame once something is written there; the same at the top level and inside a frame of B."""
|
||||
path = "/special" if where == "top" else "/special-in-b"
|
||||
page.goto(special_pages.url("A", path), wait_until="load")
|
||||
owner_site = "A" if where == "top" else "B"
|
||||
owner = wait_frame(page, special_pages.url(owner_site), "/special")
|
||||
if where == "inside_b":
|
||||
assert_other_process(page.main_frame, owner)
|
||||
expected_count = 1 + (where == "inside_b") + len(SPECIAL_FRAMES)
|
||||
assert wait_for(page, lambda: len(page.frames) == expected_count), [(f.name, f.url) for f in page.frames]
|
||||
inner = {f.name: f for f in page.frames if f.parent_frame is owner}
|
||||
assert sorted(inner) == sorted(SPECIAL_FRAMES), [(f.name, f.url) for f in page.frames]
|
||||
scope = page.frame_locator("#b") if where == "inside_b" else page
|
||||
for frame_id, (url, value, text) in SPECIAL_FRAMES.items():
|
||||
frame = inner[frame_id]
|
||||
if url is None:
|
||||
assert frame.url.startswith("data:text/html,"), frame.url
|
||||
else:
|
||||
assert frame.url == url, (frame_id, frame.url)
|
||||
assert frame.evaluate("window.v") == value, frame_id
|
||||
if frame_id == "blank":
|
||||
frame.evaluate("document.body.innerHTML = '<p id=x>written</p>'")
|
||||
text = "written"
|
||||
assert scope.frame_locator("#" + frame_id).locator("#x").inner_text() == text, frame_id
|
||||
held, watch = evidence
|
||||
with OnFailure(held, watch): # a failure keeps the module's evidence: the wire, the engine trace, every frame's lifecycle
|
||||
watch.listen(page, "page")
|
||||
path = "/special" if where == "top" else "/special-in-b"
|
||||
page.goto(special_pages.url("A", path), wait_until="load")
|
||||
owner_site = "A" if where == "top" else "B"
|
||||
owner = wait_frame(page, special_pages.url(owner_site), "/special")
|
||||
if where == "inside_b":
|
||||
assert_other_process(page.main_frame, owner)
|
||||
expected_count = 1 + (where == "inside_b") + len(SPECIAL_FRAMES)
|
||||
assert wait_for(page, lambda: len(page.frames) == expected_count), [(f.name, f.url) for f in page.frames]
|
||||
inner = {f.name: f for f in page.frames if f.parent_frame is owner}
|
||||
assert sorted(inner) == sorted(SPECIAL_FRAMES), [(f.name, f.url) for f in page.frames]
|
||||
scope = page.frame_locator("#b") if where == "inside_b" else page
|
||||
for frame_id, (url, value, text) in SPECIAL_FRAMES.items():
|
||||
frame = inner[frame_id]
|
||||
if url is None:
|
||||
assert frame.url.startswith("data:text/html,"), frame.url
|
||||
else:
|
||||
assert frame.url == url, (frame_id, frame.url)
|
||||
assert frame.evaluate("window.v") == value, frame_id
|
||||
if frame_id == "blank":
|
||||
frame.evaluate("document.body.innerHTML = '<p id=x>written</p>'")
|
||||
text = "written"
|
||||
assert scope.frame_locator("#" + frame_id).locator("#x").inner_text() == text, frame_id
|
||||
@@ -0,0 +1,162 @@
|
||||
"""Click, hover, drag and wheel reach the element under the cursor, in the top document and in a frame of another site, at every display scale.
|
||||
|
||||
The parent turns a point of the window into a point of the content with the matrix it keeps of each content process (``mChildToParentConversionMatrix``), and the
|
||||
mouse, the wheel and the drag go through it. The matrix the parent SENDS to the child is a different one (it carries the window origin the page reads), and a change
|
||||
there must not move the input: the point the parent hit-tests, the element the event is dispatched at and the ``clientX/Y`` it carries must stay the cursor's.
|
||||
Playwright's own input (``page.mouse``) is what a client sends, so this is what a script sees break.
|
||||
|
||||
What it does, per display case (the four of the window tests), once for the top document and once for a frame of another site, 500x240 at (20, 200) of the same
|
||||
page, both holding the same four boxes (CSS pixels of the document): a button ``click`` (60x40 at (20, 20)), a box ``hover`` (60x40 at (100, 20)), a box ``drag``
|
||||
(140x90 at (180, 20)) and a scroller ``scroll`` (140x100 at (20, 80), 600 high inside). The mouse is the client's (``page.mouse``), the point is the box's own
|
||||
centre plus the document's origin in the page:
|
||||
|
||||
* click: ``mouse.click`` at the centre of ``click``: the document hears trusted ``mousedown``, ``mouseup`` and ``click`` AT ``click``, with ``clientX/Y`` at the point
|
||||
EXACTLY (no tolerance; every requested point is a whole CSS pixel);
|
||||
* hover: ``mouse.move`` to the centre of ``hover``: ``mouseover`` is dispatched at ``hover``, at the exact point, and the element matches ``:hover``;
|
||||
* drag: ``mousedown`` at the centre of ``drag``, six moves to a point 30 right and 20 below, ``mouseup``: ``mousedown`` and ``mouseup`` AT ``drag`` with the two points,
|
||||
the ``mousemove`` events with the left button held and the last at the end point;
|
||||
* wheel: ``mouse.wheel(0, 120)`` over the centre of ``scroll``: the document hears a trusted ``wheel`` at ``scroll``, at the exact point, and ``scroll.scrollTop`` grows.
|
||||
|
||||
The existing suites that read input in a frame of another site and are in the candidate's rows already: ``test_nested_frame_actions.py`` (a click, and a pointer at a large
|
||||
offset, with the scales 1, 1.25, 1.5 and 2, in one-, two- and three-process pages, and the wheel at scales 1 and 1.25 under a zoom),
|
||||
``test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py`` (one click), ``test_fission_frames_tree_input_and_pixels_e2e.py`` (clicks under a transform, after a
|
||||
scroll, typing), ``test_a_drag_keeps_its_buttons_pressed_e2e.py`` and ``test_drag_motion.py`` (a drag in the top document), ``test_input_is_born_before_the_page_sees_it_e2e.py``
|
||||
(keys and moves). None puts the four kinds of input in both documents at the four scales: this file does, and only this.
|
||||
|
||||
The engine that answers these values is not released yet: it must pass on the engine of the pin, where the matrix is the real one; it is red if the matrix the
|
||||
parent sends moves the input.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: The boxes' centres in the document, CSS pixels.
|
||||
CLICK, HOVER, DRAG, SCROLL = (50, 40), (130, 40), (250, 65), (90, 130)
|
||||
DRAG_TO = (280, 85)
|
||||
#: The frame's place in the top document.
|
||||
FRAME_AT = (20, 200)
|
||||
|
||||
BODY = """<style>html,body{margin:0;padding:0}.b{position:absolute;box-sizing:border-box;margin:0;padding:0}
|
||||
#click{left:20px;top:20px;width:60px;height:40px}#hover{left:100px;top:20px;width:60px;height:40px;background:#eee}
|
||||
#drag{left:180px;top:20px;width:140px;height:90px;background:#9bd}
|
||||
#scroll{left:20px;top:80px;width:140px;height:100px;overflow:auto;background:#bd9}#scroll div{height:600px}</style>
|
||||
<button id=click class=b>click</button><div id=hover class=b>hover</div><div id=drag class=b>drag</div><div id=scroll class=b><div></div></div>
|
||||
<script>
|
||||
window.__ev = [];
|
||||
const idOf = e => { const n = e.target.closest ? e.target.closest('[id]') : null; return n ? n.id : null; };
|
||||
for (const t of ['click', 'mouseover', 'mousedown', 'mousemove', 'mouseup', 'wheel'])
|
||||
document.addEventListener(t, e => { window.__ev.push({t: t, id: idOf(e), cx: e.clientX, cy: e.clientY, trusted: e.isTrusted, buttons: e.buttons}); }, true);
|
||||
</script>"""
|
||||
|
||||
TOP = ("<!doctype html><meta charset=utf-8><title>input</title><style>#f{position:absolute;left:20px;top:200px;width:500px;height:240px;border:0}</style>"
|
||||
+ BODY + '<iframe id=f src="%s"></iframe>')
|
||||
FRAME = "<!doctype html><meta charset=utf-8><title>input frame</title>" + BODY
|
||||
|
||||
|
||||
def _events(doc) -> List[Dict[str, Any]]:
|
||||
return doc.evaluate("() => window.__ev")
|
||||
|
||||
|
||||
def _where(case: str, doc_name: str, what: str, events: List[Dict[str, Any]]) -> str:
|
||||
return "%s, %s document, %s: events heard %r" % (case, doc_name, what, events)
|
||||
|
||||
|
||||
def _at(event: Dict[str, Any], point: Tuple[float, float], case: str) -> bool:
|
||||
"""Exactly the requested point: no tolerance. Every requested point is a whole CSS pixel (the boxes' centres and the frame's origin are), so the event's
|
||||
``clientX/Y`` of the document is that value at every scale."""
|
||||
return (event["cx"], event["cy"]) == (point[0], point[1])
|
||||
|
||||
|
||||
def _said(case: str, event: Dict[str, Any], point: Tuple[float, float]) -> str:
|
||||
dpr = CASES[case][0]
|
||||
return "requested point %r, received (%r, %r), scale %r" % (point, event["cx"], event["cy"], dpr)
|
||||
|
||||
|
||||
def _of(events: List[Dict[str, Any]], kind: str, box: str) -> List[Dict[str, Any]]:
|
||||
return [e for e in events if e["t"] == kind and e["id"] == box]
|
||||
|
||||
|
||||
def _fresh(doc) -> None:
|
||||
doc.evaluate("() => { window.__ev.length = 0; }")
|
||||
|
||||
|
||||
def _check_click(page, doc, origin, case, name) -> None:
|
||||
_fresh(doc)
|
||||
page.mouse.click(origin[0] + CLICK[0], origin[1] + CLICK[1])
|
||||
wait_for(page, lambda: _of(_events(doc), "click", "click"))
|
||||
events = _events(doc)
|
||||
where = _where(case, name, "click at %r" % (CLICK,), events)
|
||||
for kind in ("mousedown", "mouseup", "click"):
|
||||
heard = _of(events, kind, "click")
|
||||
assert heard, "%s; no trusted %s at 'click'" % (where, kind)
|
||||
assert heard[-1]["trusted"], "%s; %s is not trusted" % (where, kind)
|
||||
assert _at(heard[-1], CLICK, case), "%s; %s is not at the point: %s" % (where, kind, _said(case, heard[-1], CLICK))
|
||||
|
||||
|
||||
def _check_hover(page, doc, origin, case, name) -> None:
|
||||
_fresh(doc)
|
||||
page.mouse.move(origin[0] + HOVER[0], origin[1] + HOVER[1])
|
||||
wait_for(page, lambda: _of(_events(doc), "mouseover", "hover"))
|
||||
where = _where(case, name, "hover at %r" % (HOVER,), _events(doc))
|
||||
over = _of(_events(doc), "mouseover", "hover")
|
||||
assert over and over[-1]["trusted"], "%s; no trusted mouseover at 'hover'" % where
|
||||
assert wait_for(page, lambda: doc.evaluate("() => document.getElementById('hover').matches(':hover')")), "%s; 'hover' does not match :hover" % where
|
||||
moves = [e for e in _events(doc) if e["t"] == "mousemove"]
|
||||
assert moves, "%s; no mousemove" % where
|
||||
assert _at(moves[-1], HOVER, case), "%s; the last mousemove is not at the point: %s" % (where, _said(case, moves[-1], HOVER))
|
||||
|
||||
|
||||
def _check_drag(page, doc, origin, case, name) -> None:
|
||||
_fresh(doc)
|
||||
page.mouse.move(origin[0] + DRAG[0], origin[1] + DRAG[1])
|
||||
page.mouse.down()
|
||||
page.mouse.move(origin[0] + DRAG_TO[0], origin[1] + DRAG_TO[1], steps=6)
|
||||
page.mouse.up()
|
||||
wait_for(page, lambda: _of(_events(doc), "mouseup", "drag"))
|
||||
events = _events(doc)
|
||||
where = _where(case, name, "drag from %r to %r" % (DRAG, DRAG_TO), events)
|
||||
down, up = _of(events, "mousedown", "drag"), _of(events, "mouseup", "drag")
|
||||
assert down and up, "%s; no mousedown or no mouseup at 'drag'" % where
|
||||
assert _at(down[-1], DRAG, case), "%s; mousedown at 'drag' is not at the start point: %s" % (where, _said(case, down[-1], DRAG))
|
||||
assert _at(up[-1], DRAG_TO, case), "%s; mouseup at 'drag' is not at the end point: %s" % (where, _said(case, up[-1], DRAG_TO))
|
||||
held = [e for e in events if e["t"] == "mousemove" and e["buttons"] == 1]
|
||||
assert held, "%s; no mousemove with the left button held" % where
|
||||
assert _at(held[-1], DRAG_TO, case), "%s; the last mousemove with the left button held is not at the end point: %s" % (where, _said(case, held[-1], DRAG_TO))
|
||||
|
||||
|
||||
def _check_wheel(page, doc, origin, case, name) -> None:
|
||||
_fresh(doc)
|
||||
page.mouse.move(origin[0] + SCROLL[0], origin[1] + SCROLL[1])
|
||||
page.mouse.wheel(0, 120)
|
||||
wait_for(page, lambda: doc.evaluate("() => document.getElementById('scroll').scrollTop") > 0 and _of(_events(doc), "wheel", "scroll"))
|
||||
events = _events(doc)
|
||||
where = _where(case, name, "wheel over %r" % (SCROLL,), events)
|
||||
wheel = _of(events, "wheel", "scroll")
|
||||
assert wheel and wheel[-1]["trusted"], "%s; no trusted wheel at 'scroll'" % where
|
||||
assert _at(wheel[-1], SCROLL, case), "%s; the wheel is not at the point: %s" % (where, _said(case, wheel[-1], SCROLL))
|
||||
assert doc.evaluate("() => document.getElementById('scroll').scrollTop") > 0, "%s; the scroller did not scroll" % where
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_input_reaches_the_top_and_a_frame_of_another_site(firefox_binary, case):
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/input"))
|
||||
sites.route("B", "/input", FRAME)
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
frame = wait_frame(page, sites.origin["B"], "/input", seconds=DEADLINE_S)
|
||||
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
|
||||
box = page.evaluate("() => { const r = document.getElementById('f').getBoundingClientRect(); return [r.left, r.top]; }")
|
||||
assert tuple(box) == FRAME_AT, "%s: the frame is at %r in the top document, the test placed it at %r" % (case, box, FRAME_AT)
|
||||
for name, doc, origin in (("top", page, (0, 0)), ("frame", frame, FRAME_AT)):
|
||||
_check_click(page, doc, origin, case, name)
|
||||
_check_hover(page, doc, origin, case, name)
|
||||
_check_drag(page, doc, origin, case, name)
|
||||
_check_wheel(page, doc, origin, case, name)
|
||||
@@ -0,0 +1,177 @@
|
||||
"""What a frame of another site sees of the top viewport while the top scrolls, and when a lazy frame loads, is what stock Firefox with stock Playwright sees.
|
||||
|
||||
A frame of another site runs in another process. It does not know where it is in the window: the parent tells it, as a matrix and as the part of the top viewport
|
||||
that shows the frame (the remote document's visible rect). ``IntersectionObserver`` of a document in that frame, and the ``loading=lazy`` frames inside it,
|
||||
read that rect. If the matrix the parent sends is moved from the real chrome offset to the declared one and the rect is not moved with it, the frame sees the
|
||||
viewport shifted: its observer reports a ratio that is not the visible part of the frame, and a lazy frame loads too early or too late. Both are readable by any page.
|
||||
|
||||
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 pages, at the same
|
||||
window size and scale; ours must read what stock reads, step by step. No expected value is computed here: not a ratio from geometry, not a margin of a pref.
|
||||
|
||||
1. The intersection of a frame, per display case (the four of the window tests). The top page is tall and holds a frame of another site, 300x300, at document y 1000. The frame's
|
||||
page has a box ``#t`` of 300x300. Its script makes a NEW ``IntersectionObserver`` (threshold [0]) at every look, whose first callback always comes, and reports ``isIntersecting``,
|
||||
``intersectionRatio``, ``rootBounds`` and the ``intersectionRect``. The top scrolls (``scrollTo``) so that the frame's top sits at a chosen place in the viewport: 100 (all visible), -50,
|
||||
-150, -250 (the top part clipped), -320 (all above: none visible), the viewport height less 60 (the bottom part clipped), the viewport height plus 20 (all below), and 100 again. At each step
|
||||
the test waits until the top's own ``getBoundingClientRect`` of the frame is where the scroll put it, and then until two looks of the frame, 100 ms apart, agree. Ours equals stock's at every
|
||||
step: ``isIntersecting``, ``rootBounds`` (null for a frame of another site), the ratio within a CSS pixel of the frame's height, and the intersection rectangle within a CSS pixel. The step "all above"
|
||||
is the one the candidate showed different.
|
||||
2. Lazy frames, per display case. (a) A ``loading=lazy`` frame of another site in the top document, at document y 4000, with its top 640 CSS pixels below the viewport and then 560: whether it was
|
||||
requested at each. (b) A ``loading=lazy`` frame of a third site INSIDE a frame of another site, at y 200 of that frame, which is itself at document y 4000, with its top 24 CSS pixels below the
|
||||
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 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.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
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 _window_origin import CASES, DEADLINE_S, observe, settled, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
FRAME_SIZE = 300
|
||||
#: The frame's top in the top document, in CSS pixels.
|
||||
IO_TOP = 1000
|
||||
LAZY_TOP = 4000
|
||||
#: One CSS pixel: scroll and boxes are snapped to device pixels.
|
||||
TOLERANCE_PX = 1.0
|
||||
WATCH_S = 1.5
|
||||
NEAR_WAIT_S = 6
|
||||
|
||||
TOP_IO = """<!doctype html><meta charset=utf-8><title>io</title>
|
||||
<style>html,body{margin:0;padding:0}body{height:4000px}
|
||||
#f{position:absolute;left:20px;top:%dpx;width:300px;height:300px;border:0}</style>
|
||||
<body><iframe id=f src="%%s"></iframe>""" % IO_TOP
|
||||
|
||||
FRAME_IO = """<!doctype html><meta charset=utf-8><title>io</title>
|
||||
<style>html,body{margin:0;padding:0}#t{width:300px;height:300px;background:#9bd}</style><body><div id=t></div>"""
|
||||
|
||||
#: A new observer at every look: its first callback is always queued, whatever the thresholds, and carries the state now.
|
||||
LOOK = """() => new Promise(resolve => {
|
||||
const io = new IntersectionObserver(entries => {
|
||||
const e = entries[entries.length - 1];
|
||||
io.disconnect();
|
||||
const box = r => r && {x: r.x, y: r.y, w: r.width, h: r.height};
|
||||
resolve({isIntersecting: e.isIntersecting, ratio: e.intersectionRatio, rootBounds: box(e.rootBounds),
|
||||
box: box(e.boundingClientRect), inter: box(e.intersectionRect)});
|
||||
}, {threshold: [0]});
|
||||
io.observe(document.getElementById('t'));
|
||||
})"""
|
||||
|
||||
TOP_BOX = """() => { const r = document.getElementById('f').getBoundingClientRect(); return {top: r.top, vh: document.documentElement.clientHeight}; }"""
|
||||
|
||||
FRAME_LAZY_HOST = """<!doctype html><meta charset=utf-8><title>host</title>
|
||||
<style>html,body{margin:0;padding:0}iframe{position:absolute;left:0;top:200px;width:100px;height:50px;border:0}</style>
|
||||
<body><iframe loading=lazy src="%s"></iframe>"""
|
||||
|
||||
LEAF = "<!doctype html><meta charset=utf-8><title>leaf</title><body>leaf"
|
||||
|
||||
|
||||
def _top_lazy(height: int, loading: str, src: str) -> str:
|
||||
"""The top page of the lazy cases: a tall page with ONE frame of another site at document y ``LAZY_TOP``, ``height`` high; ``loading`` is the attribute's value."""
|
||||
return ("<!doctype html><meta charset=utf-8><title>lazy</title>"
|
||||
"<style>html,body{margin:0;padding:0}body{height:9000px}"
|
||||
"iframe{position:absolute;left:20px;top:%dpx;width:300px;height:%dpx;border:0}</style>"
|
||||
'<body><iframe id=f loading=%s src="%s"></iframe>' % (LAZY_TOP, height, loading, src))
|
||||
|
||||
|
||||
def _steps_of(vh: float) -> List[List[Any]]:
|
||||
return [["all visible", 100], ["top 50 clipped", -50], ["top 150 clipped", -150], ["top 250 clipped", -250], ["all above", -320],
|
||||
["bottom 240 clipped", vh - 60], ["all below", vh + 20], ["all visible again", 100]]
|
||||
|
||||
|
||||
def _scroll_so_that_the_frame_top_is(page, frame_top: float, to: float) -> None:
|
||||
"""Scrolls the top so that an element at document y ``frame_top`` has its top ``to`` CSS pixels below the top of the viewport."""
|
||||
page.evaluate("(y) => window.scrollTo(0, y)", frame_top - to)
|
||||
|
||||
|
||||
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)
|
||||
vh = page.evaluate(TOP_BOX)["vh"]
|
||||
steps: Dict[str, Any] = {}
|
||||
for name, step_top in _steps_of(vh):
|
||||
page.evaluate("(y) => window.scrollTo(0, y)", IO_TOP - step_top)
|
||||
wait_for(page, lambda: abs(page.evaluate(TOP_BOX)["top"] - step_top) <= TOLERANCE_PX)
|
||||
reading = settled(page, lambda: frame.evaluate(LOOK))
|
||||
inter = reading["inter"] or {"y": 0, "h": 0}
|
||||
steps[name] = {"top": round(page.evaluate(TOP_BOX)["top"]), "isIntersecting": reading["isIntersecting"], "ratio": round(reading["ratio"], 4),
|
||||
"rootBounds": reading["rootBounds"], "box": [reading["box"]["w"], reading["box"]["h"]], "inter_y": round(inter["y"], 2), "inter_h": round(inter["h"], 2)}
|
||||
return {"scales": scales, "measured": {"viewport_height": vh, "steps": steps}}
|
||||
|
||||
|
||||
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)
|
||||
vh = page.evaluate(TOP_BOX)["vh"]
|
||||
|
||||
def requested_top() -> int:
|
||||
return len(sites.seen("B", "/leaf-top-" + tag))
|
||||
|
||||
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh + 640)
|
||||
measured["top_640_below"] = observe(page, requested_top, WATCH_S)[-1] > 0
|
||||
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh + 560)
|
||||
measured["top_560_below"] = wait_for(page, lambda: requested_top() >= 1, NEAR_WAIT_S)
|
||||
|
||||
page.goto(sites.url("A", "/lazy-nested-" + tag), wait_until="load", timeout=30000)
|
||||
wait_frame(page, sites.origin["B"], "/host-" + tag, seconds=DEADLINE_S)
|
||||
vh = page.evaluate(TOP_BOX)["vh"]
|
||||
|
||||
def requested_nested() -> int:
|
||||
return len(sites.seen("C", "/leaf-nested-" + tag))
|
||||
|
||||
# the lazy frame is at y 200 of its host: its top is 24 below the bottom edge of the viewport when the host's top is vh - 200 + 24
|
||||
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh - 200 + 24)
|
||||
measured["nested_24_below"] = observe(page, requested_nested, WATCH_S)[-1] > 0
|
||||
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh - 200 - 24)
|
||||
measured["nested_24_above"] = wait_for(page, lambda: requested_nested() >= 1, NEAR_WAIT_S)
|
||||
return {"scales": scales, "measured": measured}
|
||||
|
||||
|
||||
def _register(sites: Sites, tag: str) -> None:
|
||||
sites.route("A", "/io-" + tag, lambda handler: TOP_IO % sites.url("B", "/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)
|
||||
sites.route("B", "/host-" + tag, lambda handler: FRAME_LAZY_HOST % sites.url("C", "/leaf-nested-" + tag))
|
||||
sites.route("C", "/leaf-nested-" + tag, LEAF)
|
||||
|
||||
|
||||
def _twin(case: str, firefox_binary: str, monkeypatch, steps) -> Any:
|
||||
"""Stock first, ours second, each on pages of its own tag. The browsers are told apart by the order: the first call is stock's."""
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads of the record
|
||||
with Sites() as sites:
|
||||
order = iter(("stock", "ours"))
|
||||
for tag in ("stock", "ours"):
|
||||
_register(sites, tag)
|
||||
stock, ours = run_twin(case, firefox_binary, lambda page, chrome: steps(sites, page, chrome, next(order)))
|
||||
return stock, ours
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_the_intersection_of_a_frame_of_another_site_is_what_stock_reads(firefox_binary, monkeypatch, case):
|
||||
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")
|
||||
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)))
|
||||
|
||||
|
||||
@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")
|
||||
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)))
|
||||
@@ -9,6 +9,7 @@ from invisible_core import generate_profile
|
||||
# turned unused in there and were removed. An import is not unused merely
|
||||
# because the file holding it does not use it - another module can be reaching
|
||||
# a name THROUGH it, and no single-file analysis can see that.
|
||||
from invisible_core import constants as _constants
|
||||
from invisible_core.constants import (TASKBAR_PX as _TASKBAR_H,
|
||||
WINDOW_FRAME_BY_DPR as _FRAMES)
|
||||
from invisible_playwright.launcher import InvisiblePlaywright
|
||||
@@ -31,7 +32,10 @@ def test_chrome_offsets_are_positive_ints():
|
||||
"""
|
||||
assert _TASKBAR_H > 0
|
||||
for frame in _FRAMES.values():
|
||||
assert frame.border >= 0 and frame.maximized_ui > 0 and frame.popup_ui > 0
|
||||
# the bar: from the panel via declared_maximized_ui (core with ui_normal/ui_compact), the frame's field on the older pinned core
|
||||
bar = (_constants.declared_maximized_ui(frame, 1000) if hasattr(_constants, "declared_maximized_ui")
|
||||
else frame.maximized_ui)
|
||||
assert frame.border >= 0 and bar > 0 and frame.popup_ui > 0
|
||||
|
||||
for seed in range(40):
|
||||
p = generate_profile(seed)
|
||||
@@ -174,7 +178,7 @@ def no_geo_lookup(monkeypatch):
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_enter_with_profile_dir_calls_launch_persistent_context(tmp_path, monkeypatch, no_geo_lookup):
|
||||
def test_enter_with_profile_dir_calls_launch_persistent_context(tmp_path, monkeypatch, no_geo_lookup, declared_engine):
|
||||
"""When profile_dir is set, __enter__ must call
|
||||
`firefox.launch_persistent_context(user_data_dir=...)` and NOT
|
||||
`firefox.launch(...)`. This is the structural test that the persistent
|
||||
@@ -217,7 +221,7 @@ def test_enter_with_profile_dir_calls_launch_persistent_context(tmp_path, monkey
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_enter_without_profile_dir_calls_launch_not_persistent(tmp_path, monkeypatch, no_geo_lookup):
|
||||
def test_enter_without_profile_dir_calls_launch_not_persistent(tmp_path, monkeypatch, no_geo_lookup, declared_engine):
|
||||
"""Default path: profile_dir=None → firefox.launch, not
|
||||
launch_persistent_context. Sentinel that the non-persistent flow
|
||||
isn't accidentally rerouted."""
|
||||
@@ -246,7 +250,7 @@ def test_enter_without_profile_dir_calls_launch_not_persistent(tmp_path, monkeyp
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_persistent_context_user_data_dir_is_created_if_missing(tmp_path, monkeypatch, no_geo_lookup):
|
||||
def test_persistent_context_user_data_dir_is_created_if_missing(tmp_path, monkeypatch, no_geo_lookup, declared_engine):
|
||||
"""First-run scenario: the directory the user names doesn't exist yet.
|
||||
__enter__ must mkdir -p it (Playwright won't, and would crash with
|
||||
'user_data_dir does not exist')."""
|
||||
@@ -269,7 +273,7 @@ def test_persistent_context_user_data_dir_is_created_if_missing(tmp_path, monkey
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_teardown_closes_persistent_context(tmp_path, monkeypatch, no_geo_lookup):
|
||||
def test_teardown_closes_persistent_context(tmp_path, monkeypatch, no_geo_lookup, declared_engine):
|
||||
"""The teardown must close the persistent context. Forgetting this
|
||||
leaves Firefox + Playwright running until the parent process exits,
|
||||
which on long-running tools (job orchestrators, MCP servers) leaks
|
||||
|
||||
@@ -108,7 +108,7 @@ def test_default_context_viewport_follows_a_pinned_taskbar():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_default_context_screen_matches_profile():
|
||||
def test_default_context_screen_matches_profile(lab_exit):
|
||||
ip = InvisiblePlaywright(seed=42)
|
||||
kw = ip._default_context_kwargs()
|
||||
p = ip._profile
|
||||
@@ -125,7 +125,7 @@ def test_default_context_screen_matches_profile():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_default_context_color_scheme_follows_dark_theme():
|
||||
def test_default_context_color_scheme_follows_dark_theme(lab_exit):
|
||||
"""The theme follows ``dark_theme``, but through the DECLARATION.
|
||||
|
||||
Previously the wrapper passed ``color_scheme`` to Playwright, which translated it
|
||||
@@ -186,14 +186,14 @@ def test_default_context_with_no_language_asked_is_en_us():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_build_env_carries_the_declared_network():
|
||||
def test_build_env_carries_the_declared_network(declared_engine):
|
||||
from invisible_core import network_to_declare
|
||||
env = InvisiblePlaywright(seed=42)._build_env({})
|
||||
assert env["STEALTHFOX_WEBRTC_NETWORK"] == network_to_declare(42)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_build_env_caller_env_override_wins(monkeypatch):
|
||||
def test_build_env_caller_env_override_wins(monkeypatch, declared_engine):
|
||||
monkeypatch.setenv("STEALTHFOX_WEBRTC_NETWORK", "v4=198.51.100.5;v6=1")
|
||||
env = InvisiblePlaywright(seed=42)._build_env({})
|
||||
assert env["STEALTHFOX_WEBRTC_NETWORK"] == "v4=198.51.100.5;v6=1" # caller wins
|
||||
@@ -223,7 +223,7 @@ def test_build_env_drops_the_variables_the_display_names_absent():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_build_env_never_injects_font_env():
|
||||
def test_build_env_never_injects_font_env(declared_engine):
|
||||
# The patched binary is self-contained for fonts (always bundle-only; the
|
||||
# exposed set IS the bundle, system-ui + generics baked in C++). The wrapper
|
||||
# must NOT inject any STEALTHFOX_FONTLIST/SYSTEMUI env - even if legacy font
|
||||
@@ -238,7 +238,7 @@ def test_build_env_never_injects_font_env():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_build_env_no_font_keys_when_absent():
|
||||
def test_build_env_no_font_keys_when_absent(declared_engine):
|
||||
ip = InvisiblePlaywright(seed=42)
|
||||
env = ip._build_env({})
|
||||
assert "STEALTHFOX_FONTLIST" not in env
|
||||
|
||||
@@ -20,6 +20,7 @@ import urllib.parse
|
||||
|
||||
import pytest
|
||||
|
||||
import _os_cursor
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
|
||||
@@ -140,6 +141,8 @@ def _humanize_move_count(firefox_binary, humanize):
|
||||
"<div id=d style='width:600px;height:400px' "
|
||||
"onmousemove=\"window.__n=(window.__n||0)+1\">x</div>"
|
||||
))
|
||||
# A native move of the OS cursor would count among the page's mousemoves (`off <= 2` below); it is parked outside the window (tests/_os_cursor.py).
|
||||
_os_cursor.require_outside()
|
||||
page.mouse.move(10, 10)
|
||||
page.evaluate("window.__n = 0")
|
||||
page.mouse.move(500, 300)
|
||||
|
||||
@@ -164,3 +164,41 @@ def test_an_excluded_pref_that_stopped_varying_is_an_error(monkeypatch):
|
||||
with pytest.raises(SystemExit) as e:
|
||||
pc.compute(50, workers=1)
|
||||
assert "no longer vary" in str(e.value)
|
||||
|
||||
|
||||
def test_a_derived_pref_with_two_values_within_one_value_of_its_dimension_is_an_error():
|
||||
pref = "zoom.stealth.screen.maximized_ui" # of the panel
|
||||
rows = {
|
||||
1: {"dpr": "d1", "_derived": {p: "1" for p in pc.DERIVED}},
|
||||
2: {"dpr": "d1", "_derived": {p: "1" for p in pc.DERIVED}},
|
||||
3: {"dpr": "d2", "_derived": {p: "2" for p in pc.DERIVED}},
|
||||
}
|
||||
rows = {seed: dict(f, screen_panel="panel-" + f["dpr"]) for seed, f in rows.items()}
|
||||
pc.check_derived(rows) # a function of the dimension: fine
|
||||
rows[2]["_derived"][pref] = "9" # the same dpr, another bar
|
||||
with pytest.raises(SystemExit) as e:
|
||||
pc.check_derived(rows)
|
||||
assert pref in str(e.value) and "not a function of the dimension screen_panel" in str(e.value)
|
||||
|
||||
|
||||
def test_a_derived_pref_the_core_does_not_emit_is_accepted():
|
||||
rows = {s: {"dpr": "d%d" % (s % 2), "screen_panel": "p%d" % (s % 2), "_derived": {p: "<absent>" for p in pc.DERIVED}}
|
||||
for s in range(6)}
|
||||
pc.check_derived(rows) # a core that predates the pref: no seed has it
|
||||
rows[3]["_derived"]["zoom.stealth.screen.maximized_ui"] = "73" # a core that emits it for some seeds only varies
|
||||
with pytest.raises(SystemExit):
|
||||
pc.check_derived(rows)
|
||||
|
||||
|
||||
def test_a_derived_pref_is_in_no_dimension_and_names_a_dimension():
|
||||
in_a_dimension = {k for keys in pc.DIMENSIONS.values() for k in keys}
|
||||
assert not set(pc.DERIVED) & in_a_dimension
|
||||
assert not set(pc.DERIVED) & set(pc.EXCLUDED)
|
||||
assert set(pc.DERIVED.values()) <= set(pc.DIMENSIONS)
|
||||
assert pc.DERIVED["zoom.stealth.screen.maximized_ui"] == "screen_panel"
|
||||
|
||||
|
||||
def test_the_derived_prefs_of_the_core_in_use_are_functions_of_their_dimensions():
|
||||
# compute() raises on the first seed pair that breaks it; this core's own prefs, over a range.
|
||||
features = pc.compute(2000, workers=1)
|
||||
assert all("_derived" not in f for f in features.values())
|
||||
@@ -1,29 +1,30 @@
|
||||
"""A popup reads the window frame the core declares, not the one of the host.
|
||||
"""A popup reads the window frame the core declares and the position Firefox gives it, not the ones of the host.
|
||||
|
||||
What it fixes: the geometry of a window a page opens with `window.open(url, 'p', 'width=500,height=400')`, read from
|
||||
inside the popup. A popup is its real inner size plus the declared frame (retail Windows Firefox, measured by the core at
|
||||
scale 1.0: a border of 8 on the left, right and bottom, the popup UI of 72 above the content, and a default position of
|
||||
4,4 when the page names no left/top):
|
||||
inside the popup, at scale 1.0. The expected values are retail Windows Firefox 159.0's, round 5 of the window-geometry capture (GitHub run
|
||||
oss-invisible/core 45952171443, RetailCaptures `captures/WINDOW_GEOMETRY_POPUP_FRAME.csv`, step `popup`, copied by a script into `RETAIL_POPUPS` of
|
||||
`test_the_maximized_window_frames_and_popups_read_retail_e2e.py`, which this file reads): inner 500x400, outer 516x480 (a border of 8 on the left, right and bottom,
|
||||
the popup UI of 72 above the content), `screenX` and `screenY` 4, `mozInnerScreenX/Y` 12 and 76.
|
||||
|
||||
* `outerWidth == innerWidth + 2 * border`
|
||||
* `outerHeight == innerHeight + popup_ui + border`
|
||||
* `screenX == screenY ==` the declared default position (the page named none)
|
||||
* an unpositioned popup sits where Firefox's own rule puts it, not where a pref says: browser.xhtml's `screenX="4" screenY="4"` (device pixels; CSS pixels at 1.0), applied by
|
||||
`AppWindow::LoadPositionFromXUL`. The position is no declared value: there is no pref for it, and the same rule gives the same place under any declared frame.
|
||||
* `mozInnerScreenX == screenX + border`, `mozInnerScreenY == screenY + popup_ui`
|
||||
|
||||
Engine hook: `fingerprint/screen-window/geometry` of the engine series (`nsGlobalWindowOuter::GetOuterSize`,
|
||||
`GetScreenXY`, `GetMozInnerScreenX/Y`, with the content origin shift of `StealthScreenCoords`) and
|
||||
`fingerprint/screen-window/popup-position` (`nsWindowWatcher`, the default position of a popup).
|
||||
The second popup of a page (the stagger of round(22 * scale) when another browser window sits within round(4 * scale)) is not read here: capture round 8 has not measured it.
|
||||
|
||||
Negative control, in the same test: the same page in a launch declared with a SECOND frame that no runner has (border 6,
|
||||
popup UI 53, default position 9). The popup reads that one (outer - inner = 12 x 59, screen 9, mozInnerScreen 15 x 62) and
|
||||
none of the first declaration's numbers, and the two readings DIFFER. The engine off is not the control: the declared frame
|
||||
is the one of a retail Windows window at scale 1.0, so on a Windows runner the host's own popup has the very same frame
|
||||
(measured: 16 x 80 with the engine off) and the test could not tell a hook that answers from one that does not.
|
||||
Engine hook: `fingerprint/screen-window/geometry` of the engine series (the declared window rect and client offset the parent sends the content process) and
|
||||
`fingerprint/screen-window/popup-position` (`nsWindowWatcher`, the position of a popup).
|
||||
|
||||
A popup that names ONLY `left` (`window.open(url, 'p', 'width=500,height=400,left=137')`, `test_a_popup_naming_only_left_..`): the
|
||||
hook (`StealthPlacePopupAtDefault`, `fingerprint/screen-window/popup-position`) fills in only the coordinate the page did not give, so
|
||||
`screenX` is the 137 the page asked for (the opener's CSS-to-desktop scale is 1.0 here, no second conversion) and `screenY` is the
|
||||
declared default position, 4 (9 under the second frame); the frame relations are the same as for a popup with no position at all.
|
||||
Negative control, in the same test: the same page in a launch declared with a SECOND frame that no runner has (border 6, popup UI 53). The popup reads that one
|
||||
(outer - inner = 12 x 59, mozInnerScreen the position plus 6 and 53) and none of the first declaration's numbers; the two readings DIFFER in the frame and are EQUAL in the
|
||||
position. The engine off is not the control: the declared frame is the one of a retail Windows window at scale 1.0, so on a Windows runner the host's own popup has the very
|
||||
same frame (measured: 16 x 80 with the engine off) and the test could not tell a hook that answers from one that does not.
|
||||
|
||||
A popup that names ONLY `left` (`window.open(url, 'p', 'width=500,height=400,left=137')`, `test_a_popup_naming_only_left_..`): `screenX` is the 137 the page asked for (the
|
||||
opener's CSS-to-desktop scale is 1.0 here, no second conversion) and `screenY` is the unpositioned popup's, 4; the frame relations are the same as for a popup with no position
|
||||
at all.
|
||||
|
||||
Why a page reads it: `outerWidth - innerWidth`, `screenX` and `mozInnerScreenX/Y` are one line each, and a popup whose
|
||||
frame is not a Windows frame is a browser that does not run on Windows. Linux and Windows run the same assertions: the
|
||||
@@ -32,35 +33,36 @@ declaration, not the host, is what is read.
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from _popup_geometry import (OTHER_BORDER, OTHER_FRAME, OTHER_POPUP_UI, OTHER_POSITION, frame_extra, frame_of_the_declaration,
|
||||
read_popup)
|
||||
from _popup_geometry import OTHER_BORDER, OTHER_FRAME, OTHER_POPUP_UI, frame_extra, read_popup
|
||||
from test_the_maximized_window_frames_and_popups_read_retail_e2e import RETAIL_POPUPS
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Retail's unpositioned popup at scale 1.0 (round 5): the case this file pins (``_popup_geometry.PIN``).
|
||||
RETAIL = RETAIL_POPUPS["1920x1080-dpr1.0"]["popup"]
|
||||
FRAME = (RETAIL["ow"] - RETAIL["iw"], RETAIL["oh"] - RETAIL["ih"])
|
||||
BORDER = FRAME[0] // 2
|
||||
POPUP_UI = FRAME[1] - BORDER
|
||||
POSITION = RETAIL["sx"]
|
||||
|
||||
|
||||
def test_a_popup_is_its_inner_size_plus_the_declared_frame(firefox_binary):
|
||||
frame = frame_of_the_declaration()
|
||||
declared = (2 * frame.border, frame.popup_ui + frame.border)
|
||||
|
||||
def has_the_frame(reading):
|
||||
p = reading["popup"]
|
||||
return (p["ow"] - p["iw"], p["oh"] - p["ih"]) == declared
|
||||
return (p["ow"] - p["iw"], p["oh"] - p["ih"]) == FRAME
|
||||
|
||||
on = read_popup(firefox_binary, ready=has_the_frame)["popup"]
|
||||
assert (on["ow"] - on["iw"], on["oh"] - on["ih"]) == declared, (
|
||||
"the popup reads outer %dx%d for inner %dx%d: the frame is %r, the declaration is %r"
|
||||
% (on["ow"], on["oh"], on["iw"], on["ih"], (on["ow"] - on["iw"], on["oh"] - on["ih"]), declared))
|
||||
assert (on["sx"], on["sy"]) == (frame.popup_position, frame.popup_position), (
|
||||
"a popup that names no position reads screen %r, the declared default is %d" % ((on["sx"], on["sy"]),
|
||||
frame.popup_position))
|
||||
assert on["mx"] == pytest.approx(on["sx"] + frame.border, abs=0.01), (
|
||||
"mozInnerScreenX %r is not screenX %r plus the border %d" % (on["mx"], on["sx"], frame.border))
|
||||
assert on["my"] == pytest.approx(on["sy"] + frame.popup_ui, abs=0.01), (
|
||||
"mozInnerScreenY %r is not screenY %r plus the popup UI %d" % (on["my"], on["sy"], frame.popup_ui))
|
||||
assert (on["ow"] - on["iw"], on["oh"] - on["ih"]) == FRAME, (
|
||||
"the popup reads outer %dx%d for inner %dx%d: the frame is %r, retail reads %r"
|
||||
% (on["ow"], on["oh"], on["iw"], on["ih"], (on["ow"] - on["iw"], on["oh"] - on["ih"]), FRAME))
|
||||
assert (on["sx"], on["sy"]) == (RETAIL["sx"], RETAIL["sy"]), (
|
||||
"a popup that names no position reads screen %r, retail reads %r" % ((on["sx"], on["sy"]), (RETAIL["sx"], RETAIL["sy"])))
|
||||
assert (on["mx"], on["my"]) == (RETAIL["mx"], RETAIL["my"]), (
|
||||
"the popup reads mozInnerScreen %r, retail reads %r" % ((on["mx"], on["my"]), (RETAIL["mx"], RETAIL["my"])))
|
||||
|
||||
# The control: a launch declared with another frame reads that one, and none of the first declaration's relations.
|
||||
# The control: a launch declared with another frame reads that one, and none of the first declaration's relations; the position is the same.
|
||||
other_declared = frame_extra(OTHER_BORDER, OTHER_POPUP_UI)
|
||||
assert other_declared != declared
|
||||
assert other_declared != FRAME
|
||||
|
||||
def has_the_other_frame(reading):
|
||||
p = reading["popup"]
|
||||
@@ -70,39 +72,36 @@ def test_a_popup_is_its_inner_size_plus_the_declared_frame(firefox_binary):
|
||||
assert (other["ow"] - other["iw"], other["oh"] - other["ih"]) == other_declared, (
|
||||
"declared with another frame the popup reads outer %dx%d for inner %dx%d: the frame is %r, the second declaration is %r"
|
||||
% (other["ow"], other["oh"], other["iw"], other["ih"], (other["ow"] - other["iw"], other["oh"] - other["ih"]), other_declared))
|
||||
assert (other["sx"], other["sy"]) == (OTHER_POSITION, OTHER_POSITION), (
|
||||
"declared with another default position the popup reads screen %r, the second declaration is %d" % ((other["sx"], other["sy"]), OTHER_POSITION))
|
||||
assert other["mx"] == pytest.approx(other["sx"] + OTHER_BORDER, abs=0.01)
|
||||
assert other["my"] == pytest.approx(other["sy"] + OTHER_POPUP_UI, abs=0.01)
|
||||
assert (other["sx"], other["sy"]) == (POSITION, POSITION), (
|
||||
"declared with another frame the popup reads screen %r: the position of an unpositioned popup is Firefox's own, %d, under any frame"
|
||||
% ((other["sx"], other["sy"]), POSITION))
|
||||
assert other["mx"] == pytest.approx(POSITION + OTHER_BORDER, abs=0.01)
|
||||
assert other["my"] == pytest.approx(POSITION + OTHER_POPUP_UI, abs=0.01)
|
||||
assert (other["ow"] - other["iw"], other["oh"] - other["ih"]) != (on["ow"] - on["iw"], on["oh"] - on["ih"]), (
|
||||
"the two declared frames read the same frame: the declaration decides nothing")
|
||||
assert (other["sx"], other["sy"]) != (on["sx"], on["sy"]) and other["my"] - other["sy"] != on["my"] - on["sy"], (
|
||||
"the two declared frames read the same position or content origin: %r vs %r" % (other, on))
|
||||
assert other["my"] - other["sy"] != on["my"] - on["sy"], "the two declared frames read the same content origin: %r vs %r" % (other, on)
|
||||
|
||||
|
||||
LEFT = 137
|
||||
|
||||
|
||||
def test_a_popup_naming_only_left_reads_that_x_and_the_declared_default_y(firefox_binary):
|
||||
frame = frame_of_the_declaration()
|
||||
def test_a_popup_naming_only_left_reads_that_x_and_the_unpositioned_y(firefox_binary):
|
||||
features = "width=500,height=400,left=%d" % LEFT
|
||||
declared = (2 * frame.border, frame.popup_ui + frame.border)
|
||||
|
||||
def has_the_frame(reading):
|
||||
p = reading["popup"]
|
||||
return (p["ow"] - p["iw"], p["oh"] - p["ih"]) == declared
|
||||
return (p["ow"] - p["iw"], p["oh"] - p["ih"]) == FRAME
|
||||
|
||||
on = read_popup(firefox_binary, ready=has_the_frame, features=features)["popup"]
|
||||
assert (on["ow"] - on["iw"], on["oh"] - on["ih"]) == declared, (
|
||||
"the popup reads outer %dx%d for inner %dx%d: the frame is %r, the declaration is %r"
|
||||
% (on["ow"], on["oh"], on["iw"], on["ih"], (on["ow"] - on["iw"], on["oh"] - on["ih"]), declared))
|
||||
assert (on["ow"] - on["iw"], on["oh"] - on["ih"]) == FRAME, (
|
||||
"the popup reads outer %dx%d for inner %dx%d: the frame is %r, retail reads %r"
|
||||
% (on["ow"], on["oh"], on["iw"], on["ih"], (on["ow"] - on["iw"], on["oh"] - on["ih"]), FRAME))
|
||||
assert on["sx"] == LEFT, "a popup that names left=%d reads screenX %r: the page's own x is lost" % (LEFT, on["sx"])
|
||||
assert on["sy"] == frame.popup_position, (
|
||||
"a popup that names no top reads screenY %r, the declared default is %d" % (on["sy"], frame.popup_position))
|
||||
assert on["mx"] == pytest.approx(on["sx"] + frame.border, abs=0.01)
|
||||
assert on["my"] == pytest.approx(on["sy"] + frame.popup_ui, abs=0.01)
|
||||
assert on["sy"] == POSITION, "a popup that names no top reads screenY %r, an unpositioned popup reads %d" % (on["sy"], POSITION)
|
||||
assert on["mx"] == pytest.approx(on["sx"] + BORDER, abs=0.01)
|
||||
assert on["my"] == pytest.approx(on["sy"] + POPUP_UI, abs=0.01)
|
||||
|
||||
# The control: a launch declared with a second frame keeps the page's x and reads the second default for y.
|
||||
# The control: a launch declared with a second frame keeps the page's x and the same y.
|
||||
other_declared = frame_extra(OTHER_BORDER, OTHER_POPUP_UI)
|
||||
|
||||
def has_the_other_frame(reading):
|
||||
@@ -112,9 +111,6 @@ def test_a_popup_naming_only_left_reads_that_x_and_the_declared_default_y(firefo
|
||||
other = read_popup(firefox_binary, extra_prefs=OTHER_FRAME, ready=has_the_other_frame, features=features)["popup"]
|
||||
assert (other["ow"] - other["iw"], other["oh"] - other["ih"]) == other_declared
|
||||
assert other["sx"] == LEFT, "declared with another frame the popup reads screenX %r, the page asked for %d" % (other["sx"], LEFT)
|
||||
assert other["sy"] == OTHER_POSITION, (
|
||||
"declared with another default position the popup reads screenY %r, the second declaration is %d" % (other["sy"], OTHER_POSITION))
|
||||
assert other["sy"] == POSITION, "declared with another frame the popup reads screenY %r, Firefox's own is %d" % (other["sy"], POSITION)
|
||||
assert other["mx"] == pytest.approx(LEFT + OTHER_BORDER, abs=0.01)
|
||||
assert other["my"] == pytest.approx(OTHER_POSITION + OTHER_POPUP_UI, abs=0.01)
|
||||
assert other["sy"] != on["sy"] and other["sx"] == on["sx"], (
|
||||
"the declaration decides y alone when the page names x: %r vs %r" % (other, on))
|
||||
assert other["my"] == pytest.approx(POSITION + OTHER_POPUP_UI, abs=0.01)
|
||||
@@ -46,7 +46,7 @@ DELIBERATE_VS_PUBLIC_API = {
|
||||
}
|
||||
|
||||
|
||||
def test_the_wrapper_composes_what_the_public_api_composes():
|
||||
def test_the_wrapper_composes_what_the_public_api_composes(lab_exit):
|
||||
profile = generate_profile(SEED)
|
||||
mine = build_prefs(profile=profile, locale=LOCALE, timezone=TZ,
|
||||
extra_prefs=None, virtual_display=False,
|
||||
|
||||
@@ -15,8 +15,7 @@ One launch per exit (``observed``, six of them) is read by the tests below; each
|
||||
* WebRTC: the candidates and the SDP carry nothing of this machine;
|
||||
* DNS: the names of the pages reach the gateway (as DoH) and are not asked of the system resolver;
|
||||
* the time zone of the page, of its offsets read two ways, and of a worker;
|
||||
* the language of the page, of a worker and of the Accept-Language the site receives, and that it fits the exit's country;
|
||||
* a vendored detection page, served locally and loaded behind the gateway.
|
||||
* the language of the page, of a worker and of the Accept-Language the site receives, and that it fits the exit's country.
|
||||
|
||||
The four states of the gateway (coherent, TCP only, mismatched, silent) are tested by ``test_webrtc_realness.py``; here only the
|
||||
"nothing of the host" part of a coherent gather is added.
|
||||
@@ -41,7 +40,6 @@ from _host_address import this_host_address
|
||||
from _leaks import ResolverTrap, Watcher
|
||||
from _socks_servers import STUN_NUMBER, STUN_PORT
|
||||
from _udp_line import egress_by_proxy, measure_servers
|
||||
from test_detectors_e2e import _DetectorSite
|
||||
from test_webrtc_realness import _RELAY_PROBE_JS
|
||||
|
||||
pytestmark = [pytest.mark.e2e, pytest.mark.usefixtures("the_udp_line")]
|
||||
@@ -195,76 +193,6 @@ def test_the_language_of_the_page_its_worker_and_the_header_agree_and_fit_the_co
|
||||
assert problems == [], "exit %s (%s, %s): %s" % (observed.exit_ip, observed.label, observed.country, problems)
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------- the vendored detection page
|
||||
#: What the vendored detection page reads, in the page itself: the outcome fields only (the lies, the flags of a headless
|
||||
#: browser, and the three "lied" fields of the zone, the Intl and the worker).
|
||||
_DETECTION_JS = """() => {
|
||||
const f = window.Fingerprint;
|
||||
if (!f || !f.headless) return {ready: false};
|
||||
const on = (o) => Object.entries(o || {}).filter(([, v]) => v === true).map(([k]) => k).sort();
|
||||
return {
|
||||
ready: true,
|
||||
lies: (f.lies && f.lies.totalLies) || 0,
|
||||
headless: on(f.headless.headless),
|
||||
zone: f.timezone ? {location: f.timezone.location, lied: !!f.timezone.lied} : null,
|
||||
intl: f.intl ? {lied: !!f.intl.lied} : null,
|
||||
worker: f.workerScope ? {lied: !!f.workerScope.lied} : null,
|
||||
};
|
||||
}"""
|
||||
|
||||
|
||||
def _detection_page_of(site):
|
||||
"""The URL of the vendored detection page of the local site of ``test_detectors_e2e.py``: the one of its URL properties that
|
||||
is not the root (the root serves three other libraries; this page is the one that reports lies and headless flags)."""
|
||||
own = [name for name, value in vars(type(site)).items() if isinstance(value, property) and name.endswith("_url")]
|
||||
assert len(own) == 1, own
|
||||
return getattr(site, own[0])
|
||||
|
||||
|
||||
def test_the_vendored_detection_page_finds_nothing_behind_the_gateway(firefox_binary, monkeypatch):
|
||||
"""6. The vendored detection page, served locally, loaded behind the gateway: no lies, no flag of a headless browser, and
|
||||
none of the zone, the Intl or the worker reads marked as lied; and the zone the page reads is the exit's.
|
||||
|
||||
Stock Playwright Firefox 1.62 (its own Firefox, no proxy, the same page, observed once on the machine this was written on)
|
||||
shows ZERO lies and ZERO lied fields, and ONE headless flag: ``webDriverIsOn``, because stock runs with ``navigator.webdriver``
|
||||
true. That flag is the automation itself and not a reading the browser should share, so the assertion here stays zero for
|
||||
the headless flags; for the lies and the lied fields stock's outcome is zero too, so they are asserted zero. The page's
|
||||
worker-scope key was absent from stock's fingerprint, so it is asserted only when the page produces it."""
|
||||
from invisible_core import _geo
|
||||
|
||||
exit_ip = rs.EXITS["germany"]
|
||||
expected_zone, _country = _truth_of(exit_ip)
|
||||
doh = FakeDoh(rs.ZONE_NAMES)
|
||||
site = _DetectorSite()
|
||||
gateway = rs.ExitGateway("exit", doh, udp="relay", tcp_exit=exit_ip, udp_exit=exit_ip, relay_host=this_host_address())
|
||||
try:
|
||||
monkeypatch.setattr(_geo, "discover_egress_ip", egress_by_proxy(gateway))
|
||||
with _launch(firefox_binary, gateway) as browser:
|
||||
context = browser.new_context(ignore_https_errors=True)
|
||||
page = context.new_page()
|
||||
page.goto(_detection_page_of(site), wait_until="domcontentloaded", timeout=60000)
|
||||
page.wait_for_function("() => !!(window.Fingerprint && window.Fingerprint.headless)", timeout=90000)
|
||||
outcome = page.evaluate(_DETECTION_JS)
|
||||
context.close()
|
||||
reached = ("127.0.0.1", site.port) in gateway.connects
|
||||
finally:
|
||||
site.close()
|
||||
gateway.close()
|
||||
doh.close()
|
||||
print("[detection page behind %s] %r" % (exit_ip, outcome))
|
||||
assert outcome["ready"], "the detection page never produced its fingerprint: %r" % outcome
|
||||
assert reached, "the detection page was not loaded through the gateway: %s" % gateway.connects
|
||||
assert outcome["lies"] == 0, "the detection page found %d lie(s): %r" % (outcome["lies"], outcome)
|
||||
assert outcome["headless"] == [], "the detection page raised headless flags: %r" % outcome
|
||||
lied = {k: v for k, v in (("zone", outcome["zone"]), ("intl", outcome["intl"]), ("worker", outcome["worker"]))
|
||||
if v and v.get("lied")}
|
||||
assert not lied, "the detection page marked as lied: %r" % lied
|
||||
assert outcome["zone"] is not None, "the detection page read no zone: %r" % outcome
|
||||
read = outcome["zone"]["location"].replace(", ", "/").replace(" ", "_")
|
||||
assert read in rs.acceptable_zones(expected_zone) or read == expected_zone, (
|
||||
"the detection page reads the zone %r, the exit's is %s" % (outcome["zone"]["location"], expected_zone))
|
||||
|
||||
|
||||
def test_the_exits_are_distinct_places():
|
||||
"""The six exits are six different zones (a test of the table, with no browser: it asks the database only), so a page that
|
||||
ignored the exit and kept one zone could not pass them all."""
|
||||
|
||||
@@ -55,6 +55,14 @@ EXCLUDED = {
|
||||
(_BOTH, "wrapper.e2e.ab_host: the host oracle has its own row and job (e2e-host-* in e2e.yml)"),
|
||||
"tests/test_ab_host_crash_linux_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.ab_host_crash: the host oracle's recorder on a launch that dies on purpose has its own row (Linux only) and runs in the host oracle's job"),
|
||||
"tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.stock_twin: the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
|
||||
"tests/test_a_select_dropdown_opens_at_its_element_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.stock_twin: the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
|
||||
"tests/test_a_tooltip_opens_at_the_pointer_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.stock_twin: the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
|
||||
"tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.stock_twin: the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
|
||||
"tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py":
|
||||
(_BOTH, "wrapper.e2e.udp.exit: the lab's exit is an address held on lo as root (Linux only), run in the root step"),
|
||||
"tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick":
|
||||
@@ -91,7 +99,7 @@ EXCLUDED = {
|
||||
(("windows",), "skips on Windows: the Linux text path"),
|
||||
}
|
||||
#: Changed by hand, together with the list above: an exclusion is a test the candidate does not run, and it may not be added in silence.
|
||||
EXCLUDED_COUNT = 21
|
||||
EXCLUDED_COUNT = 25
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
|
||||
@@ -12,7 +12,10 @@ With the engine NOT declared (``zoom.stealth.fpp.hw_seed`` = 0, the negative con
|
||||
runs in both launches, and that is what the test asserts there (``engine_reaches("firefox-69")`` decides).
|
||||
|
||||
Why a page sees it: what the probe reads of the host decided, through the feature status, whether WebGL existed and on which path; a slow or failed probe
|
||||
took WebGL away for the whole session. Each launch also asks a page for ``getContext('webgl')``.
|
||||
took WebGL away for the whole session. Each launch also asks a page for ``getContext('webgl')``: the request is what makes Firefox read
|
||||
``GfxInfo::GetData``. With the engine declared its answer is a verdict (the engine's own GL must give a context). With the engine off it is
|
||||
evidence only, written in the failure message and never judged: the context then comes from the host's Mesa, which a runner may not serve
|
||||
(hunt run 45998187350: one engine-off launch in 3083 got no context, "Exhausted GL driver options"), and a test cannot fail for the host's GL.
|
||||
|
||||
How it is observed (the process, not a value). A thread samples the processes below this test with psutil from before the launch to after the browser
|
||||
has closed (``tests/_process_sampler.py``). The probe lives for tens of milliseconds and a poll can fall between two samples, so the sampler alone never
|
||||
@@ -89,7 +92,9 @@ def _check(firefox_binary, tmp_path, extra_prefs, want_probe):
|
||||
_require_strace_can_trace(tmp_path)
|
||||
glx, problems, webgl, report, parents, goto_at = _launch(firefox_binary, tmp_path / "launch", extra_prefs)
|
||||
assert problems == [], "the observation cannot be trusted:\n%s\n%s" % ("\n".join(problems), report)
|
||||
assert webgl is True, "getContext('webgl') is null\n" + report
|
||||
report = "getContext('webgl') answered %r%s\n%s" % (webgl, "" if extra_prefs is None else " (engine off: evidence, not a verdict)", report)
|
||||
if extra_prefs is None:
|
||||
assert webgl is True, "getContext('webgl') is null with the engine declared\n" + report
|
||||
if want_probe:
|
||||
assert glx, "no GLX probe (gfxtest glx) below the browser's parent %s\n%s" % (parents, report)
|
||||
strays = [(e.pid, s.ppid) for e, s in glx if s.ppid not in parents]
|
||||
@@ -107,5 +112,6 @@ def test_a_declared_engine_starts_no_host_gl_probe(firefox_binary, engine_reache
|
||||
|
||||
|
||||
def test_an_undeclared_engine_starts_mozilla_s_host_gl_probe(firefox_binary, tmp_path):
|
||||
"""The negative control: with the engine off Mozilla's probe starts as in stock Firefox, on every engine, and the page still has WebGL."""
|
||||
"""The negative control: with the engine off Mozilla's probe starts as in stock Firefox, on every engine. The page still asks for WebGL
|
||||
(the request is what makes Firefox read GfxInfo); its answer, on the host's Mesa, is written down and not judged."""
|
||||
_check(firefox_binary, tmp_path, UNDECLARED, want_probe=True)
|
||||
@@ -0,0 +1,352 @@
|
||||
r"""The install-from-index job installs its test harness from the wrapper's hashed lock, and the lock holds every third-party module the tests import.
|
||||
|
||||
Ledger PR #618 (release 0.60.0) was red on `windows-latest - install from index and launch` with ``ModuleNotFoundError: No module named 'psutil'`` at
|
||||
tests/_os_cursor.py: the module came with #609, and the step "Test harness only" of ``.github/workflows/user-install.yml`` installed a hand list
|
||||
(``pip install --upgrade pip pytest packaging uv``). That job runs only on ledger pull requests, so nothing else caught it, and a hand list drifts by construction:
|
||||
every new import of a test is a line somebody has to remember in a second place.
|
||||
|
||||
The harness now comes from ``ci/py-lock/gate.txt`` (ci-03: the index is read only through hashed locks), the lock the other test jobs install, with
|
||||
``--require-hashes`` and nothing else on the line. The lock holds ``uv`` (the wait on the index asks it, and the release test installs the package with it) and
|
||||
neither invisible-playwright nor invisible-core: the test installs the package under test from the index into a venv of its own, and a second copy on the path
|
||||
would make the assertions read the wrong one.
|
||||
|
||||
This test closes the circle without the network:
|
||||
|
||||
* the step of the harness installs exactly ``--require-hashes -r ci/py-lock/gate.txt`` (no package named on the line, no ``--upgrade``), before the wait and before
|
||||
the tests, and no other step of the job runs ``pip install``;
|
||||
* the lock holds neither of our two packages;
|
||||
* every third-party top-level module any file under tests/ imports (found with ``ast``; the standard library, the repository's own modules and our two packages are
|
||||
not third-party) belongs to a distribution the lock holds. An import guarded by ``try/except ImportError`` is optional: it is listed (so a new optional import is
|
||||
a decision made here, in OPTIONAL) and is not required.
|
||||
|
||||
Known-bad inputs, run on the parsers: the hand list of #618, a package named beside the lock, no ``--require-hashes``, a second ``pip install`` in the job, a lock
|
||||
without psutil, an import the lock does not cover. The green case is the state of the repository.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import importlib.metadata
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
import ci_py_lock as lock # noqa: E402
|
||||
|
||||
WORKFLOW = ROOT / ".github" / "workflows" / "user-install.yml"
|
||||
LOCK = "ci/py-lock/gate.txt"
|
||||
HARNESS_STEP = "Test harness only"
|
||||
JOB = "install"
|
||||
|
||||
#: The packages the job must not install in its harness: the test installs them itself, from the index, into its own venv.
|
||||
UNDER_TEST = {"invisible-playwright", "invisible-core"}
|
||||
OWN_MODULES = {"invisible_playwright", "invisible_core"}
|
||||
|
||||
#: Third-party modules the tests import only inside ``try/except ImportError``: not required in the lock. A new one is added here on purpose.
|
||||
OPTIONAL = {"playwright"}
|
||||
|
||||
#: Module -> distribution for the names whose distribution cannot be read from the environment (a module not installed where this runs, or a private module of
|
||||
#: a distribution). ``importlib.metadata.packages_distributions()`` is asked first.
|
||||
KNOWN_DISTRIBUTIONS = {
|
||||
"_pytest": "pytest", "pytest": "pytest", "aioquic": "aioquic", "cryptography": "cryptography", "h2": "h2", "hyperframe": "hyperframe",
|
||||
"maxminddb": "maxminddb", "packaging": "packaging", "platformdirs": "platformdirs", "playwright": "playwright", "psutil": "psutil",
|
||||
"requests": "requests", "websockets": "websockets",
|
||||
}
|
||||
|
||||
PIP_INSTALL = re.compile(r"\bpip3?\s+install\b")
|
||||
|
||||
|
||||
# ── the workflow ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def _job_steps(text: str, job: str) -> list[tuple[str, str]]:
|
||||
"""[(name, the lines of the step without comments)] of the steps of a job, read line by line (PyYAML is not a dependency of this package)."""
|
||||
lines = text.replace("\r\n", "\n").split("\n")
|
||||
start = next(i for i, line in enumerate(lines) if line == "jobs:")
|
||||
inside, steps = False, []
|
||||
for line in lines[start + 1:]:
|
||||
m = re.match(r"^ ([\w-]+):\s*$", line)
|
||||
if m:
|
||||
inside = m.group(1) == job
|
||||
continue
|
||||
if not inside:
|
||||
continue
|
||||
s = re.match(r"^ - (.*)$", line)
|
||||
if s:
|
||||
steps.append([s.group(1).strip(), []])
|
||||
line = " " + s.group(1)
|
||||
if steps and line.strip() and not line.lstrip().startswith("#"):
|
||||
steps[-1][1].append(line.strip())
|
||||
out = []
|
||||
for first, body in steps:
|
||||
name = re.match(r"name:\s*(.*)$", first)
|
||||
out.append((name.group(1).strip("\"'") if name else first, "\n".join(body)))
|
||||
return out
|
||||
|
||||
|
||||
def _run_text(body: str) -> str:
|
||||
"""What a step runs: the `run:` value, inline or as a block."""
|
||||
lines = body.split("\n")
|
||||
for i, line in enumerate(lines):
|
||||
if line.startswith("run:"):
|
||||
value = line[4:].strip()
|
||||
return "\n".join(lines[i + 1:]) if value in ("|", ">") else value
|
||||
return ""
|
||||
|
||||
|
||||
def workflow_problems(text: str) -> list[str]:
|
||||
out = []
|
||||
steps = _job_steps(text, JOB)
|
||||
names = [n for n, _ in steps]
|
||||
if names.count(HARNESS_STEP) != 1:
|
||||
return ["the job %r has %d steps named %r, expected one" % (JOB, names.count(HARNESS_STEP), HARNESS_STEP)]
|
||||
index = names.index(HARNESS_STEP)
|
||||
run = " ".join(_run_text(steps[index][1]).split())
|
||||
m = PIP_INSTALL.search(run)
|
||||
if not m:
|
||||
out.append("the harness step does not run `pip install`: %r" % run)
|
||||
else:
|
||||
tail = run[m.end():].split()
|
||||
if sorted(tail) != sorted(["--require-hashes", "-r", LOCK]) or tail[tail.index("-r") + 1:][:1] != [LOCK]:
|
||||
out.append("the harness step installs %r, expected exactly `--require-hashes -r %s` (no package named, no --upgrade, no other option)" % (" ".join(tail), LOCK))
|
||||
if "python -m pip install" not in run:
|
||||
out.append("the harness step must be `python -m pip install ...` (the pip of the interpreter the tests run with): %r" % run)
|
||||
# nothing else of the job installs from the index: the wait and the tests run with what the harness put there
|
||||
for i, (name, body) in enumerate(steps):
|
||||
if i != index and PIP_INSTALL.search(body):
|
||||
out.append("step %r also runs `pip install`: the job reads the index only through the lock" % name)
|
||||
# the harness is in place before the first step that needs it
|
||||
for needs in ("wait for the index to serve this version", "The user path, end to end"):
|
||||
if needs not in names:
|
||||
out.append("the job has no step %r" % needs)
|
||||
elif names.index(needs) < index:
|
||||
out.append("step %r runs before the harness is installed" % needs)
|
||||
return out
|
||||
|
||||
|
||||
# ── the lock ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def locked(lock_text: str) -> set[str]:
|
||||
return {lock.norm(name.split("[")[0]) for name, _v, _m, _h in lock.parse_lock(lock_text)}
|
||||
|
||||
|
||||
def lock_problems(lock_text: str) -> list[str]:
|
||||
held = locked(lock_text)
|
||||
return ["the lock holds %s, which the test installs from the index itself into its own venv" % n for n in sorted(held & UNDER_TEST)]
|
||||
|
||||
|
||||
# ── the imports of the tests ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def own_modules(root: Path) -> set[str]:
|
||||
"""Modules and packages the repository itself provides to its tests: anything under tests/, the scripts the tests import, the package under src/."""
|
||||
names: set[str] = set(OWN_MODULES) | {"tests"}
|
||||
for base in ("tests", "scripts", "src"):
|
||||
folder = root / base
|
||||
if not folder.is_dir():
|
||||
continue
|
||||
if base == "tests":
|
||||
names |= {p.stem for p in folder.rglob("*.py")} | {p.name for p in folder.rglob("*") if p.is_dir()}
|
||||
else:
|
||||
names |= {p.stem for p in folder.glob("*.py")} | {p.name for p in folder.iterdir() if p.is_dir()}
|
||||
return names
|
||||
|
||||
|
||||
def _guards_import_error(handler: ast.ExceptHandler) -> bool:
|
||||
if handler.type is None:
|
||||
return True
|
||||
kinds = handler.type.elts if isinstance(handler.type, ast.Tuple) else [handler.type]
|
||||
return any(isinstance(k, ast.Name) and k.id in {"ImportError", "ModuleNotFoundError", "Exception", "BaseException"} for k in kinds)
|
||||
|
||||
|
||||
def third_party_imports(root: Path) -> dict[str, dict[str, bool]]:
|
||||
"""{top-level module: {file: guarded}} for every import under tests/ that is neither standard library nor ours. ``guarded`` is True when the import
|
||||
sits in a ``try`` whose handlers catch ImportError."""
|
||||
own = own_modules(root)
|
||||
found: dict[str, dict[str, bool]] = {}
|
||||
for path in sorted((root / "tests").rglob("*.py")):
|
||||
tree = ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
|
||||
guarded: set[int] = set()
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Try) and any(_guards_import_error(h) for h in node.handlers):
|
||||
guarded |= {id(n) for b in node.body for n in ast.walk(b) if isinstance(n, (ast.Import, ast.ImportFrom))}
|
||||
rel = path.relative_to(root).as_posix()
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Import):
|
||||
mods = [a.name.split(".")[0] for a in node.names]
|
||||
elif isinstance(node, ast.ImportFrom) and node.level == 0 and node.module:
|
||||
mods = [node.module.split(".")[0]]
|
||||
else:
|
||||
continue
|
||||
for mod in mods:
|
||||
if mod in sys.stdlib_module_names or mod in own:
|
||||
continue
|
||||
found.setdefault(mod, {})[rel] = found.get(mod, {}).get(rel, True) and id(node) in guarded
|
||||
return found
|
||||
|
||||
|
||||
def distribution_of(module: str) -> str | None:
|
||||
dists = importlib.metadata.packages_distributions().get(module)
|
||||
if dists:
|
||||
return lock.norm(dists[0])
|
||||
return lock.norm(KNOWN_DISTRIBUTIONS[module]) if module in KNOWN_DISTRIBUTIONS else None
|
||||
|
||||
|
||||
def import_problems(imports: dict[str, dict[str, bool]], lock_text: str) -> list[str]:
|
||||
held = locked(lock_text)
|
||||
out = []
|
||||
for module, files in sorted(imports.items()):
|
||||
optional = all(files.values())
|
||||
if optional and module not in OPTIONAL:
|
||||
out.append("%s is imported only inside try/except ImportError (%s) but is not in OPTIONAL: add it there on purpose" % (module, sorted(files)[0]))
|
||||
if optional:
|
||||
continue
|
||||
dist = distribution_of(module)
|
||||
if dist is None:
|
||||
out.append("%s (imported by %s) belongs to no known distribution: add it to KNOWN_DISTRIBUTIONS" % (module, sorted(files)[0]))
|
||||
elif dist not in held:
|
||||
out.append("%s (distribution %s, imported by %s) is not in %s: the install job would fail with ModuleNotFoundError" % (module, dist, sorted(files)[0], LOCK))
|
||||
return out
|
||||
|
||||
|
||||
# ── the state of the repository ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def test_the_harness_step_installs_the_hashed_lock_and_nothing_else():
|
||||
assert workflow_problems(WORKFLOW.read_text(encoding="utf-8")) == []
|
||||
|
||||
|
||||
def test_the_lock_holds_neither_package_under_test():
|
||||
assert lock_problems((ROOT / LOCK).read_text(encoding="utf-8")) == []
|
||||
|
||||
|
||||
def test_the_lock_holds_uv_which_the_wait_and_the_release_test_use():
|
||||
assert "uv" in locked((ROOT / LOCK).read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def test_every_third_party_module_the_tests_import_is_in_the_lock():
|
||||
imports = third_party_imports(ROOT)
|
||||
assert "psutil" in imports and "pytest" in imports, "the scan found no psutil or pytest: it does not see the tests"
|
||||
assert import_problems(imports, (ROOT / LOCK).read_text(encoding="utf-8")) == []
|
||||
|
||||
|
||||
def test_psutil_of_ledger_618_is_covered_by_the_lock_the_step_installs():
|
||||
lock_text = (ROOT / LOCK).read_text(encoding="utf-8")
|
||||
assert "psutil" in third_party_imports(ROOT)
|
||||
assert "psutil" in locked(lock_text)
|
||||
assert "psutil" in {distribution_of(m) for m in third_party_imports(ROOT)}
|
||||
|
||||
|
||||
# ── known-bad inputs ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def _workflow(harness_run: str, extra: str = "") -> str:
|
||||
return f"""name: user-install
|
||||
jobs:
|
||||
linux-deps-user-install:
|
||||
uses: ./.github/workflows/linux-deps.yml
|
||||
install:
|
||||
steps:
|
||||
- uses: actions/checkout@abc # v4
|
||||
# a comment between the steps
|
||||
- name: Test harness only
|
||||
run: {harness_run}
|
||||
{extra} - name: wait for the index to serve this version
|
||||
shell: bash
|
||||
run: |
|
||||
python - <<'PY'
|
||||
print("pip download")
|
||||
PY
|
||||
- name: The user path, end to end
|
||||
run: |
|
||||
python -m pytest tests/test_release_e2e.py -m e2e
|
||||
"""
|
||||
|
||||
|
||||
GOOD_RUN = "python -m pip install --require-hashes -r ci/py-lock/gate.txt"
|
||||
|
||||
|
||||
def test_a_workflow_with_the_lock_step_is_clean():
|
||||
assert workflow_problems(_workflow(GOOD_RUN)) == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("run, what", [
|
||||
("python -m pip install --upgrade pip pytest packaging uv", "the hand list of ledger #618"),
|
||||
(GOOD_RUN + " pytest", "a package named beside the lock"),
|
||||
(GOOD_RUN + " --upgrade", "an option beside the lock"),
|
||||
("python -m pip install -r ci/py-lock/gate.txt", "no --require-hashes"),
|
||||
("python -m pip install --require-hashes -r requirements.txt", "another file"),
|
||||
("python -m pip install --require-hashes -r ci/py-lock/gate.txt invisible-playwright", "the package under test"),
|
||||
("pip install --require-hashes -r ci/py-lock/gate.txt", "not the pip of the interpreter"),
|
||||
("echo nothing", "no install at all"),
|
||||
])
|
||||
def test_a_harness_step_that_is_not_the_lock_alone_is_refused(run, what):
|
||||
assert workflow_problems(_workflow(run)), what
|
||||
|
||||
|
||||
def test_a_second_install_in_the_job_is_refused():
|
||||
extra = " - name: one more\n run: python -m pip install pyyaml\n"
|
||||
assert any("one more" in p for p in workflow_problems(_workflow(GOOD_RUN, extra)))
|
||||
|
||||
|
||||
def test_a_harness_after_the_step_that_needs_it_is_refused():
|
||||
text = _workflow(GOOD_RUN)
|
||||
harness = " - name: Test harness only\n run: " + GOOD_RUN + "\n"
|
||||
moved = text.replace(harness, "") + harness
|
||||
assert any("runs before the harness" in p for p in workflow_problems(moved))
|
||||
|
||||
|
||||
def test_a_lock_that_holds_the_package_under_test_is_refused():
|
||||
text = (ROOT / LOCK).read_text(encoding="utf-8") + "invisible-core==1.0.0 \\\n --hash=sha256:" + "0" * 64 + "\n"
|
||||
assert lock_problems(text) and "invisible-core" in lock_problems(text)[0]
|
||||
|
||||
|
||||
def _tree(tmp_path: Path, files: dict[str, str]) -> Path:
|
||||
for name, body in files.items():
|
||||
p = tmp_path / name
|
||||
p.parent.mkdir(parents=True, exist_ok=True)
|
||||
p.write_text(body, encoding="utf-8")
|
||||
return tmp_path
|
||||
|
||||
|
||||
def test_the_scan_keeps_third_party_and_drops_standard_library_own_and_relative(tmp_path):
|
||||
root = _tree(tmp_path, {
|
||||
"tests/test_a.py": "import os\nimport psutil\nfrom helper import x\nfrom . import y\nimport invisible_core\nfrom invisible_playwright.sync_api import z\nimport scriptlib\n",
|
||||
"tests/helper.py": "import requests.adapters\n",
|
||||
"scripts/scriptlib.py": "",
|
||||
"src/invisible_playwright/__init__.py": "",
|
||||
})
|
||||
assert {m: sorted(f) for m, f in third_party_imports(root).items()} == {"psutil": ["tests/test_a.py"], "requests": ["tests/helper.py"]}
|
||||
|
||||
|
||||
def test_a_guarded_import_is_optional_and_an_unguarded_one_anywhere_is_required(tmp_path):
|
||||
root = _tree(tmp_path, {
|
||||
"tests/test_a.py": "try:\n import playwright\nexcept ImportError:\n playwright = None\ntry:\n import psutil\nexcept ModuleNotFoundError:\n psutil = None\n",
|
||||
"tests/test_b.py": "import psutil\n",
|
||||
})
|
||||
found = third_party_imports(root)
|
||||
assert found["playwright"] == {"tests/test_a.py": True}
|
||||
assert found["psutil"] == {"tests/test_a.py": True, "tests/test_b.py": False}
|
||||
|
||||
|
||||
def test_an_import_the_lock_does_not_cover_is_named_with_its_file(tmp_path):
|
||||
root = _tree(tmp_path, {"tests/test_a.py": "import psutil\n"})
|
||||
lock_text = (ROOT / LOCK).read_text(encoding="utf-8")
|
||||
without = re.sub(r"(?ms)^psutil==.*?(?=^\S)", "", lock_text)
|
||||
assert "psutil" not in locked(without) and "psutil" in locked(lock_text)
|
||||
problems = import_problems(third_party_imports(root), without)
|
||||
assert len(problems) == 1 and "psutil" in problems[0] and "tests/test_a.py" in problems[0]
|
||||
assert import_problems(third_party_imports(root), lock_text) == []
|
||||
|
||||
|
||||
def test_a_module_of_no_known_distribution_is_named(tmp_path):
|
||||
root = _tree(tmp_path, {"tests/test_a.py": "import a_module_nobody_ships\n"})
|
||||
problems = import_problems(third_party_imports(root), (ROOT / LOCK).read_text(encoding="utf-8"))
|
||||
assert len(problems) == 1 and "a_module_nobody_ships" in problems[0]
|
||||
|
||||
|
||||
def test_an_optional_import_not_listed_as_optional_is_a_decision_to_make(tmp_path):
|
||||
root = _tree(tmp_path, {"tests/test_a.py": "try:\n import brotli\nexcept ImportError:\n brotli = None\n"})
|
||||
problems = import_problems(third_party_imports(root), (ROOT / LOCK).read_text(encoding="utf-8"))
|
||||
assert len(problems) == 1 and "OPTIONAL" in problems[0]
|
||||
@@ -52,61 +52,75 @@ os.replace(tmp, p)
|
||||
# the clock moves only by what the script sleeps and by what a call is said to cost, never by the real time a call took. How many rounds the
|
||||
# wait makes is then decided by the answers of the installers and by its own arithmetic, whatever the load of the machine running the test.
|
||||
# A call is free in fake time; one that hangs (exit code HUNG) costs the whole limit it was given, as a real one would. `subprocess` is imported
|
||||
# before the clock is replaced, so its own timeouts stay on the real one.
|
||||
# before the clock is replaced, so its own timeouts stay on the real one - but not its `time.sleep`: on POSIX `Popen.wait(timeout)` (which `run` ends
|
||||
# with) polls `waitpid` in a loop that sleeps through the MODULE attribute `time.sleep`, up to 0.05 s a turn. A child that has closed its pipes and is not
|
||||
# yet reaped (an interpreter shutting down on a busy machine) made that loop spin with the fake sleep, each turn adding up to 0.05 s of fake time at no
|
||||
# real cost: 60 turns passed the 3 s of INDEX_WAIT_SECONDS after one all-yes round ("1 of 3 rounds in a row ()" on the Linux job of #612). So the real
|
||||
# `run` executes with the real clock back in place, and the fake one is put back when it returns.
|
||||
_HUNG = 99
|
||||
_FAKE_CLOCK = """
|
||||
import subprocess, time
|
||||
_now = [1000.0]
|
||||
_run = subprocess.run
|
||||
_real_monotonic = time.monotonic
|
||||
_real_sleep = time.sleep
|
||||
|
||||
|
||||
def _fake_sleep(seconds):
|
||||
_now[0] += seconds
|
||||
|
||||
|
||||
def _run_in_fake_time(*args, **kwargs):
|
||||
done = _run(*args, **dict(kwargs, timeout=60))
|
||||
time.monotonic, time.sleep = _real_monotonic, _real_sleep
|
||||
try:
|
||||
done = _run(*args, **dict(kwargs, timeout=60))
|
||||
finally:
|
||||
time.monotonic, time.sleep = lambda: _now[0], _fake_sleep
|
||||
if done.returncode == %d:
|
||||
_now[0] += kwargs["timeout"]
|
||||
raise subprocess.TimeoutExpired(args[0], kwargs["timeout"])
|
||||
return done
|
||||
|
||||
|
||||
def _sleep(seconds):
|
||||
_now[0] += seconds
|
||||
|
||||
|
||||
subprocess.run = _run_in_fake_time
|
||||
time.monotonic = lambda: _now[0]
|
||||
time.sleep = _sleep
|
||||
time.sleep = _fake_sleep
|
||||
""" % _HUNG
|
||||
|
||||
|
||||
def _tool(tmp_path, name, plan, load=0.0):
|
||||
def _tool(tmp_path, name, plan, load=0.0, linger=0.0):
|
||||
"""A regular package `name` on the shim path whose `__main__` answers call number i as plan[i] says (the last letter repeats):
|
||||
y = resolves it, n = no such version, h = does not answer (exits with HUNG, which the fake clock below turns into a call that outlived its limit).
|
||||
It counts its calls in `<name>-calls`. `load` is real time every call spends before it answers: what a machine busy with other work takes."""
|
||||
It counts its calls in `<name>-calls`. `load` is real time every call spends before it answers: what a machine busy with other work takes.
|
||||
`linger` is real time it spends AFTER it answered and closed its pipes, before it exits: a child that is not yet reaped (the window a busy machine opens)."""
|
||||
shim = tmp_path / "shim" / name
|
||||
shim.mkdir(parents=True)
|
||||
(shim / "__init__.py").write_text("", encoding="utf-8") # a REGULAR package: a namespace one loses to the real one of the environment
|
||||
(shim / "__main__.py").write_text(_COUNT_CALL % str(tmp_path / (name + "-calls")) + textwrap.dedent("""
|
||||
import sys, time
|
||||
import os, sys, time
|
||||
sys.stdin.read() if %r == "uv" else None
|
||||
plan = %r
|
||||
what = plan[min(n, len(plan) - 1)]
|
||||
time.sleep(%r)
|
||||
if what == "h":
|
||||
sys.exit(%d)
|
||||
if what == "y":
|
||||
sys.exit(0)
|
||||
sys.stderr.write("ERROR: No matching distribution found for invisible-playwright==9.9.9" + chr(10))
|
||||
sys.exit(1)
|
||||
""") % (name, plan, load, _HUNG), encoding="utf-8")
|
||||
code = %d if what == "h" else 0 if what == "y" else 1
|
||||
if what == "n":
|
||||
sys.stderr.write("ERROR: No matching distribution found for invisible-playwright==9.9.9" + chr(10))
|
||||
if %r:
|
||||
sys.stdout.flush(); sys.stderr.flush()
|
||||
os.close(1); os.close(2)
|
||||
time.sleep(%r)
|
||||
os._exit(code)
|
||||
sys.exit(code)
|
||||
""") % (name, plan, load, _HUNG, linger, linger), encoding="utf-8")
|
||||
|
||||
|
||||
def _run_the_wait(tmp_path, pip="y", uv="y", *, seconds=3.0, poll=0.05, call_seconds=None, load=0.0):
|
||||
def _run_the_wait(tmp_path, pip="y", uv="y", *, seconds=3.0, poll=0.05, call_seconds=None, load=0.0, linger=0.0):
|
||||
"""Run the script of the step in a project named ``invisible-playwright`` 9.9.9, with a ``pip`` and a ``uv`` that answer as their plans say.
|
||||
Returns (completed process, pip calls, uv calls)."""
|
||||
# The tree declares 0.99.0 and the ledger pull request records 9.9.9 (what the step before the wait computes): the wait is about the latter.
|
||||
(tmp_path / "pyproject.toml").write_text('[project]\nname = "invisible-playwright"\nversion = "0.99.0"\n', encoding="utf-8")
|
||||
_tool(tmp_path, "pip", pip, load)
|
||||
_tool(tmp_path, "uv", uv, load)
|
||||
_tool(tmp_path, "pip", pip, load, linger)
|
||||
_tool(tmp_path, "uv", uv, load, linger)
|
||||
env = dict(os.environ, PYTHONPATH=str(tmp_path / "shim"), INDEX_WAIT_SECONDS=str(seconds), INDEX_WAIT_POLL=str(poll), INVPW_E2E_VERSION="9.9.9")
|
||||
if call_seconds is not None:
|
||||
env["INDEX_WAIT_CALL_SECONDS"] = str(call_seconds)
|
||||
@@ -148,6 +162,41 @@ def test_calls_that_take_long_on_a_busy_machine_do_not_cut_the_rounds_short(tmp_
|
||||
assert (pip_calls, uv_calls) == (4, 4), "pip %d, uv %d" % (pip_calls, uv_calls)
|
||||
|
||||
|
||||
def test_a_call_that_is_slow_to_exit_after_it_answered_does_not_move_the_fake_clock(tmp_path):
|
||||
"""The red of #612 (1 of 3 rounds, empty reason, 3 s of fake time gone after one all-yes round): the fake clock moved while the REAL `subprocess.run`
|
||||
ran, because on POSIX `Popen.wait(timeout)` sleeps through `time.sleep` (0.05 s a turn, a busy loop) while a child that closed its pipes is not yet
|
||||
reaped. Here `communicate` does what that loop does (a thousand turns of 0.05 s) on every OS; a sleep of the script itself, outside the call, still counts."""
|
||||
script = textwrap.dedent("""
|
||||
import subprocess, sys, time
|
||||
_communicate = subprocess.Popen.communicate
|
||||
|
||||
|
||||
def _then_the_turns_of_the_wait_loop(self, *args, **kwargs):
|
||||
out = _communicate(self, *args, **kwargs)
|
||||
for _ in range(1000):
|
||||
time.sleep(0.05)
|
||||
return out
|
||||
|
||||
|
||||
subprocess.Popen.communicate = _then_the_turns_of_the_wait_loop
|
||||
before = _now[0]
|
||||
subprocess.run([sys.executable, "-c", "pass"], capture_output=True, text=True)
|
||||
inside = _now[0] - before
|
||||
time.sleep(1.0)
|
||||
print("inside=%r after_own_sleep=%r" % (inside, _now[0] - before))
|
||||
""")
|
||||
r = subprocess.run([sys.executable, "-c", _FAKE_CLOCK + script], cwd=tmp_path, capture_output=True, text=True, timeout=60)
|
||||
assert r.returncode == 0, r.stdout + r.stderr
|
||||
assert r.stdout.strip() == "inside=0.0 after_own_sleep=1.0", r.stdout + r.stderr
|
||||
|
||||
|
||||
def test_children_not_yet_reaped_when_their_pipes_close_do_not_cut_the_rounds_short(tmp_path):
|
||||
"""The same cause through the real `Popen._wait` (POSIX): each call closes its pipes and exits 0.3 s later, 6 calls against 3 s of fake time."""
|
||||
r, pip_calls, uv_calls = _run_the_wait(tmp_path, linger=0.3)
|
||||
assert r.returncode == 0, r.stdout + r.stderr
|
||||
assert (pip_calls, uv_calls) == (3, 3), "pip %d, uv %d" % (pip_calls, uv_calls)
|
||||
|
||||
|
||||
def test_the_wait_ends_in_an_error_that_names_the_missing_version_when_the_index_never_has_it(tmp_path):
|
||||
r, pip_calls, _ = _run_the_wait(tmp_path, pip="n", uv="n", seconds=1.0)
|
||||
assert r.returncode == 1, "a forgotten publish must fail the job here: " + r.stdout + r.stderr
|
||||
@@ -205,10 +254,13 @@ def test_a_call_killed_while_it_counts_leaves_the_count_it_found(tmp_path):
|
||||
|
||||
|
||||
def test_the_harness_has_uv_for_the_wait_to_ask():
|
||||
"""Read as text: PyYAML is not a dependency of this package (nor of [dev]), as tests/test_ci_runs_once_per_commit.py says."""
|
||||
"""The harness is the wrapper's hashed lock (tests/test_the_install_job_has_every_module_its_tests_import.py holds the step to it), so `uv` is there when the lock holds it.
|
||||
Read as text: PyYAML is not a dependency of this package (nor of [dev]), as tests/test_ci_runs_once_per_commit.py says."""
|
||||
found = re.search(r"^[ \t]*-[ \t]*name:[ \t]*Test harness only[ \t]*\n[ \t]*run:[ \t]*(?P<run>.+)$", WORKFLOW.read_text(encoding="utf-8"), re.M)
|
||||
assert found, "the harness step is gone"
|
||||
assert "pip" in found.group("run") and found.group("run").split()[-1] == "uv", found.group("run")
|
||||
assert found.group("run").split()[-2:] == ["-r", "ci/py-lock/gate.txt"], found.group("run")
|
||||
held = re.findall(r"^uv==", (ROOT / "ci" / "py-lock" / "gate.txt").read_text(encoding="utf-8"), re.M)
|
||||
assert held, "the lock the harness installs does not hold uv, which the wait asks (python -m uv)"
|
||||
|
||||
|
||||
def test_the_wait_step_still_passes_the_gate_of_the_core():
|
||||
|
||||
@@ -0,0 +1,639 @@
|
||||
"""The maximized window of the engine reads as retail Windows Firefox 159.0: the window, its frames (also transformed) and its popups.
|
||||
|
||||
What it checks, per display scale, against retail Firefox 159.0 on Windows 11 measured live (GitHub runs oss-invisible/core 45657528859, 45672953042,
|
||||
45679625406 and 45695770162 for the window; 45952171443 for frames and popups; 46052782097 for transformed frames; RetailCaptures ``notes/window-geometry.md``):
|
||||
|
||||
1. the window as it opens, maximized: the numbers a page reads (``outerWidth``, ``outerHeight``, ``innerWidth``, ``innerHeight``, ``screenX``, ``screenY``,
|
||||
``mozInnerScreenX/Y``) and the offset the mouse events carry (``screenX - clientX``, ``screenY - clientY``), and the page's probe (a copy of the one of
|
||||
RetailCaptures' ``window_geometry/page.html``): ``matchMedia`` width, height, aspect-ratio and resolution (found exactly by binary search over ``min-``
|
||||
queries), ``documentElement.clientWidth`` and ``clientHeight``, and ``visualViewport`` width, height, scale, offsetLeft, offsetTop, pageLeft and pageTop
|
||||
(``RETAIL_PROBE``, printed from the raw files of capture round 4);
|
||||
2. fullscreen in and out FROM the maximized window: the page enters fullscreen with a real click on a button whose handler calls
|
||||
``document.documentElement.requestFullscreen()`` (the click is the client's own, so it is a user gesture, as in ``scripts/ci_host_gate.py``) and reads the
|
||||
window (outer == inner == the declared CSS screen, ``screenX/Y`` 0, ``mozInnerScreen`` 0, the events' offset 0), then ``document.exitFullscreen()`` and reads it
|
||||
again: EVERY value, the probe included, must be the one it had before, exactly;
|
||||
3. the frames of the maximized window, same-origin and cross-site, against retail round 5 (below);
|
||||
4. the popups opened from the maximized window, against retail round 5 (below);
|
||||
5. the cross-site frames under a CSS transform, against retail round 6 (below).
|
||||
|
||||
Four display scales: 1.0, 1.25 and 1.5 on a 1920x1080 panel (device pixels) and 2.0 on a 1600x1200 one. At 1.5 and 2.0 the browser chrome is the compact bar
|
||||
(``screen.availHeight`` 672 CSS pixels at 1.5, 552 at 2.0).
|
||||
A page reads everything in CSS pixels, so the frame in CSS pixels is the frame in device pixels over the scale, rounded the way retail rounds it: the numbers
|
||||
below are what retail answers, not a formula of this test.
|
||||
|
||||
The invariant of the window, in every step: ``event.screenX - event.clientX == mozInnerScreenX`` and ``event.screenY - event.clientY == mozInnerScreenY``, up to the
|
||||
rounding of the event's integer coordinates (``screenX`` and ``clientX`` of an event are whole numbers, ``mozInnerScreen`` is not at a fractional scale). At scale
|
||||
1.0 the frame is whole and the offset is exactly equal.
|
||||
|
||||
The engine that answers these values is not released yet: on the engine of the pin this test is RED, on purpose. It enters the suite with the engine release,
|
||||
and the wrapper pull request that bumps the pin carries it.
|
||||
|
||||
Why a page reads it: ``outerWidth - innerWidth``, ``screenX`` and ``mozInnerScreenX/Y`` are one line each, and a window whose frame is not the frame of a Windows
|
||||
window at that scale (or that does not come back from fullscreen as it was) 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.
|
||||
|
||||
The page is a local one (``Sites``); the mouse is the client's own (``page.mouse.move``), so the events are trusted ones.
|
||||
|
||||
Frames and popups, against retail round 5 (GitHub run oss-invisible/core 45952171443; RetailCaptures ``captures/WINDOW_GEOMETRY_POPUP_FRAME.csv``, whose values are
|
||||
copied by a script into ``RETAIL_FRAMES`` and ``RETAIL_POPUPS`` below, with the file's sha256). This is the comparison with RETAIL; the popup test of the repo
|
||||
(``test_popup_geometry_is_the_declared_frame_e2e.py``) compares with the core's declaration.
|
||||
|
||||
* Frames, in the maximized state: a same-origin frame (300x120 at x 10, y 60, from the page's own site) and a cross-site one (300x120 at x 10, y 200, another
|
||||
local site), added to the page for the reading and removed after it. From inside each frame the test reads ``mozInnerScreenX/Y``, ``outerWidth``,
|
||||
``outerHeight``, ``screenX/Y`` and ``devicePixelRatio``, and the offset the events of a real mouse move over the frame carry. ``outer``, ``screenX/Y`` and ``dpr``
|
||||
are the parent's; ``mozInnerScreen`` is the parent's plus the frame's rect, EXCEPT the cross-site frame at scale 1.25, which retail reads 0.4 CSS pixel further
|
||||
right (10.4, 284.8). The cross-site frame lives in another process: if it reads the parent's own ``mozInnerScreen`` (the top's origin), the place the parent
|
||||
gave it did not reach it, and the assertion says so by name.
|
||||
* A popup opened from the maximized page after a real click on a button: ``window.open(url, '_blank', 'width=500,height=400')`` at every case, and, at scale 2.0,
|
||||
``'left=100,top=80,width=500,height=400'``, which retail moves up into the work area (inner 500x400, outer 513x476, screenX/Y 100, 76, mozInnerScreen 106.5, 146).
|
||||
An unpositioned popup sits at 4 device pixels (``screenX/Y`` 4 over the scale, rounded). Everything is compared exactly.
|
||||
* The offset of the events: retail's mouse points are its own (device pixels of its window), ours are CSS pixels of the page, and the integer ``screenX - clientX``
|
||||
rounds by the point, so away from scale 1.0 the offset may differ from retail's by one; at scale 1.0 it is equal. In every case it is within one pixel of
|
||||
``mozInnerScreen`` (the invariant above).
|
||||
|
||||
Transformed cross-site frames, against retail round 6 (GitHub run oss-invisible/core 46052782097; RetailCaptures commit 4a37f5f,
|
||||
``captures/WINDOW_GEOMETRY_TRANSFORMED_FRAME.csv``, sha256 38aef449e69f8204a57ef308b6dc55437245a66512a28ae3e2d800b6dab98180; launch "b" equals launch "a" in every
|
||||
value used): in the maximized state, a container ``div`` fixed at CSS (10, 200), 300x120, with ``transform: scale(1.5)`` or ``rotate(10deg)`` and
|
||||
``transform-origin: 0 0``, holding a 300x120 cross-site frame; one at a time. The real mouse moves to the three top-page CSS points retail used; the frame
|
||||
reads the trusted ``mousemove``'s ``clientX/Y`` and ``screenX/Y`` (they are the frame's own, through the transform) and its own ``mozInnerScreenX/Y``, which
|
||||
retail reads as the frame's untransformed place (the parent's origin plus (10, 200)). ``mozInnerScreen`` is compared exactly; ``screenX/Y`` and ``clientX/Y``
|
||||
exactly at scale 1.0 and within one pixel at the others (the rule of the events above). The table ``RETAIL_TRANSFORMED`` is printed from the CSV; a comment on a
|
||||
move names the one-pixel differences of retail's same-origin frame, which this test does not check.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _waits import wait_until
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Rounding of the event's integer coordinates against the fractional ``mozInnerScreen`` of a fractional scale: less than one pixel.
|
||||
EVENT_ROUNDING = 1.0
|
||||
#: Floats of a page (``mozInnerScreenY`` 72.667 is 72.6666...).
|
||||
FLOAT = 0.001
|
||||
DEADLINE_S = 30
|
||||
|
||||
#: Points the mouse moves to, in CSS pixels of the content; a move to the point the pointer is on makes no event, so each step uses another one.
|
||||
POINTS: List[Tuple[int, int]] = [(60, 70), (120, 150), (80, 110)]
|
||||
#: The button whose click asks for fullscreen: ``position:fixed`` at (20, 20), 160x40 CSS pixels; its centre is the point of the real click.
|
||||
BUTTON = (100, 40)
|
||||
|
||||
PAGE = """<!doctype html><meta charset=utf-8><title>maximized window</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}
|
||||
#fs,#open{position:fixed;top:20px;width:160px;height:40px;margin:0;z-index:2147483647}
|
||||
#fs{left:20px}#open{left:200px}</style>
|
||||
<body><button id=fs>fullscreen</button><button id=open>popup</button><script>
|
||||
window.__last = null; window.__moves = 0; window.__fsRequest = 'not asked';
|
||||
document.getElementById('fs').addEventListener('click', () => {
|
||||
window.__fsRequest = 'pending';
|
||||
document.documentElement.requestFullscreen().then(() => { window.__fsRequest = 'resolved'; }, e => { window.__fsRequest = 'rejected: ' + e; });
|
||||
});
|
||||
document.getElementById('open').addEventListener('click', () => {
|
||||
window.open(window.__popupUrl, '_blank', window.__popupFeatures);
|
||||
});
|
||||
window.addEventListener('mousemove', e => {
|
||||
if (!e.isTrusted) return;
|
||||
window.__moves++;
|
||||
window.__last = {n: window.__moves, cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY,
|
||||
dx: e.screenX - e.clientX, dy: e.screenY - e.clientY};
|
||||
}, true);
|
||||
// Everything a page can read that may differ under responsive-design mode (inRDMPane), read here in the page itself and
|
||||
// returned as a JSON string (the content script parses it): the screen, the pixel ratio, the media queries (the integers
|
||||
// found by binary search over min- queries, the booleans as .matches), touch, the visual viewport, the root's client size.
|
||||
window.__probe = () => {
|
||||
const matches = (query) => matchMedia(query).matches;
|
||||
// The largest integer n in [0, hi] for which make(n) matches; every min- query is true up to the value and false after.
|
||||
const largest = (make, hi) => {
|
||||
let lo = 0;
|
||||
while (lo < hi) {
|
||||
const mid = Math.ceil((lo + hi) / 2);
|
||||
if (matches(make(mid))) lo = mid; else hi = mid - 1;
|
||||
}
|
||||
return lo;
|
||||
};
|
||||
const found = {
|
||||
width: largest((n) => `(min-width: ${n}px)`, 65536),
|
||||
height: largest((n) => `(min-height: ${n}px)`, 65536),
|
||||
"device-width": largest((n) => `(min-device-width: ${n}px)`, 65536),
|
||||
"device-height": largest((n) => `(min-device-height: ${n}px)`, 65536),
|
||||
// the ratio times 10000, rounded down
|
||||
"aspect-ratio_x10000": largest((n) => `(min-aspect-ratio: ${n}/10000)`, 1000000),
|
||||
"device-aspect-ratio_x10000": largest((n) => `(min-device-aspect-ratio: ${n}/10000)`, 1000000),
|
||||
// the resolution in dppx times 100, rounded down (0.01 dppx)
|
||||
"resolution_x100": largest((n) => `(min-resolution: ${n / 100}dppx)`, 2000),
|
||||
};
|
||||
const queries = {};
|
||||
for (const q of [
|
||||
`(width: ${found.width}px)`, `(height: ${found.height}px)`,
|
||||
`(device-width: ${found["device-width"]}px)`, `(device-height: ${found["device-height"]}px)`,
|
||||
"(pointer: fine)", "(pointer: coarse)", "(pointer: none)",
|
||||
"(any-pointer: fine)", "(any-pointer: coarse)", "(any-pointer: none)",
|
||||
"(hover: hover)", "(hover: none)", "(any-hover: hover)", "(any-hover: none)",
|
||||
"(orientation: portrait)", "(orientation: landscape)",
|
||||
]) queries[q] = matches(q);
|
||||
const s = screen;
|
||||
const vv = window.visualViewport;
|
||||
return JSON.stringify({
|
||||
screen: {width: s.width, height: s.height, availWidth: s.availWidth, availHeight: s.availHeight,
|
||||
availLeft: s.availLeft, availTop: s.availTop, colorDepth: s.colorDepth,
|
||||
orientation: s.orientation ? {type: s.orientation.type, angle: s.orientation.angle} : null},
|
||||
devicePixelRatio: window.devicePixelRatio,
|
||||
found: found,
|
||||
matches: queries,
|
||||
touch: {maxTouchPoints: navigator.maxTouchPoints, ontouchstart: "ontouchstart" in window, touchEvent: typeof TouchEvent},
|
||||
visualViewport: vv ? {width: vv.width, height: vv.height, scale: vv.scale, offsetLeft: vv.offsetLeft, offsetTop: vv.offsetTop,
|
||||
pageLeft: vv.pageLeft, pageTop: vv.pageTop} : null,
|
||||
client: {width: document.documentElement.clientWidth, height: document.documentElement.clientHeight},
|
||||
});
|
||||
};
|
||||
</script>"""
|
||||
|
||||
# The page of a frame and of a popup: it only hears the mouse, as the top page does.
|
||||
FRAME_PAGE = """<!doctype html><meta charset=utf-8><title>probe</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}</style>
|
||||
<body><script>
|
||||
window.__last = null; window.__moves = 0;
|
||||
window.addEventListener('mousemove', e => {
|
||||
if (!e.isTrusted) return;
|
||||
window.__moves++;
|
||||
window.__last = {n: window.__moves, cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY,
|
||||
dx: e.screenX - e.clientX, dy: e.screenY - e.clientY};
|
||||
}, true);
|
||||
</script>"""
|
||||
|
||||
#: The frames of the reading, added to the page: ``[same-origin url, cross-site url]``, 300x120 at x 10, y 60 and y 200 (retail round 5's rects).
|
||||
FRAMES_ON = """([same, cross]) => {
|
||||
for (const [id, src, top] of [['same', same, 60], ['cross', cross, 200]]) {
|
||||
const f = document.createElement('iframe');
|
||||
f.id = 'frame-' + id; f.src = src;
|
||||
f.style.cssText = 'position:absolute;left:10px;top:' + top + 'px;width:300px;height:120px;border:0;margin:0;padding:0';
|
||||
document.body.appendChild(f);
|
||||
}
|
||||
}"""
|
||||
FRAMES_OFF = "() => { document.querySelectorAll('iframe').forEach(f => f.remove()); }"
|
||||
#: The real mouse move over each frame, in the page's CSS pixels: its centre.
|
||||
FRAME_POINTS = {"same": (160, 120), "cross": (160, 260)}
|
||||
#: The click that opens the popup: the centre of the ``#open`` button (``position:fixed`` at (200, 20), 160x40 CSS pixels), and the point of the mouse move in the popup.
|
||||
OPEN = (280, 40)
|
||||
POPUP_POINT = (150, 170)
|
||||
|
||||
READ = """() => ({ow: outerWidth, oh: outerHeight, iw: innerWidth, ih: innerHeight, sx: screenX, sy: screenY,
|
||||
mx: mozInnerScreenX, my: mozInnerScreenY, dpr: devicePixelRatio, availH: screen.availHeight,
|
||||
scw: screen.width, sch: screen.height, fs: document.fullscreenElement !== null})"""
|
||||
|
||||
# What retail answers, per case: the maximized reading.
|
||||
# A key that is not in an entry is a value the measurement did not name: it is not asserted (the invariant of the events is, always).
|
||||
CASES: Dict[str, Dict[str, Any]] = {
|
||||
"1920x1080-dpr1.0": {
|
||||
"dpr": 1.0,
|
||||
"panel": (1920, 1080),
|
||||
"maximized": {"ow": 1936, "oh": 1048, "iw": 1920, "ih": 947, "sx": -8, "sy": -8, "mx": 0, "my": 85},
|
||||
},
|
||||
"1920x1080-dpr1.25": {
|
||||
"dpr": 1.25,
|
||||
"panel": (1920, 1080),
|
||||
"maximized": {"ow": 1550, "oh": 830, "iw": 1536, "ih": 731, "sx": -7, "sy": -7, "my": 84.8},
|
||||
},
|
||||
# the compact bar: availHeight is 672 CSS pixels
|
||||
"1920x1080-dpr1.5": {
|
||||
"dpr": 1.5,
|
||||
"panel": (1920, 1080),
|
||||
"availH": 672,
|
||||
"maximized": {"iw": 1280, "ih": 599, "my": 72.667},
|
||||
},
|
||||
# the compact bar again, on a 1600x1200 panel (retail live: availHeight is 552 CSS pixels)
|
||||
"1600x1200-dpr2.0": {
|
||||
"dpr": 2.0,
|
||||
"panel": (1600, 1200),
|
||||
"availH": 552,
|
||||
"maximized": {"ow": 813, "oh": 565, "iw": 800, "ih": 479, "sx": -6, "sy": -6, "mx": 0, "my": 73},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
# What retail answers to the page's probe (``window.__probe`` above, the very function of RetailCaptures' page.html), per case: the media queries found
|
||||
# by binary search (width, height, aspect-ratio times 10000 rounded down, resolution in dppx times 100), the root's client size and the visual viewport.
|
||||
# Each value below is the one printed by a script from the raw.json named in the comment above its case (round 4 of the window-geometry capture, Firefox 159.0
|
||||
# retail on GitHub's Windows runners, display launch "a"); none is retyped. The key of a case is the capture's step name ("maximized"). Round 3 (window-geometry-r3)
|
||||
# holds the same values for the step it has.
|
||||
RETAIL_PROBE: Dict[str, Dict[str, Dict[str, Any]]] = {
|
||||
# source: RetailCaptures/captures/firefox-159.0/github-runner/2026-11-25-window-geometry-r4/dpr1/1920x1080/a/raw.json, steps[...].content.probe
|
||||
# sha256 5b6eea2939717aacafb539af3f67611a151a4ae0cfabb7b60dcf5a71c8c575be
|
||||
"1920x1080-dpr1.0": {
|
||||
# maximized
|
||||
"maximized": {"mq_width": 1920, "mq_height": 947, "mq_aspect_x10000": 20274, "mq_resolution_x100": 100, "client_w": 1920, "client_h": 947, "vv_w": 1920, "vv_h": 947, "vv_scale": 1, "vv_left": 0, "vv_top": 0, "vv_page_left": 0, "vv_page_top": 0},
|
||||
},
|
||||
# source: RetailCaptures/captures/firefox-159.0/github-runner/2026-11-25-window-geometry-r4/dpr1.25/1920x1080/a/raw.json, steps[...].content.probe
|
||||
# sha256 17ba49d7573e3aa61ff439e89392c9d3ea6dc83051f97b6dbd2a4fb7a8fb9887
|
||||
"1920x1080-dpr1.25": {
|
||||
# maximized
|
||||
"maximized": {"mq_width": 1536, "mq_height": 731, "mq_aspect_x10000": 21006, "mq_resolution_x100": 125, "client_w": 1536, "client_h": 731, "vv_w": 1536, "vv_h": 731.2000122070312, "vv_scale": 1, "vv_left": 0, "vv_top": 0, "vv_page_left": 0, "vv_page_top": 0},
|
||||
},
|
||||
# source: RetailCaptures/captures/firefox-159.0/github-runner/2026-11-25-window-geometry-r4/dpr1.5/1920x1080/a/raw.json, steps[...].content.probe
|
||||
# sha256 6422295bf112ab74b1c4cf691fd1c0382655093037c39aa6cae96d91fca5785f
|
||||
"1920x1080-dpr1.5": {
|
||||
# maximized
|
||||
"maximized": {"mq_width": 1280, "mq_height": 599, "mq_aspect_x10000": 21357, "mq_resolution_x100": 150, "client_w": 1280, "client_h": 599, "vv_w": 1280, "vv_h": 599.3333129882812, "vv_scale": 1, "vv_left": 0, "vv_top": 0, "vv_page_left": 0, "vv_page_top": 0},
|
||||
},
|
||||
# source: RetailCaptures/captures/firefox-159.0/github-runner/2026-11-25-window-geometry-r4/dpr2/1600x1200/a/raw.json, steps[...].content.probe
|
||||
# sha256 be0c1610951900a32095d4965a7c9a9eae2fbf3e14791b2a55fdc8d25c75e360
|
||||
"1600x1200-dpr2.0": {
|
||||
# maximized
|
||||
"maximized": {"mq_width": 800, "mq_height": 479, "mq_aspect_x10000": 16701, "mq_resolution_x100": 200, "client_w": 800, "client_h": 479, "vv_w": 800, "vv_h": 479, "vv_scale": 1, "vv_left": 0, "vv_top": 0, "vv_page_left": 0, "vv_page_top": 0},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
# What retail answers to a frame and to a popup (round 5 of the window-geometry capture: Firefox 159.0 retail on GitHub's Windows runners, GitHub run
|
||||
# oss-invisible/core 45952171443, display launch "a"; launch "b" equals it in every value below). Every value is printed by a script from
|
||||
# RetailCaptures/captures/WINDOW_GEOMETRY_POPUP_FRAME.csv (sha256 64f1d437a261e0305604f16ac9a6b60c62546101ac994712fbdec251e8a9c2af); none is retyped.
|
||||
# RETAIL_FRAMES[case][state][kind]: a 300x120 frame at ``rect`` (CSS pixels of the page) in a same-origin or a cross-site page, read from inside the frame:
|
||||
# the parent's mozInnerScreen (parent_mx, parent_my), the frame's (mx, my), what it reads beyond parent + rect (``extra``: 0.4 CSS pixel in x for the cross-site
|
||||
# frame at scale 1.25, nothing anywhere else), outer, screenX/Y, devicePixelRatio and the events' offset (dx, dy), in the capture's state "maximized".
|
||||
RETAIL_FRAMES: Dict[str, Dict[str, Dict[str, Dict[str, Any]]]] = {
|
||||
'1600x1200-dpr2.0': {
|
||||
'maximized': {
|
||||
'same': {'rect': (10, 60), 'parent_mx': 0, 'parent_my': 73, 'mx': 10, 'my': 133, 'extra': (0, 0), 'ow': 813, 'oh': 565, 'sx': -6, 'sy': -6, 'dpr': 2, 'dx': 10, 'dy': 133},
|
||||
'cross': {'rect': (10, 200), 'parent_mx': 0, 'parent_my': 73, 'mx': 10, 'my': 273, 'extra': (0, 0), 'ow': 813, 'oh': 565, 'sx': -6, 'sy': -6, 'dpr': 2, 'dx': 10, 'dy': 273},
|
||||
},
|
||||
},
|
||||
'1920x1080-dpr1.0': {
|
||||
'maximized': {
|
||||
'same': {'rect': (10, 60), 'parent_mx': 0, 'parent_my': 85, 'mx': 10, 'my': 145, 'extra': (0, 0), 'ow': 1936, 'oh': 1048, 'sx': -8, 'sy': -8, 'dpr': 1, 'dx': 10, 'dy': 145},
|
||||
'cross': {'rect': (10, 200), 'parent_mx': 0, 'parent_my': 85, 'mx': 10, 'my': 285, 'extra': (0, 0), 'ow': 1936, 'oh': 1048, 'sx': -8, 'sy': -8, 'dpr': 1, 'dx': 10, 'dy': 285},
|
||||
},
|
||||
},
|
||||
'1920x1080-dpr1.25': {
|
||||
'maximized': {
|
||||
'same': {'rect': (10, 60), 'parent_mx': 0, 'parent_my': 84.80000305175781, 'mx': 10, 'my': 144.8000030517578, 'extra': (0, 0), 'ow': 1550, 'oh': 830, 'sx': -7, 'sy': -7, 'dpr': 1.25, 'dx': 10, 'dy': 145},
|
||||
'cross': {'rect': (10, 200), 'parent_mx': 0, 'parent_my': 84.80000305175781, 'mx': 10.399999618530273, 'my': 284.79998779296875, 'extra': (0.4, 0), 'ow': 1550, 'oh': 830, 'sx': -7, 'sy': -7, 'dpr': 1.25, 'dx': 10, 'dy': 285},
|
||||
},
|
||||
},
|
||||
'1920x1080-dpr1.5': {
|
||||
'maximized': {
|
||||
'same': {'rect': (10, 60), 'parent_mx': 0, 'parent_my': 72.66666412353516, 'mx': 10, 'my': 132.6666717529297, 'extra': (0, 0), 'ow': 1295, 'oh': 687, 'sx': -7, 'sy': -7, 'dpr': 1.5, 'dx': 10, 'dy': 133},
|
||||
'cross': {'rect': (10, 200), 'parent_mx': 0, 'parent_my': 72.66666412353516, 'mx': 10, 'my': 272.6666564941406, 'extra': (0, 0), 'ow': 1295, 'oh': 687, 'sx': -7, 'sy': -7, 'dpr': 1.5, 'dx': 10, 'dy': 273},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
# RETAIL_POPUPS[case][step]: the popup opened from the maximized page after a real click (``popup``: no position asked; ``popup_pos``: left and top asked, only at
|
||||
# scale 2.0, where retail moves the window up into the work area: screenY 76 for the 80 asked), read from inside the popup. The events' offset (dx, dy) is the
|
||||
# one of the capture's own mouse points.
|
||||
RETAIL_POPUPS: Dict[str, Dict[str, Dict[str, Any]]] = {
|
||||
'1600x1200-dpr2.0': {
|
||||
'popup': {'features': 'width=500,height=400', 'iw': 500, 'ih': 400, 'ow': 513, 'oh': 476, 'sx': 2, 'sy': 2, 'mx': 8.5, 'my': 72, 'dpr': 2, 'dx': 9, 'dy': 72},
|
||||
'popup_pos': {'features': 'left=100,top=80,width=500,height=400', 'iw': 500, 'ih': 400, 'ow': 513, 'oh': 476, 'sx': 100, 'sy': 76, 'mx': 106.5, 'my': 146, 'dpr': 2, 'dx': 107, 'dy': 146},
|
||||
},
|
||||
'1920x1080-dpr1.0': {
|
||||
'popup': {'features': 'width=500,height=400', 'iw': 500, 'ih': 400, 'ow': 516, 'oh': 480, 'sx': 4, 'sy': 4, 'mx': 12, 'my': 76, 'dpr': 1, 'dx': 12, 'dy': 76},
|
||||
},
|
||||
'1920x1080-dpr1.25': {
|
||||
'popup': {'features': 'width=500,height=400', 'iw': 500, 'ih': 400, 'ow': 514, 'oh': 478, 'sx': 3, 'sy': 3, 'mx': 10.399999618530273, 'my': 74.4000015258789, 'dpr': 1.25, 'dx': 11, 'dy': 74},
|
||||
},
|
||||
'1920x1080-dpr1.5': {
|
||||
'popup': {'features': 'width=500,height=400', 'iw': 500, 'ih': 400, 'ow': 515, 'oh': 478, 'sx': 3, 'sy': 3, 'mx': 10, 'my': 73.33333587646484, 'dpr': 1.5, 'dx': 10, 'dy': 73},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _stable(page, ask: Optional[Tuple[int, int]], fullscreen: Optional[bool] = None, reader=None) -> Dict[str, Any]:
|
||||
"""The window as the page reads it once it has settled: the inner size is the asked one (when one was asked), the document is in fullscreen or not
|
||||
(when that was asked) and two looks in a row are equal. ``reader`` is the window that is read when it is not ``page`` (a popup, a frame); ``page`` paces the wait.
|
||||
|
||||
A condition, not a pause. The last reading is returned either way, so a window that never settles is red where the assertions name what was read."""
|
||||
seen: Dict[str, Any] = {"now": None, "before": None}
|
||||
reader = page if reader is None else reader
|
||||
|
||||
def settled() -> bool:
|
||||
seen["before"], seen["now"] = seen["now"], reader.evaluate(READ)
|
||||
now = seen["now"]
|
||||
if ask is not None and (now["iw"], now["ih"]) != ask:
|
||||
return False
|
||||
if fullscreen is not None and now["fs"] is not fullscreen:
|
||||
return False
|
||||
return now == seen["before"]
|
||||
|
||||
wait_until(settled, DEADLINE_S, lambda: page.wait_for_timeout(100))
|
||||
return seen["now"]
|
||||
|
||||
|
||||
def _probe(page) -> Dict[str, Any]:
|
||||
"""What ``window.__probe`` answers, reduced to the values RETAIL_PROBE holds (the page gives its own JSON string)."""
|
||||
raw = json.loads(page.evaluate("() => window.__probe()"))
|
||||
found, client, vv = raw["found"], raw["client"], raw["visualViewport"]
|
||||
return {"mq_width": found["width"], "mq_height": found["height"], "mq_aspect_x10000": found["aspect-ratio_x10000"],
|
||||
"mq_resolution_x100": found["resolution_x100"], "client_w": client["width"], "client_h": client["height"],
|
||||
"vv_w": vv["width"], "vv_h": vv["height"], "vv_scale": vv["scale"], "vv_left": vv["offsetLeft"], "vv_top": vv["offsetTop"],
|
||||
"vv_page_left": vv["pageLeft"], "vv_page_top": vv["pageTop"]}
|
||||
|
||||
|
||||
PROBE_NAMES = {"mq_width": "matchMedia width", "mq_height": "matchMedia height", "mq_aspect_x10000": "matchMedia aspect-ratio (x10000)",
|
||||
"mq_resolution_x100": "matchMedia resolution (dppx x100)", "client_w": "documentElement.clientWidth",
|
||||
"client_h": "documentElement.clientHeight", "vv_w": "visualViewport.width", "vv_h": "visualViewport.height",
|
||||
"vv_scale": "visualViewport.scale", "vv_left": "visualViewport.offsetLeft", "vv_top": "visualViewport.offsetTop",
|
||||
"vv_page_left": "visualViewport.pageLeft", "vv_page_top": "visualViewport.pageTop"}
|
||||
|
||||
|
||||
def _check_probe(step: str, probe: Dict[str, Any], expected: Dict[str, Any], who: str) -> None:
|
||||
"""The probe of one step against ``expected`` (retail's values, or the reading before a fullscreen round trip), key by key."""
|
||||
assert set(expected) == set(PROBE_NAMES), "%s: the expected probe names %r" % (step, sorted(expected))
|
||||
for key, name in PROBE_NAMES.items():
|
||||
assert probe[key] == pytest.approx(expected[key], abs=FLOAT), (
|
||||
"%s: %s reads %r, %s reads %r (whole probe: %r)" % (step, name, probe[key], who, expected[key], probe))
|
||||
|
||||
|
||||
def _event_offset(page, point: Tuple[int, int], target=None, origin: Tuple[int, int] = (0, 0)) -> Dict[str, Any]:
|
||||
"""Moves the mouse to ``point`` and gives the last trusted mousemove the page heard for it (waits for it).
|
||||
|
||||
``target`` is the frame that hears it when it is not the page, and ``origin`` the frame's rect x, y in the page: the event carries ``point`` less ``origin``."""
|
||||
target = page if target is None else target
|
||||
client = (point[0] - origin[0], point[1] - origin[1])
|
||||
heard = target.evaluate("() => window.__moves")
|
||||
page.mouse.move(*point)
|
||||
wait_until(lambda: target.evaluate("() => window.__moves") > heard and (target.evaluate("() => window.__last") or {}).get("cx") == client[0]
|
||||
and (target.evaluate("() => window.__last") or {}).get("cy") == client[1],
|
||||
DEADLINE_S, lambda: page.wait_for_timeout(50))
|
||||
return target.evaluate("() => window.__last")
|
||||
|
||||
|
||||
def _check_reading(step: str, reading: Dict[str, Any], event: Dict[str, Any], expected: Dict[str, Any], dpr: float) -> None:
|
||||
"""The window a page reads at one step, against retail's numbers, and the events against ``mozInnerScreen``."""
|
||||
assert reading["dpr"] == dpr, "%s: the page reads devicePixelRatio %r, the test declared %r: %r" % (step, reading["dpr"], dpr, reading)
|
||||
for key, name in (("iw", "innerWidth"), ("ih", "innerHeight"), ("ow", "outerWidth"), ("oh", "outerHeight"),
|
||||
("sx", "screenX"), ("sy", "screenY"), ("mx", "mozInnerScreenX"), ("my", "mozInnerScreenY")):
|
||||
if key in expected:
|
||||
assert reading[key] == pytest.approx(expected[key], abs=FLOAT), (
|
||||
"%s: %s reads %r, retail Firefox 159.0 on Windows reads %r (whole reading: %r)" % (step, name, reading[key], expected[key], reading))
|
||||
assert event is not None, "%s: the page heard no trusted mousemove" % step
|
||||
# the invariant of every step: what the events carry is the content origin the window declares
|
||||
assert abs(event["dx"] - reading["mx"]) < EVENT_ROUNDING, (
|
||||
"%s: screenX - clientX is %r, mozInnerScreenX is %r (event %r)" % (step, event["dx"], reading["mx"], event))
|
||||
assert abs(event["dy"] - reading["my"]) < EVENT_ROUNDING, (
|
||||
"%s: screenY - clientY is %r, mozInnerScreenY is %r (event %r)" % (step, event["dy"], reading["my"], event))
|
||||
for key, name in (("dx", "screenX - clientX"), ("dy", "screenY - clientY")):
|
||||
if key in expected:
|
||||
assert event[key] == expected[key], "%s: %s of the mouse event is %r, retail reads %r (event %r)" % (step, name, event[key], expected[key], event)
|
||||
# a window whose own reading and whose events say the same thing, in whole numbers where the scale is 1.0
|
||||
if dpr == 1.0:
|
||||
assert (event["dx"], event["dy"]) == (reading["mx"], reading["my"]), (
|
||||
"%s: at scale 1.0 the events carry (%r, %r) and mozInnerScreen is (%r, %r)" % (step, event["dx"], event["dy"], reading["mx"], reading["my"]))
|
||||
|
||||
|
||||
def _fullscreen_round_trip(page, step: str, before: Dict[str, Any], before_event: Dict[str, Any], before_probe: Dict[str, Any],
|
||||
screen: Tuple[int, int], dpr: float, points: Iterator[Tuple[int, int]]) -> None:
|
||||
"""Enters fullscreen with a real click, reads the window, leaves it and reads it again: it must be exactly the window of ``before``.
|
||||
|
||||
``before_probe`` is the probe (media queries, client size, visual viewport) read with ``before``: after leaving fullscreen it is read again, equal.
|
||||
``screen`` is the declared screen in CSS pixels. In fullscreen outer == inner == screen, the window sits at the origin and so does its content."""
|
||||
assert before["fs"] is False, "%s: the window is in fullscreen before the test enters it: %r" % (step, before)
|
||||
page.mouse.click(*BUTTON) # the client's own click: a trusted event, so a user gesture
|
||||
wait_until(lambda: page.evaluate("() => window.__fsRequest") not in ("not asked", "pending"), DEADLINE_S, lambda: page.wait_for_timeout(50))
|
||||
request = page.evaluate("() => window.__fsRequest")
|
||||
assert request == "resolved", "%s: requestFullscreen after a real click answers %r, retail enters fullscreen" % (step, request)
|
||||
scw, sch = screen
|
||||
inside = _stable(page, screen, fullscreen=True)
|
||||
inside_event = _event_offset(page, next(points))
|
||||
assert inside["fs"] is True and (inside["scw"], inside["sch"]) == screen, (
|
||||
"%s: in fullscreen the page reads fullscreenElement set=%r and screen %rx%r, the declared screen is %rx%r (%r)"
|
||||
% (step, inside["fs"], inside["scw"], inside["sch"], scw, sch, inside))
|
||||
_check_reading("%s, in fullscreen" % step, inside, inside_event,
|
||||
{"ow": scw, "oh": sch, "iw": scw, "ih": sch, "sx": 0, "sy": 0, "mx": 0, "my": 0, "dx": 0, "dy": 0}, dpr)
|
||||
|
||||
page.evaluate("() => { document.exitFullscreen(); }")
|
||||
after = _stable(page, (before["iw"], before["ih"]), fullscreen=False)
|
||||
after_event = _event_offset(page, next(points))
|
||||
assert after["fs"] is False, "%s: the page reads fullscreenElement set after exitFullscreen: %r" % (step, after)
|
||||
same = {key: before[key] for key in ("iw", "ih", "ow", "oh", "sx", "sy", "mx", "my")}
|
||||
_check_reading("%s, after leaving fullscreen" % step, after, after_event, same, dpr)
|
||||
assert after["availH"] == before["availH"], "%s: availHeight reads %r after fullscreen, %r before" % (step, after["availH"], before["availH"])
|
||||
_check_probe("%s, after leaving fullscreen" % step, _probe(page), before_probe, "the reading before fullscreen")
|
||||
for key in ("dx", "dy"):
|
||||
assert abs(after_event[key] - before_event[key]) < EVENT_ROUNDING, (
|
||||
"%s: the offset of the events (%s) was %r before fullscreen and is %r after it" % (step, key, before_event[key], after_event[key]))
|
||||
|
||||
#: The coordinates of a mouse event that a frame under a transform is compared on: its own, not the offset (which a transform breaks).
|
||||
EVENT_COORDINATES = (("cx", "clientX"), ("cy", "clientY"), ("sx", "screenX"), ("sy", "screenY"))
|
||||
#: The offset of the events, the default comparison.
|
||||
EVENT_OFFSET = (("dx", "screenX - clientX"), ("dy", "screenY - clientY"))
|
||||
|
||||
|
||||
def _check_events_against_retail(step: str, event: Dict[str, Any], retail: Dict[str, Any], dpr: float, coordinates=EVENT_OFFSET) -> None:
|
||||
"""The offset of the events (``screenX - clientX``, ``screenY - clientY``; ``coordinates`` names others) against the one of retail's own mouse move: equal at
|
||||
scale 1.0, within one pixel at the others (the capture's points are device pixels of its window, ours CSS pixels of the page, and the integer coordinates round
|
||||
by the point)."""
|
||||
tolerance = 0 if dpr == 1.0 else 1
|
||||
for key, name in coordinates:
|
||||
assert abs(event[key] - retail[key]) <= tolerance, (
|
||||
"%s: %s of the mouse event is %r, retail reads %r (event %r)" % (step, name, event[key], retail[key], event))
|
||||
|
||||
|
||||
def _check_frames(page, sites, step: str, case: str, state: str, parent: Dict[str, Any], dpr: float) -> None:
|
||||
"""A same-origin and a cross-site frame in the page, read from inside: ``outer``, ``screenX/Y`` and ``dpr`` are the parent's, ``mozInnerScreen`` is retail's
|
||||
(the parent's plus the frame's rect, and retail's 0.4 CSS pixel in x for the cross-site frame at scale 1.25), and so are the events' offsets. The cross-site
|
||||
frame first has to have its own place: that it does not read the top's origin.
|
||||
|
||||
``parent`` is the reading of the page at this step; ``state`` is the key of RETAIL_FRAMES. The frames are added for the reading and removed after it."""
|
||||
url = "/frame?%s" % state
|
||||
page.evaluate(FRAMES_ON, [sites.url("A", url), sites.url("B", url)])
|
||||
try:
|
||||
for kind, site in (("same", "A"), ("cross", "B")):
|
||||
retail = RETAIL_FRAMES[case][state][kind]
|
||||
label = "%s, the %s frame" % (step, "same-origin" if kind == "same" else "cross-site")
|
||||
frame = wait_frame(page, sites.origin[site], url, seconds=30)
|
||||
reading = _stable(page, (300, 120), reader=frame)
|
||||
if kind == "cross":
|
||||
_check_own_place(label, reading, parent)
|
||||
event = _event_offset(page, FRAME_POINTS[kind], target=frame, origin=retail["rect"])
|
||||
_check_reading(label, reading, event,
|
||||
{"iw": 300, "ih": 120, "ow": parent["ow"], "oh": parent["oh"], "sx": parent["sx"], "sy": parent["sy"],
|
||||
"mx": retail["mx"], "my": retail["my"]}, dpr)
|
||||
# the parent's content origin plus the frame's rect, plus what retail reads beyond it
|
||||
assert reading["mx"] == pytest.approx(parent["mx"] + retail["rect"][0] + retail["extra"][0], abs=FLOAT), (
|
||||
"%s: mozInnerScreenX reads %r, the parent's %r plus the rect's %r plus retail's %r is %r"
|
||||
% (label, reading["mx"], parent["mx"], retail["rect"][0], retail["extra"][0], parent["mx"] + retail["rect"][0] + retail["extra"][0]))
|
||||
assert reading["my"] == pytest.approx(parent["my"] + retail["rect"][1] + retail["extra"][1], abs=FLOAT), (
|
||||
"%s: mozInnerScreenY reads %r, the parent's %r plus the rect's %r plus retail's %r is %r"
|
||||
% (label, reading["my"], parent["my"], retail["rect"][1], retail["extra"][1], parent["my"] + retail["rect"][1] + retail["extra"][1]))
|
||||
assert (reading["ow"], reading["oh"], reading["sx"], reading["sy"], reading["dpr"]) == (
|
||||
parent["ow"], parent["oh"], parent["sx"], parent["sy"], parent["dpr"]), (
|
||||
"%s: outer, screenX/Y and devicePixelRatio of the frame are not the parent's (frame %r, parent %r)" % (label, reading, parent))
|
||||
_check_events_against_retail(label, event, retail, dpr)
|
||||
finally:
|
||||
page.evaluate(FRAMES_OFF)
|
||||
|
||||
|
||||
def _check_popup(page, sites, step: str, retail: Dict[str, Any], dpr: float) -> None:
|
||||
"""Opens ``window.open(url, '_blank', features)`` with a real click on the page's button and reads the popup from inside, against retail, exactly.
|
||||
|
||||
The popup is closed after the reading."""
|
||||
page.evaluate("([url, features]) => { window.__popupUrl = url; window.__popupFeatures = features; }", [sites.url("A", "/popup"), retail["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)
|
||||
reading = _stable(popup, (retail["iw"], retail["ih"]))
|
||||
event = _event_offset(popup, POPUP_POINT)
|
||||
_check_reading(step, reading, event, {key: retail[key] for key in ("iw", "ih", "ow", "oh", "sx", "sy", "mx", "my")}, dpr)
|
||||
_check_events_against_retail(step, event, retail, dpr)
|
||||
finally:
|
||||
popup.close()
|
||||
|
||||
|
||||
#: The transformed frames of retail round 6, in the order of the test: the key of RETAIL_TRANSFORMED's cases, then the CSS of the container's transform.
|
||||
TRANSFORMS = {"cross_scale": "scale(1.5)", "cross_rotate": "rotate(10deg)"}
|
||||
#: A container fixed at CSS (10, 200), 300x120, transformed from its top left corner, holding the cross-site frame (300x120).
|
||||
TRANSFORMED_ON = """([src, transform]) => {
|
||||
const box = document.createElement('div');
|
||||
box.id = 'transformed';
|
||||
box.style.cssText = 'position:fixed;left:10px;top:200px;width:300px;height:120px;margin:0;padding:0;transform-origin:0 0;transform:' + transform;
|
||||
const f = document.createElement('iframe');
|
||||
f.src = src;
|
||||
f.style.cssText = 'display:block;width:300px;height:120px;border:0;margin:0;padding:0';
|
||||
box.appendChild(f);
|
||||
document.body.appendChild(box);
|
||||
}"""
|
||||
TRANSFORMED_OFF = "() => { document.querySelectorAll('#transformed').forEach(b => b.remove()); }"
|
||||
|
||||
# What retail answers to a cross-site frame under a transform (round 6 of the window-geometry capture: Firefox 159.0 retail on GitHub's Windows runners, GitHub run
|
||||
# oss-invisible/core 46052782097, display launch "a"; launch "b" equals it in every value below). Every value is printed by a script from
|
||||
# RetailCaptures (commit 4a37f5f) captures/WINDOW_GEOMETRY_TRANSFORMED_FRAME.csv (sha256 38aef449e69f8204a57ef308b6dc55437245a66512a28ae3e2d800b6dab98180); none is retyped.
|
||||
# RETAIL_TRANSFORMED[case][frame]: the frame's own mozInnerScreen (mx, my; the capture's columns mozInnerScreenX/Y) and, for each of the three real mouse moves, the
|
||||
# CSS point of the top page it was asked to (the capture's asked_css_x, asked_css_y) and what the frame's trusted mousemove carried there: clientX, clientY, screenX,
|
||||
# screenY (cx, cy, sx, sy). A comment on a move says what retail's same-origin frame (frame same_scale, same_rotate) reads when it differs by one pixel.
|
||||
RETAIL_TRANSFORMED: Dict[str, Dict[str, Dict[str, Any]]] = {
|
||||
'1600x1200-dpr2.0': {
|
||||
'cross_scale': {'mx': 10, 'my': 273, 'moves': [
|
||||
((122.5, 254), {'cx': 75, 'cy': 36, 'sx': 123, 'sy': 327}),
|
||||
((235, 290), {'cx': 150, 'cy': 60, 'sx': 235, 'sy': 363}),
|
||||
((347.5, 326), {'cx': 225, 'cy': 84, 'sx': 348, 'sy': 399}),
|
||||
]},
|
||||
'cross_rotate': {'mx': 10, 'my': 273, 'moves': [
|
||||
((77.609, 248.477), {'cx': 75, 'cy': 36, 'sx': 78, 'sy': 322}),
|
||||
((147.302, 285.136), {'cx': 150, 'cy': 60, 'sx': 148, 'sy': 358}),
|
||||
((216.995, 321.795), {'cx': 225, 'cy': 84, 'sx': 217, 'sy': 395}),
|
||||
]},
|
||||
},
|
||||
'1920x1080-dpr1.0': {
|
||||
'cross_scale': {'mx': 10, 'my': 285, 'moves': [
|
||||
((122.5, 254), {'cx': 75, 'cy': 36, 'sx': 123, 'sy': 339}), # same-origin frame: screenX 122
|
||||
((235, 290), {'cx': 150, 'cy': 60, 'sx': 235, 'sy': 375}),
|
||||
((347.5, 326), {'cx': 225, 'cy': 84, 'sx': 348, 'sy': 411}),
|
||||
]},
|
||||
'cross_rotate': {'mx': 10, 'my': 285, 'moves': [
|
||||
((77.609, 248.477), {'cx': 75, 'cy': 35, 'sx': 78, 'sy': 332}), # same-origin frame: screenY 333
|
||||
((147.302, 285.136), {'cx': 150, 'cy': 60, 'sx': 147, 'sy': 370}),
|
||||
((216.995, 321.795), {'cx': 225, 'cy': 84, 'sx': 217, 'sy': 407}),
|
||||
]},
|
||||
},
|
||||
'1920x1080-dpr1.25': {
|
||||
'cross_scale': {'mx': 10.399999618530273, 'my': 284.79998779296875, 'moves': [
|
||||
((122.5, 254), {'cx': 74, 'cy': 36, 'sx': 122, 'sy': 339}), # same-origin frame: clientX 75
|
||||
((235, 290), {'cx': 150, 'cy': 60, 'sx': 235, 'sy': 375}),
|
||||
((347.5, 326), {'cx': 225, 'cy': 84, 'sx': 348, 'sy': 411}), # same-origin frame: screenX 347
|
||||
]},
|
||||
'cross_rotate': {'mx': 10.399999618530273, 'my': 284.79998779296875, 'moves': [
|
||||
((77.609, 248.477), {'cx': 74, 'cy': 36, 'sx': 78, 'sy': 333}), # same-origin frame: clientX 75, screenY 334
|
||||
((147.302, 285.136), {'cx': 150, 'cy': 59, 'sx': 147, 'sy': 369}), # same-origin frame: clientY 60, screenY 370
|
||||
((216.995, 321.795), {'cx': 224, 'cy': 83, 'sx': 217, 'sy': 406}), # same-origin frame: clientX 225, clientY 84
|
||||
]},
|
||||
},
|
||||
'1920x1080-dpr1.5': {
|
||||
'cross_scale': {'mx': 10, 'my': 272.6666564941406, 'moves': [
|
||||
((122.5, 254), {'cx': 75, 'cy': 36, 'sx': 123, 'sy': 327}),
|
||||
((235, 290), {'cx': 150, 'cy': 60, 'sx': 235, 'sy': 363}),
|
||||
((347.5, 326), {'cx': 225, 'cy': 84, 'sx': 347, 'sy': 399}),
|
||||
]},
|
||||
'cross_rotate': {'mx': 10, 'my': 272.6666564941406, 'moves': [
|
||||
((77.609, 248.477), {'cx': 74, 'cy': 37, 'sx': 77, 'sy': 321}), # same-origin frame: clientX 75, clientY 36
|
||||
((147.302, 285.136), {'cx': 150, 'cy': 60, 'sx': 147, 'sy': 358}),
|
||||
((216.995, 321.795), {'cx': 225, 'cy': 84, 'sx': 217, 'sy': 395}),
|
||||
]},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _event_at(page, point: Tuple[float, float], target) -> Dict[str, Any]:
|
||||
"""Moves the mouse to ``point`` (CSS pixels of the top page) and gives the last trusted mousemove ``target`` (a frame) heard for it (waits for it)."""
|
||||
heard = target.evaluate("() => window.__moves")
|
||||
page.mouse.move(*point)
|
||||
wait_until(lambda: target.evaluate("() => window.__moves") > heard, DEADLINE_S, lambda: page.wait_for_timeout(50))
|
||||
return target.evaluate("() => window.__last")
|
||||
|
||||
|
||||
def _check_own_place(label: str, reading: Dict[str, Any], parent: Dict[str, Any]) -> None:
|
||||
"""A frame of another process that reads the top's own ``mozInnerScreen`` has lost the place the parent gave it."""
|
||||
assert (reading["mx"], reading["my"]) != (parent["mx"], parent["my"]), (
|
||||
"%s: the out-of-process frame lost its own place in the top (it reads the top's origin): mozInnerScreen is (%r, %r), the top's is (%r, %r) (frame %r)"
|
||||
% (label, reading["mx"], reading["my"], parent["mx"], parent["my"], reading))
|
||||
|
||||
|
||||
def _check_transformed_frames(page, sites, step: str, case: str, parent: Dict[str, Any], dpr: float) -> None:
|
||||
"""A cross-site frame under ``scale(1.5)`` and then under ``rotate(10deg)``, one at a time, read from inside against retail's: its ``mozInnerScreen`` exactly,
|
||||
and what the trusted mousemove of each of the three real moves carries (``clientX/Y``, ``screenX/Y``): exactly at scale 1.0, within one pixel at the others."""
|
||||
for frame_name, transform in TRANSFORMS.items():
|
||||
retail = RETAIL_TRANSFORMED[case][frame_name]
|
||||
url = "/frame?%s" % frame_name
|
||||
label = "%s, the cross-site frame under %s" % (step, transform)
|
||||
page.evaluate(TRANSFORMED_ON, [sites.url("B", url), transform])
|
||||
try:
|
||||
frame = wait_frame(page, sites.origin["B"], url, seconds=30)
|
||||
reading = _stable(page, (300, 120), reader=frame)
|
||||
_check_own_place(label, reading, parent)
|
||||
assert reading["mx"] == pytest.approx(retail["mx"], abs=FLOAT), (
|
||||
"%s: mozInnerScreenX reads %r, retail Firefox 159.0 on Windows reads %r (frame %r)" % (label, reading["mx"], retail["mx"], reading))
|
||||
assert reading["my"] == pytest.approx(retail["my"], abs=FLOAT), (
|
||||
"%s: mozInnerScreenY reads %r, retail Firefox 159.0 on Windows reads %r (frame %r)" % (label, reading["my"], retail["my"], reading))
|
||||
for number, (point, expected) in enumerate(retail["moves"], start=1):
|
||||
event = _event_at(page, point, frame)
|
||||
_check_events_against_retail("%s, move %d to %r" % (label, number, point), event, expected, dpr, EVENT_COORDINATES)
|
||||
finally:
|
||||
page.evaluate(TRANSFORMED_OFF)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_the_maximized_window_frames_and_popups_read_retail(firefox_binary, case):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
spec = CASES[case]
|
||||
dpr = spec["dpr"]
|
||||
panel = spec["panel"]
|
||||
# the declared screen a page reads: the panel over the scale, rounded as the engine rounds it
|
||||
screen = (int(panel[0] / dpr + 0.5), int(panel[1] / dpr + 0.5))
|
||||
points = iter(POINTS)
|
||||
pin = {"screen.width": panel[0], "screen.height": panel[1], "screen.dpr": dpr}
|
||||
with Sites() as s:
|
||||
s.route("A", "/page", PAGE)
|
||||
s.route("A", "/frame", FRAME_PAGE) # the same-origin frame
|
||||
s.route("B", "/frame", FRAME_PAGE) # the cross-site frames
|
||||
s.route("A", "/popup", FRAME_PAGE)
|
||||
with InvisiblePlaywright(seed=42, pin=pin, binary_path=firefox_binary, headless=True, humanize=False) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(s.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
|
||||
# 1. the window as it opens, maximized
|
||||
maximized = _stable(page, None)
|
||||
maximized_event = _event_offset(page, next(points))
|
||||
if "availH" in spec:
|
||||
assert maximized["availH"] == spec["availH"], "the compact bar: screen.availHeight reads %r, retail %r" % (maximized["availH"], spec["availH"])
|
||||
_check_reading("maximized (%s)" % case, maximized, maximized_event, spec["maximized"], dpr)
|
||||
maximized_probe = _probe(page)
|
||||
_check_probe("maximized (%s)" % case, maximized_probe, RETAIL_PROBE[case]["maximized"], "retail Firefox 159.0 on Windows")
|
||||
|
||||
# 2. the frames of the maximized window: retail's mozInnerScreen, outer, screen, dpr and event offsets
|
||||
_check_frames(page, s, "maximized (%s)" % case, case, "maximized", maximized, dpr)
|
||||
|
||||
# 3. fullscreen and back: the window it had, exactly
|
||||
_fullscreen_round_trip(page, "fullscreen (%s)" % case, maximized, maximized_event, maximized_probe, screen, dpr, points)
|
||||
|
||||
# 4. popups opened from the maximized page: no position at every case, and the positioned one at scale 2.0, as retail places them
|
||||
for popup_step, retail_popup in RETAIL_POPUPS[case].items():
|
||||
_check_popup(page, s, "window.open(%r) from the maximized page, %s (%s)" % (retail_popup["features"], popup_step, case), retail_popup, dpr)
|
||||
|
||||
# 5. the cross-site frames under a transform
|
||||
_check_transformed_frames(page, s, "maximized (%s)" % case, case, maximized, dpr)
|
||||
@@ -0,0 +1,225 @@
|
||||
"""The OS cursor is parked outside the browser window, and a gesture that records pointer events checks it.
|
||||
|
||||
A headed window that appears under the OS cursor gets a native ``WM_MOUSEMOVE`` for it, and the first native move of a process passes Gecko's filter: the page
|
||||
sees a ``mousemove`` with ``buttons=0`` at the cursor's place, in the middle of whatever the test records. On a GitHub Windows runner the cursor is at
|
||||
(512, 384) and the window covers (-8, -8) to (1928, 1040) of a 1920x1080 screen (``test_drag_motion.py::test_a_real_page_sees_a_drag_that_travelled`` saw
|
||||
``mousemove 512,299 buttons=0`` after the press). Nothing here launches a browser or touches the real cursor: the rectangles are the runner's, the system is a fake.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import _os_cursor
|
||||
from _os_cursor import (MARGIN, TheCursorCannotBeParked, TheCursorIsInside, cursor_is_outside, park, park_outside, require_outside)
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
#: What a GitHub Windows runner shows while a headed browser is up.
|
||||
RUNNER_SCREEN = (0, 0, 1920, 1080)
|
||||
RUNNER_WINDOW = (-8, -8, 1928, 1040)
|
||||
RUNNER_CURSOR = (512, 384)
|
||||
|
||||
|
||||
def _free(point, windows, margin=MARGIN):
|
||||
return all(not (w[0] - margin <= point[0] < w[2] + margin and w[1] - margin <= point[1] < w[3] + margin) for w in windows)
|
||||
|
||||
|
||||
def _on_screen(point, screen):
|
||||
return screen[0] <= point[0] < screen[2] and screen[1] <= point[1] < screen[3]
|
||||
|
||||
|
||||
class _Desktop:
|
||||
"""The five answers of the desktop, with a cursor that obeys ``SetCursorPos`` unless ``obeys`` is False."""
|
||||
|
||||
def __init__(self, screen=RUNNER_SCREEN, windows=(RUNNER_WINDOW,), cursor=RUNNER_CURSOR, obeys=True):
|
||||
self._screen, self.windows, self.cursor, self.obeys = screen, list(windows), cursor, obeys
|
||||
self.asked = []
|
||||
|
||||
def screen(self):
|
||||
return self._screen
|
||||
|
||||
def windows_below(self, root_pid):
|
||||
return list(self.windows)
|
||||
|
||||
def cursor_position(self):
|
||||
return self.cursor
|
||||
|
||||
def set_cursor_position(self, x, y):
|
||||
self.asked.append((x, y))
|
||||
if self.obeys:
|
||||
self.cursor = (x, y)
|
||||
|
||||
|
||||
# ── the arrangement of the runner ────────────────────────────────────────────
|
||||
|
||||
def test_the_runners_cursor_is_inside_the_window_the_engine_opens():
|
||||
"""The arrangement that put a native move into a drag: the cursor on the runner is inside the window, so a window that appears under it is told."""
|
||||
assert cursor_is_outside([RUNNER_WINDOW], RUNNER_CURSOR) is False
|
||||
|
||||
|
||||
def test_a_parked_point_is_outside_the_runners_window_with_a_margin():
|
||||
point = park_outside([RUNNER_WINDOW], RUNNER_SCREEN)
|
||||
assert _on_screen(point, RUNNER_SCREEN)
|
||||
assert _free(point, [RUNNER_WINDOW])
|
||||
assert cursor_is_outside([RUNNER_WINDOW], point, MARGIN)
|
||||
|
||||
|
||||
def test_without_a_window_the_cursor_goes_to_the_bottom_right_corner():
|
||||
"""Before the browser starts there is no window to read: the corner where the engine puts none."""
|
||||
assert park_outside([], RUNNER_SCREEN) == (1919, 1079)
|
||||
|
||||
|
||||
def test_the_cursor_on_the_edge_of_a_window_is_inside_and_one_pixel_beyond_it_is_outside():
|
||||
window = (100, 100, 200, 200)
|
||||
assert not cursor_is_outside([window], (100, 100))
|
||||
assert not cursor_is_outside([window], (199, 199))
|
||||
assert cursor_is_outside([window], (200, 199))
|
||||
assert cursor_is_outside([window], (99, 150))
|
||||
|
||||
|
||||
def test_the_margin_widens_the_window_in_every_direction():
|
||||
window = (100, 100, 200, 200)
|
||||
assert not cursor_is_outside([window], (205, 150), margin=8)
|
||||
assert cursor_is_outside([window], (208, 150), margin=8)
|
||||
assert not cursor_is_outside([window], (150, 93), margin=8)
|
||||
|
||||
|
||||
# ── where the free point is ──────────────────────────────────────────────────
|
||||
|
||||
def test_a_window_on_the_corner_sends_the_cursor_to_another_one():
|
||||
window = (1000, 600, 1920, 1080)
|
||||
point = park_outside([window], RUNNER_SCREEN)
|
||||
assert _on_screen(point, RUNNER_SCREEN) and _free(point, [window])
|
||||
|
||||
|
||||
def test_a_window_that_covers_the_screen_has_no_free_point_and_says_so():
|
||||
with pytest.raises(TheCursorCannotBeParked) as caught:
|
||||
park_outside([(-8, -8, 1928, 1088)], RUNNER_SCREEN)
|
||||
message = str(caught.value)
|
||||
assert "Where:" in message and "What:" in message and "Fix:" in message
|
||||
assert "shrink the window" in message
|
||||
|
||||
|
||||
def test_a_window_that_leaves_less_than_the_margin_free_has_no_free_point():
|
||||
"""A strip of 4 pixels is free but the cursor would be 4 pixels from the page: not parked there."""
|
||||
with pytest.raises(TheCursorCannotBeParked):
|
||||
park_outside([(0, 0, 1920, 1076)], RUNNER_SCREEN)
|
||||
|
||||
|
||||
def test_a_strip_wider_than_the_margin_is_used():
|
||||
window = (0, 0, 1920, 1060)
|
||||
point = park_outside([window], RUNNER_SCREEN)
|
||||
assert _on_screen(point, RUNNER_SCREEN) and _free(point, [window])
|
||||
|
||||
|
||||
def test_two_monitors_leave_the_second_one_free():
|
||||
screen = (0, 0, 3840, 1080)
|
||||
point = park_outside([RUNNER_WINDOW], screen)
|
||||
assert _on_screen(point, screen) and _free(point, [RUNNER_WINDOW])
|
||||
assert point[0] > RUNNER_WINDOW[2]
|
||||
|
||||
|
||||
def test_a_virtual_screen_with_a_negative_origin_is_read_in_its_own_coordinates():
|
||||
"""A monitor left of and above the primary one: the virtual screen starts at a negative point and a window on the primary monitor covers part of it."""
|
||||
screen = (-1920, -200, 1920, 1080)
|
||||
point = park_outside([RUNNER_WINDOW], screen)
|
||||
assert _on_screen(point, screen) and _free(point, [RUNNER_WINDOW])
|
||||
|
||||
|
||||
def test_a_virtual_screen_with_a_negative_origin_and_a_window_on_every_monitor_but_the_strip():
|
||||
screen = (-1920, 0, 1920, 1080)
|
||||
windows = [(-1920, 0, 0, 1000), (0, 0, 1920, 1000)]
|
||||
point = park_outside(windows, screen)
|
||||
assert _on_screen(point, screen) and _free(point, windows)
|
||||
assert point[1] >= 1000 + MARGIN
|
||||
|
||||
|
||||
def test_several_windows_are_all_avoided():
|
||||
windows = [(0, 0, 900, 1080), (1000, 0, 1920, 500), (1000, 600, 1900, 1080)]
|
||||
point = park_outside(windows, RUNNER_SCREEN)
|
||||
assert _on_screen(point, RUNNER_SCREEN) and _free(point, windows)
|
||||
|
||||
|
||||
def test_an_empty_screen_is_refused_with_a_message():
|
||||
with pytest.raises(TheCursorCannotBeParked) as caught:
|
||||
park_outside([], (0, 0, 0, 0))
|
||||
assert "Fix:" in str(caught.value)
|
||||
|
||||
|
||||
# ── the system calls ─────────────────────────────────────────────────────────
|
||||
|
||||
def test_park_moves_the_cursor_out_of_the_window_and_reads_it_back():
|
||||
desktop = _Desktop()
|
||||
assert not cursor_is_outside(desktop.windows, desktop.cursor)
|
||||
point = park(api=desktop)
|
||||
assert desktop.asked == [point] and desktop.cursor == point
|
||||
assert cursor_is_outside(desktop.windows, desktop.cursor, MARGIN)
|
||||
|
||||
|
||||
def test_park_fails_with_a_message_when_the_system_does_not_move_the_cursor():
|
||||
desktop = _Desktop(obeys=False)
|
||||
with pytest.raises(TheCursorCannotBeParked) as caught:
|
||||
park(api=desktop)
|
||||
message = str(caught.value)
|
||||
assert "Where:" in message and "What:" in message and "Fix:" in message
|
||||
assert "interactive desktop" in message
|
||||
|
||||
|
||||
def test_the_precondition_fails_on_the_runners_arrangement():
|
||||
"""The red of the e2e: the cursor at (512, 384) inside the window, nothing parked it."""
|
||||
with pytest.raises(TheCursorIsInside) as caught:
|
||||
require_outside(api=_Desktop())
|
||||
assert "(512, 384)" in str(caught.value)
|
||||
|
||||
|
||||
def test_the_precondition_passes_once_the_cursor_is_parked():
|
||||
desktop = _Desktop()
|
||||
park(api=desktop)
|
||||
require_outside(api=desktop)
|
||||
|
||||
|
||||
def test_the_precondition_looks_at_every_window_of_the_browsers():
|
||||
desktop = _Desktop(windows=[RUNNER_WINDOW, (400, 300, 700, 500)], cursor=(2000 - 100, 1079))
|
||||
require_outside(api=desktop)
|
||||
desktop.cursor = (500, 400)
|
||||
with pytest.raises(TheCursorIsInside):
|
||||
require_outside(api=desktop)
|
||||
|
||||
|
||||
# ── not Windows ──────────────────────────────────────────────────────────────
|
||||
|
||||
def test_without_windows_nothing_is_parked_and_every_precondition_holds(monkeypatch):
|
||||
monkeypatch.setattr(_os_cursor, "_is_windows", lambda: False)
|
||||
assert park() is None
|
||||
require_outside()
|
||||
assert cursor_is_outside([RUNNER_WINDOW]) is True
|
||||
assert _os_cursor.browser_windows() == []
|
||||
|
||||
|
||||
def test_on_the_runners_1920x1080_screen_the_strip_below_the_window_holds_the_cursor():
|
||||
"""The arrangement the Windows e2e jobs declare (e2e.yml: the runner's screen is set to 1920x1080, the largest mode its video device accepts, run
|
||||
45730213378): the window of a 1920x1080 identity, (-8, 0, 1928, 1040), leaves y 1040..1080 free, and the cursor is parked there."""
|
||||
window = (-8, 0, 1928, 1040)
|
||||
point = park_outside([window], (0, 0, 1920, 1080))
|
||||
assert point[1] >= 1040 + MARGIN and point[1] < 1080
|
||||
assert cursor_is_outside([window], point)
|
||||
|
||||
|
||||
def test_every_windows_e2e_job_declares_the_runners_screen_before_its_e2e():
|
||||
"""The step that sets the runner's screen (1024x768 by default, smaller than the window) is in every Windows job of e2e.yml, before its first `run:`
|
||||
step that starts pytest; a job added without it would park the cursor inside the window, and the gestures' precondition would say so only on Windows."""
|
||||
import pathlib
|
||||
import re
|
||||
|
||||
workflow = (pathlib.Path(__file__).resolve().parents[1] / ".github" / "workflows" / "e2e.yml").read_text(encoding="utf-8")
|
||||
jobs = re.split(r"\n (?=[a-z0-9-]+:\n)", workflow)
|
||||
windows = [j for j in jobs if re.search(r"^ runs-on: windows", j, re.M)]
|
||||
assert windows, "no Windows job found in e2e.yml: the check reads nothing"
|
||||
missing = []
|
||||
for job in windows:
|
||||
name = job.split(":", 1)[0].strip()
|
||||
step = job.find("The runner's screen is 1920x1080")
|
||||
pytest_at = min((m.start() for m in re.finditer(r"pytest|run_e2e", job)), default=-1)
|
||||
if step < 0 or (pytest_at >= 0 and step > pytest_at):
|
||||
missing.append(name)
|
||||
assert not missing, "these Windows jobs of e2e.yml start their e2e without declaring the runner's screen first: %s" % missing
|
||||
@@ -0,0 +1,106 @@
|
||||
"""A page cannot reach the three chrome-only methods the parent uses to map a declared screen point back to the real one.
|
||||
|
||||
The engine declares the window origin and the chrome offset to the content process. The parent keeps a map from declared to real screen coordinates and exposes it
|
||||
to the browser's own chrome code, on ``CanonicalBrowsingContext``, as three ``[ChromeOnly]`` methods: ``stealthScreenRectToReal``, ``stealthScreenXDevPxToReal`` and
|
||||
``stealthScreenYDevPxToReal``. A page that could call them would read the real window geometry from the declared one, so they must not be there for content.
|
||||
This replaces the engine mochitest of the same point (a mochitest needs a build; this is one the candidate runs).
|
||||
|
||||
What it does, per display case (the four of the window tests), in the top document and in a frame of another site (another process), from the page's own script:
|
||||
|
||||
* the roots it can reach are collected: ``window``, ``document``, ``navigator``, ``location``, ``history``, ``screen``, ``visualViewport``, ``top``, ``parent``, ``self``,
|
||||
``frames``, the frame element's ``contentWindow`` where it is reachable, ``window.browsingContext`` and ``window.windowGlobalChild`` (both chrome-only: they must be
|
||||
undefined or throw), ``document.defaultView``, ``document.documentElement``, ``window.opener`` and ``window.frameElement``;
|
||||
* for each root, every object along its prototype chain is visited, and each of the three names is tried: as a property read (``obj[name]``), with ``in`` and with
|
||||
``Object.getOwnPropertyDescriptor``; and the names of every own property of the chain are searched for the strings ``stealthScreen`` and ``ToReal``;
|
||||
* ``CanonicalBrowsingContext`` and ``BrowsingContext`` are tried as globals (``typeof``, ``globalThis[name]``, ``window[name]``).
|
||||
|
||||
Every attempt must give ``undefined`` (or ``false``, or no descriptor), or throw on access. A function, a descriptor or a name that matches is a method of the parent a page
|
||||
can see, and the message names the root, the object and the name.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _window_origin import CASES, DEADLINE_S, launch_case, wait_for
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
METHODS = ["stealthScreenRectToReal", "stealthScreenXDevPxToReal", "stealthScreenYDevPxToReal"]
|
||||
|
||||
PAGE = "<!doctype html><meta charset=utf-8><title>exposure</title><body><iframe id=f src=\"%s\"></iframe>"
|
||||
FRAME = "<!doctype html><meta charset=utf-8><title>exposure in a frame</title><body>x"
|
||||
|
||||
#: The page's own probe. Returns every attempt that gave something other than undefined / false / no descriptor / a throw, as strings.
|
||||
PROBE = """(methods) => {
|
||||
const found = [];
|
||||
const attempt = (label, fn) => { try { return fn(); } catch (e) { return undefined; } };
|
||||
const roots = {};
|
||||
const add = (name, get) => { const v = attempt(name, get); if (v !== undefined && v !== null && (typeof v === 'object' || typeof v === 'function')) roots[name] = v; };
|
||||
add('window', () => window); add('self', () => self); add('globalThis', () => globalThis);
|
||||
add('document', () => document); add('navigator', () => navigator); add('location', () => location);
|
||||
add('history', () => history); add('screen', () => screen); add('visualViewport', () => visualViewport);
|
||||
add('top', () => top); add('parent', () => parent); add('frames', () => frames);
|
||||
add('opener', () => opener); add('frameElement', () => frameElement);
|
||||
add('document.defaultView', () => document.defaultView); add('document.documentElement', () => document.documentElement);
|
||||
add('document.body', () => document.body); add('iframe', () => document.querySelector('iframe'));
|
||||
add('iframe.contentWindow', () => document.querySelector('iframe').contentWindow);
|
||||
add('window.browsingContext', () => window.browsingContext); add('window.windowGlobalChild', () => window.windowGlobalChild);
|
||||
add('window.docShell', () => window.docShell); add('window.windowUtils', () => window.windowUtils);
|
||||
add('window.windowRoot', () => window.windowRoot); add('window.browsingContext.top', () => window.browsingContext.top);
|
||||
add('window.browsingContext.parent', () => window.browsingContext.parent);
|
||||
add('document.browsingContext', () => document.browsingContext);
|
||||
// the chrome-only members of a window must not be there for content at all
|
||||
for (const name of ['window.browsingContext', 'window.windowGlobalChild', 'window.docShell', 'window.windowUtils', 'window.windowRoot', 'document.browsingContext'])
|
||||
if (roots[name] !== undefined) found.push('a chrome-only root is reachable: ' + name);
|
||||
const seen = new Set();
|
||||
for (const [rootName, root] of Object.entries(roots)) {
|
||||
let obj = root, depth = 0;
|
||||
while (obj && depth < 20) {
|
||||
depth++;
|
||||
if (seen.has(obj)) { obj = attempt('proto', () => Object.getPrototypeOf(obj)); continue; }
|
||||
seen.add(obj);
|
||||
const own = attempt('names', () => Object.getOwnPropertyNames(obj)) || [];
|
||||
const symbols = attempt('symbols', () => Object.getOwnPropertySymbols(obj)) || [];
|
||||
for (const n of own) if (/stealthScreen|ToReal/i.test(n)) found.push(rootName + ': own property ' + n + ' on ' + attempt('ctor', () => String(obj.constructor && obj.constructor.name)));
|
||||
for (const s of symbols) if (/stealthScreen|ToReal/i.test(String(s))) found.push(rootName + ': own symbol ' + String(s));
|
||||
for (const m of methods) {
|
||||
const read = attempt('read', () => root[m]);
|
||||
if (read !== undefined) found.push(rootName + '[' + m + '] reads ' + typeof read);
|
||||
if (attempt('in', () => m in obj) === true) found.push(rootName + ': ' + m + ' in ' + attempt('ctor', () => String(obj.constructor && obj.constructor.name)));
|
||||
if (attempt('desc', () => Object.getOwnPropertyDescriptor(obj, m))) found.push(rootName + ': a descriptor of ' + m + ' on ' + attempt('ctor', () => String(obj.constructor && obj.constructor.name)));
|
||||
}
|
||||
obj = attempt('proto', () => Object.getPrototypeOf(obj));
|
||||
}
|
||||
}
|
||||
for (const g of ['CanonicalBrowsingContext', 'BrowsingContext', 'WindowContext', 'CanonicalWindowContext', 'WindowGlobalParent', 'WindowGlobalChild']) {
|
||||
if (typeof attempt(g, () => globalThis[g]) !== 'undefined') found.push('the global ' + g + ' is defined for a page');
|
||||
if (attempt(g, () => window[g]) !== undefined) found.push('window.' + g + ' is defined for a page');
|
||||
if (attempt(g, () => g in globalThis) === true) found.push(g + ' in globalThis');
|
||||
}
|
||||
return {found, roots: Object.keys(roots).length, visited: seen.size};
|
||||
}"""
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page(firefox_binary, case):
|
||||
results: Dict[str, Dict[str, Any]] = {}
|
||||
with Sites() as sites:
|
||||
sites.route("A", "/page", lambda handler: PAGE % sites.url("B", "/frame"))
|
||||
sites.route("B", "/frame", FRAME)
|
||||
with launch_case(firefox_binary, case) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
|
||||
frame = wait_frame(page, sites.origin["B"], "/frame", seconds=DEADLINE_S)
|
||||
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
|
||||
for name, doc in (("top document", page), ("frame of another site", frame)):
|
||||
results[name] = doc.evaluate(PROBE, METHODS)
|
||||
problems: List[str] = []
|
||||
for name, result in results.items():
|
||||
# a probe that visited nothing proves nothing
|
||||
if result["roots"] < 8 or result["visited"] < 20:
|
||||
problems.append("%s: the probe reached only %d roots and visited %d objects" % (name, result["roots"], result["visited"]))
|
||||
for line in result["found"]:
|
||||
problems.append("%s: %s" % (name, line))
|
||||
assert not problems, "%s: a page can reach what is chrome-only (%d):\n %s" % (case, len(problems), "\n ".join(problems))
|
||||
@@ -32,6 +32,7 @@ EXPECTED = {
|
||||
"wrapper.e2e.compositing": {"runner_image": WIN2022},
|
||||
"wrapper.e2e.fakeweb": {"stock_firefox": True, "extra_steps": ["fakeweb_profiles"]},
|
||||
"wrapper.e2e.securitystate": {"core_dumps": "invpw-cores"},
|
||||
"wrapper.e2e.stock_twin": {"stock_firefox": True},
|
||||
"wrapper.e2e.suite.linux.1": {"run": "suite_run"},
|
||||
"wrapper.e2e.suite.linux.2": {"run": "suite_run"},
|
||||
"wrapper.e2e.suite.linux.3": {"run": "suite_run"},
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
"""tests/vendor/README.md lists every vendored bundle with the sha256 of its bytes, and a bundle changed without its row is red.
|
||||
|
||||
The bundles are third-party code kept byte-identical to upstream; the README is where their version, licence and notice live. A bundle
|
||||
swapped, edited or added without touching that table would leave the provenance claiming something the file no longer is.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
VENDOR = Path(__file__).resolve().parent / "vendor"
|
||||
ROW = re.compile(r"^\|\s*`([^`]+)`\s*\|.*\|\s*`([0-9a-f]{64})`\s*\|", re.MULTILINE)
|
||||
|
||||
|
||||
def problems(directory: Path) -> list:
|
||||
"""What differs between the files of `directory` and the rows of its README.md, one line each."""
|
||||
rows = {name: digest for name, digest in ROW.findall((directory / "README.md").read_text(encoding="utf-8"))}
|
||||
files = {p.name: p for p in directory.iterdir() if p.is_file() and p.name != "README.md"}
|
||||
out = ["%s has no row" % n for n in sorted(files) if n not in rows]
|
||||
out += ["%s has a row and no file" % n for n in sorted(rows) if n not in files]
|
||||
out += ["%s differs from its sha256" % n for n in sorted(rows)
|
||||
if n in files and hashlib.sha256(files[n].read_bytes()).hexdigest() != rows[n]]
|
||||
return out
|
||||
|
||||
|
||||
def test_every_vendored_bundle_has_a_row_with_the_sha256_of_its_bytes():
|
||||
assert problems(VENDOR) == []
|
||||
|
||||
|
||||
def test_a_bundle_changed_without_its_row_is_red(tmp_path):
|
||||
(tmp_path / "a.js").write_bytes(b"one")
|
||||
(tmp_path / "README.md").write_text("| `a.js` | kind | 1 | MIT | `%s` | n |\n" % hashlib.sha256(b"one").hexdigest(), encoding="utf-8")
|
||||
assert problems(tmp_path) == []
|
||||
(tmp_path / "a.js").write_bytes(b"two")
|
||||
assert problems(tmp_path) == ["a.js differs from its sha256"]
|
||||
|
||||
|
||||
def test_a_bundle_with_no_row_and_a_row_with_no_bundle_are_red(tmp_path):
|
||||
(tmp_path / "a.js").write_bytes(b"one")
|
||||
(tmp_path / "README.md").write_text("| `b.js` | kind | 1 | MIT | `%s` | n |\n" % ("0" * 64), encoding="utf-8")
|
||||
assert problems(tmp_path) == ["a.js has no row", "b.js has a row and no file"]
|
||||
@@ -0,0 +1,139 @@
|
||||
"""The control launch of a WebGL test runs on the engine's own GL, never on the host's. No browser.
|
||||
|
||||
With the engine off (``zoom.stealth.fpp.hw_seed`` 0) Firefox loads the HOST's Mesa for WebGL; on a runner it once gave no context in 3083 launches
|
||||
("Exhausted GL driver options"), and a test cannot fail because of the runner's Mesa. The engine's own GL (``llvmpipe/`` next to the executable) is
|
||||
used only with the engine on, so the control of a test that compares a noised read with a read as drawn keeps the engine ON, with the same declared
|
||||
GPU, and declares only the canvas noise off (``zoom.stealth.canvas.substitute_pixels`` false), the control tests/test_webgl_noise_active.py already
|
||||
uses. These tests hold the prefs that the two e2e files pass to the launch, read from the call to ``InvisiblePlaywright`` itself (a recorder stands
|
||||
in for it and raises at once), and the rule of the verdict on the GL that both files call:
|
||||
|
||||
* tests/test_canvas_reads_as_drawn.py, the non-premultiplied WebGL canvas: neither launch has hw_seed 0; the control declares the noise off; the
|
||||
noised launch does not;
|
||||
* tests/test_canvas_create_pattern_projection_e2e.py: the same, for both of its launches;
|
||||
* the verdict on the GL: some engine process maps the engine's own libEGL.so.1 and libgallium-*, and no process maps a libEGL that is not the
|
||||
engine's; it does not apply on Windows nor to an engine without a GL of its own.
|
||||
* tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py needs the engine off (it proves Mozilla's own probe of the
|
||||
host's GL): its page still asks for WebGL, and with the engine off the answer is written down and not judged; with the engine declared
|
||||
a missing context is still red.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
import engine_process_tree as tree
|
||||
import invisible_playwright
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
HW_SEED = "zoom.stealth.fpp.hw_seed"
|
||||
SUBSTITUTE = "zoom.stealth.canvas.substitute_pixels"
|
||||
|
||||
|
||||
class _Launched(Exception):
|
||||
"""The recorder has what it came for: the launch goes no further."""
|
||||
|
||||
|
||||
def _prefs_of_the_launch(monkeypatch, module_name, launch):
|
||||
"""The ``extra_prefs`` that ``launch()`` hands to InvisiblePlaywright, in the module under test."""
|
||||
module = importlib.import_module(module_name)
|
||||
seen = {}
|
||||
|
||||
class Recorder:
|
||||
def __init__(self, *args, **kwargs):
|
||||
seen.update(kwargs)
|
||||
raise _Launched
|
||||
|
||||
monkeypatch.setattr(module, "InvisiblePlaywright", Recorder, raising=False)
|
||||
monkeypatch.setattr(invisible_playwright, "InvisiblePlaywright", Recorder)
|
||||
with pytest.raises(_Launched):
|
||||
launch(module)
|
||||
return dict(seen.get("extra_prefs") or {})
|
||||
|
||||
|
||||
def _the_two_launches_keep_the_engine_on_and_only_the_noise_differs(noised, control):
|
||||
assert (noised.get(HW_SEED) or 0) > 0, (
|
||||
"the noised launch does not declare the engine on (hw_seed %r): its prefs are %r" % (noised.get(HW_SEED), noised))
|
||||
assert (control.get(HW_SEED) or 0) > 0, (
|
||||
"the control launch has the engine off (hw_seed %r): WebGL would run on the host's GL, which a runner may not serve; its prefs are %r"
|
||||
% (control.get(HW_SEED), control))
|
||||
assert control.get(SUBSTITUTE) is False, (
|
||||
"the control launch does not declare the canvas noise off (%s is %r): its prefs are %r" % (SUBSTITUTE, control.get(SUBSTITUTE), control))
|
||||
assert noised.get(SUBSTITUTE) is not False, "the noised launch declares the canvas noise off: its prefs are %r" % noised
|
||||
|
||||
|
||||
def test_the_non_premultiplied_canvas_control_keeps_the_engine_on_and_declares_only_the_noise_off(monkeypatch):
|
||||
name = "test_canvas_reads_as_drawn"
|
||||
noised = _prefs_of_the_launch(monkeypatch, name, lambda m: m._non_premultiplied(None, True))
|
||||
control = _prefs_of_the_launch(monkeypatch, name, lambda m: m._non_premultiplied(None, False))
|
||||
_the_two_launches_keep_the_engine_on_and_only_the_noise_differs(noised, control)
|
||||
|
||||
|
||||
def test_the_create_pattern_control_keeps_the_engine_on_and_declares_only_the_noise_off(monkeypatch):
|
||||
name = "test_canvas_create_pattern_projection_e2e"
|
||||
noised = _prefs_of_the_launch(monkeypatch, name, lambda m: m._read(None, True))
|
||||
control = _prefs_of_the_launch(monkeypatch, name, lambda m: m._read(None, False))
|
||||
_the_two_launches_keep_the_engine_on_and_only_the_noise_differs(noised, control)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def engine_dir(tmp_path):
|
||||
"""An engine folder with a binary; the maps below are written with its real path, as /proc gives them."""
|
||||
folder = tmp_path / "engine"
|
||||
folder.mkdir()
|
||||
(folder / "firefox").write_bytes(b"")
|
||||
real = os.path.realpath(str(folder))
|
||||
return str(folder / "firefox"), os.path.join(real, "llvmpipe") + os.sep
|
||||
|
||||
|
||||
def test_a_process_that_maps_the_engines_own_gl_and_nothing_foreign_passes(engine_dir):
|
||||
binary, own = engine_dir
|
||||
tree.assert_the_gl_is_the_engines_own(binary, {10: [own + "libEGL.so.1", own + "libgallium-26.2.6.so"], 11: ["/usr/lib/libc.so.6"]})
|
||||
|
||||
|
||||
def test_a_host_libegl_in_any_process_fails_and_names_the_pid(engine_dir):
|
||||
binary, own = engine_dir
|
||||
below = {10: [own + "libEGL.so.1", own + "libgallium-26.2.6.so"], 11: ["/usr/lib/x86_64-linux-gnu/libEGL.so.1"]}
|
||||
with pytest.raises(AssertionError) as caught:
|
||||
tree.assert_the_gl_is_the_engines_own(binary, below)
|
||||
assert "11" in str(caught.value) and "/usr/lib/x86_64-linux-gnu/libEGL.so.1" in str(caught.value)
|
||||
|
||||
|
||||
def test_no_process_that_draws_on_the_engines_own_gl_fails(engine_dir):
|
||||
binary, own = engine_dir
|
||||
with pytest.raises(AssertionError):
|
||||
tree.assert_the_gl_is_the_engines_own(binary, {10: ["/usr/lib/x86_64-linux-gnu/libgallium-25.2.8.so"]})
|
||||
with pytest.raises(AssertionError):
|
||||
tree.assert_the_gl_is_the_engines_own(binary, {})
|
||||
|
||||
|
||||
def test_the_verdict_on_the_gl_does_not_apply_where_it_has_no_maps(engine_dir):
|
||||
binary, _ = engine_dir
|
||||
tree.assert_the_gl_is_the_engines_own(binary, None)
|
||||
|
||||
|
||||
def _host_gl_check(monkeypatch, webgl):
|
||||
"""`_check` of tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py with its launch stood in for: a probe born
|
||||
before the goto under the browser's parent, nothing wrong with the observation, and the page's answer to getContext('webgl') given."""
|
||||
import types
|
||||
|
||||
module = importlib.import_module("test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e")
|
||||
probe = (types.SimpleNamespace(pid=11), types.SimpleNamespace(ppid=10, first=1.0))
|
||||
monkeypatch.setattr(module.shutil, "which", lambda name: "/usr/bin/" + name)
|
||||
monkeypatch.setattr(module, "_require_strace_can_trace", lambda path: None)
|
||||
monkeypatch.setattr(module, "_launch", lambda binary, work, prefs: ([probe], [], webgl, "the report", {10}, 2.0))
|
||||
return module
|
||||
|
||||
|
||||
@pytest.mark.parametrize("webgl", [None, False])
|
||||
def test_the_host_gl_control_writes_down_a_missing_context_on_the_host_s_mesa_and_does_not_judge_it(monkeypatch, tmp_path, webgl):
|
||||
module = _host_gl_check(monkeypatch, webgl)
|
||||
module._check("firefox", tmp_path, module.UNDECLARED, want_probe=True)
|
||||
|
||||
|
||||
def test_the_declared_engine_still_requires_a_webgl_context(monkeypatch, tmp_path):
|
||||
module = _host_gl_check(monkeypatch, None)
|
||||
with pytest.raises(AssertionError, match="null with the engine declared"):
|
||||
module._check("firefox", tmp_path, None, want_probe=True)
|
||||
@@ -0,0 +1,111 @@
|
||||
"""scripts/ci_wer_dumps.py reads the header of a Windows Error Reporting dump and names the thread, the exception and the module that holds the faulting address.
|
||||
|
||||
A minidump is built here byte by byte (MINIDUMP_HEADER, a directory of a module list and an exception stream, MINIDUMP_MODULE records with their UTF-16 names,
|
||||
MINIDUMP_EXCEPTION_STREAM; layouts: https://learn.microsoft.com/windows/win32/api/minidumpapiset/), so no Windows and no debugger is needed:
|
||||
|
||||
* an access violation inside the second module is reported with its code name, the thread id, ``module+offset`` and the failed access (a write of an address);
|
||||
* an address in no module says so; a dump with no exception stream says it was taken on request;
|
||||
* a file that is not a minidump and an empty folder do not raise: the step must never fail the job, and no dump is the normal case;
|
||||
* the summary lists every dump with its size and is written to ``summary.txt`` beside them.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import struct
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
|
||||
import ci_wer_dumps # noqa: E402
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
PYTHON_BASE, PYTHON_SIZE = 0x00007FF700000000, 0x20000
|
||||
XUL_BASE, XUL_SIZE = 0x00007FFA10000000, 0x5000000
|
||||
|
||||
|
||||
def _minidump(address: int | None, code: int = 0xC0000005, thread: int = 4242, params=(1, 0xDEAD0010)) -> bytes:
|
||||
"""A minidump with two modules and, when ``address`` is not None, an exception stream."""
|
||||
names = ["C:\\hostedtoolcache\\python.exe", "D:\\a\\_temp\\firefox\\xul.dll"]
|
||||
mods = [(PYTHON_BASE, PYTHON_SIZE), (XUL_BASE, XUL_SIZE)]
|
||||
n_streams = 2 if address is not None else 1
|
||||
dir_at = 32
|
||||
module_list_at = dir_at + 12 * n_streams
|
||||
module_list_size = 4 + 108 * len(mods)
|
||||
exception_at = module_list_at + module_list_size
|
||||
exception_size = 8 + 32 + 15 * 8 + 8
|
||||
strings_at = exception_at + (exception_size if address is not None else 0)
|
||||
blobs, rvas, at = [], [], strings_at
|
||||
for n in names:
|
||||
raw = n.encode("utf-16-le")
|
||||
blob = struct.pack("<I", len(raw)) + raw
|
||||
rvas.append(at)
|
||||
blobs.append(blob)
|
||||
at += len(blob)
|
||||
out = struct.pack("<4sIIIIIQ", b"MDMP", 0xA793, n_streams, dir_at, 0, 0, 0x2) # signature, version, streams, directory rva, checksum, time, flags
|
||||
out += struct.pack("<III", 4, module_list_size, module_list_at)
|
||||
if address is not None:
|
||||
out += struct.pack("<III", 6, exception_size, exception_at)
|
||||
out += struct.pack("<I", len(mods))
|
||||
for (base, size), rva in zip(mods, rvas):
|
||||
out += struct.pack("<QIIII", base, size, 0, 0, rva) + b"\0" * (108 - 24)
|
||||
if address is not None:
|
||||
padded = list(params) + [0] * (15 - len(params))
|
||||
out += struct.pack("<IIIIQQII", thread, 0, code, 0, 0, address, len(params), 0) + struct.pack("<15Q", *padded) + struct.pack("<II", 0, 0)
|
||||
for b in blobs:
|
||||
out += b
|
||||
return out
|
||||
|
||||
|
||||
def test_an_access_violation_inside_a_module_is_named_with_its_offset(tmp_path):
|
||||
dump = tmp_path / "python.exe.1234.dmp"
|
||||
dump.write_bytes(_minidump(XUL_BASE + 0x1234))
|
||||
d = ci_wer_dumps.read_dump(dump)
|
||||
assert (d["thread_id"], d["code"], d["address"]) == (4242, 0xC0000005, XUL_BASE + 0x1234)
|
||||
assert d["module"].endswith("xul.dll") and d["offset"] == 0x1234 and d["module_count"] == 2
|
||||
text = ci_wer_dumps.describe(dump)
|
||||
assert "EXCEPTION_ACCESS_VIOLATION on thread 4242" in text
|
||||
assert "xul.dll+0x1234" in text
|
||||
assert "failed access: write of 0x00000000DEAD0010" in text
|
||||
|
||||
|
||||
def test_the_first_module_is_found_too_and_an_address_in_none_says_so(tmp_path):
|
||||
first = tmp_path / "a.dmp"
|
||||
first.write_bytes(_minidump(PYTHON_BASE + 0x10))
|
||||
assert ci_wer_dumps.read_dump(first)["module"].endswith("python.exe")
|
||||
nowhere = tmp_path / "b.dmp"
|
||||
nowhere.write_bytes(_minidump(0x1000))
|
||||
assert "module" not in ci_wer_dumps.read_dump(nowhere)
|
||||
assert "no module of the dump" in ci_wer_dumps.describe(nowhere)
|
||||
|
||||
|
||||
def test_a_dump_with_no_exception_stream_says_it_was_taken_on_request(tmp_path):
|
||||
dump = tmp_path / "c.dmp"
|
||||
dump.write_bytes(_minidump(None))
|
||||
assert "no exception stream" in ci_wer_dumps.describe(dump)
|
||||
|
||||
|
||||
def test_a_file_that_is_not_a_minidump_does_not_raise(tmp_path):
|
||||
junk = tmp_path / "d.dmp"
|
||||
junk.write_bytes(b"not a dump" * 10)
|
||||
assert "unreadable header" in ci_wer_dumps.describe(junk)
|
||||
short = tmp_path / "e.dmp"
|
||||
short.write_bytes(b"MDMP")
|
||||
assert "unreadable header" in ci_wer_dumps.describe(short)
|
||||
|
||||
|
||||
def test_the_summary_lists_every_dump_with_its_size_and_is_saved_beside_them(tmp_path, capsys):
|
||||
(tmp_path / "python.exe.1.dmp").write_bytes(_minidump(XUL_BASE + 8))
|
||||
(tmp_path / "python.exe.2.dmp").write_bytes(_minidump(XUL_BASE + 16))
|
||||
assert ci_wer_dumps.main(["x", str(tmp_path)]) == 0
|
||||
out = capsys.readouterr().out
|
||||
assert ": 2\n" in out and "python.exe.1.dmp" in out and "python.exe.2.dmp" in out and "xul.dll+0x10" in out
|
||||
assert (tmp_path / "summary.txt").read_text(encoding="utf-8") == out
|
||||
|
||||
|
||||
def test_no_dump_and_no_folder_are_the_normal_case(tmp_path, capsys):
|
||||
assert ci_wer_dumps.main(["x", str(tmp_path)]) == 0
|
||||
assert ": 0\n" in capsys.readouterr().out
|
||||
assert ci_wer_dumps.main(["x", str(tmp_path / "missing")]) == 0
|
||||
assert not (tmp_path / "missing").exists()
|
||||
@@ -87,7 +87,7 @@ def slow(monkeypatch):
|
||||
return vd
|
||||
|
||||
|
||||
def test_a_second_browser_is_served_while_the_first_starts_its_display(slow):
|
||||
def test_a_second_browser_is_served_while_the_first_starts_its_display(slow, declared_engine):
|
||||
"""While the first browser's display start is in progress (blocked until the
|
||||
test lets it return), the loop answers a second browser. If the start ran on
|
||||
the loop, the loop would stand still inside it and the second browser could
|
||||
|
||||
@@ -28,7 +28,7 @@ import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from engine_process_tree import maps_of_the_engine_below
|
||||
from engine_process_tree import assert_the_gl_is_the_engines_own, maps_of_the_engine_below, ships_its_own_gl
|
||||
|
||||
pytestmark = [pytest.mark.e2e,
|
||||
pytest.mark.skipif(not sys.platform.startswith("linux"), reason="the engine's own GL is Linux's")]
|
||||
@@ -226,16 +226,9 @@ ON_WINDOWS = {
|
||||
}
|
||||
|
||||
|
||||
def _ships_its_own_gl(binary_dir: str) -> bool:
|
||||
"""The engine's own GL is in the package from firefox-59: the test follows
|
||||
the package under test, not the core's version (the gate runs a candidate
|
||||
under the published core)."""
|
||||
return os.path.isfile(os.path.join(binary_dir, "llvmpipe", "libEGL.so.1"))
|
||||
|
||||
|
||||
def test_webgl_draws_on_the_engine_s_own_gl(firefox_binary):
|
||||
binary_dir = os.path.dirname(os.path.realpath(firefox_binary))
|
||||
if not _ships_its_own_gl(binary_dir):
|
||||
if not ships_its_own_gl(binary_dir):
|
||||
pytest.skip("this engine has no GL of its own (it ships from firefox-59)")
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
@@ -246,14 +239,7 @@ def test_webgl_draws_on_the_engine_s_own_gl(firefox_binary):
|
||||
# The engine processes BELOW THIS TEST, never the first one on the machine: an e2e run
|
||||
# has other workers' browsers in /proc, one of which has not drawn anything yet.
|
||||
below = maps_of_the_engine_below(os.getpid(), binary_dir)
|
||||
own = os.path.join(binary_dir, "llvmpipe") + os.sep
|
||||
assert below, "no engine process below this test"
|
||||
drew = [pid for pid, maps in below.items()
|
||||
if own + "libEGL.so.1" in maps and any(m.startswith(own + "libgallium-") for m in maps)]
|
||||
assert drew, {pid: [m for m in maps if "EGL" in m or "gallium" in m] for pid, maps in below.items()}
|
||||
foreign = {pid: [m for m in maps if "libEGL" in os.path.basename(m) and not m.startswith(own)]
|
||||
for pid, maps in below.items()}
|
||||
assert not any(foreign.values()), foreign
|
||||
assert_the_gl_is_the_engines_own(firefox_binary, below)
|
||||
|
||||
|
||||
def test_every_declared_extension_answers_as_on_windows(firefox_binary):
|
||||
|
||||
@@ -6,7 +6,7 @@ Two layers, both runnable on GitHub CI:
|
||||
samples. No browser, no proxy, no network. These lock in every rule we found
|
||||
on 2026-06-06: host must be mDNS ``.local``; an srflx must carry a
|
||||
GENUINE nICEr priority (never ``local_pref == 0xFFFF``) and a
|
||||
stable, distinct foundation; CreepJS's resolver must return the egress, and a
|
||||
stable, distinct foundation; the resolver of a public headless detector must return the egress, and a
|
||||
host-only SDP must read as "blocked". They run in the standard ``tests.yml``.
|
||||
|
||||
* **e2e** (`@pytest.mark.e2e`) - launch the patched binary and verify the live
|
||||
@@ -99,7 +99,7 @@ def srflx_candidates(cands):
|
||||
|
||||
def host_is_mdns(cands):
|
||||
"""Every host candidate must be a ``<uuid>.local`` mDNS name, never a raw
|
||||
LAN IP (the §9.4 leak form that fails BrowserLeaks)."""
|
||||
LAN IP (the §9.4 leak form that fails a public leak-test page)."""
|
||||
hosts = host_candidates(cands)
|
||||
return bool(hosts) and all(is_mdns(c["address"]) for c in hosts)
|
||||
|
||||
@@ -127,10 +127,10 @@ def srflx_realness(cand, expected_ip=None):
|
||||
return (not reasons), reasons
|
||||
|
||||
|
||||
def creep_get_ipaddress(sdp):
|
||||
"""Faithful port of CreepJS's getIPAddress(sdp): connection line first, then
|
||||
def resolve_ipaddress_from_sdp(sdp):
|
||||
"""Faithful port of the getIPAddress(sdp) of a public headless detector: connection line first, then
|
||||
the first candidate IP; '0.0.0.0' counts as blocked. Returns None if blocked
|
||||
- i.e. exactly what makes CreepJS render 'stun connection: blocked'."""
|
||||
- i.e. exactly what makes that detector render 'stun connection: blocked'."""
|
||||
blocked = "0.0.0.0"
|
||||
conn = (re.findall(r"c=IN\s.+\s", sdp) or [""])[0].strip().split(" ")
|
||||
conn_ip = conn[2] if len(conn) > 2 else ""
|
||||
@@ -203,22 +203,22 @@ def test_srflx_foundation_distinct_from_host():
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_creep_resolver_returns_egress_when_srflx_present():
|
||||
assert creep_get_ipaddress(SDP_GOOD) == "203.0.113.7"
|
||||
def test_the_resolver_returns_the_egress_when_srflx_is_present():
|
||||
assert resolve_ipaddress_from_sdp(SDP_GOOD) == "203.0.113.7"
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_creep_resolver_reports_blocked_for_host_only():
|
||||
def test_the_resolver_reports_blocked_for_host_only():
|
||||
"""The exact false-green we shipped: host-only (.local) SDP → no public IP
|
||||
→ CreepJS shows 'blocked'. The resolver must return None here."""
|
||||
assert creep_get_ipaddress(SDP_BLOCKED) is None
|
||||
→ that detector shows 'blocked'. The resolver must return None here."""
|
||||
assert resolve_ipaddress_from_sdp(SDP_BLOCKED) is None
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_mdns_host_is_invisible_to_creep_resolver():
|
||||
def test_mdns_host_is_invisible_to_the_resolver():
|
||||
"""A .local host must NOT be mis-read as an IP (the hyphen in the UUID is
|
||||
what makes CreepJS skip it and fall through to the srflx)."""
|
||||
assert creep_get_ipaddress("v=0\r\nc=IN IP4 0.0.0.0\r\n" f"a={HOST_MDNS}\r\n") is None
|
||||
what makes that detector skip it and fall through to the srflx)."""
|
||||
assert resolve_ipaddress_from_sdp("v=0\r\nc=IN IP4 0.0.0.0\r\n" f"a={HOST_MDNS}\r\n") is None
|
||||
|
||||
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
@@ -235,7 +235,7 @@ from invisible_core.prefs import translate_profile_to_prefs # noqa: E402
|
||||
def test_shipped_webrtc_baseline_is_the_validated_config():
|
||||
prefs = translate_profile_to_prefs(generate_profile(seed=42), timezone="America/New_York")
|
||||
# host candidate must be mDNS .local like vanilla Firefox (manually
|
||||
# validated on BrowserLeaks/CreepJS through a residential proxy) - not a
|
||||
# validated on public leak-test and detector pages through a residential proxy) - not a
|
||||
# raw LAN IP.
|
||||
assert prefs["media.peerconnection.ice.obfuscate_host_addresses"] is True
|
||||
# IPv6 is removed from ICE gathering, but NOT from a pref: since 2026-08-25
|
||||
@@ -1270,7 +1270,7 @@ def test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all(monkeypatch):
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
# The egress IP must not change MID-SESSION.
|
||||
#
|
||||
# Measured on 2026-08-25 on browserleaks, behind a residential proxy: the
|
||||
# Measured on 2026-08-25 on a public leak-test page, behind a residential proxy: the
|
||||
# page exited from 203.0.113.30 while a second reading of the exit said
|
||||
# 216.131.76.64, and the site says so plainly ("WebRTC IP doesn't match your
|
||||
# Remote IP"). It was not a regression in the binary - interleaved A/B between
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
"""A WebGL test that gets no context writes down why, and its verdict stays the first attempt's. No browser.
|
||||
|
||||
tests/test_canvas_reads_as_drawn.py failed once on the engine-off launch with "webgl is unavailable: a WebGL canvas cannot be read" and nothing else was left of
|
||||
the run (the probe returned null). The probe now returns what the canvas heard on `webglcontextcreationerror`; these tests hold how that result is read.
|
||||
"""
|
||||
import _webgl_unavailable as unavailable
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
NO_CONTEXT = {"unavailable": True, "statusMessages": ["FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS"],
|
||||
"webglInterface": "function", "webgl2Interface": "function"}
|
||||
PIXELS = {"url": "data:image/png;base64,AAAA", "blob": "AAAA", "premultipliedAlpha": False}
|
||||
|
||||
|
||||
def test_a_probe_without_a_context_is_the_old_null_with_its_record():
|
||||
got, first = unavailable.split_probe(NO_CONTEXT)
|
||||
assert got is None
|
||||
assert first is NO_CONTEXT
|
||||
|
||||
|
||||
def test_a_probe_with_a_context_is_read_as_before():
|
||||
got, first = unavailable.split_probe(PIXELS)
|
||||
assert got is PIXELS
|
||||
assert first is None
|
||||
|
||||
|
||||
def test_a_probe_that_returns_nothing_is_still_no_context_but_has_no_record():
|
||||
# an old page or a failed evaluate: `None` is read as `None`, as it always was
|
||||
assert unavailable.split_probe(None) == (None, None)
|
||||
|
||||
|
||||
def test_the_message_keeps_the_old_sentence_and_appends_both_attempts():
|
||||
second = {"statusMessages": [], "created": True, "renderer": "llvmpipe"}
|
||||
message = unavailable.unavailable_message(NO_CONTEXT, second)
|
||||
assert message.startswith("webgl is unavailable: a WebGL canvas cannot be read | first: ")
|
||||
assert message == ("webgl is unavailable: a WebGL canvas cannot be read | first: %r; second after 2 s: %r" % (NO_CONTEXT, second))
|
||||
assert "FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS" in message and "llvmpipe" in message
|
||||
|
||||
|
||||
def test_the_pause_before_the_second_attempt_is_2_seconds():
|
||||
assert unavailable.SECOND_ATTEMPT_AFTER_MS == 2000
|
||||
@@ -16,7 +16,7 @@ from invisible_playwright import ensure_binary, get_default_stealth_prefs
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
def test_public_import_matches_direct_import():
|
||||
def test_public_import_matches_direct_import(lab_exit):
|
||||
"""The wrapper's re-export IS the core's function, not a copy of it."""
|
||||
from invisible_core.config import get_default_stealth_prefs as _core
|
||||
|
||||
|
||||
Vendored
+13
-16
@@ -2,23 +2,20 @@
|
||||
|
||||
These are upstream, unmodified, MIT-licensed browser-fingerprinting / bot-detection
|
||||
libraries, vendored so the detector e2e tests run **hermetically and identically**
|
||||
on a dev box and on a GitHub runner (no external CDN at test time - Firefox
|
||||
tracking-protection blocks the openfpcdn.io CDN anyway, and we want CI offline).
|
||||
on a dev box and on a GitHub runner (no external CDN at test time, and we want CI offline).
|
||||
|
||||
They are served from a localhost HTTP server and loaded into the patched Firefox;
|
||||
the tests assert the REAL detectors don't flag the stealth build (BotD: `bot===false`;
|
||||
fpscanner: engine-agnostic rules clean; CreepJS: `headlessRating===0` + no JS-proxy
|
||||
tells) and that the fingerprint is stable (FingerprintJS: same `visitorId` across
|
||||
launches). CreepJS runs fully offline - the tests abort every non-loopback request,
|
||||
so its optional crowd-comparison POST never fires and the verdict is computed locally.
|
||||
the tests assert the REAL detectors don't flag the stealth build (bot detector: `bot===false`;
|
||||
rules scanner: engine-agnostic rules clean) and that the fingerprint is stable (fingerprint
|
||||
library: same `visitorId` across launches).
|
||||
|
||||
| File | Package | Version | Source | License |
|
||||
|---|---|---|---|---|
|
||||
| `botd-2.0.0.esm.js` | `@fingerprintjs/botd` | 2.0.0 | https://cdn.jsdelivr.net/npm/@fingerprintjs/botd@2.0.0/dist/botd.esm.js | MIT |
|
||||
| `fingerprintjs-5.2.0.umd.min.js` | `@fingerprintjs/fingerprintjs` | 5.2.0 | https://cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@5.2.0/dist/fp.umd.min.js | MIT |
|
||||
| `fpscanner-1.0.6.es.js` | `fpscanner` | 1.0.6 | https://cdn.jsdelivr.net/npm/fpscanner@1.0.6/dist/fpScanner.es.js | MIT |
|
||||
| `creepjs-10aa672.js` | `abrahamjuliot/creepjs` | git `10aa6724` | https://raw.githubusercontent.com/abrahamjuliot/creepjs/10aa6724cd33a1015db1574211890518cd04f0cc/docs/creep.js | MIT |
|
||||
Every file of this directory has one row below, with the sha256 of its bytes;
|
||||
`tests/test_the_vendored_bundles_are_listed_with_their_hash.py` is red if a file has no row, a row has no
|
||||
file, or a hash differs. To update a bundle: drop the pinned upstream dist here, bump the version in the
|
||||
file name, and change its row (name, version, sha256).
|
||||
|
||||
All MIT (FingerprintJS Inc. / Antoine Vastel / Abraham Juliot). To update: download
|
||||
the pinned dist (jsdelivr for npm packages, raw.githubusercontent for CreepJS at a
|
||||
commit SHA), drop it here, and bump the version in the filename + this table.
|
||||
| File | Kind | Version | SPDX license | sha256 | Licence notice |
|
||||
|---|---|---|---|---|---|
|
||||
| `bot-detector-2.0.0.esm.js` | client-side bot detector | 2.0.0 | MIT | `f438ed251dc7414ece9d4a2b6941441ad9ffae1a1905817f5f0c7366e701dd86` | in the file header (copyright line and licence reference) |
|
||||
| `fingerprint-library-5.2.0.umd.min.js` | open-source fingerprint library | 5.2.0 | MIT | `a8de5ead580c42d2e2b01a5752aa08da510852230971aa18554d67cd5de5775b` | in the file header (copyright line and full licence text) |
|
||||
| `rules-scanner-1.0.6.es.js` | automation-rules scanner | 1.0.6 | MIT | `4ae2557e92451687e275877039d4dff4601ad1344c5bc8206e9c7087fbf5e91a` | in the file header (upstream's MIT notice: the copyright holder and year and the full permission text verbatim; the contact address is left out) |
|
||||
File renamed without changes.
Vendored
-9710
File diff suppressed because it is too large.
Load diff
Vendored
File renamed without changes.
@@ -1,3 +1,26 @@
|
||||
/*!
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 antoinevastel
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
function ie() {
|
||||
return navigator.webdriver;
|
||||
}
|
||||
Reference in new issue
Block a user