Compare commits
99
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc6d861f62 | ||
|
|
8f8a191e9b | ||
|
|
eca6652f56 | ||
|
|
fbae6d54a4 | ||
|
|
836e16724e | ||
|
|
2ca4fa8084 | ||
|
|
8dc5c3745a | ||
|
|
ce65951227 | ||
|
|
766961dcdb | ||
|
|
eb203fc58c | ||
|
|
3f4ee5c61e | ||
|
|
5d0be75316 | ||
|
|
dbd2022e34 | ||
|
|
ac5a519244 | ||
|
|
f5d2ec81f9 | ||
|
|
6d1bd1047b | ||
|
|
ac75085d10 | ||
|
|
8ab1d3d68a | ||
|
|
b58edbf367 | ||
|
|
aad5ac38da | ||
|
|
ac62151198 | ||
|
|
94fd5740c8 | ||
|
|
174c6b8b88 | ||
|
|
4bf9b5e009 | ||
|
|
0af776766a | ||
|
|
f5234742e6 | ||
|
|
07018c00b7 | ||
|
|
b37287094e | ||
|
|
4d97eae291 | ||
|
|
a4e6c8f56d | ||
|
|
435d261ce4 | ||
|
|
8a42ed3676 | ||
|
|
2c6a93900f | ||
|
|
756f722d40 | ||
|
|
215f552a10 | ||
|
|
98da306330 | ||
|
|
b14f479e09 | ||
|
|
af48556777 | ||
|
|
5776836ab6 | ||
|
|
da0720364a | ||
|
|
c3295c5b12 | ||
|
|
a7b1acf732 | ||
|
|
8d6d6ae208 | ||
|
|
194ae6f042 | ||
|
|
dee362ea02 | ||
|
|
f8e5ff8700 | ||
|
|
e8b3efa8c9 | ||
|
|
b02f74ed58 | ||
|
|
b48592587f | ||
|
|
66e5b75cb6 | ||
|
|
8e4be5b67d | ||
|
|
69a9c60328 | ||
|
|
2b9858570a | ||
|
|
bd71ac2026 | ||
|
|
cba46aa042 | ||
|
|
55ce95a1ad | ||
|
|
a837e63a08 | ||
|
|
70f81bbb3a | ||
|
|
3a67051a92 | ||
|
|
112607291a | ||
|
|
38fb8b6877 | ||
|
|
2703b5fc97 | ||
|
|
323d272a32 | ||
|
|
b7f974788a | ||
|
|
3f372e4675 | ||
|
|
a9ec63caed | ||
|
|
c3dad8b9e9 | ||
|
|
50f2e53c9c | ||
|
|
0a0a2f4efd | ||
|
|
8add8e4a42 | ||
|
|
89c7d3be3b | ||
|
|
241d156f1f | ||
|
|
d6dc3bf0ba | ||
|
|
74deb6a060 | ||
|
|
fa735a74e7 | ||
|
|
d6498e527b | ||
|
|
92712b1658 | ||
|
|
ab3247d359 | ||
|
|
4bf642a58a | ||
|
|
360a22887f | ||
|
|
2d31ecdfff | ||
|
|
6b67a514e5 | ||
|
|
f42d5ecd26 | ||
|
|
1f06722137 | ||
|
|
9f91d752e4 | ||
|
|
c820dd50f9 | ||
|
|
20af8c4509 | ||
|
|
c6d3ded241 | ||
|
|
11db0d50b5 | ||
|
|
194035dec5 | ||
|
|
79b46cc0a2 | ||
|
|
8c926d9551 | ||
|
|
c65828d809 | ||
|
|
5d84475d98 | ||
|
|
0d3a710c02 | ||
|
|
4c7faecde0 | ||
|
|
f84f83f17d | ||
|
|
2b68ae3adf | ||
|
|
6c800e7fa0 |
No files matched your search
@@ -22,10 +22,6 @@
|
||||
# Windows runner separates the two without asking anyone to stay off it
|
||||
# for six hours.
|
||||
#
|
||||
# A SECOND PATTERN, `pattern=init-map`: not a hunt, a measurement. It maps what a launch does from `InvisiblePlaywright(...)` to the first page and the first goto,
|
||||
# with the time of every step (scripts/init_map.py), on Linux and on Windows, and uploads a JSON and a Markdown table. No threshold and no verdict: the job is green
|
||||
# when it measured, and the numbers are read by whoever is looking for where to optimise. The loop above does not run for it.
|
||||
#
|
||||
# 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.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
@@ -38,18 +34,6 @@ on:
|
||||
description: "How many runs at most (at 12% it takes ~18 for a 90% chance)"
|
||||
required: false
|
||||
default: "18"
|
||||
pattern:
|
||||
description: "What to run. hang = the loop below (e2e until it catches a hang); init-map = the map of the launch's steps with their time (Linux and Windows; `runs` and `os` do not apply)"
|
||||
required: false
|
||||
default: "hang"
|
||||
type: choice
|
||||
options:
|
||||
- hang
|
||||
- init-map
|
||||
map_runs:
|
||||
description: "pattern=init-map: how many launches are measured, on a warm cache, for each scenario"
|
||||
required: false
|
||||
default: "10"
|
||||
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
|
||||
@@ -77,7 +61,6 @@ env:
|
||||
jobs:
|
||||
hunt:
|
||||
name: hunt (${{ inputs.os }})
|
||||
if: inputs.pattern != 'init-map'
|
||||
runs-on: ${{ inputs.os }}
|
||||
# 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
|
||||
@@ -169,72 +152,3 @@ jobs:
|
||||
evidence/e2e-watchdog.log
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
# pattern=init-map: the map of a launch (scripts/init_map.py). The published engine, the core and the wrapper of this ref. Warm cache: one launch that is not
|
||||
# counted, then `map_runs` launches in a fresh interpreter each, for three scenarios (no proxy; behind a SOCKS5 gateway of the runner, which keeps the UDP
|
||||
# measurement beside the TCP discovery; `headless=True`); then one launch on a cold cache (a new cache directory, the engine kept) and one under cProfile. The
|
||||
# engine's download is timed apart (the `fetch` step). Nothing here is a gate.
|
||||
init-map:
|
||||
name: init-map (${{ matrix.os }})
|
||||
if: inputs.pattern == 'init-map'
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
include:
|
||||
- { os: linux, runner: ubuntu-24.04 }
|
||||
- { os: windows, runner: windows-2022 }
|
||||
env:
|
||||
# The profile of every Firefox is made in TEMP: on the Windows runners the default is on C:, whose disk the browsers saturate (the reason of the e2e jobs).
|
||||
TEMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
TMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
|
||||
PYTHONUTF8: "1"
|
||||
PYTHONUNBUFFERED: "1"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with: { fetch-depth: 1 }
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with: { python-version: '3.11' }
|
||||
- name: Install the wrapper (and the stock client, for the system libraries of Firefox)
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install .
|
||||
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
|
||||
- name: System deps (xvfb + Firefox runtime libs)
|
||||
if: matrix.os == 'linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y xvfb
|
||||
sudo "$(which python)" -m playwright install-deps firefox
|
||||
- name: Fetch the published firefox binary (timed apart, a cold download is not a step of the map)
|
||||
run: |
|
||||
t0=$(python -c "import time; print(time.time())")
|
||||
python -m invisible_playwright fetch | tee fetch.log
|
||||
t1=$(python -c "import time; print(time.time())")
|
||||
echo "INIT_MAP_FETCH_SECONDS=$(python -c "print(round($t1 - $t0, 2))")" >> "$GITHUB_ENV"
|
||||
- name: The map of the launch
|
||||
env:
|
||||
INIT_MAP_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
run: |
|
||||
mkdir -p init-map-out
|
||||
if [ "$RUNNER_OS" = "Linux" ]; then PRE="xvfb-run -a"; else PRE=""; fi
|
||||
$PRE python -u scripts/init_map.py --runs "${{ inputs.map_runs }}" --out init-map-out 2>&1 | tee init-map-out/init-map.log
|
||||
test -f "init-map-out/init-map-$(python -c "import os; print('windows' if os.name == 'nt' else 'linux')").md"
|
||||
- name: The table in the summary
|
||||
if: always()
|
||||
run: cat init-map-out/init-map-*.md >> "$GITHUB_STEP_SUMMARY" || true
|
||||
- name: Upload the map
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: init-map-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
path: |
|
||||
init-map-out
|
||||
fetch.log
|
||||
if-no-files-found: warn
|
||||
retention-days: 30
|
||||
+38
-32
@@ -113,12 +113,18 @@ jobs:
|
||||
sudo apt-get install -y xvfb
|
||||
# the fontconfig e2e trace the opens of the browser: strace is not in the runner image (setsid is, util-linux)
|
||||
sudo apt-get install -y strace
|
||||
# tests/test_security_state_engine_e2e.py, on a crash of the engine: a core file where kernel.core_pattern says, and gdb to read it (the test deletes the core and
|
||||
# uploads the backtrace with the evidence). Only a process that lifts its own core limit leaves a core, the runner's default limit is 0.
|
||||
sudo apt-get install -y gdb
|
||||
mkdir -p "$RUNNER_TEMP/invpw-cores"
|
||||
sudo sysctl -w kernel.core_pattern="$RUNNER_TEMP/invpw-cores/core.%e.%p"
|
||||
echo "INVPW_CORE_DIR=$RUNNER_TEMP/invpw-cores" >> "$GITHUB_ENV"
|
||||
sudo "$(which python)" -m playwright install-deps firefox
|
||||
# The preloaded-intermediates list is a file of the repository (ci/intermediates.json, empty, the sha256 in ci/intermediates.pin.json): with
|
||||
# STEALTHFOX_INTERMEDIATES set the core neither downloads nor checks Mozilla's. BEFORE `fetch`, which makes the list present (it would download it).
|
||||
- name: The intermediates list (a fixed file of the repository)
|
||||
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
|
||||
# STEALTHFOX_SECURITY_STATE set the core neither downloads nor generates one. BEFORE `fetch`, which makes the state present (it would download and generate it).
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
shell: bash
|
||||
run: python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json
|
||||
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 protocol mirror agrees with the engine it is pinned to
|
||||
@@ -318,6 +324,11 @@ jobs:
|
||||
if: needs.core-on-index.outputs.available == 'true'
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 20
|
||||
# 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'
|
||||
# `run:` blocks are PowerShell on Windows unless said otherwise (e2e-hunt.yml had a ParserError on its first launch there).
|
||||
defaults:
|
||||
run:
|
||||
@@ -331,11 +342,11 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install ".[dev]"
|
||||
# The intermediates list of the repository (ci/intermediates.json, empty): with STEALTHFOX_INTERMEDIATES set the core asks Mozilla for nothing.
|
||||
# BEFORE `fetch`, which makes the list present (it would download it).
|
||||
- name: The intermediates list (a fixed file of the repository)
|
||||
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
|
||||
# STEALTHFOX_SECURITY_STATE set the core neither downloads nor generates one. BEFORE `fetch`, which makes the state present (it would download and generate it).
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
shell: bash
|
||||
run: python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json
|
||||
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 keyboard shortcut selects all (the browser opens on the runner's desktop, as in e2e-hunt.yml)
|
||||
@@ -345,15 +356,22 @@ jobs:
|
||||
|
||||
# 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
|
||||
# of 12/11 (run 43307193708) took ~50 minutes in one job, so the files are split in four parts (the sorted list, every fourth
|
||||
# file: a split that does not move when a file is added elsewhere). Left out, by name, are the suites ci/required-suites.json
|
||||
# declares `linux_only` (the reason is on the row); tests/test_every_suite_runs_on_linux_and_windows.py holds both together.
|
||||
# of 12/11 (run 43307193708) took ~50 minutes in one job, so the files are split in four parts: the rows `wrapper.e2e.suite.windows.1`
|
||||
# to `.4` of ci/required-suites.json, balanced on the test times measured on Windows (a split that does not move when a file is added
|
||||
# elsewhere: a new file is added by hand to a row). Left out of the rows, by name, are the suites ci/required-suites.json declares
|
||||
# `linux_only` (the reason is on the row) and the tests that skip on Windows; tests/test_the_e2e_suite_is_accounted_for.py holds the
|
||||
# partition whole and tests/test_every_suite_runs_on_linux_and_windows.py holds both systems together.
|
||||
e2e-windows:
|
||||
name: e2e (windows, part ${{ matrix.part }})
|
||||
needs: core-on-index
|
||||
if: needs.core-on-index.outputs.available == 'true' && inputs.only != 'windows-control-a'
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 40
|
||||
# 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:
|
||||
@@ -371,33 +389,21 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install ".[dev]"
|
||||
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
|
||||
# The preloaded-intermediates list is a file of the repository (ci/intermediates.json, empty, the sha256 in ci/intermediates.pin.json): with
|
||||
# STEALTHFOX_INTERMEDIATES set the core neither downloads nor checks Mozilla's. BEFORE `fetch`, which makes the list present (it would download it).
|
||||
- name: The intermediates list (a fixed file of the repository)
|
||||
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
|
||||
# STEALTHFOX_SECURITY_STATE set the core neither downloads nor generates one. BEFORE `fetch`, which makes the state present (it would download and generate it).
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
shell: bash
|
||||
run: python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json
|
||||
run: python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json
|
||||
- name: Fetch the published firefox binary
|
||||
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
|
||||
# The GeoIP database made by the repository, as on the Linux run (no download, the same bytes every run).
|
||||
- name: The GeoIP database (made by the repository, same bytes every run)
|
||||
run: python scripts/ci_lab_geoip.py build
|
||||
- name: The files of this part, without the linux_only suites
|
||||
run: |
|
||||
set -e
|
||||
python -m pytest --collect-only -q -m e2e -o addopts= -p no:cacheprovider 2>/dev/null | grep "::" | cut -d: -f1 | sort -u > "$RUNNER_TEMP/e2e_files.txt"
|
||||
python - "${{ matrix.part }}" "$RUNNER_TEMP" <<'PY'
|
||||
import json, os, sys
|
||||
part, tmp = int(sys.argv[1]), sys.argv[2]
|
||||
rows = json.load(open("ci/required-suites.json", encoding="utf-8"))
|
||||
left_out = [t for r in rows if r.get("linux_only") for t in r["tests"]]
|
||||
files = [l.strip() for l in open(os.path.join(tmp, "e2e_files.txt")) if l.strip()]
|
||||
files = [f for f in files if f not in left_out]
|
||||
mine = [f for i, f in enumerate(files) if i % 4 == part - 1]
|
||||
nodes = [t for t in left_out if "::" in t and t.split("::")[0] in mine]
|
||||
open(os.path.join(tmp, "e2e_args.txt"), "w").write("\n".join(mine + ["--deselect=" + n for n in nodes]) + "\n")
|
||||
print("%d e2e files, %d left out as linux_only, %d in part %d, %d node(s) deselected"
|
||||
% (len(files) + len([t for t in left_out if "::" not in t]), len(left_out), len(mine), part, len(nodes)))
|
||||
PY
|
||||
# The files of the part are the rows `wrapper.e2e.suite.windows.N` of ci/required-suites.json (files, and node ids where a file has tests that skip on
|
||||
# Windows or run in another suite): the same list the gate of the candidate runs on the engine under test, so what is measured here and there is one
|
||||
# partition. tests/test_the_e2e_suite_is_accounted_for.py holds it whole, and the suites declared `linux_only` are left out of it by name.
|
||||
- name: The files of this part (the row of the suite, in ci/required-suites.json)
|
||||
run: python scripts/ci_verdict.py args --required ci/required-suites.json --suite "wrapper.e2e.suite.windows.${{ matrix.part }}" --os windows > "$RUNNER_TEMP/e2e_args.txt"
|
||||
- name: Run this part of the e2e
|
||||
env:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
|
||||
@@ -88,10 +88,10 @@ jobs:
|
||||
sudo "$(which python)" -m playwright install-deps firefox
|
||||
- name: Playwright's own Firefox (the control)
|
||||
run: python -m playwright install firefox
|
||||
# The preloaded-intermediates list is a file of the repository (ci/intermediates.json, empty, the sha256 in ci/intermediates.pin.json): with
|
||||
# STEALTHFOX_INTERMEDIATES set the core neither downloads nor checks Mozilla's. BEFORE `fetch`, which makes the list present (it would download it).
|
||||
- name: The intermediates list (a fixed file of the repository)
|
||||
run: python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json
|
||||
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
|
||||
# STEALTHFOX_SECURITY_STATE set the core neither downloads nor generates one. BEFORE `fetch`, which makes the state present (it would download and generate it).
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
run: python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json
|
||||
- name: Fetch the published firefox binary
|
||||
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
|
||||
# The GeoIP database made by the repository (no download, the same bytes every run).
|
||||
|
||||
@@ -234,11 +234,11 @@ jobs:
|
||||
run: |
|
||||
python -m ruff check --select F821,F811,F601 --no-cache --output-format concise .
|
||||
|
||||
# The preloaded-intermediates list is a file of the repository (ci/intermediates.json, empty, the sha256 in ci/intermediates.pin.json): with
|
||||
# STEALTHFOX_INTERMEDIATES set the core neither downloads nor checks Mozilla's.
|
||||
- name: The intermediates list (a fixed file of the repository)
|
||||
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
|
||||
# STEALTHFOX_SECURITY_STATE set the core neither downloads nor generates one.
|
||||
- name: The security state (a fixed directory of the repository)
|
||||
shell: bash
|
||||
run: python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json
|
||||
run: python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json
|
||||
|
||||
# The GeoIP database is made by the repository (scripts/ci_lab_geoip.py: the same bytes on every run, the sha256 in ci/geoip.json), never a
|
||||
# site and never a licensed file: without STEALTHFOX_GEOIP_MMDB the core asks GitHub which database is the latest on every call
|
||||
|
||||
@@ -4,6 +4,20 @@ 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.58.0] - 2026-11-21
|
||||
|
||||
### Changed
|
||||
- Pins invisible-core 68.80.0 on the engine firefox-68 (Firefox 159.0).
|
||||
- Every profile starts with the security state a retail Firefox has: the intermediate certificates, OneCRL and the CRLite revocation filters.
|
||||
`invisible-playwright fetch` downloads them from Mozilla's service and has the engine build them once; every launch copies the result into its
|
||||
profile. Filters ten days old or more are left out, as a retail Firefox does, with one warning that says to run `fetch`.
|
||||
|
||||
### Fixed
|
||||
- `networkidle` waits for the end of the document request that is still arriving when the page is cut, instead of ending early.
|
||||
- A navigation the page's process reports as aborted while the parent is still carrying its request now waits for that request, so a
|
||||
`goto` no longer fails with a false abort.
|
||||
- Behind a SOCKS5 proxy, WebRTC sockets on ports Windows reserves no longer take the proxy's UDP association from the sockets that work.
|
||||
|
||||
## [0.57.1] - 2026-11-20
|
||||
|
||||
### Fixed
|
||||
|
||||
+642
@@ -43632,6 +43632,648 @@
|
||||
}
|
||||
},
|
||||
"wheel_filename": "invisible_playwright-0.57.1-py3-none-any.whl"
|
||||
},
|
||||
{
|
||||
"published_at": "2026-11-21T10:59:58Z",
|
||||
"requires_dist": [
|
||||
"greenlet<4.0.0,>=3.1.1",
|
||||
"invisible-core==68.80.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": "eb72d5e2510357290e107ab81a0142749bcfba54191c430f0046093fe91a214d",
|
||||
"files": {
|
||||
"LICENSE": "2abb03e63a96918967f383cbc36e3faefe10a47ae20b2cab43212ef965e02f96",
|
||||
"PKG-INFO": "3d4dda3a68fd4d64e094c253c9d565f96426fc8e90de71dd03a6474b3fc1eef3",
|
||||
"README.md": "2114ecc63ee45954a88b4d91d3e11f01e416f40810a3d71963f3d5d986d4cf67",
|
||||
"docs/README.md": "ae694f21758d2b80d1dc8eb4d13867d7241ca80fb4137c0ead03e7af799b7192",
|
||||
"docs/integrations/README.md": "d9d4a01c5ce0b3a94123653bf8e78283113cae0a6ec22ba0bc2a2a77baf8ea19",
|
||||
"pyproject.toml": "a9c3966266d21bad46ee245ec05de1628b2b39ddab422808286b847f8f72b609",
|
||||
"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/_bindings.py": "3ccfc601acdee9fe67c6de693892ff90d53b60729df1be29f091493a4a3e0c9c",
|
||||
"src/invisible_playwright/_juggler/_marshal.py": "11da69c3de627bd809a1d5b5371874f4aab3356d95ed602a4dfe4d53230245df",
|
||||
"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": "6c453ccb00624a40d222ae8887c93aed688a108199d17e18e0791109c2686535",
|
||||
"src/invisible_playwright/_juggler/pointer.py": "2516adc85c3872e120a58812f499023bb15c26b556b89c0edd12033d3d87ed40",
|
||||
"src/invisible_playwright/_juggler/remote.py": "5346ff9f247e8b9611524515974aeec84210e5f164f99237a78845771292a21f",
|
||||
"src/invisible_playwright/_juggler/server.py": "e03c54cd87fe4563cc2ea3abcc88cf6cdcf2aa278647d97c836b6aa82383bbf5",
|
||||
"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/_close_loop_verdicts.py": "9adad099186f5ba4d352db792b5265442c8926ea9ae24cc8659164348dd8907e",
|
||||
"tests/_cpu_by_type.py": "74a9acc80a560141b90966804b4f664ed6044caa7faff5f34a107bedd64dd2cf",
|
||||
"tests/_doh_servers.py": "0521a66bb3402b27655156003a50e09f306d09c60644575516afd00b72c7d771",
|
||||
"tests/_doh_support.py": "172caeae4992a91b57fa9866430cdb6bb4df53609c6c6646304b22dfa14b3941",
|
||||
"tests/_e2e_clocks.py": "af6ccede1a1c5719670e3d1cf75216e4d9782dc49b7249473354894c24504128",
|
||||
"tests/_e2e_verdicts.py": "733e6489cb9f463dc544e47bb9e50faabbc16441e7595912f86d28d28bc770c7",
|
||||
"tests/_egress_sink.py": "57669610c5601b9fc351e86072db8092a403f6dac18e6b7b72e2c6a840a6b1df",
|
||||
"tests/_fission_frames.py": "35520541f121ce63d20d523d4eb6988c3501702962c6678fa065b30a56cccccc",
|
||||
"tests/_h3_server.py": "b3e45ee4d890a233ea43d4ddd857d705f90c14792105c24278a384d4d9e62bc8",
|
||||
"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/_page_bytes.py": "979e20aa6f97d28f084499ecc3ba3f412b3f4d92cfda4db9b187c285be5f0032",
|
||||
"tests/_page_work.py": "88fc590ca508a4c5ee37e1a40892083dbfb82e2ae0cff0635cc67a579d0a73d0",
|
||||
"tests/_pointer_fakes.py": "b27e66aeb9e173fd43a764e4a95866080ef80615a904ea6ce100bda8a552dcaf",
|
||||
"tests/_ports.py": "318c91399b6397395df993f55c5109e06d2b25b351d93d73d19369825d445202",
|
||||
"tests/_post_publication.py": "a7009a34d0b0a22f9eab18904d638becb3b776117843e70e59081d417905be40",
|
||||
"tests/_processes.py": "4193b1cea8f43dfa85e998e70246188c482a6e3f8b5fa0e9517c272ce9fa7846",
|
||||
"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": "bc6dee22c478f454db557a14e2a9325acafb7ba95a9968b7ca5bb907832fcea7",
|
||||
"tests/_strace_stand_in.py": "2a8f79444466cde95eeaf438b5d6fe0cef6f5d998bb5118d901d475706896c4a",
|
||||
"tests/_trap_policy.py": "b71592501c795a14396a4dd2dcd4396ef54377d87a011af9475dbb3bb7d6cfcf",
|
||||
"tests/_turn_chain.py": "fe923aabfb07d6d2bf1680bf3c92f25a4a48983a0601100d50cdb4fce2787af1",
|
||||
"tests/_udp_line.py": "ec8165605f4f58a07a740611085f7ec05a2b3dd37d1019d65d6addf628812dd7",
|
||||
"tests/_waits.py": "68af63ff7bb0a1fe3b3ff58b4d390fa0b848b6e8ed1c9bee88192d571b4f05a8",
|
||||
"tests/_witness.py": "3e6175efd084b7dd9b408ccba18e973a79cf9c43daaf07bef52f760664f55597",
|
||||
"tests/conftest.py": "f1c22c9db6557f5d239e9b372d906d2b1d4d629d3ec143aca5e3e5c9ab5962d7",
|
||||
"tests/data/engine_gates.json": "420b53e60c74efd764311aac9ddf3814328f1ceb800d6186d056217866f9ebdf",
|
||||
"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": "2b9df7acdd8874bbdc658b514de7d9bcc5fe9963396551b287b5244e5aaa268f",
|
||||
"tests/fakeweb/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"tests/fakeweb/journey_site.py": "c17e7d9b4571d0776b7f9b658e60ca04364e2107c59c4e6cae7f50b0bac695ad",
|
||||
"tests/fakeweb/loader.py": "f04f12e55132c3eed2d3dedf28b5dc583630307e44fc2af91ce00908b1192681",
|
||||
"tests/fakeweb/pages.json": "b55d4fdb0cc1838ef450312bff6b49c141f190b8329594a5e80c1053261e4f42",
|
||||
"tests/fakeweb/profile_p2.py": "290d3e4d1b930f9b22528ff52cd0bb19969690e7238053942aa86cb1a5f782f8",
|
||||
"tests/fakeweb/profile_p4.py": "873db3efe788397bdb96eda190eb81d2a31bb98f92f3a80636b3780b2f744f36",
|
||||
"tests/fakeweb/sites.py": "6a2ef6d454a08578389ac6eaefbf101f2ac740dfbc3460ac57c6c7ede3a98990",
|
||||
"tests/fakeweb/stock.lock": "56a47089999a7a48278e6c894e2eb2df30bf0e2bc7b6c5ff554baced3829d26f",
|
||||
"tests/gates/e2e_clock_exceptions.json": "c3fb29c354a81cd42bacabb030b2fccf0e3eee61982a43e7f938d4a88bf8b0a4",
|
||||
"tests/gates/upstream_baseline.json": "d87ea58e2ea92b24b8d5d6f3451f1fc0055825c53e315555d522aed7fa6d273a",
|
||||
"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_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_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": "b7192bfdd19b74bbdb357b2c41a665cf19b844ede1be72deba9385cf2b38bdb7",
|
||||
"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_launch_stops_the_display.py": "0b1abca525396088c48aaf7c5a93eead14bf304bf786dbf9f5aa2898c9333629",
|
||||
"tests/test_a_field_is_typed_after_a_pause.py": "8fcbe8fbfe30f022f07129aaaabc64d27c6b6c4deac628dab3d84a49c4ab1a39",
|
||||
"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_keepalive_request_reaches_the_client_e2e.py": "ec2e25ac059f797ce3510fb7d21145e5ea5134dc9fa1f0b88d8ebac9cb32bb0e",
|
||||
"tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py": "ef8e2f386d6dd55a191118811708944c7a61364d5c97ba0f31083c4338aaf4c5",
|
||||
"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_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": "ac99363d43bfeac58d75a7844e8de842818a489dc6674a5bc1c9a8971909cd8e",
|
||||
"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": "d42bff20da1be4b732fa1f31fe92eb7f3e7a73b8a121d03af095443254173606",
|
||||
"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_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_served_browser_answers_a_plain_client_e2e.py": "b5147129eba86f91d10c6631615ba5f6153e66b405bb499081aa7c24e33c6799",
|
||||
"tests/test_a_session_ends_before_the_next_test_starts.py": "99cab200dbb0c95d99d7456dd0e303ef5474841f0e7c237c6823e7cd931b8c01",
|
||||
"tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py": "5e7c7028beaefeb73a9419656d8b9074d438383e05baa7fadc77b00615ff78f9",
|
||||
"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": "830705c090e7ccde73e1211635cf2ef1a789928021cea8eb32e85bce3e1b5a94",
|
||||
"tests/test_accept_language_on_the_wire_e2e.py": "7881900b5508d20c97ac0828e0e489bf7970b80193a19126ddbfb9c1ec0cde83",
|
||||
"tests/test_actions_without_a_point.py": "6c48b30fcc2c1c48e74f6fdde90a61217fe26590a9a1e8b46981be4a27f6a048",
|
||||
"tests/test_add_script_tag.py": "b513b68ef486b2837ad7e9dc411a24fe323160f8c75234ac53bb8295c77212c8",
|
||||
"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": "11ecc5b425233e97287813e4bf4435321b7b4d9e9aa67685a9642ee759adec91",
|
||||
"tests/test_browser_output_is_drained.py": "08a135852f9f1aa51944c57600e5e4ab0c50cdc0a5f9d549d5a5d0e26ed77284",
|
||||
"tests/test_build.py": "30fff1ce6fd17c1d81874fc6db7253a745a403d30e536cf6ed7186533584e13a",
|
||||
"tests/test_bypass_csp_e2e.py": "8cfae28f4acdd2d6e7bed95a8117bbac00064cb9d3cee2c39ebf9b7d16099078",
|
||||
"tests/test_caller_world_handles_e2e.py": "464332c1893f610e04f68cced2a3b03f2ca6b8790ff7346eb112200093371210",
|
||||
"tests/test_canvas_reads_as_drawn.py": "95444935965f00f7db3668e1b61ceb2be74a864b16b6288283c877e7fc68c0bf",
|
||||
"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": "328cf30c2dcd45fa7ef8349981952d530c9d448883a370a4f4e8611b54e24adf",
|
||||
"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_real_geoip_check.py": "4e7abc43dab8c50ead9802137c7b34f80f8f2191cc8310aee73ac20f995e84fc",
|
||||
"tests/test_ci_real_geoip_exit_code.py": "e5acaa5829ccea2a930a0c7310c9aa3ddc725c16bf883095bcad8125b5014fa9",
|
||||
"tests/test_ci_runs_once_per_commit.py": "6c92c16d6914db249e88937a06bd81fc0a3bd124f1adbeda0852e70b21437ea1",
|
||||
"tests/test_ci_verdict.py": "b56f0f076efcf4cb021aea361cb8c91bbde6044625f3ccea9e747c6c7bf744cd",
|
||||
"tests/test_ci_workflows_build_the_geoip_database.py": "c232cb4e994e5c45b9563b13be811254fda5d63c427292216eaf6f4a45351ba5",
|
||||
"tests/test_ci_workflows_set_the_intermediates_list.py": "48c18de15649eb4a6335cb56d7ee85f8a89ca3ba45b4d78b49d1068b492b84a0",
|
||||
"tests/test_ci_workflows_set_the_security_state.py": "6a3e76f2826055352336787f72b581434cc8915702103447803f3e65b9991822",
|
||||
"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": "bc8c5955645fd3df66f9c701a45f7e31dc1e3d52e2202ee005787fe0590a5769",
|
||||
"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_cursor_dispatch.py": "7ea3d9aca83e672f059fbf85da3dead955176afc639a13e8ebf29b5b66ee04a8",
|
||||
"tests/test_cursor_wiring.py": "86a48cae0a462e62f34179059cea8e60e4683fbbb3b6bfca5bb447f9893f0915",
|
||||
"tests/test_declared_host_network_e2e.py": "e767b4d0d74a7ccac4f6d5ed4738d00eb7fd920cbee088a92ded3c0364c99aea",
|
||||
"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": "5f2e92d07ed1f0848c84ee2a3e11e5176659d800136773c974853e5cde8a716f",
|
||||
"tests/test_download_is_intercepted_e2e.py": "dc77bf0ce3374c0896b03a877e6c4b4b4aae5dbefbb92ea5a7d013b8f5d9057b",
|
||||
"tests/test_drag_motion.py": "8c7e2c00f35c3f6018d5c621f52677af53331fbae89bf18be1f0b84c0e38ece8",
|
||||
"tests/test_e2e.py": "60fe4aad2e8fb6b146f09c590eb18037bcd8dfd009e2c29cacb217c882b001d6",
|
||||
"tests/test_e2e_hermetic.py": "6ff72fb72345fc1f766edc63f741818c708a805b1041d18cc1bf7bddfce3dc91",
|
||||
"tests/test_element_handle_actions.py": "a32fcaed7ebbed8a0e67477460c847084a05cca8bfd7e93072f8c5be371068b3",
|
||||
"tests/test_element_screenshot_e2e.py": "42d9b82c856bd86140c64a959ab552d4391866916a2c59b0303c681a6e18a9f2",
|
||||
"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_refusal_is_declared.py": "07d0669781c9576a76c1090731f6906708e72bdf65371384c5ade362d574694a",
|
||||
"tests/test_every_route_command_is_answered_may_fail.py": "15359fc307e1dfdfb73e74bd1965b72a7d7de53dc9b07b7f5e10d0bc6ea820e2",
|
||||
"tests/test_every_suite_runs_on_linux_and_windows.py": "bded76458724f831dfd4514ca7a35350650eab18f27bc42733c7e94f3c000515",
|
||||
"tests/test_expose_binding_e2e.py": "87fc46eda36fa78e885add276c285e65db23c72d46add9fdafe79fc364473e12",
|
||||
"tests/test_expose_binding_refusal.py": "830fa5b68be646ca2e51d187b2dd9ef1401ef6231aa648bec501e6992f19f24e",
|
||||
"tests/test_fakeweb_p2_e2e.py": "0cce9485eda46eb6748f8d1df7bcfb1affa5ddb0c1a00d49f26dba662a27a265",
|
||||
"tests/test_fakeweb_p4_e2e.py": "a85bb59424de263a2a299a35f0a9cb4123ffa3bc01f83fcf277255ed8b138d08",
|
||||
"tests/test_fakeweb_p4_report.py": "87f7b4198e9aff1631fb67be33e146469c4ae18424e53de500509cb2a6799504",
|
||||
"tests/test_file_chooser.py": "bdc2112386776e3c348eab585e0c6fb1c3ad75627e9e51588295d6ffa0ab8f62",
|
||||
"tests/test_fingerprint_consistency.py": "b6da7f73a6fdd5ebf4297ee7f976ff0ca028493e40decd1be47b863b8dff5093",
|
||||
"tests/test_fingerprint_surface.py": "20d2d936f925610a448a74d8b47cf6ecded48532e99ae9ad6d490bc016fab816",
|
||||
"tests/test_first_launch_from_a_new_path.py": "e3d61cc2a8fc893a34058cf05204f9bfd8cbc93fa7544733b5aa5cafd044a45d",
|
||||
"tests/test_fission_frames_dialogs_downloads_popups_e2e.py": "f206299cf493f63b4ebbb8b4c11fad5b657ef4ee0699675dcfd9e832547e5eb5",
|
||||
"tests/test_fission_frames_history_and_processes_e2e.py": "78b4ea8d969c38547f2f72a036b081c2c3f7c1e08acb8baaa75eb60314713d37",
|
||||
"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": "daf643d0e02bbf798bc25043343f7a9d5b5e55d6191fafea2d88733f1369285f",
|
||||
"tests/test_fission_identity_parity_e2e.py": "9b5eb515f8758fb29aa6d6017d3f0a19b1ce3ad75d5134f0c391938d03653d7d",
|
||||
"tests/test_fission_iframe_crash_e2e.py": "2518669c50908cce4ed370d88f400621cf9c1d031f6887c1ab06d88d77422ec5",
|
||||
"tests/test_fission_strategy1_bench.py": "ad7a1c6fd5c1dc40a403b04806a6c210c1db30ed4d32d46c9776baa848b2ab82",
|
||||
"tests/test_fixtures_name_why_the_package_is_missing.py": "8de82b31e4baef3dc2485a082e7e9136501a1796aa2a73b73ae40d9722cd581b",
|
||||
"tests/test_fork.py": "fbd37d915c3aa8ea8490578b4da4b4207970efc928c5209a00c885cb6423e06d",
|
||||
"tests/test_frame_dispatch.py": "04ca6dcba6e13064d201531ed14c23b1212fee14e3c1aa6027badd30699aa598",
|
||||
"tests/test_frames_outlive_the_back_forward_cache_e2e.py": "75409e7e4b7d4259db5ece525042f6507884e05e1d2306ed7e33e39d8c904e7b",
|
||||
"tests/test_geoip_used.py": "0ad66c33f98711bd00d909c3f421f4b02bfef0aae141f01751238cc88448b3e7",
|
||||
"tests/test_goto_and_every_way_it_is_stopped_e2e.py": "47cfc60d65c0b01e858e9ccdfbb398e4f9a09448a760c82c45b38bd8f8ff9cf0",
|
||||
"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_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": "9f45e92a68f9ea913ade15cfb468b9cc13ca3f42e3a4a79de3de484649205ba9",
|
||||
"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_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": "2006cbac5f4a485033bb857c755f535eda3bf01a8dd1c551069e3d96335e9bb3",
|
||||
"tests/test_launcher_helpers.py": "4a6b7bbed4f0b82ce96c71fd04c15c519cb488d24475f212bb454aab5826c560",
|
||||
"tests/test_long_session_e2e.py": "96cd8fd6bb5ec76d56574d9bfb1bea0a3803dde55f7ed261f91ff6922f5e064a",
|
||||
"tests/test_motion_never_hides_a_programming_error.py": "d70b395a2b156106064941dfbfa5c2247f2ed1f6f0701a9dac7d7101fa41dd8f",
|
||||
"tests/test_mouse.py": "9183150efbf1c9766d415bf8032dd7570b8d30a28abc5cd08d7c9f0f64397b57",
|
||||
"tests/test_mouse_events_keep_their_values_e2e.py": "bbeb14ebc08e7b471f7ef8db32b91c945f0b444870f30e197c1ac5695fa55547",
|
||||
"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": "c40bf1bbedfb7b4d0262af4eb594ad53f02cdd502de592ae0341a6acb86414a7",
|
||||
"tests/test_oop_frame_element.py": "cc81644aa23226b5ff6c7d7e1f78863d33f4b4e07bf86b7c3fcb441c261cab86",
|
||||
"tests/test_oop_frame_geometry.py": "03064113e169395e8edf2218b75fb38f0df9049d75342d4c2a2b0b892a27c589",
|
||||
"tests/test_page_number_follows_the_call.py": "19fccae03e22cd302251cc78395e3f846d0b5477483bd59aea0b8a60ed60fe93",
|
||||
"tests/test_persistent_profile_keeps_state.py": "b4f8a819fe44239cb4f1537e7acbaa1b97c07384dd5c6af5d53044607d8b999a",
|
||||
"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": "583ab849325708736c7235787df4be2a15b8827e83a03106c980a5845ab61f0e",
|
||||
"tests/test_popup_adoption_unit.py": "ee9c2b940346cc0ab71151bdbb0b0ab988983df961847d3c548996c7e03ce4ab",
|
||||
"tests/test_popup_destinations_e2e.py": "1d857eb23f9c81edda31bfdac4627cf082adb63e7ffbff978ebda7f75c57b2de",
|
||||
"tests/test_popup_pages.py": "a9752710243580869a5fb676417eb09724f4c5dc9043ab9348f7ea2b0875dac1",
|
||||
"tests/test_popups_reach_the_client_e2e.py": "82556ca17c9b8db3a0432b0030ebde116d21c56c8a7bb78b376247b2a94d4013",
|
||||
"tests/test_prefs_composition_arm.py": "a91195bbb2a8b7fd2be986593572e54fb69b26ddcf3728d8a99ba9ae3abea1f2",
|
||||
"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": "ad96a2d6542f909a29813b99028615d9a80f40c08eef26dab3541a83c56f6342",
|
||||
"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_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": "1db5f04a71fea453ba8d53eb7009f5d7ba9fcfc265be47fe19a29dc51bbe423a",
|
||||
"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": "747f25ff0eb37568c986edbe634bbca3f5f6cea7cbed0c9fdfbe97a87b616090",
|
||||
"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_callers_code_is_not_counted_e2e.py": "9b4d7f0033101db7a5242d39a7086b2c418282d8d880daabe312572190bd15b8",
|
||||
"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_device_enumeration_takes_the_declared_time_e2e.py": "ff56e2abfc60256bc09774ca5bdc73972b1136292bf61ec083ecf3144246214e",
|
||||
"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_tests_do_not_wait_on_clocks.py": "d858a2a06d0d18e5ec30493703a320a425778a8b6bbdfebca238e933c5ac917d",
|
||||
"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_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_favicon_stays_out_of_sight_e2e.py": "d89a381cf59c081cbd59097c85377bc8347dbb6de71419fc985202ec9e3db962",
|
||||
"tests/test_the_floor_says_the_installer_of_this_environment.py": "baa238883691235250b426537e95e9da6bd68749073bd980b392bd050d83536a",
|
||||
"tests/test_the_h3_line_helpers.py": "a76ec5669483bd69e975eb809b28c2346c1e80d5a24657e3729bdbc5fa8308e2",
|
||||
"tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py": "ea075622ed1dbc8f3ad58a5a5606ef94ce94711f3440c53280882b8bcc6c6f1e",
|
||||
"tests/test_the_host_address_helper.py": "e104c158686333a80603ba838e6b5210ceb99570b2772d859523e6fd7f6c5905",
|
||||
"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": "1d6c1bc3934b32b6a10c898f4160102cc5699ae601e2aa8565ffc58347250e84",
|
||||
"tests/test_the_keyboard_follows_the_session_language.py": "a745ec07a7020f4df8a6f1d3101b3efaccd9937a7f7abb573b6d349e2af86f95",
|
||||
"tests/test_the_lab_ca_and_its_ocsp_leaf.py": "723e542175fcc9156869d0e43759acab1bce2b91028938d78f65ed31c32b31b8",
|
||||
"tests/test_the_leak_watcher_sees_a_direct_connection.py": "a5dc39c2ebc379a17e80d8667c12623dc04fd138dddc30db64d5cd46fa64801d",
|
||||
"tests/test_the_marionette_helpers.py": "2b7fa3b93f3de07eb086ebc2e2ce7a7d2386d8d48a170a2dcab884319e420152",
|
||||
"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_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_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_real_sites_runner_imports_its_own_package.py": "ecdf34c87f70a0641e76182c50630066ab5ebe63833161ddda423002365d4961",
|
||||
"tests/test_the_real_sites_workflow.py": "8b5236bd570604cc77af917de41894e8ed7e569a5f991f947de193468de2a63b",
|
||||
"tests/test_the_realness_helpers.py": "3211aaf9a1f01e03a4efbf9c64c81f183fdfa51d20a157a4976f30945af78fe8",
|
||||
"tests/test_the_registry_collects_the_oldest_like_playwright.py": "188e319115e0c441a7075c342bc30e22378b7f70e889cce09cf1967cf85c1b09",
|
||||
"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": "10421f0802257983be343e78dd9e1cb2c2d2c45759cf9065240c412e944c0fc4",
|
||||
"tests/test_the_sandbox_e2e_runs_where_user_namespaces_are_on.py": "3fb2e5b18caa40339f346d0662654ce4d611a7c7a6557b26eb85d3e3ade31bbb",
|
||||
"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_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_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_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": "a3fe788cecba7d98d46d40499ee405894792b43a571e454994128c9efb5a84cb",
|
||||
"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": "c09fee036f5b2cd4e62e92ad1f03b24704e13a8b7cca585539e89e72ceb79d71",
|
||||
"tests/test_the_working_clone_has_the_workbench_next_to_it.py": "eb1cc18021c5f37dc2fbaea0329fea4c2ce0e7172df54cae5659782f8db6c07b",
|
||||
"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": "76cfa87142db05d8483ae6fb08348650c67e95818f2a6c5e1209047160fe587d",
|
||||
"tests/test_voices_e2e.py": "642378ed4184173b572b0346c3bad2c5bef2a427e07d309dc96f3a0ce61cd4fb",
|
||||
"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_draws_on_the_engine_s_own_gl_e2e.py": "9b8c284e2f49d0a83ee2d76fe95ab0773a075d9cb8f0fb4ca80ba6da9027adf2",
|
||||
"tests/test_webgl_noise_active.py": "1a820cb9dd67e9fa4c909beab8ce2eeefb0da3eb81b178275dac017afdcb83e6",
|
||||
"tests/test_webrtc_realness.py": "a671838e4cf47809ce03a5a94ee00cfe4bbd4cc215dd347278f1f609253bac35",
|
||||
"tests/unit/test_bfcache_evidence.py": "aac37eae30b4140a84593973486b784b0f48771d4a08ed91bee102ea972f5a7e",
|
||||
"tests/unit/test_config_public.py": "26463631553cda971169d8519621f0d02f1992be9cb86e6d56bdd3b697c49def",
|
||||
"tests/unit/test_engine_at_least.py": "e12b329f0cad61615aa4783e737b034d10e9a1b2e025d90c032589ff2d4c1a98",
|
||||
"tests/unit/test_fontconfig_cache_criterion.py": "117e968a6e52a0765367d9d716ae13d09577000f9438cd17d72d5b45b4b919ae",
|
||||
"tests/unit/test_processes_counts_sites.py": "960541d1e102c8c1ea1b6aacad0a2ddf98083ba4daba720db8b58f8c11ec2a39",
|
||||
"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": "671fa104883b8d51159a58cf3f5a66c44c2cecbadfd48afe56228b8a2cea14e8"
|
||||
}
|
||||
},
|
||||
"sdist_filename": "invisible_playwright-0.58.0.tar.gz",
|
||||
"seal_tag": "",
|
||||
"version": "0.58.0",
|
||||
"wheel": {
|
||||
"digest": "d7bf3c3b707bf2e97548e233dcd15ab7aad52e670ceccfa8a290c28fadaa00e4",
|
||||
"files": {
|
||||
"<dist-info>/METADATA": "3d4dda3a68fd4d64e094c253c9d565f96426fc8e90de71dd03a6474b3fc1eef3",
|
||||
"<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/_bindings.py": "3ccfc601acdee9fe67c6de693892ff90d53b60729df1be29f091493a4a3e0c9c",
|
||||
"invisible_playwright/_juggler/_marshal.py": "11da69c3de627bd809a1d5b5371874f4aab3356d95ed602a4dfe4d53230245df",
|
||||
"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": "6c453ccb00624a40d222ae8887c93aed688a108199d17e18e0791109c2686535",
|
||||
"invisible_playwright/_juggler/pointer.py": "2516adc85c3872e120a58812f499023bb15c26b556b89c0edd12033d3d87ed40",
|
||||
"invisible_playwright/_juggler/remote.py": "5346ff9f247e8b9611524515974aeec84210e5f164f99237a78845771292a21f",
|
||||
"invisible_playwright/_juggler/server.py": "e03c54cd87fe4563cc2ea3abcc88cf6cdcf2aa278647d97c836b6aa82383bbf5",
|
||||
"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.58.0-py3-none-any.whl"
|
||||
}
|
||||
],
|
||||
"schema": 1
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"format":1,"collection":"security-state/intermediates","collection_timestamp":0,"fetched_utc":"1970-01-01T00:00:00Z","count":0,"set_sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","certs":[]}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"comment": "The preloaded-intermediates list every CI leg launches with (STEALTHFOX_INTERMEDIATES): EMPTY (format 1, no certificates), so a leg never asks Mozilla for the real list (the core neither downloads nor checks when the variable is set) and every run has the same bytes. Set by scripts/ci_lab_intermediates.py. To change the list, change ci/intermediates.json and sha256 here in one commit; `set` refuses to go on when they differ. The real list is looked at only by what the release proves about the product.",
|
||||
"file": "ci/intermediates.json",
|
||||
"sha256": "f4f6a2332a4d589a1e8aaa4e73c820644a764125bb2970667afc7351e7cb3465",
|
||||
"bytes": 219
|
||||
}
|
||||
+12
-3
@@ -7,13 +7,22 @@
|
||||
{"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.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 259, "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": "92 = 6+32+21+7+8+3+9+6. The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
|
||||
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 263, "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."},
|
||||
{"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."},
|
||||
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "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), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 4 = 3 + 1. 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)."},
|
||||
{"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": 2183, "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_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.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_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.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_actions_without_a_point.py", "tests/test_add_script_tag.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_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.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_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.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_css_calc_is_windows_e2e.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_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_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.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_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_names_are_declared.py"Line truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2184, "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_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.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_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.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_actions_without_a_point.py", "tests/test_add_script_tag.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_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.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_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.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_css_calc_is_windows_e2e.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_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_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.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_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_nameLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2260, "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_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.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_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.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_actions_without_a_point.py", "tests/test_add_script_tag.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_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_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_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_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.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_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.pLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2261, "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_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.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_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.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_actions_without_a_point.py", "tests/test_add_script_tag.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_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_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_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_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.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_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_compositioLine 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)."},
|
||||
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 376, "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_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_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_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "windows_twin"Line truncated
|
||||
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 411, "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": 239, "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_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_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_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_reader_of_a_webgl_canvas_agrees_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_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)."},
|
||||
{"id": "wrapper.e2e.suite.windows.1", "giro": "G2", "os": ["windows"], "min_tests": 260, "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_left_documents_body_is_evicted_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_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)."},
|
||||
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 218, "exact": true, "tests": ["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_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_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_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)."},
|
||||
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 273, "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)."},
|
||||
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 270, "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_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_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)."},
|
||||
{"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."}
|
||||
]
|
||||
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{"file": "tests/test_css_calc_is_windows_e2e.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 1, "wrapper.unit.all.windows": 1}},
|
||||
{"file": "tests/test_math_sin_cos_tan_are_windows_e2e.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 1, "wrapper.unit.all.windows": 1}},
|
||||
{"file": "tests/test_system_fonts_and_colors_are_windows_e2e.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 1, "wrapper.unit.all.windows": 1}},
|
||||
{"file": "tests/test_webgl_dot_has_the_declared_gpu_s_bits_e2e.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_canvas_icc_refs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 9, "wrapper.unit.all.windows": 9}},
|
||||
{"file": "tests/unit/test_canvas_text_colors_refs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 8, "wrapper.unit.all.windows": 8}},
|
||||
{"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}}
|
||||
]
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"comment": "The ready security state every job of ci.yml launches with (STEALTHFOX_SECURITY_STATE, set at the top of the workflow): a result with NO data (format 1, ok, no CRLite hashes, zero timestamps, no engine) and no security_state/ directory, so a launch copies nothing and no job asks Mozilla for anything or runs the engine's generate mode (the core neither downloads nor generates when the variable is set). To change it, change ci/security-state/securitystate-result.json and sha256 here in one commit; tests/test_ci_sets_the_security_state.py fails when they differ.",
|
||||
"file": "ci/security-state/securitystate-result.json",
|
||||
"sha256": "15bed64b8d0d0db9e6e5cceeec231bbca5300cdc6715280a647895dd6f6f14a4",
|
||||
"bytes": 260
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"format":1,"ok":true,"error":null,"engine":{"version":"","build_id":""},"collections":{"intermediates":{"collection_timestamp":0},"onecrl":{"collection_timestamp":0},"cert-revocations":{"collection_timestamp":0,"channel":"default"}},"crlite_filter_hashes":[]}
|
||||
+2
-2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "invisible_playwright"
|
||||
version = "0.57.1"
|
||||
version = "0.58.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==67.79.0",
|
||||
"invisible_core==68.80.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
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
"""Builds tests/data/canvas_icc_ref/refs.json, the reference of the canvas ICC readback test.
|
||||
|
||||
One measurement of retail Firefox 159.0 on Windows with the default prefs (the run
|
||||
``a_win_default``: qcms converts a tagged image to the monitor profile, here the stock
|
||||
"sRGB Color Space Profile.icm"), and one control run on the same machine with
|
||||
gfx.color_management.force_srgb=true (``b_win_force_srgb``: the bytes without that
|
||||
conversion), both made by index.html and the images of gen_images.py:
|
||||
|
||||
python -I scripts/build_canvas_icc_refs.py <a_win_default.json> <b_win_force_srgb.json> \
|
||||
--repeat <a2_win_default_repeat.json> --host-profile <host_display_profile.json> \
|
||||
--source <name of the capture> [--out tests/data/canvas_icc_ref/refs.json]
|
||||
|
||||
The script stops if the repeat run has other hashes than the reference run, if the runs
|
||||
were not made on the same Firefox build, or if the prefs of the two runs are not the default
|
||||
and force_srgb=true. The probes are the 72 of the page: for each of the 10 images drawImage,
|
||||
drawImage at 32 px, createImageBitmap with the default colour space conversion and with
|
||||
``none``; the 22 fill colours; the canvas colorSpace probe; the 9 environment values.
|
||||
|
||||
Standard library only: it does not import invisible_core, and the repository holds no PNG
|
||||
and no run's pixel hex, only hashes and sizes.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
DEFAULT_OUT = Path(__file__).resolve().parents[1] / "tests" / "data" / "canvas_icc_ref" / "refs.json"
|
||||
IMAGE_PROBES = ("drawImage", "drawImage_scaled32", "bitmap_default", "bitmap_none")
|
||||
#: Value probes that are not colour management: the host's theme, which the retail machine
|
||||
#: had dark; the test does not compare it (the persona's colour scheme is checked elsewhere).
|
||||
NOT_COMPARED = ("env | prefers-color-scheme:dark",)
|
||||
|
||||
|
||||
GEN_IMAGES = DEFAULT_OUT.parent / "gen_images.py"
|
||||
|
||||
|
||||
def image_files():
|
||||
"""{image id: {file, bytes, sha256}} of the ten images gen_images.py writes: the reference
|
||||
names them, so a generator that drifts is seen before the engine is blamed."""
|
||||
spec = importlib.util.spec_from_file_location("gen_images", GEN_IMAGES)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
imgs, _profiles = mod.build_images()
|
||||
return {iid: {"file": "images/%s.%s" % (iid, ext), "bytes": len(data),
|
||||
"sha256": hashlib.sha256(data).hexdigest()}
|
||||
for iid, ext, data, _what in imgs}
|
||||
|
||||
|
||||
class RefError(ValueError):
|
||||
"""The runs cannot be one reference."""
|
||||
|
||||
|
||||
def env_sha256(value):
|
||||
"""The hash of an environment value: SHA-256 of its compact JSON (as JSON.stringify)."""
|
||||
return hashlib.sha256(json.dumps(value, separators=(",", ":")).encode()).hexdigest()
|
||||
|
||||
|
||||
def probes(R):
|
||||
"""{probe name: {kind, sha256, bytes (pixel probes), value (env)}} of a page result R
|
||||
(``window.R`` of index.html). ``bytes`` is the RGBA length: 4 x width x height."""
|
||||
out = {}
|
||||
for iid, v in R["images"].items():
|
||||
for k in IMAGE_PROBES:
|
||||
e = v.get(k)
|
||||
if not isinstance(e, dict) or "sha256" not in e:
|
||||
raise RefError("image %s probe %s has no hash: %r" % (iid, k, e))
|
||||
size = 32 if k == "drawImage_scaled32" else 16
|
||||
out["%s | %s" % (iid, k)] = {"kind": "image", "sha256": e["sha256"],
|
||||
"bytes": 4 * size * size}
|
||||
for f, v in R["fills"].items():
|
||||
if "sha256" not in v:
|
||||
raise RefError("fill %s has no hash: %r" % (f, v))
|
||||
out["fill | " + f] = {"kind": "fill", "sha256": v["sha256"], "bytes": 4 * 16 * 16}
|
||||
p3 = R["canvas_colorspace"].get("p3_fill_p3_canvas") or {}
|
||||
if "sha256" not in p3:
|
||||
raise RefError("the canvas colorSpace probe has no hash")
|
||||
out["canvas colorSpace p3 fill"] = {"kind": "colorspace", "sha256": p3["sha256"],
|
||||
"bytes": 4 * 16 * 16}
|
||||
for k, v in R["env"].items():
|
||||
out["env | " + k] = {"kind": "env", "sha256": env_sha256(v), "value": v}
|
||||
return out
|
||||
|
||||
|
||||
def build(a, b, repeat, host_profile, source):
|
||||
"""The reference from the default run ``a``, the control run ``b`` (force_srgb), the
|
||||
repeat of ``a`` and the host profile description; all as loaded JSON."""
|
||||
for key in ("buildid", "exe_sha256", "version", "os"):
|
||||
if a["firefox"][key] != b["firefox"][key] or a["firefox"][key] != repeat["firefox"][key]:
|
||||
raise RefError("the runs differ in the Firefox %s" % key)
|
||||
pa, pb, pr = probes(a["R"]), probes(b["R"]), probes(repeat["R"])
|
||||
if pa != pr:
|
||||
bad = sorted(k for k in pa if pa[k] != pr.get(k))
|
||||
raise RefError("the repeat run differs from the reference run on %d probes: %s"
|
||||
% (len(bad), ", ".join(bad[:5])))
|
||||
if set(pa) != set(pb):
|
||||
raise RefError("the control run has other probes than the reference run")
|
||||
prefs_a, prefs_b = a["prefs_read_back"], b["prefs_read_back"]
|
||||
if prefs_a.get("gfx.color_management.display_profile") not in ("", None):
|
||||
raise RefError("the reference run has a display_profile pref: it must read the host's")
|
||||
if prefs_a.get("gfx.color_management.force_srgb") is not False:
|
||||
raise RefError("the reference run is not made with the default force_srgb (false)")
|
||||
if prefs_b.get("gfx.color_management.force_srgb") is not True:
|
||||
raise RefError("the control run is not made with force_srgb=true")
|
||||
for k, v in prefs_a.items():
|
||||
if k != "gfx.color_management.force_srgb" and prefs_b.get(k) != v:
|
||||
raise RefError("the control run differs in %s" % k)
|
||||
|
||||
out = {}
|
||||
dependent = []
|
||||
for name, p in pa.items():
|
||||
e = dict(p)
|
||||
if pb[name]["sha256"] != p["sha256"]:
|
||||
e["without_conversion_sha256"] = pb[name]["sha256"]
|
||||
dependent.append(name)
|
||||
if name in NOT_COMPARED:
|
||||
e["compared"] = False
|
||||
out[name] = e
|
||||
return {
|
||||
"test_page": "index.html",
|
||||
"image_generator": "gen_images.py",
|
||||
"source": {
|
||||
"capture": source,
|
||||
"reference_run": "runs/a_win_default.json",
|
||||
"repeat_run": "runs/a2_win_default_repeat.json (same hashes on all probes)",
|
||||
"control_run": "runs/b_win_force_srgb.json (gfx.color_management.force_srgb=true)",
|
||||
"date": "2026-11-09",
|
||||
},
|
||||
"firefox": {**a["firefox"], "prefs": prefs_a},
|
||||
"display_profile": {"file": host_profile["file"], "size": host_profile["size"],
|
||||
"sha256": host_profile["sha256"], "api": "GetICMProfileW"},
|
||||
"images": image_files(),
|
||||
"probe_count": len(out),
|
||||
"profile_dependent_count": len(dependent),
|
||||
"profile_dependent": sorted(dependent),
|
||||
"probes": out,
|
||||
}
|
||||
|
||||
|
||||
def main(argv):
|
||||
ap = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("reference", help="run json of the retail default run (a_win_default)")
|
||||
ap.add_argument("control", help="run json of the force_srgb run (b_win_force_srgb)")
|
||||
ap.add_argument("--repeat", required=True, help="run json of the repeat of the default run")
|
||||
ap.add_argument("--host-profile", required=True, help="host_display_profile.json")
|
||||
ap.add_argument("--source", default="canvas-color/canvas-color-icc-readback",
|
||||
help="name of the capture the runs come from")
|
||||
ap.add_argument("--out", default=str(DEFAULT_OUT))
|
||||
a = ap.parse_args(argv[1:])
|
||||
|
||||
def load(p):
|
||||
return json.loads(Path(p).read_text(encoding="utf-8"))
|
||||
|
||||
try:
|
||||
refs = build(load(a.reference), load(a.control), load(a.repeat),
|
||||
load(a.host_profile), a.source)
|
||||
except RefError as e:
|
||||
print("error: %s" % e, file=sys.stderr)
|
||||
return 1
|
||||
Path(a.out).write_text(json.dumps(refs, ensure_ascii=False, indent=1) + "\n",
|
||||
encoding="utf-8")
|
||||
print("%d probes (%d depend on the display profile) -> %s"
|
||||
% (refs["probe_count"], refs["profile_dependent_count"], a.out))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,184 +0,0 @@
|
||||
"""Builds tests/data/canvas_text_ref_colors/refs.json from the bytes retail Firefox drew.
|
||||
|
||||
The reference of tests/test_canvas_text_colors_and_cleartype_is_windows_e2e.py: coloured
|
||||
canvas text, and 39 cases (25 of black text on white, 14 coloured) under three ClearType
|
||||
keys, all measured on retail Firefox 159.0 on Windows with tests/data/canvas_text_ref_colors/
|
||||
index.html (the 14 coloured cases) and tests/data/canvas_text_ref/index.html (the 25 black
|
||||
ones). The measuring harness saved, for every case, the RGBA bytes of the canvas
|
||||
(<name>.rgba) and a <name>.json with its id, width, height and sha256:
|
||||
|
||||
<BYTES>/colors/retail/<name>.{json,rgba} the 14 coloured cases, retail's own
|
||||
ClearType state (the seed's)
|
||||
<BYTES>/keys/<gamma>_<contrast>/retail/<name>.{json,rgba}
|
||||
the 39 cases under that key; the case
|
||||
id of a coloured one is "color:<id>"
|
||||
|
||||
python -I scripts/build_canvas_text_colors_refs.py --bytes <BYTES> \
|
||||
[--keys 1800_100,1400_50,2200_0] [--out tests/data/canvas_text_ref_colors/refs.json]
|
||||
|
||||
The repository holds no .rgba: they are 270 kB each. The script hashes an .rgba when the
|
||||
directory has it (and stops if that is not the sha256 its .json says, or the size is not
|
||||
width x height x 4); when only the .json is there (a byte file kept only where the engine
|
||||
differed) it takes the hash the harness wrote. It stops too when the black cases under
|
||||
1800/100 are not the ones tests/data/canvas_text_ref/refs.json holds for the same ids, or
|
||||
when the coloured cases under 1800/100 differ from the ones of colors/retail (same machine,
|
||||
same key: they are one measurement). Standard library only.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DATA = ROOT / "tests" / "data" / "canvas_text_ref_colors"
|
||||
BASE_REFS = ROOT / "tests" / "data" / "canvas_text_ref" / "refs.json"
|
||||
DEFAULT_KEYS = "1800_100,1400_50,2200_0"
|
||||
SEED_KEY = "1800_100"
|
||||
DATE = "2026-11-09"
|
||||
#: The prefs of the retail profile for the keys (user.js), gamma and contrast per key.
|
||||
RETAIL_PREFS = {
|
||||
"gfx.canvas.accelerated": False,
|
||||
"gfx.font_rendering.cleartype_params.gamma": "<gamma>",
|
||||
"gfx.font_rendering.cleartype_params.enhanced_contrast": "<contrast>",
|
||||
"gfx.font_rendering.cleartype_params.cleartype_level": 100,
|
||||
"gfx.font_rendering.cleartype_params.pixel_structure": 1,
|
||||
"gfx.font_rendering.cleartype_params.rendering_mode": 0,
|
||||
}
|
||||
#: The coloured cases of colors/retail were measured with the machine's own ClearType prefs,
|
||||
#: and gfx.canvas.accelerated off.
|
||||
COLORS_RETAIL_PREFS = {"gfx.canvas.accelerated": False}
|
||||
|
||||
|
||||
class BuildError(ValueError):
|
||||
"""The saved bytes cannot be this reference."""
|
||||
|
||||
|
||||
def colors_of_page(html):
|
||||
"""[[name, fg, bg], ...] and [sizes] from the measuring page, as the page declares them."""
|
||||
m = re.search(r"const COLORS = (\[\[.*?\]\]);", html, re.S)
|
||||
s = re.search(r"const SIZES = (\[[^\]]*\]);", html)
|
||||
if not m or not s:
|
||||
raise BuildError("index.html declares no COLORS / SIZES")
|
||||
return json.loads(m.group(1)), json.loads(s.group(1))
|
||||
|
||||
|
||||
def read_dir(d):
|
||||
"""{case id: {"width", "height", "sha256"}} of the .json files of one directory."""
|
||||
d = Path(d)
|
||||
if not d.is_dir():
|
||||
raise BuildError("%s is not a directory" % d)
|
||||
out = {}
|
||||
for j in sorted(d.glob("*.json")):
|
||||
m = json.loads(j.read_text(encoding="utf-8"))
|
||||
sha, w, h = m["sha256"], int(m["w"]), int(m["h"])
|
||||
rgba = j.with_suffix(".rgba")
|
||||
if rgba.is_file():
|
||||
data = rgba.read_bytes()
|
||||
if len(data) != w * h * 4:
|
||||
raise BuildError("%s: %d bytes, not %d x %d x 4" % (rgba, len(data), w, h))
|
||||
got = hashlib.sha256(data).hexdigest()
|
||||
if got != sha:
|
||||
raise BuildError("%s: sha256 %s, its json says %s" % (rgba, got, sha))
|
||||
if not re.fullmatch(r"[0-9a-f]{64}", sha):
|
||||
raise BuildError("%s: sha256 %r is not 64 hex digits" % (j, sha))
|
||||
if m["id"] in out:
|
||||
raise BuildError("%s: case %r twice in %s" % (j.name, m["id"], d))
|
||||
out[m["id"]] = {"width": w, "height": h, "sha256": sha}
|
||||
return out
|
||||
|
||||
|
||||
def build(bytes_dir, keys, page_html, base):
|
||||
colors, sizes = colors_of_page(page_html)
|
||||
color_ids = ["%s|%s" % (c[0], s) for c in colors for s in sizes]
|
||||
bytes_dir = Path(bytes_dir)
|
||||
seed = read_dir(bytes_dir / "colors" / "retail")
|
||||
if sorted(seed) != sorted(color_ids):
|
||||
raise BuildError("colors/retail has %s, the page draws %s" % (sorted(seed), sorted(color_ids)))
|
||||
spec = {"%s|%s" % (c[0], s): {"name": c[0], "fg": c[1], "bg": c[2], "size": s}
|
||||
for c in colors for s in sizes}
|
||||
out_colors = {i: {"id": i, **spec[i], **seed[i]} for i in color_ids}
|
||||
|
||||
out_keys = {}
|
||||
for tag in keys:
|
||||
gamma, contrast = (int(x) for x in tag.split("_"))
|
||||
cases = read_dir(bytes_dir / "keys" / tag / "retail")
|
||||
black = {i: v for i, v in cases.items() if not i.startswith("color:")}
|
||||
col = {i[len("color:"):]: v for i, v in cases.items() if i.startswith("color:")}
|
||||
if sorted(col) != sorted(color_ids):
|
||||
raise BuildError("key %s: coloured cases %s, the page draws %s"
|
||||
% (tag, sorted(col), sorted(color_ids)))
|
||||
for i in black:
|
||||
if i not in base["cases"]:
|
||||
raise BuildError("key %s: %r is not a case of canvas_text_ref" % (tag, i))
|
||||
out_keys[tag] = {
|
||||
"gamma": gamma, "contrast": contrast, "count": len(black) + len(col),
|
||||
"black": {i: {"id": i, **black[i]} for i in sorted(black)},
|
||||
"colors": {i: {"id": i, **col[i]} for i in color_ids},
|
||||
}
|
||||
if SEED_KEY in out_keys:
|
||||
k = out_keys[SEED_KEY]
|
||||
for i, v in k["black"].items():
|
||||
if v["sha256"] != base["cases"][i]["sha256"]:
|
||||
raise BuildError("%s under %s: %s, canvas_text_ref/refs.json has %s"
|
||||
% (i, SEED_KEY, v["sha256"], base["cases"][i]["sha256"]))
|
||||
for i, v in k["colors"].items():
|
||||
if v["sha256"] != out_colors[i]["sha256"]:
|
||||
raise BuildError("%s under %s differs from colors/retail: %s vs %s"
|
||||
% (i, SEED_KEY, v["sha256"], out_colors[i]["sha256"]))
|
||||
arial = [f for f in base["fonts"] if f["family"] == "Arial"]
|
||||
if len(arial) != 1:
|
||||
raise BuildError("canvas_text_ref/refs.json has no single Arial entry")
|
||||
return {
|
||||
"test_page": "index.html",
|
||||
"black_page": "../canvas_text_ref/index.html",
|
||||
"text": base["text"],
|
||||
"firefox": base["firefox"],
|
||||
"canvas": base["canvas"],
|
||||
"cleartype": base["cleartype"],
|
||||
"fonts": arial,
|
||||
"capture": {
|
||||
"date": DATE,
|
||||
"origin": "retail Firefox 159.0 (build %s, firefox.exe sha256 %s) on Windows, "
|
||||
"headless, canvases read back with getImageData; bytes saved by the "
|
||||
"measuring harness: colors/retail (the 14 coloured cases) and "
|
||||
"keys/<gamma>_<contrast>/retail (39 cases per key) of the win-asset "
|
||||
"analysis of 2026-11-09"
|
||||
% (base["firefox"]["buildid"], base["firefox"]["exe_sha256"]),
|
||||
"colors_prefs": COLORS_RETAIL_PREFS,
|
||||
"keys_prefs": RETAIL_PREFS,
|
||||
},
|
||||
"colors": {"count": len(out_colors), "cases": out_colors},
|
||||
"keys": out_keys,
|
||||
}
|
||||
|
||||
|
||||
def main(argv):
|
||||
ap = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("--bytes", required=True, metavar="DIR",
|
||||
help="directory with colors/retail and keys/<gamma>_<contrast>/retail")
|
||||
ap.add_argument("--keys", default=DEFAULT_KEYS,
|
||||
help="ClearType keys, gamma_contrast, comma separated (default %(default)s)")
|
||||
ap.add_argument("--out", default=str(DATA / "refs.json"))
|
||||
a = ap.parse_args(argv[1:])
|
||||
keys = [k for k in a.keys.split(",") if k]
|
||||
try:
|
||||
refs = build(a.bytes, keys, (DATA / "index.html").read_text(encoding="utf-8"),
|
||||
json.loads(BASE_REFS.read_text(encoding="utf-8")))
|
||||
except (BuildError, KeyError, ValueError) as e:
|
||||
print("error: %s" % e, file=sys.stderr)
|
||||
return 1
|
||||
Path(a.out).write_text(json.dumps(refs, ensure_ascii=False, indent=1) + "\n",
|
||||
encoding="utf-8", newline="\n")
|
||||
print("%d coloured cases, %d keys x %d cases -> %s"
|
||||
% (refs["colors"]["count"], len(refs["keys"]),
|
||||
next(iter(refs["keys"].values()))["count"], a.out))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,106 +0,0 @@
|
||||
"""Builds tests/data/canvas_text_ref/refs.json, the one reference of the canvas text test.
|
||||
|
||||
Two measurements of retail Firefox 159.0 on Windows, made with the same page code, the same
|
||||
bundled font files and the same machine, are merged by case id:
|
||||
|
||||
python -I scripts/build_canvas_text_refs.py <canvas_ref_bundle/refs.json> \
|
||||
<canvas_ref_ext/refs.json> [--out tests/data/canvas_text_ref/refs.json]
|
||||
|
||||
The bundle file has the base cases (no ``gruppo`` field: they become group ``0_base``), the
|
||||
extension file has the cases of the other groups. A case id that is in both files is kept
|
||||
once, with the extension's group; the script stops if the two hashes of such a case differ,
|
||||
or if the two files were not measured on the same Firefox build, with the same ClearType
|
||||
state and the same font files. Fields that name a file of the measuring machine (the PNG
|
||||
paths) are dropped: the repository holds no PNG and no font.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
BASE_GROUP = "0_base"
|
||||
DEFAULT_OUT = Path(__file__).resolve().parents[1] / "tests" / "data" / "canvas_text_ref" / "refs.json"
|
||||
_DROP = ("png",)
|
||||
|
||||
|
||||
class MergeError(ValueError):
|
||||
"""The two measurements cannot be one reference."""
|
||||
|
||||
|
||||
def _case(case, group):
|
||||
out = {k: v for k, v in case.items() if k not in _DROP}
|
||||
out.setdefault("alpha", True)
|
||||
out.setdefault("stretch", "normal")
|
||||
out.setdefault("text", "TEXT")
|
||||
out["gruppo"] = group
|
||||
return out
|
||||
|
||||
|
||||
def merge(bundle, ext):
|
||||
"""One reference from the bundle measurement and the extension measurement."""
|
||||
for key in ("firefox", "canvas", "cleartype", "text"):
|
||||
if bundle[key] != ext[key]:
|
||||
raise MergeError("the two measurements differ in %r: %r vs %r"
|
||||
% (key, bundle[key], ext[key]))
|
||||
ext_fonts = {f["bundle_file"]: f for f in ext["fonts"]}
|
||||
for f in bundle["fonts"]:
|
||||
other = ext_fonts.get(f["bundle_file"])
|
||||
if other is None or other["sha256"] != f["sha256"]:
|
||||
raise MergeError("font %s is not the same file in the two measurements"
|
||||
% f["bundle_file"])
|
||||
|
||||
cases = {}
|
||||
for cid, c in bundle["cases"].items():
|
||||
cases[cid] = _case(c, c.get("gruppo") or BASE_GROUP)
|
||||
for cid, c in ext["cases"].items():
|
||||
if not c.get("gruppo"):
|
||||
raise MergeError("extension case %r has no group" % cid)
|
||||
if cid in cases and cases[cid]["sha256"] != c["sha256"]:
|
||||
raise MergeError("case %r has two different hashes: %s and %s"
|
||||
% (cid, cases[cid]["sha256"], c["sha256"]))
|
||||
cases[cid] = _case(c, c["gruppo"])
|
||||
|
||||
groups = {}
|
||||
for c in cases.values():
|
||||
groups[c["gruppo"]] = groups.get(c["gruppo"], 0) + 1
|
||||
status = {**bundle.get("font_load_status", {}), **ext.get("font_load_status", {})}
|
||||
return {
|
||||
"test_page": "index.html",
|
||||
"font_source": "bundle",
|
||||
"text": bundle["text"],
|
||||
"firefox": bundle["firefox"],
|
||||
"canvas": bundle["canvas"],
|
||||
"cleartype": bundle["cleartype"],
|
||||
"fonts": ext["fonts"],
|
||||
"font_load_status": status,
|
||||
"case_count": len(cases),
|
||||
"groups": dict(sorted(groups.items())),
|
||||
"cases": cases,
|
||||
}
|
||||
|
||||
|
||||
def main(argv):
|
||||
ap = argparse.ArgumentParser(description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("bundle", help="refs.json of the base measurement (canvas_ref_bundle)")
|
||||
ap.add_argument("ext", help="refs.json of the extension measurement (canvas_ref_ext)")
|
||||
ap.add_argument("--out", default=str(DEFAULT_OUT))
|
||||
a = ap.parse_args(argv[1:])
|
||||
load = lambda p: json.loads(Path(p).read_text(encoding="utf-8"))
|
||||
try:
|
||||
refs = merge(load(a.bundle), load(a.ext))
|
||||
except MergeError as e:
|
||||
print("error: %s" % e, file=sys.stderr)
|
||||
return 1
|
||||
Path(a.out).write_text(json.dumps(refs, ensure_ascii=False, indent=1) + "\n",
|
||||
encoding="utf-8")
|
||||
print("%d cases -> %s" % (refs["case_count"], a.out))
|
||||
for g, n in refs["groups"].items():
|
||||
print(" %-30s %3d" % (g, n))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,82 +0,0 @@
|
||||
"""The preloaded-intermediates list of a CI leg: a fixed (empty) file of the repository, and the variable that makes the core use it.
|
||||
|
||||
python scripts/ci_lab_intermediates.py set [--pin ci/intermediates.pin.json] # checks the file against the pin, exports STEALTHFOX_INTERMEDIATES
|
||||
|
||||
Why this exists: without ``STEALTHFOX_INTERMEDIATES`` the core downloads Mozilla's intermediates list on a cold cache (in line, at the first launch or at
|
||||
`invisible_playwright fetch`) and asks once a week whether it changed, from the python of the test. A CI leg reaches no site for its data and every run has to
|
||||
have the same bytes, so the leg launches with ``ci/intermediates.json``: a valid list in the engine's format 1 with no certificate. With the variable set the
|
||||
core neither downloads nor checks, ever. ``ci/intermediates.pin.json`` holds the sha256 of the file: ``set`` refuses to go on when the file is not that.
|
||||
|
||||
``set`` writes ``STEALTHFOX_INTERMEDIATES=<absolute path>`` to ``$GITHUB_ENV`` (every later step of the job sees it) and, when there is no
|
||||
``$GITHUB_ENV``, to stdout. The paths of the pin are relative to the repository, not to the working directory of the caller.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ENV = "STEALTHFOX_INTERMEDIATES"
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class Refused(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def sha256_of(path) -> str:
|
||||
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def load_pin(path) -> dict:
|
||||
try:
|
||||
pin = json.loads(Path(path).read_text(encoding="utf-8"))
|
||||
except (OSError, ValueError) as exc:
|
||||
raise Refused("the pin %s cannot be read: %s" % (path, exc))
|
||||
sha = pin.get("sha256") if isinstance(pin, dict) else None
|
||||
if not isinstance(sha, str) or len(sha) != 64 or any(c not in "0123456789abcdef" for c in sha):
|
||||
raise Refused("the pin %s has no sha256 that is a sha256" % path)
|
||||
if not isinstance(pin.get("file"), str) or not pin["file"]:
|
||||
raise Refused("the pin %s names no file" % path)
|
||||
return pin
|
||||
|
||||
|
||||
def resolve(pin: dict, pin_path) -> Path:
|
||||
"""The file the pin names, checked against its sha256: a file that is not the pinned one is refused."""
|
||||
target = Path(pin["file"])
|
||||
if not target.is_absolute():
|
||||
target = ROOT / target
|
||||
if not target.is_file():
|
||||
raise Refused("the file %s of the pin cannot be found" % pin["file"])
|
||||
got = sha256_of(target)
|
||||
if got != pin["sha256"]:
|
||||
raise Refused("%s has sha256 %s, the pin says %s: change both in one commit" % (pin["file"], got, pin["sha256"]))
|
||||
return target.resolve()
|
||||
|
||||
|
||||
def main(argv=None) -> int:
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n", 1)[0])
|
||||
sub = ap.add_subparsers(dest="cmd", required=True)
|
||||
s = sub.add_parser("set")
|
||||
s.add_argument("--pin", default="ci/intermediates.pin.json")
|
||||
ns = ap.parse_args(argv)
|
||||
try:
|
||||
path = resolve(load_pin(ns.pin), ns.pin)
|
||||
except Refused as exc:
|
||||
print("ci_lab_intermediates: %s" % exc, file=sys.stderr)
|
||||
return 1
|
||||
line = "%s=%s" % (ENV, path)
|
||||
env_file = os.environ.get("GITHUB_ENV")
|
||||
if env_file:
|
||||
with open(env_file, "a", encoding="utf-8", newline="\n") as fh:
|
||||
fh.write(line + "\n")
|
||||
else:
|
||||
print(line)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,87 @@
|
||||
"""The security state of a CI leg: a fixed, ready directory of the repository, and the variable that makes the core use it.
|
||||
|
||||
python scripts/ci_lab_security_state.py set [--pin ci/security-state.pin.json] # checks the directory against the pin, exports STEALTHFOX_SECURITY_STATE
|
||||
|
||||
Why this exists: without ``STEALTHFOX_SECURITY_STATE`` the core downloads Mozilla's security-state collections on a cold cache (in line, at the first launch or at
|
||||
`invisible_playwright fetch`), has the engine generate the state from them and copies it into every profile. A CI leg reaches no site for its data, runs no generation and
|
||||
every run has to have the same bytes, so the leg launches with ``ci/security-state/``: a ready directory that holds ONLY ``securitystate-result.json`` (a result with no
|
||||
data: format 1, ok, no CRLite hashes, zero timestamps, no engine) and no ``security_state/``, so a launch copies nothing. With the variable set the core neither downloads
|
||||
nor generates, ever. ``ci/security-state.pin.json`` holds the sha256 of that file: ``set`` refuses to go on when the file is not that, or when the directory holds
|
||||
anything else.
|
||||
|
||||
``set`` writes ``STEALTHFOX_SECURITY_STATE=<absolute directory>`` to ``$GITHUB_ENV`` (every later step of the job sees it) and, when there is no ``$GITHUB_ENV``, to
|
||||
stdout. The paths of the pin are relative to the repository, not to the working directory of the caller.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ENV = "STEALTHFOX_SECURITY_STATE"
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class Refused(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def sha256_of(path) -> str:
|
||||
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def load_pin(path) -> dict:
|
||||
try:
|
||||
pin = json.loads(Path(path).read_text(encoding="utf-8"))
|
||||
except (OSError, ValueError) as exc:
|
||||
raise Refused("the pin %s cannot be read: %s" % (path, exc))
|
||||
sha = pin.get("sha256") if isinstance(pin, dict) else None
|
||||
if not isinstance(sha, str) or len(sha) != 64 or any(c not in "0123456789abcdef" for c in sha):
|
||||
raise Refused("the pin %s has no sha256 that is a sha256" % path)
|
||||
if not isinstance(pin.get("file"), str) or not pin["file"]:
|
||||
raise Refused("the pin %s names no file" % path)
|
||||
return pin
|
||||
|
||||
|
||||
def resolve(pin: dict, pin_path) -> Path:
|
||||
"""The directory of the file the pin names, checked: the file has the pinned sha256 and it is the ONLY entry of its directory."""
|
||||
target = Path(pin["file"])
|
||||
if not target.is_absolute():
|
||||
target = ROOT / target
|
||||
if not target.is_file():
|
||||
raise Refused("the file %s of the pin cannot be found" % pin["file"])
|
||||
got = sha256_of(target)
|
||||
if got != pin["sha256"]:
|
||||
raise Refused("%s has sha256 %s, the pin says %s: change both in one commit" % (pin["file"], got, pin["sha256"]))
|
||||
others = sorted(p.name for p in target.parent.iterdir() if p.name != target.name)
|
||||
if others:
|
||||
raise Refused("the directory %s holds more than %s: %s" % (target.parent, target.name, ", ".join(others)))
|
||||
return target.parent.resolve()
|
||||
|
||||
|
||||
def main(argv=None) -> int:
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n", 1)[0])
|
||||
sub = ap.add_subparsers(dest="cmd", required=True)
|
||||
s = sub.add_parser("set")
|
||||
s.add_argument("--pin", default="ci/security-state.pin.json")
|
||||
ns = ap.parse_args(argv)
|
||||
try:
|
||||
path = resolve(load_pin(ns.pin), ns.pin)
|
||||
except Refused as exc:
|
||||
print("ci_lab_security_state: %s" % exc, file=sys.stderr)
|
||||
return 1
|
||||
line = "%s=%s" % (ENV, path)
|
||||
env_file = os.environ.get("GITHUB_ENV")
|
||||
if env_file:
|
||||
with open(env_file, "a", encoding="utf-8", newline="\n") as fh:
|
||||
fh.write(line + "\n")
|
||||
else:
|
||||
print(line)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run ONE row of the whole-e2e suite against a binary, for the candidate's gate, and write ONE junit for the judge.
|
||||
|
||||
ci_suite_run.py --required ci/required-suites.json --suite wrapper.e2e.suite.linux.1 --os linux --binary FF --junit result/x.xml
|
||||
|
||||
The run is the run of ``scripts/run_e2e.py`` (``invisible_core.testing.e2e``: the two passes, ``-m "e2e and not wall_clock"`` with 4 browsers at once and then
|
||||
``-m "e2e and wall_clock"`` alone, ``--dist loadfile``, the deadline per test, no rerun) on the files and node ids of the row; this script does not copy it, it calls it.
|
||||
What it adds is the end: that run writes one junit per pass, and the judge (``scripts/ci_verdict.py judge``) reads one. The two are merged into ONE xunit2 file, every
|
||||
testcase as pytest wrote it (``classname`` kept, no ``file``/``line``).
|
||||
|
||||
The exit code is 0 when the passes reached their end, red tests included: the verdict is the judge's, and a failed test is a line of its list, not a reason to lose the
|
||||
junit. It is not 0 when a pass did not run to its end (interrupted, an internal error, a usage error: the code of that pass) or when no junit was written at all.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import xml.etree.ElementTree as ET
|
||||
from pathlib import Path
|
||||
from typing import Callable, Optional, Sequence
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
import ci_verdict # noqa: E402 (the judge: the row is read the way it reads it)
|
||||
|
||||
#: pytest's exit codes that mean "the pass reached its end": all passed, some failed, nothing collected (a client with no `wall_clock` test has an empty pass).
|
||||
_REACHED_THE_END = (0, 1, 5)
|
||||
|
||||
|
||||
def row_arguments(required: str, suite: str, os_name: str) -> list:
|
||||
"""The files and node ids of the row, in its order (what ``ci_verdict.py args`` prints, without the marker: the passes bring their own)."""
|
||||
return list(ci_verdict.find_suite(ci_verdict.load_required(required), suite, os_name)["tests"])
|
||||
|
||||
|
||||
def pass_junits(directory: Path, procs: str = "4") -> list:
|
||||
"""The junit file of each pass of the run, in the order of the passes (``invisible_core.testing.e2e`` names them)."""
|
||||
from invisible_core.testing import e2e
|
||||
|
||||
return [e2e.junit_file(Path(directory), selection) for _width, selection in e2e.passes(procs)]
|
||||
|
||||
|
||||
def merge_junits(paths: Sequence, out: Path) -> int:
|
||||
"""Write ONE xunit2 junit with every testcase of the junit files that exist, in the order given. -> the number of testcases.
|
||||
|
||||
The counts of the testsuite are those of the testcases written, not the sum of the headers read: a header that disagrees with its own cases is not copied.
|
||||
A path that does not exist is a pass that wrote nothing (it is not an error here: the judge counts what is in the file)."""
|
||||
cases = []
|
||||
for path in paths:
|
||||
if not Path(path).is_file():
|
||||
continue
|
||||
cases += [copy.deepcopy(c) for c in ET.parse(path).getroot().iter("testcase")]
|
||||
tags = [{child.tag for child in c} for c in cases]
|
||||
failures = sum(1 for t in tags if "failure" in t and "error" not in t)
|
||||
errors = sum(1 for t in tags if "error" in t)
|
||||
skipped = sum(1 for t in tags if "skipped" in t and not ({"failure", "error"} & t))
|
||||
seconds = sum(float(c.get("time") or 0) for c in cases)
|
||||
suite = ET.Element("testsuite", {"name": "pytest", "errors": str(errors), "failures": str(failures), "skipped": str(skipped),
|
||||
"tests": str(len(cases)), "time": "%.3f" % seconds})
|
||||
suite.extend(cases)
|
||||
root = ET.Element("testsuites", {"name": "pytest tests"})
|
||||
root.append(suite)
|
||||
out = Path(out)
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
ET.ElementTree(root).write(out, encoding="utf-8", xml_declaration=True)
|
||||
return len(cases)
|
||||
|
||||
|
||||
def run(required: str, suite: str, os_name: str, binary: str, junit: str, *, repo: Path, procs: Optional[str] = None,
|
||||
run_e2e: Optional[Callable] = None, junit_directory: Optional[Path] = None) -> int:
|
||||
"""Run the row and write the merged junit. ``run_e2e`` is ``invisible_core.testing.e2e.main`` (a fake in the unit tests)."""
|
||||
from invisible_core.testing import e2e
|
||||
|
||||
run_e2e = run_e2e or e2e.main
|
||||
arguments = row_arguments(required, suite, os_name)
|
||||
directory = Path(junit_directory or tempfile.mkdtemp(prefix="invpw-suite-junit-"))
|
||||
# the core reads the directory of the junit from the environment (its own order: this variable, the watchdog's folder, the checkout): one name, set for this run
|
||||
before = os.environ.get(e2e.JUNIT_DIR_ENV)
|
||||
os.environ[e2e.JUNIT_DIR_ENV] = str(directory)
|
||||
try:
|
||||
code = run_e2e([binary] + (["-n", procs] if procs else []) + arguments, repo)
|
||||
finally:
|
||||
if before is None:
|
||||
os.environ.pop(e2e.JUNIT_DIR_ENV, None)
|
||||
else:
|
||||
os.environ[e2e.JUNIT_DIR_ENV] = before
|
||||
written = merge_junits(pass_junits(directory, procs or "4"), Path(junit))
|
||||
print("[ci_suite_run] %s on %s: %d test(s) in %s" % (suite, os_name, written, junit), flush=True)
|
||||
if code not in _REACHED_THE_END:
|
||||
print("[ci_suite_run] a pass did not run to its end (exit %s)" % code, file=sys.stderr)
|
||||
return code
|
||||
if not written:
|
||||
print("[ci_suite_run] no pass wrote a junit", file=sys.stderr)
|
||||
return 3
|
||||
return 0
|
||||
|
||||
|
||||
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("--required", required=True, help="ci/required-suites.json")
|
||||
parser.add_argument("--suite", required=True, help="the id of the row")
|
||||
parser.add_argument("--os", required=True, choices=ci_verdict.OSES)
|
||||
parser.add_argument("--binary", required=True, help="the engine under test")
|
||||
parser.add_argument("--junit", required=True, help="the one junit written for the judge")
|
||||
parser.add_argument("--procs", default=None, help="browsers at once, for the first pass (default: the run's own, 4)")
|
||||
ns = parser.parse_args(argv)
|
||||
try:
|
||||
return run(ns.required, ns.suite, ns.os, ns.binary, ns.junit, repo=Path(__file__).resolve().parent.parent, procs=ns.procs)
|
||||
except ci_verdict.Usage as exc:
|
||||
print("ci_suite_run.py: %s" % exc, file=sys.stderr)
|
||||
return 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
+69
-7
@@ -21,6 +21,9 @@ pytest wrote and fails on every one of them.
|
||||
missing (--binary is mandatory: without it exit 2) or the commit cannot be known; the --seal is unreadable.
|
||||
With --main-required (the list of main) the list only grows: a suite of main is gone, its minimum went down,
|
||||
its `exact` went from true to false, its os or tests lost an element, or its marker changed is red.
|
||||
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.
|
||||
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
|
||||
@@ -248,12 +251,65 @@ def _int(value):
|
||||
return value if _is_int(value) else 0
|
||||
|
||||
|
||||
def against_main(current, main):
|
||||
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)."""
|
||||
if not isinstance(data, list):
|
||||
return ["the retired list must be a JSON list"]
|
||||
problems, seen = [], 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
|
||||
f = e.get("file")
|
||||
if not isinstance(f, str) or not f.strip():
|
||||
problems.append("%s has no file" % where)
|
||||
elif f in seen:
|
||||
problems.append("%s: the file %s appears more than once" % (where, f))
|
||||
else:
|
||||
seen.add(f)
|
||||
where = "retired %s" % f
|
||||
for key in ("reason", "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))
|
||||
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)
|
||||
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)."""
|
||||
path = Path(main_required).with_name(RETIRED_NAME)
|
||||
if not path.is_file():
|
||||
return [], []
|
||||
try:
|
||||
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)
|
||||
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):
|
||||
"""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)."""
|
||||
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."""
|
||||
problems = []
|
||||
if not isinstance(main, list):
|
||||
return ["the list of main is not a JSON list: it cannot be compared"]
|
||||
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)}
|
||||
for old in main:
|
||||
if not isinstance(old, dict):
|
||||
@@ -263,12 +319,16 @@ def against_main(current, main):
|
||||
if new is None:
|
||||
problems.append("the suite %s of main is gone from the list" % sid)
|
||||
continue
|
||||
if _int(new.get("min_tests")) < _int(old.get("min_tests")):
|
||||
problems.append("the minimum of %s went down: %s on main, %s here"
|
||||
% (sid, old.get("min_tests"), new.get("min_tests")))
|
||||
lost = [t for t in old.get("tests", []) if t not in new.get("tests", [])]
|
||||
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)
|
||||
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 ""))
|
||||
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)
|
||||
lost = [t for t in old.get("tests", []) if t not in new.get("tests", [])]
|
||||
if lost:
|
||||
problems.append("the suite %s lost %d required test(s) that main has: %s" % (sid, len(lost), ", ".join(lost)))
|
||||
lost_os = [o for o in old.get("os", []) if o not in new.get("os", [])]
|
||||
@@ -406,7 +466,9 @@ def cmd_judge(ns):
|
||||
problems.append("the list of main %s exists, but --main-has-no-list says main has none" % ns.main_required)
|
||||
elif exists:
|
||||
try:
|
||||
problems += against_main(suites, _read_json_list(ns.main_required))
|
||||
retired, retired_problems = retired_of_main(ns.main_required)
|
||||
problems += retired_problems
|
||||
problems += against_main(suites, _read_json_list(ns.main_required), retired)
|
||||
except Usage as exc:
|
||||
problems.append(str(exc))
|
||||
elif ns.main_has_no_list:
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
"""Which canvas text cases two runs draw differently.
|
||||
|
||||
tests/test_canvas_text_is_windows_e2e.py writes canvas_text_<tag>.json (case id -> SHA-256
|
||||
of the RGBA bytes) into INVISIBLE_CANVAS_TEXT_OUT. Run it on Debian 12 and on Ubuntu 24.04
|
||||
(and the retail reference, tests/data/canvas_text_ref/refs.json, is accepted too), then:
|
||||
|
||||
python scripts/compare_canvas_text_runs.py debian.json ubuntu.json
|
||||
|
||||
The exit status is 0 when every case is equal on both sides and both draw the same set.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
def load(path):
|
||||
"""case id -> sha256, from a run file or from refs.json."""
|
||||
data = json.loads(open(path, encoding="utf-8").read())
|
||||
if "cases" in data:
|
||||
return {k: v["sha256"] for k, v in data["cases"].items()}
|
||||
return data
|
||||
|
||||
|
||||
def compare(a, b):
|
||||
"""(only in a, only in b, ids whose hash differs)."""
|
||||
only_a = sorted(set(a) - set(b))
|
||||
only_b = sorted(set(b) - set(a))
|
||||
differ = sorted(k for k in set(a) & set(b) if a[k] != b[k])
|
||||
return only_a, only_b, differ
|
||||
|
||||
|
||||
def main(argv):
|
||||
if len(argv) != 3:
|
||||
print(__doc__)
|
||||
return 2
|
||||
a, b = load(argv[1]), load(argv[2])
|
||||
only_a, only_b, differ = compare(a, b)
|
||||
for label, ids in (("only in %s" % argv[1], only_a), ("only in %s" % argv[2], only_b),
|
||||
("differ", differ)):
|
||||
if ids:
|
||||
print("%s (%d):" % (label, len(ids)))
|
||||
for k in ids:
|
||||
print(" " + k)
|
||||
print("%d cases compared, %d differ" % (len(set(a) & set(b)), len(differ)))
|
||||
return 1 if (only_a or only_b or differ) else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,738 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""A MAP of what a launch does, from the user's call to the first page, with the time of every step.
|
||||
|
||||
One question: where does the time of `InvisiblePlaywright(...)` go, from the call to a page that has loaded a first page? It is a measurement and nothing else: no
|
||||
threshold, no verdict, and nothing of the product is changed. The product is measured from the outside: each function that is a step is wrapped by a timer that
|
||||
calls the original (`time.perf_counter_ns` before and after, the thread's name), installed on the modules' attributes in the worker process only. A step the product
|
||||
renames makes a target that is not found: it is said in the report (`unpatched`), never silently skipped.
|
||||
|
||||
Two modes of one file.
|
||||
|
||||
driver (default) starts a worker process per launch (a fresh interpreter each: the import of the packages is a step of a launch), `--runs` times on a warm
|
||||
cache after one warm-up launch that is not counted, for each scenario; then ONE launch on a cold cache (a new cache directory, the engine kept: the
|
||||
engine's download is not this map's, the workflow times `fetch` apart); then ONE launch under cProfile; then writes `init-map-<system>.json` and
|
||||
`init-map-<system>.md` in `--out`.
|
||||
worker (--worker) one launch: imports, the wrapped steps, `InvisiblePlaywright(...)` -> `__enter__` -> `browser.new_page()` -> two `goto` of a page on 127.0.0.1 ->
|
||||
`__exit__`, and writes its spans as JSON.
|
||||
|
||||
Scenarios (`--scenarios`):
|
||||
|
||||
direct `InvisiblePlaywright(seed=...)`: no proxy, the exit asked of the internet (what a user without a proxy pays), the engine on the surface of the system.
|
||||
proxy the same behind a SOCKS5 gateway of this machine (`tests/_socks_servers.py`, the fake web's: no real proxy; it forwards the question of the exit for real): the TCP exit is asked THROUGH the proxy and the
|
||||
UDP exit is measured beside it, on a thread (the product's decision: they stay parallel).
|
||||
headless `headless=True`: the hidden surface (an Xvfb on Linux, a Win32 desktop on Windows) is made by the launch.
|
||||
|
||||
What a time is. Every time is milliseconds of `time.perf_counter_ns`, relative to the instant before `InvisiblePlaywright(...)` is called. A step's `self` time is its
|
||||
time minus the time of the steps inside it. A step runs `in parallel` with another when they are not one inside the other and they overlap in half of the runs or more.
|
||||
The tree is made by containment of the intervals, so a span that a background thread makes while the caller waits sits under whichever step was open (its thread is in
|
||||
the column `thread`).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import contextlib
|
||||
import functools
|
||||
import importlib
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import signal
|
||||
import statistics
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
HERE = Path(__file__).resolve()
|
||||
|
||||
# ── what is wrapped ─────────────────────────────────────────────────────────
|
||||
# (module, "Class.attr" or "attr", label). The labels are the names of the steps in the map. An entry whose target is not found is reported as `unpatched`.
|
||||
TARGETS: List[Tuple[str, str, str]] = [
|
||||
# the wrapper: the three calls of the user and what `__enter__` does
|
||||
("invisible_playwright.launcher", "InvisiblePlaywright.__init__", "ctor"),
|
||||
("invisible_playwright.launcher", "generate_profile", "ctor.generate_profile"),
|
||||
("invisible_playwright.launcher", "guard_for", "ctor.lifetime_guard"),
|
||||
("invisible_playwright._session", "declared_network", "ctor.declared_network"),
|
||||
("invisible_playwright.launcher", "InvisiblePlaywright.__enter__", "enter"),
|
||||
("invisible_playwright.launcher", "prepare_session_geo", "geo"),
|
||||
("invisible_core._geo", "discover_egress_ip", "geo.tcp_egress_discovery"),
|
||||
("invisible_core._udp_exit", "start_measurement", "geo.udp_measurement_start"),
|
||||
("invisible_core._udp_exit", "PendingMeasurement._run", "geo.udp_probe_thread"),
|
||||
("invisible_core._udp_exit", "PendingMeasurement.result", "geo.udp_join"),
|
||||
("invisible_core._geo", "ensure_geoip_mmdb", "geo.geoip_database"),
|
||||
("invisible_core._geo", "ip_to_timezone", "geo.ip_to_timezone"),
|
||||
("invisible_core._geo", "ip_to_coordinates", "geo.ip_to_coordinates"),
|
||||
("invisible_core._geo", "position_to_declare", "geo.declared_position"),
|
||||
("invisible_core._geo", "_decide", "geo.decide_locale"),
|
||||
("invisible_playwright.launcher", "resolve_executable", "engine_check"),
|
||||
("invisible_playwright._engine", "ensure_binary", "engine_check.ensure_binary"),
|
||||
("invisible_core.download", "read_stamp", "engine_check.read_stamp"),
|
||||
("invisible_core.download", "verify_engine", "engine_check.verify_engine"),
|
||||
("invisible_core.seal", "read_engine_identity", "engine_check.read_engine_identity"),
|
||||
("invisible_core.seal", "engine_problems", "engine_check.engine_problems"),
|
||||
("invisible_playwright._session", "CommonLaunch._resolve_headless", "resolve_headless"),
|
||||
("invisible_playwright._session", "make_virtual_display", "resolve_headless.make_virtual_display"),
|
||||
("invisible_playwright._session", "CommonLaunch._build_prefs", "build_prefs"),
|
||||
("invisible_playwright._session", "compose_session_prefs", "build_prefs.compose_session_prefs"),
|
||||
("invisible_playwright.launcher", "_configure_proxy_shared", "configure_proxy"),
|
||||
("invisible_playwright._session", "CommonLaunch._build_env", "build_env"),
|
||||
("invisible_playwright._session", "resolve_executable", "build_env.engine_check_again"),
|
||||
("invisible_playwright._session", "verify_font_manifest", "build_env.verify_font_manifest"),
|
||||
("invisible_playwright._session", "cached_font_manifest_path", "build_env.font_manifest_file"),
|
||||
("invisible_playwright._session", "build_launch_env", "build_env.build_launch_env"),
|
||||
# the client and the in-process server
|
||||
("invisible_playwright._pw.sync_api._context_manager", "PlaywrightContextManager.__enter__", "playwright_start"),
|
||||
("invisible_playwright._pw.sync_api._generated", "BrowserType.launch", "client_launch"),
|
||||
("invisible_playwright._pw.sync_api._generated", "BrowserType.launch_persistent_context", "client_launch_persistent"),
|
||||
("invisible_playwright._juggler.server", "BrowserTypeDispatcher.op_launch", "server_launch"),
|
||||
("invisible_playwright._juggler.server", "session_for_launch", "server_launch.session_for_launch"),
|
||||
("invisible_core.juggler._profile", "SessionFiles.__init__", "server_launch.session_files"),
|
||||
("invisible_playwright._juggler.server", "take_session_motion", "server_launch.take_session_motion"),
|
||||
("invisible_playwright._juggler.server", "write_user_js", "write_profile"),
|
||||
("invisible_core._intermediates", "ensure_intermediates", "write_profile.intermediates_list"),
|
||||
("invisible_playwright._juggler.server", "launch_proxy_command", "server_launch.launch_proxy_command"),
|
||||
("invisible_core.juggler.connection", "launch", "engine_start"),
|
||||
("invisible_core._engine_env", "compose", "engine_start.compose_environment"),
|
||||
("invisible_core.juggler.connection", "_spawn_windows", "engine_start.spawn_process"),
|
||||
("invisible_core.juggler.connection", "_spawn_posix", "engine_start.spawn_process"),
|
||||
("invisible_core.juggler.connection", "ProcessOutput.wait_for_ready", "engine_start.wait_listening"),
|
||||
("invisible_core.juggler.connection", "Connection.__init__", "engine_start.connection_init"),
|
||||
("invisible_core.juggler.connection", "Connection.send_placed", "send"),
|
||||
("invisible_playwright._juggler.server", "read_version", "server_launch.read_version"),
|
||||
("invisible_playwright._juggler.server", "BrowserDispatcher.__init__", "server_launch.browser_dispatcher"),
|
||||
("invisible_playwright.launcher", "assert_wire_version", "assert_wire_version"),
|
||||
("invisible_playwright.launcher", "InvisiblePlaywright._patch_new_context_defaults", "patch_new_context_defaults"),
|
||||
("invisible_playwright._session", "CommonLaunch._arm_cursor_engine", "arm_cursor_engine"),
|
||||
# the first page
|
||||
("invisible_playwright._pw.sync_api._generated", "Browser.new_page", "client_new_page"),
|
||||
("invisible_playwright.launcher", "InvisiblePlaywright._assert_uscita_invariata", "egress_recheck"),
|
||||
("invisible_playwright._juggler.server", "BrowserDispatcher.op_new_context", "server_new_context"),
|
||||
("invisible_playwright._juggler.server", "BrowserDispatcher._apply_context_options", "server_new_context.apply_options"),
|
||||
("invisible_playwright._juggler.server", "BrowserContextDispatcher.op_new_page", "server_new_page"),
|
||||
("invisible_playwright._juggler.server", "BrowserDispatcher._wait_for_page", "server_new_page.wait_for_page"),
|
||||
# the first goto
|
||||
("invisible_playwright._pw.sync_api._generated", "Page.goto", "client_goto"),
|
||||
("invisible_playwright._juggler.server", "FrameDispatcher.op_goto", "server_goto"),
|
||||
# the end (not part of the map: told for the record)
|
||||
("invisible_playwright.launcher", "InvisiblePlaywright.__exit__", "exit"),
|
||||
]
|
||||
|
||||
#: Steps that run on a thread of their own by design; the others are in the line of the caller.
|
||||
BACKGROUND = {"geo.udp_probe_thread"}
|
||||
|
||||
#: One line for each step: what it does.
|
||||
DESC = {
|
||||
"ctor": "constructor: seed, profile (fingerprint) and guard",
|
||||
"ctor.generate_profile": "the profile generated from the seed",
|
||||
"ctor.lifetime_guard": "the process lifetime guard",
|
||||
"ctor.declared_network": "the network declared by the seed",
|
||||
"enter": "__enter__: everything up to the browser being ready",
|
||||
"geo": "prepare_session_geo: exit, zone, language, position",
|
||||
"geo.tcp_egress_discovery": "discovery of the exit IP (TCP, an HTTPS request)",
|
||||
"geo.udp_measurement_start": "start of the UDP measurement thread",
|
||||
"geo.udp_probe_thread": "UDP measurement of the exit (a thread, beside the TCP discovery)",
|
||||
"geo.udp_join": "wait for the UDP measurement and its verdict",
|
||||
"geo.geoip_database": "GeoIP database (cache, daily check)",
|
||||
"geo.ip_to_timezone": "zone from the IP",
|
||||
"geo.ip_to_coordinates": "coordinates from the IP",
|
||||
"geo.declared_position": "position declared from the seed",
|
||||
"geo.decide_locale": "language decided from the exit",
|
||||
"engine_check": "choice and verification of the engine (the seal)",
|
||||
"engine_check.ensure_binary": "ensure_binary: the engine's cache",
|
||||
"engine_check.read_stamp": "read the cache stamp",
|
||||
"engine_check.verify_engine": "verify_engine: the engine against the seal",
|
||||
"engine_check.read_engine_identity": "application.ini and provenance of the engine",
|
||||
"engine_check.engine_problems": "comparison with the seal",
|
||||
"resolve_headless": "hidden surface (headless=True)",
|
||||
"resolve_headless.make_virtual_display": "makes the Xvfb / Win32 desktop",
|
||||
"build_prefs": "composition of the prefs",
|
||||
"build_prefs.compose_session_prefs": "the core's compose_session_prefs",
|
||||
"configure_proxy": "proxy configuration",
|
||||
"build_env": "construction of the environment",
|
||||
"build_env.engine_check_again": "second verification of the engine (made by _build_env)",
|
||||
"build_env.verify_font_manifest": "the font list against the engine",
|
||||
"build_env.font_manifest_file": "the font list file",
|
||||
"build_env.build_launch_env": "the process environment",
|
||||
"playwright_start": "sync_playwright().start(): in-process server and client",
|
||||
"client_launch": "BrowserType.launch, client side",
|
||||
"client_launch_persistent": "launch_persistent_context, client side",
|
||||
"server_launch": "op_launch of the in-process server",
|
||||
"server_launch.session_for_launch": "the launch's session",
|
||||
"server_launch.session_files": "profile and temporary directories",
|
||||
"server_launch.take_session_motion": "takes the session prefs out",
|
||||
"write_profile": "writing user.js",
|
||||
"write_profile.intermediates_list": "the intermediates list (cache)",
|
||||
"server_launch.launch_proxy_command": "the proxy command",
|
||||
"engine_start": "engine start (connection.launch)",
|
||||
"engine_start.compose_environment": "the engine's environment (_engine_env.compose)",
|
||||
"engine_start.spawn_process": "process creation",
|
||||
"engine_start.wait_listening": "wait for the engine to be ready (the listening line)",
|
||||
"engine_start.connection_init": "Juggler connection",
|
||||
"send": "Juggler message (round trip)",
|
||||
"server_launch.read_version": "the engine's version",
|
||||
"server_launch.browser_dispatcher": "BrowserDispatcher (Browser.enable)",
|
||||
"assert_wire_version": "version on the wire against the seal",
|
||||
"patch_new_context_defaults": "context defaults",
|
||||
"arm_cursor_engine": "cursor engine",
|
||||
"client_new_page": "browser.new_page(), client side",
|
||||
"egress_recheck": "check of the exit (with a proxy only)",
|
||||
"server_new_context": "first context",
|
||||
"server_new_context.apply_options": "context options",
|
||||
"server_new_page": "first page",
|
||||
"server_new_page.wait_for_page": "wait for Page.ready",
|
||||
"client_goto": "page.goto, client side",
|
||||
"server_goto": "goto, server side",
|
||||
"exit": "closing (outside the map)",
|
||||
}
|
||||
|
||||
|
||||
# ── the worker ──────────────────────────────────────────────────────────────
|
||||
class Recorder:
|
||||
def __init__(self) -> None:
|
||||
self.spans: List[Dict[str, Any]] = []
|
||||
self.lock = threading.Lock()
|
||||
|
||||
def add(self, label: str, t0: int, t1: int, extra: Optional[str] = None) -> None:
|
||||
span = {"label": label, "t0": t0, "t1": t1, "thread": threading.current_thread().name}
|
||||
if extra:
|
||||
span["extra"] = extra
|
||||
with self.lock:
|
||||
self.spans.append(span)
|
||||
|
||||
|
||||
def _timed(recorder: Recorder, label: str, fn):
|
||||
@functools.wraps(fn)
|
||||
def wrapper(*args, **kwargs):
|
||||
start = time.perf_counter_ns()
|
||||
extra = None
|
||||
if label == "send":
|
||||
method = args[1] if len(args) >= 2 else kwargs.get("method")
|
||||
extra = method if isinstance(method, str) else None
|
||||
try:
|
||||
return fn(*args, **kwargs)
|
||||
finally:
|
||||
recorder.add(label if extra is None else "send:" + extra, start, time.perf_counter_ns())
|
||||
return wrapper
|
||||
|
||||
|
||||
def install(recorder: Recorder) -> List[str]:
|
||||
"""Wrap every target; the labels of the targets that were not found."""
|
||||
unpatched: List[str] = []
|
||||
for module_name, dotted, label in TARGETS:
|
||||
try:
|
||||
module = importlib.import_module(module_name)
|
||||
owner: Any = module
|
||||
parts = dotted.split(".")
|
||||
for part in parts[:-1]:
|
||||
owner = getattr(owner, part)
|
||||
original = getattr(owner, parts[-1])
|
||||
setattr(owner, parts[-1], _timed(recorder, label, original))
|
||||
except Exception as exc: # noqa: BLE001
|
||||
unpatched.append("%s %s -> %s: %s" % (module_name, dotted, label, type(exc).__name__))
|
||||
return unpatched
|
||||
|
||||
|
||||
class _Page(BaseHTTPRequestHandler):
|
||||
def do_GET(self): # noqa: N802
|
||||
body = b"<!doctype html><title>init map</title><p>hello</p>"
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/html; charset=utf-8")
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
|
||||
def worker(args: argparse.Namespace) -> int:
|
||||
started = time.perf_counter_ns()
|
||||
result: Dict[str, Any] = {"status": "error", "scenario": args.scenario}
|
||||
out = Path(args.out)
|
||||
try:
|
||||
t = time.perf_counter_ns()
|
||||
import invisible_core # noqa: F401
|
||||
marks = {"import_core": time.perf_counter_ns() - t}
|
||||
t = time.perf_counter_ns()
|
||||
from invisible_playwright.sync_api import InvisiblePlaywright
|
||||
import invisible_playwright.launcher # noqa: F401
|
||||
import invisible_playwright._juggler.server # noqa: F401
|
||||
marks["import_wrapper"] = time.perf_counter_ns() - t
|
||||
result["marks_ns"] = marks
|
||||
recorder = Recorder()
|
||||
if args.dry:
|
||||
_dry()
|
||||
result["unpatched"] = install(recorder)
|
||||
|
||||
httpd = ThreadingHTTPServer(("127.0.0.1", 0), _Page)
|
||||
threading.Thread(target=httpd.serve_forever, daemon=True, name="init-map-page").start()
|
||||
url = "http://127.0.0.1:%d/" % httpd.server_address[1]
|
||||
|
||||
kwargs: Dict[str, Any] = {"seed": args.seed}
|
||||
if args.scenario == "headless":
|
||||
kwargs["headless"] = True
|
||||
if args.scenario == "proxy":
|
||||
kwargs["proxy"] = {"server": args.proxy}
|
||||
if args.stun:
|
||||
kwargs["udp_stun_servers"] = [args.stun]
|
||||
profiler = None
|
||||
if args.profile:
|
||||
import cProfile
|
||||
profiler = cProfile.Profile()
|
||||
instance = None
|
||||
entered = False
|
||||
call_start = time.perf_counter_ns()
|
||||
try:
|
||||
if profiler:
|
||||
profiler.enable()
|
||||
instance = InvisiblePlaywright(**kwargs)
|
||||
browser = instance.__enter__()
|
||||
entered = True
|
||||
page = browser.new_page()
|
||||
call_end = time.perf_counter_ns()
|
||||
if profiler:
|
||||
profiler.disable()
|
||||
t = time.perf_counter_ns()
|
||||
page.goto(url + "?1")
|
||||
recorder.add("goto1", t, time.perf_counter_ns())
|
||||
t = time.perf_counter_ns()
|
||||
page.goto(url + "?2")
|
||||
recorder.add("goto2", t, time.perf_counter_ns())
|
||||
result["status"] = "ok"
|
||||
result["call_ns"] = [call_start, call_end]
|
||||
finally:
|
||||
if profiler:
|
||||
with contextlib.suppress(Exception):
|
||||
profiler.disable()
|
||||
if instance is not None:
|
||||
with contextlib.suppress(Exception):
|
||||
if entered:
|
||||
instance.__exit__(None, None, None)
|
||||
else:
|
||||
instance._teardown()
|
||||
if profiler and args.profile_out:
|
||||
import io
|
||||
import pstats
|
||||
text = io.StringIO()
|
||||
for key in ("cumulative", "tottime"):
|
||||
stats = pstats.Stats(profiler, stream=text)
|
||||
text.write("\n=== sorted by %s (main thread only; the first 45) ===\n" % key)
|
||||
stats.sort_stats(key).print_stats(45)
|
||||
Path(args.profile_out).write_text(text.getvalue(), encoding="utf-8")
|
||||
result["spans"] = recorder.spans
|
||||
result["call_ns"] = result.get("call_ns") or [call_start, time.perf_counter_ns()]
|
||||
except BaseException as exc: # noqa: BLE001
|
||||
import traceback
|
||||
result["error"] = "%s: %s" % (type(exc).__name__, exc)
|
||||
result["traceback"] = traceback.format_exc()[-3000:]
|
||||
if "recorder" in locals():
|
||||
result["spans"] = recorder.spans
|
||||
result.setdefault("call_ns", [started, time.perf_counter_ns()])
|
||||
result["python"] = sys.version.split()[0]
|
||||
out.write_text(json.dumps(result), encoding="utf-8")
|
||||
return 0
|
||||
|
||||
|
||||
def _dry() -> None:
|
||||
"""Local check of the wrapping only (never in a workflow): the engine is not started, `launch` raises after the steps before it."""
|
||||
import invisible_core.juggler.connection as connection
|
||||
import invisible_playwright._engine as engine
|
||||
import invisible_playwright._session as session
|
||||
import invisible_playwright.launcher as launcher
|
||||
|
||||
class Dry(RuntimeError):
|
||||
pass
|
||||
|
||||
def fake_launch(*a, **k):
|
||||
raise Dry("dry run: the engine is not started")
|
||||
|
||||
fake = lambda *a, **k: Path(sys.executable) # noqa: E731
|
||||
for owner in (engine, session, launcher):
|
||||
setattr(owner, "resolve_executable", fake)
|
||||
connection.launch = fake_launch
|
||||
|
||||
|
||||
# ── the driver ──────────────────────────────────────────────────────────────
|
||||
def kill_tree(proc: subprocess.Popen) -> None:
|
||||
try:
|
||||
if os.name == "nt":
|
||||
subprocess.run(["taskkill", "/F", "/T", "/PID", str(proc.pid)], capture_output=True, timeout=30)
|
||||
else:
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
|
||||
except Exception: # noqa: BLE001
|
||||
with contextlib.suppress(Exception):
|
||||
proc.kill()
|
||||
|
||||
|
||||
def run_worker(scenario: str, seed: int, workdir: Path, tag: str, *, proxy: str = "", stun: str = "", env_extra: Optional[Dict[str, str]] = None,
|
||||
profile: bool = False, timeout: int = 300) -> Dict[str, Any]:
|
||||
out = workdir / ("run-%s.json" % tag)
|
||||
cmd = [sys.executable, "-u", str(HERE), "--worker", "--scenario", scenario, "--seed", str(seed), "--out", str(out)]
|
||||
if proxy:
|
||||
cmd += ["--proxy", proxy]
|
||||
if stun:
|
||||
cmd += ["--stun", stun]
|
||||
if profile:
|
||||
cmd += ["--profile", "--profile-out", str(workdir / ("profile-%s.txt" % tag))]
|
||||
env = dict(os.environ, **(env_extra or {}))
|
||||
kwargs: Dict[str, Any] = {"env": env, "stdout": subprocess.PIPE, "stderr": subprocess.STDOUT}
|
||||
if os.name != "nt":
|
||||
kwargs["start_new_session"] = True
|
||||
proc = subprocess.Popen(cmd, **kwargs)
|
||||
try:
|
||||
text, _ = proc.communicate(timeout=timeout)
|
||||
except subprocess.TimeoutExpired:
|
||||
kill_tree(proc)
|
||||
text, _ = proc.communicate()
|
||||
return {"status": "timeout", "scenario": scenario, "log": (text or b"").decode("utf-8", "replace")[-2000:]}
|
||||
if proc.poll() is None:
|
||||
kill_tree(proc)
|
||||
if not out.exists():
|
||||
return {"status": "no-result", "scenario": scenario, "log": (text or b"").decode("utf-8", "replace")[-2000:]}
|
||||
data = json.loads(out.read_text(encoding="utf-8"))
|
||||
if data.get("status") != "ok":
|
||||
data["log"] = (text or b"").decode("utf-8", "replace")[-1500:]
|
||||
return data
|
||||
|
||||
|
||||
def build_run(data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""One run's spans as a tree, in ms relative to the call."""
|
||||
call0, call1 = data["call_ns"]
|
||||
spans = []
|
||||
for s in data.get("spans", []):
|
||||
if s["t1"] < call0:
|
||||
continue
|
||||
spans.append({"label": s["label"], "t0": (s["t0"] - call0) / 1e6, "t1": (s["t1"] - call0) / 1e6, "thread": s["thread"]})
|
||||
spans.append({"label": "call", "t0": 0.0, "t1": (call1 - call0) / 1e6, "thread": "MainThread"})
|
||||
spans.sort(key=lambda s: (s["t0"], -s["t1"]))
|
||||
stack: List[Dict[str, Any]] = []
|
||||
for s in spans:
|
||||
if s["label"] in BACKGROUND:
|
||||
# not in the line of the caller: it hangs under the step it started inside, and never holds another open
|
||||
holder = [p for p in stack if p["t0"] <= s["t0"] and s["t1"] <= p["t1"] + 1e-9]
|
||||
s["parent"] = holder[-1] if holder else None
|
||||
s["bg"] = True
|
||||
continue
|
||||
while stack and not (stack[-1]["t0"] <= s["t0"] and s["t1"] <= stack[-1]["t1"] + 1e-9):
|
||||
stack.pop()
|
||||
s["parent"] = stack[-1] if stack else None
|
||||
s["bg"] = False
|
||||
stack.append(s)
|
||||
seen: Dict[Tuple[int, str], int] = {}
|
||||
for s in spans:
|
||||
parent = s["parent"]
|
||||
key = (id(parent), s["label"])
|
||||
seen[key] = seen.get(key, 0) + 1
|
||||
s["path"] = ((parent["path"] + "/") if parent else "") + s["label"] + ("" if seen[key] == 1 else "#%d" % seen[key])
|
||||
s["depth"] = (parent["depth"] + 1) if parent else 0
|
||||
for s in spans:
|
||||
kids = [k["t1"] - k["t0"] for k in spans if k["parent"] is s and not k["bg"]]
|
||||
s["self"] = max(0.0, (s["t1"] - s["t0"]) - sum(kids))
|
||||
marks = data.get("marks_ns", {})
|
||||
return {"spans": spans, "call_ms": (call1 - call0) / 1e6,
|
||||
"import_core_ms": marks.get("import_core", 0) / 1e6, "import_wrapper_ms": marks.get("import_wrapper", 0) / 1e6}
|
||||
|
||||
|
||||
def pct(values: List[float], q: float) -> float:
|
||||
v = sorted(values)
|
||||
return v[max(0, math.ceil(q * len(v)) - 1)]
|
||||
|
||||
|
||||
def ancestors(s: Dict[str, Any]) -> set:
|
||||
out = set()
|
||||
while s["parent"] is not None:
|
||||
s = s["parent"]
|
||||
out.add(s["path"])
|
||||
return out
|
||||
|
||||
|
||||
def aggregate(runs: List[Dict[str, Any]]) -> Dict[str, Any]:
|
||||
n = len(runs)
|
||||
by_path: Dict[str, Dict[str, Any]] = {}
|
||||
for r in runs:
|
||||
for s in r["spans"]:
|
||||
e = by_path.setdefault(s["path"], {"path": s["path"], "label": s["label"], "depth": s["depth"], "dur": [], "self": [], "start": [],
|
||||
"threads": set(), "bg": s["bg"], "parent": s["parent"]["path"] if s["parent"] else None})
|
||||
e["dur"].append(s["t1"] - s["t0"])
|
||||
e["self"].append(s["self"])
|
||||
e["start"].append(s["t0"])
|
||||
e["threads"].add(s["thread"])
|
||||
# overlaps: two steps neither of which holds the other, overlapping in half of the runs or more
|
||||
overlap_runs: Dict[Tuple[str, str], int] = {}
|
||||
for r in runs:
|
||||
spans = [s for s in r["spans"] if s["t1"] - s["t0"] >= 2.0]
|
||||
up = {s["path"]: ancestors(s) for s in spans}
|
||||
for i, a in enumerate(spans):
|
||||
for b in spans[i + 1:]:
|
||||
if a["path"] in up[b["path"]] or b["path"] in up[a["path"]]:
|
||||
continue
|
||||
common = min(a["t1"], b["t1"]) - max(a["t0"], b["t0"])
|
||||
if common >= max(1.0, 0.5 * min(a["t1"] - a["t0"], b["t1"] - b["t0"])):
|
||||
key = tuple(sorted((a["path"], b["path"])))
|
||||
overlap_runs[key] = overlap_runs.get(key, 0) + 1
|
||||
parallel: Dict[str, List[str]] = {}
|
||||
for (a, b), count in overlap_runs.items():
|
||||
if count * 2 >= n:
|
||||
parallel.setdefault(a, []).append(b)
|
||||
parallel.setdefault(b, []).append(a)
|
||||
total = [r["import_core_ms"] + r["import_wrapper_ms"] + r["call_ms"] + _goto1(r) for r in runs]
|
||||
total_median = statistics.median(total)
|
||||
steps = []
|
||||
for e in by_path.values():
|
||||
steps.append({
|
||||
"path": e["path"], "label": e["label"], "depth": e["depth"], "parent": e["parent"], "count": len(e["dur"]),
|
||||
"median_ms": round(statistics.median(e["dur"]), 3), "p90_ms": round(pct(e["dur"], 0.9), 3),
|
||||
"min_ms": round(min(e["dur"]), 3), "max_ms": round(max(e["dur"]), 3),
|
||||
"self_median_ms": round(statistics.median(e["self"]), 3),
|
||||
"start_median_ms": round(statistics.median(e["start"]), 3),
|
||||
"pct_total": round(100.0 * statistics.median(e["dur"]) / total_median, 2) if total_median else 0.0,
|
||||
"thread": ",".join(sorted(e["threads"])), "background": e["bg"],
|
||||
"in_parallel_with": sorted(parallel.get(e["path"], [])),
|
||||
})
|
||||
steps.sort(key=lambda x: (x["start_median_ms"], x["depth"]))
|
||||
return {
|
||||
"runs": n,
|
||||
"total_ms": {"median": round(total_median, 1), "p90": round(pct(total, 0.9), 1), "min": round(min(total), 1), "max": round(max(total), 1)},
|
||||
"import_core_ms": _stat([r["import_core_ms"] for r in runs]),
|
||||
"import_wrapper_ms": _stat([r["import_wrapper_ms"] for r in runs]),
|
||||
"call_ms": _stat([r["call_ms"] for r in runs]),
|
||||
"steps": _in_tree_order(steps),
|
||||
}
|
||||
|
||||
|
||||
def _goto1(r: Dict[str, Any]) -> float:
|
||||
for s in r["spans"]:
|
||||
if s["label"] == "goto1":
|
||||
return s["t1"] - s["t0"]
|
||||
return 0.0
|
||||
|
||||
|
||||
def _stat(values: List[float]) -> Dict[str, float]:
|
||||
return {"median": round(statistics.median(values), 2), "p90": round(pct(values, 0.9), 2), "min": round(min(values), 2), "max": round(max(values), 2)}
|
||||
|
||||
|
||||
def _in_tree_order(steps: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
||||
children: Dict[Optional[str], List[Dict[str, Any]]] = {}
|
||||
for s in steps:
|
||||
children.setdefault(s["parent"], []).append(s)
|
||||
out: List[Dict[str, Any]] = []
|
||||
|
||||
def walk(parent: Optional[str]) -> None:
|
||||
for s in sorted(children.get(parent, []), key=lambda x: x["start_median_ms"]):
|
||||
out.append(s)
|
||||
walk(s["path"])
|
||||
|
||||
walk(None)
|
||||
return out
|
||||
|
||||
|
||||
def describe(label: str) -> str:
|
||||
if label.startswith("send:"):
|
||||
return "Juggler: " + label[5:]
|
||||
return DESC.get(label, "")
|
||||
|
||||
|
||||
def markdown(report: Dict[str, Any]) -> str:
|
||||
meta = report["meta"]
|
||||
lines = ["# Map of the launch of invisible (%s)" % meta["system"], ""]
|
||||
lines.append("A measurement, not a verdict: no threshold. Times in milliseconds, median and p90 of %s launches on a warm cache (one warm-up launch that is not counted; every launch in a new interpreter)." % report["config"]["runs"])
|
||||
lines.append("")
|
||||
lines.append("- system: %s, Python %s, %s CPUs" % (meta["platform"], meta["python"], meta["cpus"]))
|
||||
lines.append("- core %s, wrapper %s, engine %s (%s)" % (meta["core"], meta["wrapper"], meta["engine_tag"], meta["engine_upstream"]))
|
||||
lines.append("- run: %s" % meta.get("run_url", "local"))
|
||||
if meta.get("fetch_seconds") is not None:
|
||||
lines.append("- download of the engine on a cold cache (`fetch`, outside the map): %.1f s" % meta["fetch_seconds"])
|
||||
lines.append("- time 0 is the instant before `InvisiblePlaywright(...)`; the total is the import + the call up to the first page + the first goto")
|
||||
if meta.get("unpatched"):
|
||||
lines.append("- steps that could not be measured (targets not found): %s" % "; ".join(sorted(set(meta["unpatched"]))))
|
||||
lines.append("")
|
||||
for name, sc in report["scenarios"].items():
|
||||
lines += _scenario_md("Scenario `%s` (warm cache)" % name, sc)
|
||||
cold = report.get("cold")
|
||||
if cold:
|
||||
lines += _scenario_md("Cold cache, scenario `direct`: ONE launch (a new cache directory: GeoIP database, intermediates list, font files; the engine was there)", cold)
|
||||
for name, why in report.get("failed", {}).items():
|
||||
lines += ["## %s: not measured" % name, "", why, ""]
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
def _scenario_md(title: str, sc: Dict[str, Any]) -> List[str]:
|
||||
out = ["## " + title, ""]
|
||||
t = sc["total_ms"]
|
||||
out.append("Total (import to first goto): median %.0f ms, p90 %.0f ms (min %.0f, max %.0f). Import of the core %.0f ms, of the wrapper %.0f ms; the call up to the first page %.0f ms (p90 %.0f)." % (
|
||||
t["median"], t["p90"], t["min"], t["max"], sc["import_core_ms"]["median"], sc["import_wrapper_ms"]["median"], sc["call_ms"]["median"], sc["call_ms"]["p90"]))
|
||||
out.append("")
|
||||
out.append("| step | what | median ms | p90 ms | % of total | own ms | in parallel with | thread |")
|
||||
out.append("|---|---|---:|---:|---:|---:|---|---|")
|
||||
total = t["median"]
|
||||
out.append("| import of the core and the wrapper | the packages are imported | %.0f | %.0f | %.1f | %.0f | | MainThread |" % (
|
||||
sc["import_core_ms"]["median"] + sc["import_wrapper_ms"]["median"],
|
||||
sc["import_core_ms"]["p90"] + sc["import_wrapper_ms"]["p90"],
|
||||
100.0 * (sc["import_core_ms"]["median"] + sc["import_wrapper_ms"]["median"]) / total if total else 0,
|
||||
sc["import_core_ms"]["median"] + sc["import_wrapper_ms"]["median"]))
|
||||
hidden: Dict[Optional[str], List[float]] = {}
|
||||
visible = []
|
||||
for s in sc["steps"]:
|
||||
if s["median_ms"] < 0.3 and s["label"] != "call":
|
||||
hidden.setdefault(s["parent"], []).append(s["median_ms"])
|
||||
else:
|
||||
visible.append(s)
|
||||
for s in visible:
|
||||
parallel = ", ".join(p.split("/")[-1] for p in s["in_parallel_with"])
|
||||
name = (" " * s["depth"]) + "`" + s["path"].split("/")[-1] + "`"
|
||||
names = s["thread"].split(",")
|
||||
thread = "" if names == ["MainThread"] else ", ".join(names[:2]) + (" +%d" % (len(names) - 2) if len(names) > 2 else "")
|
||||
out.append("| %s | %s | %.1f | %.1f | %.1f | %.1f | %s | %s |" % (
|
||||
name, describe(s["label"]), s["median_ms"], s["p90_ms"], s["pct_total"], s["self_median_ms"], parallel, thread))
|
||||
extra = hidden.get(s["path"])
|
||||
if extra:
|
||||
out.append("| %s+ %d steps under 0.3 ms | | %.1f | | | | | |" % (" " * (s["depth"] + 1), len(extra), sum(extra)))
|
||||
out.append("")
|
||||
return out
|
||||
|
||||
|
||||
def top_three(sc: Dict[str, Any]) -> List[Dict[str, Any]]:
|
||||
"""The three steps with the most time of their own in the line of the caller (not the ones that wait for what is under them)."""
|
||||
cands = [s for s in sc["steps"] if not s["background"] and s["label"] not in ("call",)]
|
||||
return sorted(cands, key=lambda s: -s["self_median_ms"])[:3]
|
||||
|
||||
|
||||
def meta_of(unpatched: List[str]) -> Dict[str, Any]:
|
||||
from invisible_core.seal import active_seal
|
||||
import invisible_core
|
||||
import invisible_playwright
|
||||
seal = active_seal()
|
||||
return {
|
||||
"system": "Windows" if os.name == "nt" else "Linux", "platform": platform.platform(), "python": platform.python_version(),
|
||||
"cpus": os.cpu_count(), "core": getattr(invisible_core, "__version__", "?"), "wrapper": getattr(invisible_playwright, "__version__", "?"),
|
||||
"engine_tag": seal.tag, "engine_upstream": seal.upstream_version,
|
||||
"run_url": os.environ.get("INIT_MAP_RUN_URL") or "locale", "unpatched": unpatched,
|
||||
"date_utc": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
|
||||
"temp": tempfile.gettempdir(),
|
||||
}
|
||||
|
||||
|
||||
def count_browsers() -> int:
|
||||
try:
|
||||
if os.name == "nt":
|
||||
text = subprocess.run(["tasklist", "/FI", "IMAGENAME eq firefox.exe"], capture_output=True, text=True, timeout=30).stdout
|
||||
return text.lower().count("firefox.exe")
|
||||
text = subprocess.run(["pgrep", "-c", "-f", "firefox"], capture_output=True, text=True, timeout=30).stdout
|
||||
return int(text.strip() or 0)
|
||||
except Exception: # noqa: BLE001
|
||||
return -1
|
||||
|
||||
|
||||
def driver(args: argparse.Namespace) -> int:
|
||||
out = Path(args.out)
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
work = Path(tempfile.mkdtemp(prefix="init-map-"))
|
||||
scenarios = [s for s in args.scenarios.split(",") if s]
|
||||
report: Dict[str, Any] = {"config": {"runs": args.runs, "seed": args.seed, "scenarios": scenarios}, "scenarios": {}, "failed": {}}
|
||||
gateway = None
|
||||
proxy = stun = ""
|
||||
exit_ip = ""
|
||||
if "proxy" in scenarios:
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
import _socks_servers
|
||||
# The gateway of the tests refuses the question "what is my exit" (the lab declares it instead of asking the internet). Here the question is the step that
|
||||
# is measured, so the gateway forwards it for real: the TCP discovery goes through it to the services, as it does through a real proxy.
|
||||
_socks_servers.asks_the_world = lambda server, host, port: False
|
||||
try:
|
||||
from invisible_core._geo import discover_egress_ip
|
||||
exit_ip = discover_egress_ip(None)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
print("the exit address of this machine could not be asked (%s): the fake STUN answers its default" % exc)
|
||||
gateway = _socks_servers.coherent(exit_ip=exit_ip) if exit_ip else _socks_servers.coherent()
|
||||
proxy, stun = gateway.server, gateway.measure_servers[0]
|
||||
report["config"]["proxy_gateway"] = "coherent SOCKS5 on loopback (tests/_socks_servers.py), TCP forwarded for real, UDP to a fake STUN that answers the machine's exit"
|
||||
unpatched: List[str] = []
|
||||
try:
|
||||
for name in scenarios:
|
||||
kw = {"proxy": proxy, "stun": stun} if name == "proxy" else {}
|
||||
print("== %s: warm-up" % name, flush=True)
|
||||
warm = run_worker(name, args.seed, work, name + "-warm", **kw)
|
||||
if warm.get("status") != "ok":
|
||||
report["failed"][name] = "the warm-up launch failed: %s %s" % (warm.get("error") or warm.get("status"), (warm.get("log") or warm.get("traceback") or "")[-600:])
|
||||
print(report["failed"][name], flush=True)
|
||||
continue
|
||||
unpatched += warm.get("unpatched", [])
|
||||
good: List[Dict[str, Any]] = []
|
||||
failures = []
|
||||
for i in range(args.runs):
|
||||
data = run_worker(name, args.seed, work, "%s-%02d" % (name, i), **kw)
|
||||
if data.get("status") == "ok":
|
||||
good.append(build_run(data))
|
||||
print("== %s run %d/%d: call %.0f ms" % (name, i + 1, args.runs, good[-1]["call_ms"]), flush=True)
|
||||
else:
|
||||
failures.append(data.get("error") or data.get("status"))
|
||||
print("== %s run %d/%d FAILED: %s" % (name, i + 1, args.runs, failures[-1]), flush=True)
|
||||
if good:
|
||||
report["scenarios"][name] = aggregate(good)
|
||||
report["scenarios"][name]["raw"] = [{"call_ms": r["call_ms"], "spans": [{k: s[k] for k in ("label", "path", "t0", "t1", "thread")} for s in r["spans"]]} for r in good]
|
||||
if failures:
|
||||
report["scenarios"][name]["failed_runs"] = failures
|
||||
else:
|
||||
report["failed"][name] = "no launch succeeded: %s" % failures[:3]
|
||||
if "direct" in scenarios and "direct" in report["scenarios"]:
|
||||
from invisible_core.download import engine_root
|
||||
cold_cache = work / "cold-cache"
|
||||
print("== cold cache (one launch, a new cache directory, the engine kept)", flush=True)
|
||||
data = run_worker("direct", args.seed, work, "cold", env_extra={
|
||||
"INVISIBLE_PLAYWRIGHT_CACHE_DIR": str(cold_cache), "INVISIBLE_PLAYWRIGHT_ENGINE_DIR": str(engine_root())})
|
||||
if data.get("status") == "ok":
|
||||
report["cold"] = aggregate([build_run(data)])
|
||||
else:
|
||||
report["failed"]["cold"] = "the cold-cache launch failed: %s %s" % (data.get("error") or data.get("status"), (data.get("log") or "")[-600:])
|
||||
print("== profile (one launch under cProfile)", flush=True)
|
||||
data = run_worker("direct", args.seed, work, "profile", profile=True)
|
||||
if data.get("status") == "ok" and (work / "profile-profile.txt").exists():
|
||||
shutil.copy(work / "profile-profile.txt", out / ("init-map-profile-%s.txt" % ("windows" if os.name == "nt" else "linux")))
|
||||
finally:
|
||||
if gateway is not None:
|
||||
with contextlib.suppress(Exception):
|
||||
gateway.close()
|
||||
report["meta"] = meta_of(unpatched)
|
||||
report["meta"]["browsers_left"] = count_browsers()
|
||||
for name, sc in list(report["scenarios"].items()) + ([("cold", report["cold"])] if report.get("cold") else []):
|
||||
sc["top_three_by_own_time"] = [{"path": s["path"], "self_median_ms": s["self_median_ms"], "median_ms": s["median_ms"]} for s in top_three(sc)]
|
||||
if os.environ.get("INIT_MAP_FETCH_SECONDS"):
|
||||
report["meta"]["fetch_seconds"] = float(os.environ["INIT_MAP_FETCH_SECONDS"])
|
||||
system = "windows" if os.name == "nt" else "linux"
|
||||
(out / ("init-map-%s.json" % system)).write_text(json.dumps(report, indent=1), encoding="utf-8")
|
||||
text = markdown(report)
|
||||
(out / ("init-map-%s.md" % system)).write_text(text, encoding="utf-8")
|
||||
print(text)
|
||||
shutil.rmtree(work, ignore_errors=True)
|
||||
return 0 if report["scenarios"] else 1
|
||||
|
||||
|
||||
def main() -> int:
|
||||
for stream in (sys.stdout, sys.stderr):
|
||||
with contextlib.suppress(Exception):
|
||||
stream.reconfigure(encoding="utf-8")
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
|
||||
ap.add_argument("--worker", action="store_true")
|
||||
ap.add_argument("--dry", action="store_true", help="local check of the wrapping: the engine is not started (worker only)")
|
||||
ap.add_argument("--scenario", default="direct")
|
||||
ap.add_argument("--scenarios", default="direct,proxy,headless")
|
||||
ap.add_argument("--runs", type=int, default=10)
|
||||
ap.add_argument("--seed", type=int, default=4242)
|
||||
ap.add_argument("--proxy", default="")
|
||||
ap.add_argument("--stun", default="")
|
||||
ap.add_argument("--profile", action="store_true")
|
||||
ap.add_argument("--profile-out", default="")
|
||||
ap.add_argument("--out", default="init-map")
|
||||
args = ap.parse_args()
|
||||
return worker(args) if args.worker else driver(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -1,47 +0,0 @@
|
||||
import socket,json,subprocess,time,os,sys,base64
|
||||
base=os.getcwd(); prof=base+'/prof'; os.makedirs(prof,exist_ok=True)
|
||||
exe=base+'/ex3/core/firefox.exe'
|
||||
open(prof+'/user.js','w').write('user_pref("marionette.port",2828);user_pref("browser.shell.checkDefaultBrowser",false);user_pref("datareporting.policy.dataSubmissionEnabled",false);user_pref("app.update.auto",false);user_pref("app.update.enabled",false);\n')
|
||||
p=subprocess.Popen([exe,'-headless','-marionette','-remote-allow-system-access','-no-remote','-profile',prof,'about:blank'],env=dict(os.environ,MOZ_REMOTE_ALLOW_SYSTEM_ACCESS='1'),stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||
try:
|
||||
s=None
|
||||
for i in range(60):
|
||||
try:
|
||||
s=socket.create_connection(('127.0.0.1',2828),timeout=5);break
|
||||
except Exception: time.sleep(1)
|
||||
f=s.makefile('rwb',buffering=0)
|
||||
def rd():
|
||||
n=b''
|
||||
while True:
|
||||
c=s.recv(1)
|
||||
if c==b':':break
|
||||
n+=c
|
||||
n=int(n);d=b''
|
||||
while len(d)<n: d+=s.recv(n-len(d))
|
||||
return json.loads(d)
|
||||
mid=[0]
|
||||
def cmd(name,params=None):
|
||||
mid[0]+=1
|
||||
m=json.dumps([0,mid[0],name,params or {}]).encode()
|
||||
s.sendall(str(len(m)).encode()+b':'+m)
|
||||
while True:
|
||||
r=rd()
|
||||
if r[0]==1 and r[1]==mid[0]: return r[2] if r[2] else r[3]
|
||||
s.settimeout(60)
|
||||
rd()
|
||||
cmd('WebDriver:NewSession',{'capabilities':{}})
|
||||
h=cmd('WebDriver:GetWindowHandles'); cmd('WebDriver:SwitchToWindow',{'handle':h[0]})
|
||||
cmd('WebDriver:Navigate',{'url':'data:text/html,<body><p id=p>text</p>'})
|
||||
js="""
|
||||
const fonts=['menu','caption','icon','message-box','small-caption','status-bar','system-ui'];
|
||||
const colors=['Canvas','CanvasText','LinkText','VisitedText','ActiveText','ButtonFace','ButtonText','ButtonBorder','Field','FieldText','GrayText','Highlight','HighlightText','Mark','MarkText','SelectedItem','SelectedItemText','AccentColor','AccentColorText','ActiveBorder','ActiveCaption','AppWorkspace','Background','ButtonHighlight','ButtonShadow','CaptionText','InactiveBorder','InactiveCaption','InactiveCaptionText','InfoBackground','InfoText','Menu','MenuText','Scrollbar','ThreeDDarkShadow','ThreeDFace','ThreeDHighlight','ThreeDLightShadow','ThreeDShadow','Window','WindowFrame','WindowText'];
|
||||
const o={fonts:{},light:{},dark:{},selection:{}};
|
||||
for(const f of fonts){const d=document.createElement('div');d.style.font=f==='system-ui'?'16px system-ui':f;document.body.appendChild(d);const c=getComputedStyle(d);o.fonts[f]={family:c.fontFamily,size:c.fontSize,weight:c.fontWeight,style:c.fontStyle,stretch:c.fontStretch};d.remove();}
|
||||
for(const sch of ['light','dark']){for(const k of colors){const d=document.createElement('div');d.style.colorScheme=sch;d.style.color=k;d.style.backgroundColor=k;document.body.appendChild(d);o[sch][k]=getComputedStyle(d).color;d.remove();}
|
||||
const d=document.createElement('div');d.style.colorScheme=sch;d.textContent='x';document.body.appendChild(d);const c=getComputedStyle(d,'::selection');o.selection[sch]={color:c.color,bg:c.backgroundColor};d.remove();}
|
||||
return o;"""
|
||||
r=cmd('WebDriver:ExecuteScript',{'script':js,'args':[]})
|
||||
json.dump(r['value'] if 'value' in r else r,open(base+'/retail_theme.json','w'),indent=1)
|
||||
print(json.dumps(r)[:1500])
|
||||
finally:
|
||||
subprocess.run(['taskkill','/F','/T','/PID',str(p.pid)],capture_output=True)
|
||||
@@ -1,218 +0,0 @@
|
||||
"""The expected values of tests/test_css_calc_is_windows_e2e.py.
|
||||
|
||||
Run it with `python -I`. Two steps, because a number is only worth testing if
|
||||
the two C libraries give a different page-visible text for it:
|
||||
|
||||
python -I scripts/ucrt_css_calc.py dump OUT # on Windows: ucrtbase.dll's f32 functions
|
||||
python -I scripts/ucrt_css_calc.py dump OUT # on Linux: the host's libm
|
||||
python -I scripts/ucrt_css_calc.py pick WIN LINUX tests/data/ucrt_css_calc.txt
|
||||
|
||||
`dump` computes, for a fixed grid of inputs, what the style engine (Servo's
|
||||
calc.rs) makes of ``calc(1px * sin(x))`` and the others, and the text it then
|
||||
serializes. The style engine does every step in f32 (CSSFloat): the library
|
||||
function is the f32 one (sinf, cosf, tanf, asinf, acosf, atanf, atan2f, expf,
|
||||
logf, powf), an angle is converted to degrees with one f32 multiplication, and
|
||||
a number is written by cssparser's dtoa_short: the shortest decimal that
|
||||
reads back as that f32, rounded half up to 6 significant digits. So two
|
||||
libraries whose results differ in the last f32 bit only show on the page when
|
||||
that bit moves the 6th digit - which `pick` looks for.
|
||||
|
||||
`pick` keeps every input whose text differs between the two dumps, and a few
|
||||
that do not (the control: the same text from both libraries), in the format
|
||||
the test reads:
|
||||
|
||||
<fn> <args...> <text on Windows>
|
||||
|
||||
The reference is ucrtbase's FMA3 code path, the one every Windows 11 CPU runs
|
||||
(the same one idwr_math reproduces); the SSE2 fallback of older CPUs can differ in
|
||||
the last bit and is not what a page on Windows 11 reads.
|
||||
|
||||
Inputs are exact in f32 (multiples of a power of two), so the page and this
|
||||
script read the same number whatever the CSS parser does with decimals.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ctypes
|
||||
import math
|
||||
import struct
|
||||
import sys
|
||||
from decimal import ROUND_HALF_UP, Decimal
|
||||
from pathlib import Path
|
||||
|
||||
#: Rust's f32::to_degrees multiplier, as an f32.
|
||||
RAD_TO_DEG = struct.unpack("<f", struct.pack("<f", 57.2957795130823208767981548141051703))[0]
|
||||
|
||||
#: How many differing inputs of each function `pick` keeps, and how many of the
|
||||
#: ones that agree.
|
||||
KEEP_DIFFERENT = 6
|
||||
KEEP_SAME = 3
|
||||
|
||||
|
||||
def f32(x: float) -> float:
|
||||
return struct.unpack("<f", struct.pack("<f", x))[0]
|
||||
|
||||
|
||||
def load_libm():
|
||||
if sys.platform == "win32":
|
||||
lib = ctypes.CDLL("ucrtbase.dll")
|
||||
else:
|
||||
lib = ctypes.CDLL("libm.so.6")
|
||||
funcs = {}
|
||||
for name, nargs in (("sinf", 1), ("cosf", 1), ("tanf", 1), ("asinf", 1), ("acosf", 1),
|
||||
("atanf", 1), ("atan2f", 2), ("expf", 1), ("logf", 1), ("powf", 2)):
|
||||
fn = getattr(lib, name)
|
||||
fn.restype = ctypes.c_float
|
||||
fn.argtypes = [ctypes.c_float] * nargs
|
||||
funcs[name] = fn
|
||||
return funcs
|
||||
|
||||
|
||||
def shortest_f32(x: float) -> str:
|
||||
"""The shortest decimal text that reads back as this f32."""
|
||||
for digits in range(1, 10):
|
||||
text = "%.*e" % (digits - 1, x)
|
||||
if f32(float(text)) == x:
|
||||
return text
|
||||
return "%.8e" % x
|
||||
|
||||
|
||||
def serialize(x: float) -> str:
|
||||
"""cssparser's number text for an f32: 6 significant digits, half up,
|
||||
no trailing zeros, no exponent in the range the grid stays in."""
|
||||
if x == 0:
|
||||
return "0"
|
||||
d = Decimal(shortest_f32(x))
|
||||
exp = d.adjusted()
|
||||
q = d.quantize(Decimal(1).scaleb(exp - 5), rounding=ROUND_HALF_UP)
|
||||
text = format(q.normalize(), "f")
|
||||
return "0" if text in ("-0", "") else text
|
||||
|
||||
|
||||
def decimal(k: int, shift: int) -> str:
|
||||
"""k / 2**shift as an exact decimal text."""
|
||||
d = Decimal(k) / Decimal(2 ** shift)
|
||||
return format(d.normalize(), "f")
|
||||
|
||||
|
||||
def grid():
|
||||
"""(fn, args as texts) for every case of the dump."""
|
||||
out = []
|
||||
for fn, lim, shift in (("sin", 16, 10), ("cos", 16, 10), ("tan", 16, 10)):
|
||||
for k in range(-lim << shift, (lim << shift) + 1):
|
||||
out.append((fn, [decimal(k, shift)]))
|
||||
# Finer, over the stretch where the functions bend the most.
|
||||
for k in range(-(4 << 13), (4 << 13) + 1):
|
||||
out.append(("tan", [decimal(k, 13)]))
|
||||
for k in range(-(8 << 12), (8 << 12) + 1):
|
||||
out.append(("atan", [decimal(k, 12)]))
|
||||
for k in range(-(4 << 12), (4 << 12) + 1):
|
||||
out.append(("exp", [decimal(k, 12)]))
|
||||
for k in range(1, 32 * 1024 + 1):
|
||||
out.append(("log", [decimal(k, 10)]))
|
||||
for a in range(-128, 129):
|
||||
for b in range(-128, 129):
|
||||
if a or b:
|
||||
out.append(("atan2", [decimal(a, 6), decimal(b, 6)]))
|
||||
for k in range(-4096, 4097):
|
||||
out.append(("asin", [decimal(k, 12)]))
|
||||
out.append(("acos", [decimal(k, 12)]))
|
||||
for k in range(-8 * 512, 8 * 512 + 1):
|
||||
out.append(("atan", [decimal(k, 9)]))
|
||||
for a in range(-64, 65):
|
||||
for b in range(-64, 65):
|
||||
if a or b:
|
||||
out.append(("atan2", [decimal(a, 4), decimal(b, 4)]))
|
||||
for k in range(-10 * 256, 10 * 256 + 1):
|
||||
out.append(("exp", [decimal(k, 8)]))
|
||||
for k in range(1, 64 * 64 + 1):
|
||||
out.append(("log", [decimal(k, 6)]))
|
||||
for a in range(2, 513):
|
||||
for b in (2, 3, 5, 7, 10):
|
||||
out.append(("log", [decimal(a, 3), str(b)]))
|
||||
for a in range(-32, 33):
|
||||
for b in range(-32, 33):
|
||||
out.append(("hypot", [decimal(a * 3, 4), decimal(b * 5, 4)]))
|
||||
for a in range(4, 257):
|
||||
for b in range(-64, 65):
|
||||
out.append(("pow", [decimal(a, 4), decimal(b, 4)]))
|
||||
return out
|
||||
|
||||
|
||||
def evaluate(lib, fn, args):
|
||||
"""(text, unit) the page shows, from f32 steps."""
|
||||
v = [f32(float(a)) for a in args]
|
||||
if fn in ("sin", "cos", "tan", "exp"):
|
||||
return serialize(f32(lib[fn + "f"](v[0]))), "px"
|
||||
if fn == "log":
|
||||
if len(v) == 1:
|
||||
return serialize(f32(lib["logf"](v[0]))), "px"
|
||||
return serialize(f32(f32(lib["logf"](v[0])) / f32(lib["logf"](v[1])))), "px"
|
||||
if fn == "hypot":
|
||||
# powi(2) is a product, the sum is f32, sqrt is exact in IEEE: no library
|
||||
# function here, so no difference between the two - the control.
|
||||
return serialize(f32(math.sqrt(f32(f32(v[0] * v[0]) + f32(v[1] * v[1]))))), "px"
|
||||
if fn == "pow":
|
||||
return serialize(f32(lib["powf"](v[0], v[1]))), "px"
|
||||
if fn in ("asin", "acos", "atan"):
|
||||
return serialize(f32(f32(lib[fn + "f"](v[0])) * RAD_TO_DEG)), "deg"
|
||||
if fn == "atan2":
|
||||
return serialize(f32(f32(lib["atan2f"](v[0], v[1])) * RAD_TO_DEG)), "deg"
|
||||
raise ValueError(fn)
|
||||
|
||||
|
||||
def dump(out: Path) -> None:
|
||||
lib = load_libm()
|
||||
lines = []
|
||||
for fn, args in grid():
|
||||
text, unit = evaluate(lib, fn, args)
|
||||
if text in ("nan", "inf", "-inf") or "e" in text.lower():
|
||||
continue
|
||||
lines.append("%s %s %s%s" % (fn, " ".join(args), text, unit))
|
||||
out.write_text("\n".join(lines) + "\n")
|
||||
print("wrote %s: %d cases (%s)" % (out, len(lines), sys.platform))
|
||||
|
||||
|
||||
def read(path: Path) -> dict:
|
||||
cases = {}
|
||||
for line in path.read_text().splitlines():
|
||||
parts = line.split()
|
||||
cases[tuple(parts[:-1])] = parts[-1]
|
||||
return cases
|
||||
|
||||
|
||||
def pick(win: Path, linux: Path, out: Path) -> None:
|
||||
a, b = read(win), read(linux)
|
||||
chosen = ["# Expected text of getComputedStyle for calc(1px * f(args)) (word-spacing)",
|
||||
"# and of rotate: f(args) for the angle functions, from ucrtbase.dll's f32",
|
||||
"# functions. Generated by scripts/ucrt_css_calc.py (python -I) - do not edit.",
|
||||
"# <fn> <args...> <text on Windows>"]
|
||||
stats = []
|
||||
for fn in ("sin", "cos", "tan", "asin", "acos", "atan", "atan2", "exp", "log", "pow", "hypot"):
|
||||
keys = sorted(k for k in a if k[0] == fn and k in b)
|
||||
different = [k for k in keys if a[k] != b[k]]
|
||||
same = [k for k in keys if a[k] == b[k]]
|
||||
# Spread over the list, not the first ones.
|
||||
step_d = max(1, len(different) // KEEP_DIFFERENT)
|
||||
quarter = max(1, len(same) // 4)
|
||||
take = different[::step_d][:KEEP_DIFFERENT] + same[quarter::quarter][:KEEP_SAME]
|
||||
stats.append("%s: %d of %d differ" % (fn, len(different), len(keys)))
|
||||
for k in take:
|
||||
chosen.append("%s %s" % (" ".join(k), a[k]))
|
||||
out.write_text("\n".join(chosen) + "\n")
|
||||
print("\n".join(stats))
|
||||
print("wrote %s" % out)
|
||||
|
||||
|
||||
def main(argv) -> int:
|
||||
if len(argv) == 3 and argv[1] == "dump":
|
||||
dump(Path(argv[2]))
|
||||
elif len(argv) == 5 and argv[1] == "pick":
|
||||
pick(Path(argv[2]), Path(argv[3]), Path(argv[4]))
|
||||
else:
|
||||
print(__doc__)
|
||||
return 2
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -6261,7 +6261,11 @@ class BrowserTypeDispatcher(Dispatcher):
|
||||
# profile sees them; without it, the language alone decides.
|
||||
keyboard_layout = prefs.pop(KEYBOARD_LAYOUT_PREF, None) or profiles_pref(
|
||||
prefs.get("intl.accept_languages") or "")
|
||||
write_user_js(profile, prefs)
|
||||
# The security state is placed in the profile by this one call, FOR THE ENGINE THIS LAUNCH RUNS: a generation is tied to its
|
||||
# build id, so the core is told which binary it is (`engine=`). `engine_argv` is NOT passed: the line this launch runs is
|
||||
# headed or headless, with `-juggler-pipe` and the caller's `args`, none of which a generation may use (it is its own
|
||||
# headless run on a work profile); the core's default line for the engine is the right one.
|
||||
write_user_js(profile, prefs, engine=executable)
|
||||
# ⛔ THE CALLER'S TIMEOUT, not ours. `launch(timeout=)` is a
|
||||
# documented option and this server ignored it, so a caller who
|
||||
# shortened it waited the full built-in 60 s anyway - and one who
|
||||
|
||||
@@ -38,7 +38,7 @@ import argparse
|
||||
import sys
|
||||
|
||||
from . import __version__
|
||||
from invisible_core import BINARY_VERSION, FIREFOX_UPSTREAM_VERSION, update_intermediates
|
||||
from invisible_core import BINARY_VERSION, FIREFOX_UPSTREAM_VERSION, update_security_state
|
||||
from invisible_core.download import cache_root, engine_root, ensure_binary # noqa: F401
|
||||
|
||||
from ._pin import (
|
||||
@@ -86,13 +86,14 @@ def _cmd_fetch(_args: argparse.Namespace) -> int:
|
||||
except Exception as e:
|
||||
print(f"error: {e}", file=sys.stderr)
|
||||
return 1
|
||||
# The list of preloaded intermediate certificates the core declares to the engine: `fetch` is where the user asks for what is current, so it looks for a
|
||||
# newer list EVERY time (a small request to the changes feed; the list is downloaded only when it changed) and puts it in the cache. A launch only reads the
|
||||
# cache. A failure here is a warning and nothing more: it changes neither the exit code nor the last line (`update_intermediates` itself does not raise).
|
||||
# The security state the core copies into every profile (the intermediates, OneCRL and the CRLite filters a retail Firefox has from its first second): `fetch` is
|
||||
# where the user asks for what is current, so it looks for newer data EVERY time (a small request to the changes feed; a collection is downloaded only when it
|
||||
# changed), has THIS engine generate the state from it and puts the result in the cache. A launch only copies from the cache. A failure here is a warning and
|
||||
# nothing more: it changes neither the exit code nor the last line (`update_security_state` itself does not raise).
|
||||
try:
|
||||
update_intermediates()
|
||||
update_security_state(engine=path)
|
||||
except Exception as e:
|
||||
print(f"warning: the intermediates list could not be fetched: {e}", file=sys.stderr)
|
||||
print(f"warning: the security state could not be fetched: {e}", file=sys.stderr)
|
||||
# Last line, alone, so `$(invisible-playwright fetch)` is a path.
|
||||
print(path)
|
||||
return 0
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
"""What the canvas-reader e2e tests share: one scene, the readers of a canvas, the page that serves them, and the comparison of bytes.
|
||||
|
||||
The engine applies its canvas noise (``gfx::StealthProjectPixels``) to a WebGL or WebGPU canvas when a PAGE reads it, and only then. These
|
||||
tests ask whether every road by which a page reads such a canvas gives the same bytes, so they need one scene that the noise touches, the same
|
||||
scene drawn through every API, and the same list of readers for every kind of canvas.
|
||||
|
||||
THE SCENE. Ten triangles with random vertex colours (a fixed generator, the same numbers in every launch and in every API: ``starVertices``)
|
||||
over a white clear. The noise touches only an edge pixel whose 3x3 neighbourhood holds a THIRD colour besides a blend of two, so a flat clear
|
||||
is never touched; ten overlapping triangles make hundreds of such junctions, and the chance that two reads of a noised and an un-noised canvas
|
||||
differ nowhere is nil. The 2D twin (``draw2D``) draws the same triangles with translucent fills and a shadow: a canvas that WOULD be noised if
|
||||
the 2D road were projected, and is not (a 2D canvas reads as drawn).
|
||||
|
||||
THE CONTROL. ``noised=False`` declares ``zoom.stealth.canvas.substitute_pixels`` false: the canvas noise is declared off and NOTHING else changes
|
||||
(same declared GPU, same antialiasing, same raster), so the difference between the two launches is the noise and nothing else, which is why
|
||||
the tests may ask that it touches only the low bit of R, G and B. (A launch with ``hw_seed`` 0 would also change the declared GPU.)
|
||||
|
||||
THE READERS (``readersOf``): the canvas's own read (``readPixels`` / ``getImageData``), ``drawImage`` onto a 2D canvas, ``createImageBitmap``, the
|
||||
PNG of ``toDataURL`` / ``toBlob`` / ``convertToBlob`` (decoded here, never by the browser, so the browser's image decoding is not a variable)
|
||||
and, for an OffscreenCanvas, ``transferToImageBitmap``. Every entry is the base64 of RGBA bytes, top row first; a name that ends in ``.png`` is a
|
||||
PNG file.
|
||||
|
||||
Nothing here waits on a clock: the page's async functions end on events, and the one wait that needs polling (``wait_until``) ends on a condition.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import contextlib
|
||||
import json
|
||||
import threading
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
from typing import Dict, List
|
||||
|
||||
import _page_bytes as pb
|
||||
from _servers import LocalServer
|
||||
|
||||
#: The side of every canvas of the scene.
|
||||
SIZE = 128
|
||||
#: A noise seed that no runner has.
|
||||
HW_SEED = 12345
|
||||
#: The persona (identity) seed of every launch: not the noise seed.
|
||||
SEED = 7
|
||||
|
||||
#: The JS of the scene and of the readers. Plain script: it runs in the page and, as the head of a worker's source, in a worker (no ``document`` in it).
|
||||
SHARED_JS = r"""
|
||||
const W = 128, H = 128;
|
||||
|
||||
// ten triangles, 30 vertices of (x, y, r, g, b), x and y in clip space: a fixed generator, so every launch and every API draws the same scene
|
||||
function starVertices() {
|
||||
const v = []; let s = 12345;
|
||||
const rnd = () => (s = (s * 1103515245 + 12345) & 0x7fffffff) / 0x7fffffff;
|
||||
for (let i = 0; i < 30; i++) v.push(rnd() * 1.8 - 0.9, rnd() * 1.8 - 0.9, rnd(), rnd(), rnd());
|
||||
return v;
|
||||
}
|
||||
|
||||
function drawGL(canvas, kind) {
|
||||
const gl = canvas.getContext(kind || 'webgl', {preserveDrawingBuffer: true, antialias: true});
|
||||
if (!gl) throw new Error('no ' + (kind || 'webgl') + ' context');
|
||||
const shader = (type, src) => {
|
||||
const s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s);
|
||||
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s));
|
||||
return s;
|
||||
};
|
||||
const pr = gl.createProgram();
|
||||
gl.attachShader(pr, shader(gl.VERTEX_SHADER, 'attribute vec2 p; attribute vec3 c; varying vec3 v; void main(){v=c;gl_Position=vec4(p,0.,1.);}'));
|
||||
gl.attachShader(pr, shader(gl.FRAGMENT_SHADER, 'precision mediump float; varying vec3 v; void main(){gl_FragColor=vec4(v,1.);}'));
|
||||
gl.linkProgram(pr);
|
||||
if (!gl.getProgramParameter(pr, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(pr));
|
||||
gl.useProgram(pr);
|
||||
const b = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, b);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(starVertices()), gl.STATIC_DRAW);
|
||||
const pl = gl.getAttribLocation(pr, 'p'), cl = gl.getAttribLocation(pr, 'c');
|
||||
gl.enableVertexAttribArray(pl); gl.vertexAttribPointer(pl, 2, gl.FLOAT, false, 20, 0);
|
||||
gl.enableVertexAttribArray(cl); gl.vertexAttribPointer(cl, 3, gl.FLOAT, false, 20, 8);
|
||||
gl.clearColor(1, 1, 1, 1); gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 30);
|
||||
gl.finish();
|
||||
return gl;
|
||||
}
|
||||
|
||||
// the same ten triangles on a 2D canvas, with translucent fills and a shadow
|
||||
function draw2D(x) {
|
||||
x.fillStyle = '#fff'; x.fillRect(0, 0, W, H);
|
||||
const v = starVertices();
|
||||
for (let t = 0; t < 10; t++) {
|
||||
const q = v.slice(t * 15, t * 15 + 15);
|
||||
x.fillStyle = 'rgba(' + Math.round(q[2] * 255) + ',' + Math.round(q[3] * 255) + ',' + Math.round(q[4] * 255) + ',' + (t % 2 ? 0.7 : 1) + ')';
|
||||
x.beginPath();
|
||||
for (let k = 0; k < 3; k++) {
|
||||
const px = (q[k * 5] + 1) / 2 * W, py = (1 - q[k * 5 + 1]) / 2 * H;
|
||||
if (k) x.lineTo(px, py); else x.moveTo(px, py);
|
||||
}
|
||||
x.closePath(); x.fill();
|
||||
}
|
||||
x.shadowColor = 'rgba(0, 0, 0, 0.6)'; x.shadowBlur = 4; x.shadowOffsetX = 3; x.shadowOffsetY = 2;
|
||||
x.fillStyle = 'rgb(200, 120, 20)'; x.fillRect(40, 40, 30, 30);
|
||||
}
|
||||
|
||||
// readPixels, top row first (readPixels gives the bottom row first)
|
||||
function readGL(gl) {
|
||||
const buf = new Uint8Array(W * H * 4);
|
||||
gl.readPixels(0, 0, W, H, gl.RGBA, gl.UNSIGNED_BYTE, buf);
|
||||
const out = new Uint8Array(W * H * 4);
|
||||
for (let y = 0; y < H; y++) out.set(buf.subarray((H - 1 - y) * W * 4, (H - y) * W * 4), y * W * 4);
|
||||
return out;
|
||||
}
|
||||
|
||||
function readCtx(x) { return new Uint8Array(x.getImageData(0, 0, W, H).data); }
|
||||
|
||||
function b64(u8) {
|
||||
let s = '';
|
||||
for (let i = 0; i < u8.length; i += 8192) s += String.fromCharCode.apply(null, u8.subarray(i, i + 8192));
|
||||
return btoa(s);
|
||||
}
|
||||
|
||||
function blobB64(blob) {
|
||||
return new Promise((ok, bad) => {
|
||||
const r = new FileReader();
|
||||
r.onload = () => ok(String(r.result).split(',')[1]);
|
||||
r.onerror = () => bad(new Error('FileReader failed'));
|
||||
r.readAsDataURL(blob);
|
||||
});
|
||||
}
|
||||
|
||||
// what a fresh 2D canvas (made by `make`) holds after `draw(context)`
|
||||
function pixelsOf(make, draw) {
|
||||
const c = make(); c.width = W; c.height = H;
|
||||
const x = c.getContext('2d'); draw(x);
|
||||
return readCtx(x);
|
||||
}
|
||||
|
||||
// every road by which a page turns `src` into bytes: {name: base64 of RGBA, top row first}; a name ending in .png is a PNG file
|
||||
async function readersOf(src, direct, make, withTransfer) {
|
||||
const out = {direct: b64(direct())};
|
||||
out.drawImage = b64(pixelsOf(make, x => x.drawImage(src, 0, 0)));
|
||||
const bm = await createImageBitmap(src);
|
||||
out.createImageBitmap = b64(pixelsOf(make, x => x.drawImage(bm, 0, 0)));
|
||||
bm.close();
|
||||
if (src.toDataURL) {
|
||||
out['toDataURL.png'] = src.toDataURL('image/png').split(',')[1];
|
||||
out['toBlob.png'] = await blobB64(await new Promise(r => src.toBlob(r, 'image/png')));
|
||||
} else {
|
||||
out['convertToBlob.png'] = await blobB64(await src.convertToBlob({type: 'image/png'}));
|
||||
}
|
||||
if (withTransfer && src.transferToImageBitmap) { // last: it empties the canvas
|
||||
const tb = src.transferToImageBitmap();
|
||||
out.transferToImageBitmap = b64(pixelsOf(make, x => x.drawImage(tb, 0, 0)));
|
||||
tb.close();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
const makeElement = () => document.createElement('canvas');
|
||||
const makeOffscreen = () => new OffscreenCanvas(W, H);
|
||||
"""
|
||||
|
||||
|
||||
def page_html(page_js: str) -> str:
|
||||
"""A page whose script holds SHARED_JS, ``WORKER_LIB`` (the same text, for the source of a worker) and the page's own functions."""
|
||||
return ("<!doctype html><meta charset=utf-8><title>canvas readers</title><body><script>\n" + SHARED_JS
|
||||
+ "\nconst WORKER_LIB = " + json.dumps(SHARED_JS) + ";\n" + page_js + "\n</script></body>")
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def serve(html: str):
|
||||
"""The page on a local http origin (a secure context, and a site a canvas has a principal on); port 0, the one the system gave."""
|
||||
body = html.encode("utf-8")
|
||||
|
||||
class Page(BaseHTTPRequestHandler):
|
||||
timeout = 5
|
||||
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/html; charset=utf-8")
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
httpd = LocalServer(("127.0.0.1", 0), Page)
|
||||
threading.Thread(target=httpd.serve_forever, daemon=True).start()
|
||||
try:
|
||||
yield "http://127.0.0.1:%d/" % httpd.server_address[1]
|
||||
finally:
|
||||
httpd.shutdown()
|
||||
httpd.server_close()
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def launched(firefox_binary, html: str, noised: bool = True, pin=None, viewport=None):
|
||||
"""The page open in a browser of the product: the engine on (a declared noise seed no runner has), and, when ``noised`` is false, the
|
||||
canvas noise declared off and nothing else. One browser, closed on leaving."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {"zoom.stealth.fpp.hw_seed": HW_SEED}
|
||||
if not noised:
|
||||
prefs["zoom.stealth.canvas.substitute_pixels"] = False
|
||||
with serve(html) as url:
|
||||
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True, extra_prefs=prefs, pin=pin) as browser:
|
||||
context = browser.new_context(viewport=viewport) if viewport else browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto(url, wait_until="load", timeout=60_000)
|
||||
yield page
|
||||
|
||||
|
||||
def run(page, call: str, deadline_s: int = 120):
|
||||
"""Runs the page's async function ``call`` (a JS expression that gives a promise) to its end and returns what it resolved to. The end is
|
||||
the promise's own: the deadline is only how long a lost event is allowed before the test says so."""
|
||||
page.evaluate("() => { window.DONE = false; window.ERR = null; window.R = null;"
|
||||
" Promise.resolve().then(() => %s).then(r => { window.R = r; window.DONE = true; },"
|
||||
" e => { window.ERR = String((e && e.stack) || e); window.DONE = true; }); }" % call)
|
||||
page.wait_for_function("window.DONE === true", timeout=deadline_s * 1000)
|
||||
err = page.evaluate("window.ERR")
|
||||
assert err is None, "the page could not run %s: %s" % (call, err)
|
||||
return page.evaluate("window.R")
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------ bytes
|
||||
|
||||
def rgba_of_image(image) -> bytes:
|
||||
"""RGBA bytes of an ``_page_bytes.unfiltered`` image (RGB gets an opaque alpha)."""
|
||||
data, channels = image["data"], image["channels"]
|
||||
if channels == 4:
|
||||
return data
|
||||
assert channels == 3, "a PNG of %d channels is not read here" % channels
|
||||
out = bytearray()
|
||||
for i in range(0, len(data), 3):
|
||||
out += data[i:i + 3] + b"\xff"
|
||||
return bytes(out)
|
||||
|
||||
|
||||
def rgba(name: str, value: str) -> bytes:
|
||||
"""The RGBA bytes of a reader's entry: its base64, or, for a PNG, the pixels it decodes to."""
|
||||
raw = base64.b64decode(value)
|
||||
if name.endswith(".png"):
|
||||
image = pb.unfiltered(raw)
|
||||
assert (image["w"], image["h"]) == (SIZE, SIZE), "%s is a %dx%d image, not %dx%d" % (name, image["w"], image["h"], SIZE, SIZE)
|
||||
return rgba_of_image(image)
|
||||
assert len(raw) == SIZE * SIZE * 4, "%s holds %d bytes, not %d" % (name, len(raw), SIZE * SIZE * 4)
|
||||
return raw
|
||||
|
||||
|
||||
def decode(readers: Dict[str, str], prefix: str = "") -> Dict[str, bytes]:
|
||||
return {prefix + name: rgba(name, value) for name, value in readers.items()}
|
||||
|
||||
|
||||
def differing_pixels(a: bytes, b: bytes) -> int:
|
||||
assert len(a) == len(b), "two images of %d and %d bytes" % (len(a), len(b))
|
||||
return sum(1 for i in range(0, len(a), 4) if a[i:i + 4] != b[i:i + 4])
|
||||
|
||||
|
||||
def only_the_low_bit_of_rgb(a: bytes, b: bytes) -> List[int]:
|
||||
"""The pixels where ``a`` and ``b`` differ by more than the low bit of R, G and B (or in alpha): the noise writes nothing else."""
|
||||
return [i // 4 for i in range(0, len(a), 4)
|
||||
if (a[i] | 1, a[i + 1] | 1, a[i + 2] | 1, a[i + 3]) != (b[i] | 1, b[i + 1] | 1, b[i + 2] | 1, b[i + 3])]
|
||||
|
||||
|
||||
def distinct_colours(a: bytes) -> int:
|
||||
return len({a[i:i + 4] for i in range(0, len(a), 4)})
|
||||
|
||||
|
||||
def disagreements(readers: Dict[str, bytes], reference: str) -> List[str]:
|
||||
"""The readers whose bytes are not those of ``reference``, each with how many pixels differ."""
|
||||
want = readers[reference]
|
||||
return ["%s (%d pixels differ)" % (name, differing_pixels(want, got)) for name, got in readers.items() if got != want]
|
||||
|
||||
|
||||
def assert_agree(what: str, readers: Dict[str, bytes], reference: str = "direct") -> None:
|
||||
bad = disagreements(readers, reference)
|
||||
assert not bad, (
|
||||
"%s: the readers %s do not read what %s reads (readers: %s). Every road by which a page reads a canvas gives the same bytes "
|
||||
"when it is the same canvas" % (what, "; ".join(bad), reference, ", ".join(sorted(readers))))
|
||||
@@ -1,115 +0,0 @@
|
||||
"""What the canvas text e2e tests share: the persona pin, the bundled fonts and the server.
|
||||
|
||||
tests/test_canvas_text_is_windows_e2e.py (black text, 342 cases) and
|
||||
tests/test_canvas_text_colors_and_cleartype_is_windows_e2e.py (coloured text and the
|
||||
ClearType keys) both compare the RGBA bytes of a canvas drawn by the engine with the ones
|
||||
retail Firefox 159.0 on Windows drew, for pages served on localhost with the engine's own
|
||||
bundled font files. This module holds what the two do the same way.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import http.server
|
||||
import json
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
DATA = Path(__file__).parent / "data" / "canvas_text_ref"
|
||||
|
||||
#: What the reference's ``cleartype`` field says the retail machine had: FontSmoothing 2 with
|
||||
#: FontSmoothingType 2 is ClearType (system text quality 5). The other tuning values are an
|
||||
#: untuned Windows machine's (gamma 1.8, contrast 1.0, level 1.0), which refs.json does not
|
||||
#: record.
|
||||
UNTUNED = {"font.cleartype_gamma": 1800, "font.cleartype_contrast": 100,
|
||||
"font.cleartype_level": 100}
|
||||
|
||||
|
||||
def pin(refs):
|
||||
"""The prefs that make the engine the machine ``refs["cleartype"]`` describes."""
|
||||
ct = refs["cleartype"]
|
||||
smoothing, kind = str(ct["FontSmoothing"]), str(ct["FontSmoothingType"])
|
||||
if smoothing == "2" and kind in ("2", "0x2"):
|
||||
quality = 5
|
||||
elif smoothing == "2":
|
||||
quality = 4
|
||||
else:
|
||||
quality = 0
|
||||
return {"screen.dpr": 1.0, "font.system_text_quality": quality, **UNTUNED}
|
||||
|
||||
|
||||
def bundle_font(fonts_dir, entry):
|
||||
"""The bundled file a reference entry names."""
|
||||
return Path(fonts_dir) / entry["bundle_file"]
|
||||
|
||||
|
||||
def wrong_fonts(fonts_dir, entries):
|
||||
"""One line for each reference font whose bundled file is not the one measured."""
|
||||
wrong = []
|
||||
for e in entries:
|
||||
f = bundle_font(fonts_dir, e)
|
||||
got = hashlib.sha256(f.read_bytes()).hexdigest() if f.is_file() else None
|
||||
if got != e["sha256"]:
|
||||
wrong.append("%s: the engine's %s has sha256 %s, the reference was made with %s"
|
||||
% (e["family"], f.name, got, e["sha256"]))
|
||||
return wrong
|
||||
|
||||
|
||||
def serve(fonts_dir, entries, pages):
|
||||
"""``pages`` (url path -> HTML bytes) and, under /bundle/<name>, the engine's bundled
|
||||
font files. Returns the running server; the caller shuts it down."""
|
||||
by_url = {"/bundle/" + e["bundle_file"]: bundle_font(fonts_dir, e) for e in entries}
|
||||
|
||||
class _H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
path = self.path.split("?")[0]
|
||||
if path in pages:
|
||||
body, kind = pages[path], "text/html"
|
||||
elif path in by_url and by_url[path].is_file():
|
||||
body, kind = by_url[path].read_bytes(), "font/ttf"
|
||||
else:
|
||||
self.send_error(404)
|
||||
return
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", kind)
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), _H)
|
||||
threading.Thread(target=server.serve_forever, daemon=True).start()
|
||||
return server
|
||||
|
||||
|
||||
_SPECS_LOOP = " window.R = {};\n for (const sp of SPECS) {"
|
||||
|
||||
|
||||
def only_cases(html, ids):
|
||||
"""canvas_text_ref/index.html as text, drawing only the cases ``ids``.
|
||||
|
||||
The page draws all 342 cases (the 400 px ones take minutes); a test that wants a few of
|
||||
them serves this. The drawing code is untouched, so a case gives the bytes it gives in
|
||||
the whole page."""
|
||||
if _SPECS_LOOP not in html:
|
||||
raise AssertionError("canvas_text_ref/index.html no longer has the loop over SPECS "
|
||||
"that only_cases() narrows: update the helper")
|
||||
return html.replace(
|
||||
_SPECS_LOOP,
|
||||
" window.R = {};\n const ONLY = new Set(%s);\n"
|
||||
" for (const sp of SPECS.filter(s => ONLY.has(s.id))) {" % json.dumps(sorted(ids)))
|
||||
|
||||
|
||||
def diff_lines(want, got, label=""):
|
||||
"""One line for each case of ``want`` (id -> sha256) that ``got`` does not draw as
|
||||
expected: its name, the hash retail gave, the hash the engine gave (or "not drawn")."""
|
||||
lines = []
|
||||
for cid in sorted(want):
|
||||
have = got.get(cid)
|
||||
if have != want[cid]:
|
||||
lines.append("%s%s: expected %s, got %s"
|
||||
% (label, cid, want[cid], have if have is not None else "not drawn"))
|
||||
lines += ["%s%s: drawn but not in the reference" % (label, cid)
|
||||
for cid in sorted(set(got) - set(want))]
|
||||
return lines
|
||||
@@ -2,8 +2,8 @@
|
||||
unit test feeds them the red case and the green case without a browser).
|
||||
|
||||
None of them reads how long something took: a loop that is held is told by WHERE the thread of the loop was (inside a blocking step of
|
||||
the close), a browser that keeps answering is told by the ORDER of the events (a call that began and ended while the close was in
|
||||
flight, and answers that came while the removal of the profile was held), and the removal of the profile is told by WHICH THREAD
|
||||
the close), a browser that keeps answering is told by the ORDER of the events (a reply that arrived while the close was in flight,
|
||||
and answers that came while the removal of the profile was held), and the removal of the profile is told by WHICH THREAD
|
||||
reached it (the reaper's or its continuation's, never the loop's nor one of the close's) and by the order of the close's return and
|
||||
the release of the hold. A machine that is slow stretches every duration and changes none of these.
|
||||
|
||||
@@ -85,21 +85,35 @@ def charged_more_than_ran_problem(held: float, busy_run: float) -> Optional[str]
|
||||
"its selector (the machine did not schedule it) was counted as held" % (held * 1000, busy_run * 1000))
|
||||
|
||||
|
||||
def others_answered_problem(others: Sequence[dict], gate: dict) -> Optional[str]:
|
||||
def others_answered_problem(others: Sequence[dict], gate: dict, loop_inside: Dict[str, dict]) -> Optional[str]:
|
||||
"""What is wrong with the way the other browsers answered while the first one closed, or None.
|
||||
|
||||
``others`` has one record per other browser: ``inside`` is the calls that began AFTER the close began and ended BEFORE it ended
|
||||
(a call that was answered during the close, in the order of the events, not by how long it took), ``during_removal`` the calls
|
||||
that began after the removal of the closing browser's profile was reached and ended while it was still held. ``gate`` says how that
|
||||
hold ended: ``reached`` (the removal ran), ``released_by``: ``answered`` (the close had returned and every other browser had
|
||||
answered a call that began after the removal was reached: the loop was free while the removal waited) or ``deadline`` (they had not,
|
||||
in 30 s: the loop could not run while the removal was waiting, which is a removal made on the loop's thread)."""
|
||||
``others`` has one record per other browser: ``answered`` is the replies that ARRIVED while the close was in flight, whenever the
|
||||
call began (a reply read during the close is proof that the loop ran then; a call that began a moment before the close and ended
|
||||
in it is one), ``inside`` the calls that began AND ended in it (printed, not judged), ``during_removal`` the calls that began after
|
||||
the removal of the closing browser's profile was reached and ended while it was still held. ``gate`` says how that hold ended:
|
||||
``reached`` (the removal ran), ``released_by``: ``answered`` (the close had returned and every other browser had answered a call
|
||||
that began after the removal was reached: the loop was free while the removal waited) or ``deadline`` (they had not, in 30 s: the
|
||||
loop could not run while the removal was waiting, which is a removal made on the loop's thread). ``loop_inside`` is what the
|
||||
watcher saw of the loop's thread during the close (see the head of this file).
|
||||
|
||||
A browser that answered nothing inside the close is the loop's fault only if the loop was HELD: the watcher saw its thread inside
|
||||
a step of the close that waits, or no browser answered at all (nothing shows that the loop ran). One engine that did not answer
|
||||
while the others did, and the loop was seen free, is a browser the machine did not run: the removal's hold below still asks every
|
||||
browser to answer, once the close is over."""
|
||||
if len(others) != 3:
|
||||
return "the client followed %d other browsers instead of 3: %r" % (len(others), others)
|
||||
silent = [i for i, r in enumerate(others) if r["inside"] < 1]
|
||||
silent = [i for i, r in enumerate(others) if r["answered"] < 1]
|
||||
if silent:
|
||||
return ("the other browsers %s did not answer a single call that began and ended inside the close (calls inside it, per "
|
||||
"browser: %s): the loop that serves them did not run during the close" % (silent, [r["inside"] for r in others]))
|
||||
held = blocked_by(loop_inside)
|
||||
counts = [r["answered"] for r in others]
|
||||
if held:
|
||||
return ("the other browsers %s did not answer a single call inside the close (replies that arrived inside it, per "
|
||||
"browser: %s) and the watcher saw the loop's thread inside %s: the loop that serves them did not run during "
|
||||
"the close" % (silent, counts, held))
|
||||
if len(silent) == len(others):
|
||||
return ("no other browser answered a single call inside the close (replies that arrived inside it, per browser: %s): "
|
||||
"nothing shows that the loop ran during the close" % counts)
|
||||
if gate.get("reached") and gate.get("released_by") != "answered":
|
||||
return ("the removal of the profile was held until every other browser answered, and they did not (%s): the loop that "
|
||||
"serves them could not run while the removal waited, so the removal ran on it (answers during the removal, per "
|
||||
|
||||
@@ -602,7 +602,8 @@ class DohGateway(Gateway):
|
||||
* CONNECT to a loopback address is relayed for real (the pages and the echo servers of a test);
|
||||
* the egress endpoints of the base class (``api.ipify.org:80``) keep working;
|
||||
* any other CONNECT is refused (reply 2 "not allowed", for an address; 4 "host unreachable", for a name) and
|
||||
listed in :attr:`refused`: the gateway never resolves a name and never reaches past the loopback.
|
||||
listed in :attr:`refused` (and in ``guard``, the record every gateway of ``_socks_servers`` writes under ``$RUNNER_TEMP/invpw-evidence/``):
|
||||
the gateway never resolves a name and never reaches past the loopback. Its UDP relay is the base one: only the lab's, the rest dropped and recorded.
|
||||
|
||||
:attr:`connects` (inherited) lists EVERY CONNECT target in order, so ``("page-a.test", 80)`` in it means the
|
||||
browser sent a name where it should have sent an address. :attr:`credentials_seen` lists every
|
||||
@@ -696,6 +697,7 @@ class DohGateway(Gateway):
|
||||
if not is_loopback(host):
|
||||
self.connects.append((host, port))
|
||||
self.refused.append((host, port))
|
||||
self.guard.refuse(host, port, getattr(self._local, "atyp", 3), "tcp")
|
||||
self._send(c, self._reply(2 if _is_address(host) else 4))
|
||||
return
|
||||
self.connects.append((host, port))
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
"""What an e2e test that fails leaves for a reader, and nothing when it passes.
|
||||
|
||||
``with FailureEvidence("name") as evidence:`` around the body of a test: while the body runs, the helper collects, in a temporary folder,
|
||||
the sources the test points it at (the fake web's own record, the Juggler wire of the served browser, the engine's own Juggler trace,
|
||||
the client's view of every request); when the body raises (an assertion included), it copies what it holds to
|
||||
``$RUNNER_TEMP/invpw-evidence/<name>/<pid>-<ms>/``, the folder the e2e jobs upload (``invpw-evidence-*``), with a ``meta.json``; when the
|
||||
body passes, it deletes it all. Off a runner (no ``RUNNER_TEMP``) nothing is copied. It changes no assertion, wait or deadline of the
|
||||
test: it only listens.
|
||||
|
||||
A test that passed slowly may keep the evidence too: ``evidence.keep(why)`` saves what the helper holds at that moment (the same folder, a
|
||||
``meta.json`` whose ``kept`` says why, judged after the fact and never a verdict). ``arm(moz_log=...)`` also starts the engine's own log
|
||||
(``MOZ_LOG``, its file in the evidence), and ``note_records(name, state)`` adds a record the test keeps itself (``state.lock``,
|
||||
``state.records``) as ``<name>.jsonl``.
|
||||
|
||||
The times written: ``t``, wall-clock seconds since the epoch (``time.time()``; the engine's own trace writes milliseconds in ``t``, its
|
||||
``performance.timeOrigin + now``, also since the epoch), and ``m``, ``time.perf_counter()`` of the test process, finer on Windows (whose wall
|
||||
clock ticks every 15 ms) and shared by the fake web's record, the client's log and the Juggler wire.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
#: The folder under ``$RUNNER_TEMP`` the e2e workflows upload (``invpw-evidence-*``).
|
||||
EVIDENCE_FOLDER = "invpw-evidence"
|
||||
#: The most characters of one Juggler message kept in the wire log: a message longer than this is cut and says so.
|
||||
WIRE_LIMIT = 4000
|
||||
#: The engine's trace: the variable `Trace.js` of the engine reads in the parent process (off without it).
|
||||
TRACE_ENV = "INVISIBLE_JUGGLER_TRACE_DIR"
|
||||
#: The base name of the engine's log file in the evidence (``MOZ_LOG_FILE``; the engine adds a suffix per process).
|
||||
MOZ_LOG_BASE = "engine"
|
||||
|
||||
|
||||
class FailureEvidence:
|
||||
def __init__(self, name: str):
|
||||
self.name = name
|
||||
self.work = pathlib.Path(tempfile.mkdtemp(prefix="invpw-failure-evidence-"))
|
||||
self.trace_dir = self.work / "juggler-engine-trace"
|
||||
self.wire_path = self.work / "juggler-wire.jsonl"
|
||||
self.moz_log_dir = self.work / "moz-log"
|
||||
#: The records the test keeps itself, by name (``note_records``).
|
||||
self.records = {}
|
||||
#: What the client heard of each request (a list ``profile_p2.drive(client_log=...)`` fills).
|
||||
self.client_log = []
|
||||
#: The cells of the run, once it has returned (``note_cells``).
|
||||
self.cells = None
|
||||
self._stop = None
|
||||
self._patch = None
|
||||
self._wire = None
|
||||
self._wire_lock = threading.Lock()
|
||||
self.saved_to = None
|
||||
|
||||
# ---- what the test points the helper at ---------------------------------------------------------------------------
|
||||
def watch_server(self, stop) -> None:
|
||||
"""The ``stop`` function ``tests/fakeweb/sites.start`` returned: it carries the server's own record (``stop.state``)."""
|
||||
self._stop = stop
|
||||
|
||||
def note_cells(self, cells) -> None:
|
||||
self.cells = cells
|
||||
|
||||
def note_records(self, name: str, state) -> None:
|
||||
"""A record the test keeps itself (``state.lock``, ``state.records``: a list of dicts), saved as ``<name>.jsonl``."""
|
||||
self.records[name] = state
|
||||
|
||||
def arm(self, moz_log: str = "") -> None:
|
||||
"""Before the browser under test is launched: the engine writes its trace, and the Juggler wire of this process is logged.
|
||||
Armed after the other processes of the test were started, so that they do not inherit the variable. ``moz_log``, a value of
|
||||
``MOZ_LOG`` (modules and levels), also starts the engine's own log into the evidence (a diagnostic no page reads: the core passes it)."""
|
||||
self.trace_dir.mkdir(parents=True, exist_ok=True)
|
||||
self._patch = pytest.MonkeyPatch()
|
||||
self._patch.setenv(TRACE_ENV, str(self.trace_dir))
|
||||
if moz_log:
|
||||
self.moz_log_dir.mkdir(parents=True, exist_ok=True)
|
||||
self._patch.setenv("MOZ_LOG", moz_log)
|
||||
self._patch.setenv("MOZ_LOG_FILE", str(self.moz_log_dir / MOZ_LOG_BASE))
|
||||
self._wire = open(self.wire_path, "w", encoding="utf-8")
|
||||
try:
|
||||
from invisible_core.juggler import connection
|
||||
except Exception as exc: # the trace of the engine is still written; say that the wire is not
|
||||
self._write_wire({"dir": "note", "what": "the Juggler wire is not logged: %r" % (exc,)})
|
||||
return
|
||||
owner = self
|
||||
original_deliver, original_write = connection.Connection._deliver, connection.Connection._write
|
||||
|
||||
def deliver(connection_self, raw):
|
||||
owner._log_wire("in", raw)
|
||||
return original_deliver(connection_self, raw)
|
||||
|
||||
def write(connection_self, msg):
|
||||
owner._log_wire("out", msg)
|
||||
return original_write(connection_self, msg)
|
||||
|
||||
self._patch.setattr(connection.Connection, "_deliver", deliver)
|
||||
self._patch.setattr(connection.Connection, "_write", write)
|
||||
|
||||
# ---- the wire ------------------------------------------------------------------------------------------------------
|
||||
def _write_wire(self, record: dict) -> None:
|
||||
try:
|
||||
with self._wire_lock:
|
||||
if self._wire is not None:
|
||||
self._wire.write(json.dumps(record, default=str) + "\n")
|
||||
self._wire.flush()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _log_wire(self, direction: str, message) -> None:
|
||||
try:
|
||||
if isinstance(message, (bytes, bytearray)):
|
||||
text = bytes(message).decode("utf-8", "replace")
|
||||
else:
|
||||
text = json.dumps(message, default=str)
|
||||
cut = len(text) > WIRE_LIMIT
|
||||
self._write_wire({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "dir": direction, "len": len(text), "cut": cut,
|
||||
"msg": text[:WIRE_LIMIT]})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ---- the end ---------------------------------------------------------------------------------------------------------
|
||||
def keep(self, why: str) -> None:
|
||||
"""Saves what the helper holds now, though the test has not failed: a run judged after the fact as one to read (a step slower
|
||||
than any healthy run). Not a verdict: nothing is raised and the test goes on. Never raises."""
|
||||
try:
|
||||
self._save(None, None, kept=why)
|
||||
except Exception as problem:
|
||||
sys.stderr.write("evidence: could not be kept: %r\n" % (problem,))
|
||||
|
||||
def __enter__(self) -> "FailureEvidence":
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc, tb) -> bool:
|
||||
try:
|
||||
if self._patch is not None:
|
||||
self._patch.undo()
|
||||
with self._wire_lock:
|
||||
if self._wire is not None:
|
||||
self._wire.close()
|
||||
self._wire = None
|
||||
if exc_type is not None:
|
||||
self._save(exc_type, exc)
|
||||
except Exception as problem: # the evidence never hides the failure it is about
|
||||
sys.stderr.write("failure evidence: could not be saved: %r\n" % (problem,))
|
||||
finally:
|
||||
shutil.rmtree(self.work, ignore_errors=True)
|
||||
return False
|
||||
|
||||
def _save(self, exc_type, exc, kept: str = "") -> None:
|
||||
base = os.environ.get("RUNNER_TEMP")
|
||||
if not base:
|
||||
return
|
||||
target = pathlib.Path(base) / EVIDENCE_FOLDER / self.name / ("%d-%d" % (os.getpid(), int(time.time() * 1000)))
|
||||
target.mkdir(parents=True, exist_ok=True)
|
||||
if self._stop is not None and getattr(self._stop, "state", None) is not None:
|
||||
state = self._stop.state
|
||||
with state.lock:
|
||||
records = list(state.records)
|
||||
self._jsonl(target / "fakeweb-server-record.jsonl", records)
|
||||
for name, state in self.records.items():
|
||||
with state.lock:
|
||||
records = list(state.records)
|
||||
self._jsonl(target / ("%s.jsonl" % name), records)
|
||||
self._jsonl(target / "client-request-log.jsonl", list(self.client_log))
|
||||
if self.cells is not None:
|
||||
(target / "cells.json").write_text(json.dumps(self.cells, indent=1, default=str), encoding="utf-8")
|
||||
if self.wire_path.exists():
|
||||
shutil.copyfile(self.wire_path, target / "juggler-wire.jsonl")
|
||||
if self.trace_dir.exists():
|
||||
shutil.copytree(self.trace_dir, target / "juggler-engine-trace", dirs_exist_ok=True)
|
||||
if self.moz_log_dir.exists():
|
||||
shutil.copytree(self.moz_log_dir, target / "moz-log", dirs_exist_ok=True)
|
||||
meta = {"test": self.name, "platform": sys.platform,
|
||||
"machine": platform.machine(), "python": platform.python_version(), "saved_at": round(time.time(), 4),
|
||||
"times": "t: wall-clock seconds since the epoch (the engine's trace: milliseconds, in t); m: time.perf_counter() of the test process, the scale shared by the server record, the client log and the wire",
|
||||
"files": sorted(p.name for p in target.iterdir())}
|
||||
if exc_type is not None:
|
||||
meta["failure"] = "%s: %s" % (exc_type.__name__, str(exc)[:1500])
|
||||
if kept:
|
||||
meta["kept"] = kept
|
||||
(target / "meta.json").write_text(json.dumps(meta, indent=1), encoding="utf-8")
|
||||
self.saved_to = target
|
||||
|
||||
@staticmethod
|
||||
def _jsonl(path: pathlib.Path, records) -> None:
|
||||
with open(path, "w", encoding="utf-8") as out:
|
||||
for record in records:
|
||||
out.write(json.dumps(record, default=str) + "\n")
|
||||
@@ -0,0 +1,244 @@
|
||||
"""What the e2e tests of the font list need to know about the bundle and about the host, read from files and never typed.
|
||||
|
||||
Two sources, both plain data:
|
||||
|
||||
* the bundle manifest the core hands to the engine (``invisible_core._fpforge.profile.FONT_MANIFEST``, the text of
|
||||
``bundle-fonts.list``: ``F|<family>`` opens a family, ``f|<file>|<index>|...|<psname>|<upem>|<ascent>|<descent>|...`` is one of its faces,
|
||||
``A|<alias>|<target>`` is a Windows font-substitute). The engine prefers this text to the copy in its own directory, so it is the list of
|
||||
the families the engine answers to;
|
||||
* the font files of the machine that runs the test (the host): the folders a system installs fonts in. Each file's ``name`` table gives the
|
||||
family, PostScript and full names of each of its faces. A host font whose names are not in the bundle is a "host-only" face: the engine
|
||||
must not know it, and a test that asks the page for it has a name that exists on this machine and in no bundle.
|
||||
|
||||
Only the header and the ``name`` table of a file are read (a font collection is several faces; ``simsun.ttc`` is 15 MB).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Dict, Iterable, List, Optional, Set
|
||||
|
||||
#: What an sfnt file starts with: TrueType 1.0, OpenType with CFF outlines, the Apple TrueType tag, a collection.
|
||||
_SFNT = (b"\x00\x01\x00\x00", b"OTTO", b"true")
|
||||
_COLLECTION = b"ttcf"
|
||||
_EXTENSIONS = {".ttf", ".otf", ".ttc", ".otc"}
|
||||
|
||||
#: name ids of the strings that name a face.
|
||||
FAMILY, FULL, POSTSCRIPT, TYPOGRAPHIC_FAMILY = 1, 4, 6, 16
|
||||
|
||||
|
||||
class Manifest:
|
||||
"""The bundle manifest, parsed: families in order, the faces of each (file, index, PostScript name, metrics) and the aliases."""
|
||||
|
||||
def __init__(self, text: str):
|
||||
self.families: List[str] = []
|
||||
self.faces: Dict[str, List[dict]] = {}
|
||||
self.aliases: Dict[str, str] = {}
|
||||
current: Optional[str] = None
|
||||
for line in text.splitlines():
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
fields = line.split("|")
|
||||
if fields[0] == "F" and len(fields) >= 2:
|
||||
current = fields[1]
|
||||
self.families.append(current)
|
||||
self.faces[current] = []
|
||||
elif fields[0] == "A" and len(fields) >= 3:
|
||||
self.aliases[fields[1]] = fields[2]
|
||||
elif fields[0] == "f" and current is not None and len(fields) >= 19:
|
||||
self.faces[current].append({
|
||||
"file": fields[1], "index": int(fields[2]), "psname": fields[8],
|
||||
"upem": int(fields[9]), "ascent": int(fields[10]), "descent": int(fields[11]),
|
||||
})
|
||||
|
||||
def family_of_psname(self, psname: str) -> Optional[str]:
|
||||
for family, faces in self.faces.items():
|
||||
if any(face["psname"] == psname for face in faces):
|
||||
return family
|
||||
return None
|
||||
|
||||
def face_with_psname(self, psname: str) -> dict:
|
||||
for faces in self.faces.values():
|
||||
for face in faces:
|
||||
if face["psname"] == psname:
|
||||
return face
|
||||
raise AssertionError("the bundle manifest has no face with the PostScript name %r" % psname)
|
||||
|
||||
def known_names(self) -> Set[str]:
|
||||
"""Every name the bundle answers to, lower case: its families, its aliases and the PostScript names of its faces."""
|
||||
names = {family.lower() for family in self.families}
|
||||
names |= {alias.lower() for alias in self.aliases}
|
||||
names |= {face["psname"].lower() for faces in self.faces.values() for face in faces}
|
||||
return names
|
||||
|
||||
|
||||
def bundle_manifest() -> Manifest:
|
||||
"""The manifest of the core installed with the wrapper under test, the one the engine is handed as ``zoom.stealth.fonts.manifest``."""
|
||||
from invisible_core._fpforge.profile import FONT_MANIFEST
|
||||
|
||||
manifest = Manifest(FONT_MANIFEST)
|
||||
assert manifest.families, "the manifest of the core has no family: the parser read nothing"
|
||||
return manifest
|
||||
|
||||
|
||||
def _decode(platform: int, encoding: int, raw: bytes) -> Optional[str]:
|
||||
try:
|
||||
if platform in (0, 3):
|
||||
return raw.decode("utf-16-be")
|
||||
if platform == 1 and encoding == 0:
|
||||
return raw.decode("mac_roman")
|
||||
except UnicodeDecodeError:
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def _name_strings(table: bytes) -> Dict[int, List[tuple]]:
|
||||
"""name id -> [(is english windows name, text)] of one ``name`` table."""
|
||||
out: Dict[int, List[tuple]] = {}
|
||||
if len(table) < 6:
|
||||
return out
|
||||
_format, count, string_offset = struct.unpack(">HHH", table[:6])
|
||||
for i in range(count):
|
||||
record = table[6 + 12 * i: 18 + 12 * i]
|
||||
if len(record) < 12:
|
||||
break
|
||||
platform, encoding, language, name_id, length, offset = struct.unpack(">6H", record)
|
||||
text = _decode(platform, encoding, table[string_offset + offset: string_offset + offset + length])
|
||||
if text:
|
||||
out.setdefault(name_id, []).append((platform == 3 and language == 0x409, text))
|
||||
return out
|
||||
|
||||
|
||||
def face_names(path: Path) -> List[dict]:
|
||||
"""For each face of a font file: ``family`` (every family string, any language), ``psname`` and ``full`` (the English ones, or None).
|
||||
|
||||
An unreadable file, or a file that is not an sfnt, has no faces: a host folder holds other things than fonts."""
|
||||
faces: List[dict] = []
|
||||
try:
|
||||
with open(path, "rb") as handle:
|
||||
head = handle.read(12)
|
||||
if len(head) < 12:
|
||||
return faces
|
||||
if head[:4] == _COLLECTION:
|
||||
count = struct.unpack(">I", head[8:12])[0]
|
||||
if count > 64:
|
||||
return faces
|
||||
offsets = struct.unpack(">%dI" % count, handle.read(4 * count))
|
||||
elif head[:4] in _SFNT:
|
||||
offsets = (0,)
|
||||
else:
|
||||
return faces
|
||||
for base in offsets:
|
||||
handle.seek(base + 4)
|
||||
tables = struct.unpack(">H", handle.read(2))[0]
|
||||
handle.seek(base + 12)
|
||||
directory = handle.read(16 * tables)
|
||||
name_table = None
|
||||
for i in range(tables):
|
||||
tag, _checksum, offset, length = struct.unpack(">4sIII", directory[16 * i: 16 * i + 16])
|
||||
if tag == b"name" and 0 < length <= 1 << 20:
|
||||
handle.seek(offset)
|
||||
name_table = handle.read(length)
|
||||
break
|
||||
if name_table is None:
|
||||
continue
|
||||
strings = _name_strings(name_table)
|
||||
|
||||
def english(name_id: int) -> Optional[str]:
|
||||
for is_english, text in strings.get(name_id, []):
|
||||
if is_english:
|
||||
return text
|
||||
return None
|
||||
|
||||
families = []
|
||||
for name_id in (FAMILY, TYPOGRAPHIC_FAMILY):
|
||||
for _english, text in strings.get(name_id, []):
|
||||
if text not in families:
|
||||
families.append(text)
|
||||
faces.append({"file": str(path), "families": families, "psname": english(POSTSCRIPT), "full": english(FULL)})
|
||||
except (OSError, struct.error):
|
||||
return []
|
||||
return faces
|
||||
|
||||
|
||||
def host_font_files() -> List[Path]:
|
||||
"""The font files the host has installed, in a stable order."""
|
||||
if sys.platform == "win32":
|
||||
roots = [Path(os.environ.get("WINDIR", r"C:\Windows")) / "Fonts"]
|
||||
local = os.environ.get("LOCALAPPDATA")
|
||||
if local:
|
||||
roots.append(Path(local) / "Microsoft" / "Windows" / "Fonts")
|
||||
else:
|
||||
roots = [Path("/usr/share/fonts"), Path("/usr/local/share/fonts"), Path.home() / ".fonts",
|
||||
Path.home() / ".local" / "share" / "fonts"]
|
||||
files: List[Path] = []
|
||||
for root in roots:
|
||||
if root.is_dir():
|
||||
files += [p for p in root.rglob("*") if p.suffix.lower() in _EXTENSIONS and p.is_file()]
|
||||
return sorted(files, key=lambda p: str(p).lower())
|
||||
|
||||
|
||||
def _plain(name: Optional[str]) -> bool:
|
||||
"""A name that goes into a CSS string between double quotes without an escape: printable ASCII, no quote, no backslash."""
|
||||
return bool(name) and all(32 <= ord(ch) < 127 and ch not in "\"\\" for ch in name)
|
||||
|
||||
|
||||
def bundle_file_names(manifest: Manifest, binary: str) -> Set[str]:
|
||||
"""Every name (families of any language, PostScript, full), lower case, that the files of the bundle carry in their own ``name`` tables.
|
||||
|
||||
The engine answers to the other-language family names of a bundled face as it does to its family (a localized name is an alias of the
|
||||
face it names), so a host font that carries such a name is not host-only. The folder is ``<engine>/fonts``; when the build has no such
|
||||
folder the set is empty and the manifest alone decides."""
|
||||
folder = Path(binary).resolve().parent / "fonts"
|
||||
names: Set[str] = set()
|
||||
if not folder.is_dir():
|
||||
return names
|
||||
for name in sorted({face["file"] for faces in manifest.faces.values() for face in faces}):
|
||||
for face in face_names(folder / name):
|
||||
names |= {family.lower() for family in face["families"]}
|
||||
names |= {value.lower() for value in (face["psname"], face["full"]) if value}
|
||||
return names
|
||||
|
||||
|
||||
def host_only_faces(manifest: Manifest, extra_known: Iterable[str] = ()) -> List[dict]:
|
||||
"""The faces of the host whose names the bundle does not know: no family, no alias and no PostScript name of the bundle."""
|
||||
known = manifest.known_names() | set(extra_known)
|
||||
out: List[dict] = []
|
||||
for path in host_font_files():
|
||||
for face in face_names(path):
|
||||
names = [name.lower() for name in face["families"]]
|
||||
if face["psname"]:
|
||||
names.append(face["psname"].lower())
|
||||
if names and not any(name in known for name in names):
|
||||
out.append(face)
|
||||
return out
|
||||
|
||||
|
||||
def host_only_families(manifest: Manifest, extra_known: Iterable[str] = ()) -> List[str]:
|
||||
"""The family names (every language) of the host-only faces, once each, in the order of the files."""
|
||||
extra_known = set(extra_known)
|
||||
known = manifest.known_names() | extra_known
|
||||
seen: Set[str] = set()
|
||||
out: List[str] = []
|
||||
for face in host_only_faces(manifest, extra_known):
|
||||
for family in face["families"]:
|
||||
key = family.lower()
|
||||
if key not in seen and key not in known and _plain(family):
|
||||
seen.add(key)
|
||||
out.append(family)
|
||||
return out
|
||||
|
||||
|
||||
def a_host_only_face(manifest: Manifest, prefer: Iterable[str] = (), extra_known: Iterable[str] = ()) -> dict:
|
||||
"""One host-only face with a PostScript name and a full name a page can write: the first of the ``prefer`` families the host has, else the first.
|
||||
|
||||
The face is what a ``src: local()`` is given: its names exist on this machine (the file is on its disk) and in no bundle."""
|
||||
faces = [f for f in host_only_faces(manifest, extra_known) if _plain(f["psname"]) and _plain(f["full"])]
|
||||
assert faces, "the host has no font whose names are not the bundle's: there is nothing to ask the engine for that only the host knows"
|
||||
for wanted in prefer:
|
||||
for face in faces:
|
||||
if wanted.lower() in (family.lower() for family in face["families"]):
|
||||
return face
|
||||
return faces[0]
|
||||
@@ -0,0 +1,213 @@
|
||||
"""The pieces the e2e tests of the language and the zone a context declares share.
|
||||
|
||||
* ``serve(routes)``: a local HTTP server on a port the OS gives, answering a table of paths (the query is ignored), each with its bytes, its type
|
||||
and, if the test needs them, extra headers. Nothing leaves the machine.
|
||||
* ``open_chrome(port)`` / ``chrome(...)`` / ``set_pref(...)``: the engine's own chrome scope through Marionette, for what no protocol command of
|
||||
the wrapper does: writing ``intl.accept_languages`` while a session runs, and ``content_process_prefs(...)``: what a pref holds in the
|
||||
content process of each tab asked for (the proof that a process has taken a change, read from the process itself).
|
||||
* ``read_in_page_realm(page, body)``: runs ``body`` as an inline ``<script>`` of the page, so in the page's own realm, and returns what it
|
||||
wrote into the DOM. ``page.evaluate`` is not the page's realm on this engine; an inline script is what a site runs.
|
||||
* the measuring scripts of the canvas tests (``MEASURE_JS``): the width of a few strings as a canvas of one language group draws them.
|
||||
|
||||
No clock, no port written as a number, no environment written here.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import http.server
|
||||
import json
|
||||
import threading
|
||||
from typing import Any, Dict, Tuple, Union
|
||||
|
||||
import webfont_probe
|
||||
|
||||
#: What the launch of a browser whose chrome scope is read through Marionette is given (the env var MOZ_REMOTE_ALLOW_SYSTEM_ACCESS
|
||||
#: is set by the test with ``monkeypatch``).
|
||||
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
|
||||
|
||||
Route = Union[bytes, Tuple[bytes, str], Tuple[bytes, str, Dict[str, str]]]
|
||||
|
||||
|
||||
def serve(routes: Dict[str, Route]):
|
||||
"""A server for ``routes``; returns ``(server, base_url)``. Stop it with :func:`stop`."""
|
||||
|
||||
class Handler(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
path = self.path.split("?", 1)[0]
|
||||
route = routes.get(path)
|
||||
if route is None:
|
||||
self.send_response(404)
|
||||
self.send_header("Content-Length", "0")
|
||||
self.end_headers()
|
||||
return
|
||||
if isinstance(route, bytes):
|
||||
route = (route, "text/html; charset=utf-8")
|
||||
body, kind = route[0], route[1]
|
||||
extra = route[2] if len(route) > 2 else {}
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", kind)
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
for name, value in extra.items():
|
||||
self.send_header(name, value)
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
|
||||
server.daemon_threads = True
|
||||
threading.Thread(target=server.serve_forever, daemon=True).start()
|
||||
return server, "http://127.0.0.1:%d" % server.server_address[1]
|
||||
|
||||
|
||||
def stop(server) -> None:
|
||||
server.shutdown()
|
||||
server.server_close()
|
||||
|
||||
|
||||
PAGE = b"<!doctype html><html><head><meta charset=utf-8><title>t</title></head><body><p id=p>t</p></body></html>"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------- the chrome scope
|
||||
|
||||
def open_chrome(port: int):
|
||||
"""A Marionette session in chrome scope on the engine that listens on ``port``."""
|
||||
marionette = webfont_probe._Marionette(port)
|
||||
marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
marionette.call("WebDriver:SetTimeouts", {"script": 240000})
|
||||
marionette.call("Marionette:SetContext", {"value": "chrome"})
|
||||
return marionette
|
||||
|
||||
|
||||
def chrome(marionette, script: str, *args: Any) -> Any:
|
||||
"""Run ``script`` (the body of a function that returns ``JSON.stringify(...)``) in chrome scope; its answer, decoded."""
|
||||
return json.loads(marionette.call("WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
|
||||
|
||||
|
||||
SET_STRING_PREF_JS = """
|
||||
const [name, value] = arguments;
|
||||
Services.prefs.setStringPref(name, value);
|
||||
return JSON.stringify(Services.prefs.getStringPref(name));
|
||||
"""
|
||||
|
||||
|
||||
def set_pref(marionette, name: str, value: str) -> str:
|
||||
return chrome(marionette, SET_STRING_PREF_JS, name, value)
|
||||
|
||||
|
||||
#: What the content process of each tab holds for a pref, read in that process. ``arguments``: the pref's name and the labels of the tabs; a tab is
|
||||
#: found by its address ending in ``?<label>``. A process script (``Services.ppmm.loadProcessScript``, a data: URL, only the processes that exist)
|
||||
#: runs in every process and sends back its pid and the value ``Services.prefs`` of THAT process gives; the answer comes when each tab's process
|
||||
#: has answered. The parent sends a pref change to a content process before this message on the same channel, and the process applies it
|
||||
#: (and runs its observers) before it runs the script, so a process that answers has handled the change.
|
||||
PROCESS_PREFS_JS = """
|
||||
const [name, labels] = arguments;
|
||||
const done = arguments[arguments.length - 1];
|
||||
const wanted = {};
|
||||
for (const win of Services.wm.getEnumerator('navigator:browser')) {
|
||||
for (const tab of win.gBrowser.tabs) {
|
||||
const spec = tab.linkedBrowser.currentURI.spec;
|
||||
const wg = tab.linkedBrowser.browsingContext && tab.linkedBrowser.browsingContext.currentWindowGlobal;
|
||||
for (const label of labels) {
|
||||
if (spec.endsWith('?' + label) && wg && wg.domProcess) { wanted[label] = wg.domProcess.osPid; }
|
||||
}
|
||||
}
|
||||
}
|
||||
const missing = labels.filter((label) => !(label in wanted));
|
||||
if (missing.length) { done(JSON.stringify({missing})); return; }
|
||||
const KEY = 'invisible-probe:pref';
|
||||
const answers = {};
|
||||
const listener = {
|
||||
receiveMessage(message) {
|
||||
answers[message.data.pid] = message.data.value;
|
||||
if (Object.values(wanted).every((pid) => pid in answers)) {
|
||||
Services.ppmm.removeMessageListener(KEY, listener);
|
||||
const prefs = {};
|
||||
for (const [label, pid] of Object.entries(wanted)) { prefs[label] = answers[pid]; }
|
||||
done(JSON.stringify({pids: wanted, prefs}));
|
||||
}
|
||||
},
|
||||
};
|
||||
Services.ppmm.addMessageListener(KEY, listener);
|
||||
const body = 'sendAsyncMessage(' + JSON.stringify(KEY) + ', {pid: Services.appinfo.processID, value: Services.prefs.getStringPref(' + JSON.stringify(name) + ', "")});';
|
||||
Services.ppmm.loadProcessScript('data:,' + encodeURIComponent(body), false);
|
||||
"""
|
||||
|
||||
|
||||
def content_process_prefs(marionette, name: str, labels) -> Dict[str, Any]:
|
||||
"""``{"pids": {label: pid}, "prefs": {label: value}}``: what pref ``name`` holds in the content process of each tab whose address ends with
|
||||
``?<label>`` (or ``{"missing": [labels]}`` when a tab is not there)."""
|
||||
answer = marionette.call("WebDriver:ExecuteAsyncScript", {"script": PROCESS_PREFS_JS, "args": [name, list(labels)]})
|
||||
return json.loads(answer["value"])
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------------------------------------- the page realm
|
||||
|
||||
def read_in_page_realm(page, body: str, name: str = "read") -> Any:
|
||||
"""What ``body`` (the body of a function that returns a JSON-able value) gives when an inline script of the page runs it."""
|
||||
page.add_script_tag(content=("document.documentElement.setAttribute('data-%s', JSON.stringify((() => {%s})()));" % (name, body)))
|
||||
return json.loads(page.evaluate("n => document.documentElement.getAttribute('data-' + n)", name))
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------------ the workers
|
||||
|
||||
#: A dedicated worker that answers every message with the language its realm and its navigator speak.
|
||||
LANG_WORKER = b"""
|
||||
onmessage = () => postMessage({languages: [...navigator.languages],
|
||||
intl: Intl.DateTimeFormat().resolvedOptions().locale});
|
||||
"""
|
||||
|
||||
#: Starts that worker in the page and leaves ``window.__ask()`` to ask it again; the worker lives as long as the page.
|
||||
START_LANG_WORKER_JS = """() => {
|
||||
window.__worker = new Worker('/lang-worker.js');
|
||||
window.__ask = () => new Promise((ok) => {
|
||||
window.__worker.onmessage = (e) => ok(e.data);
|
||||
window.__worker.postMessage(0);
|
||||
});
|
||||
}"""
|
||||
|
||||
ASK_LANG_WORKER_JS = "() => window.__ask()"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------- the canvases
|
||||
|
||||
#: The width of a few strings, in two generic families, as a canvas of ONE language group draws them: Latin text (the generic serif of each
|
||||
#: group is another font), full-width Han, kana, half-width kana. ``widths(canvas)`` takes the 2D context's canvas, a main-thread or a
|
||||
#: worker's OffscreenCanvas, or an element: the font is resolved the way each of them resolves it, which is what the tests compare.
|
||||
MEASURE_JS = """
|
||||
const STRINGS = ['Hamburgefonstiv', '\\u6f22\\u5b57', '\\u3042\\u3044\\u3046', '\\uff71\\uff72\\uff73', '\\u76f4\\u9aa8'];
|
||||
function widths(context) {
|
||||
const out = {};
|
||||
for (const font of ['20px serif', '20px sans-serif']) {
|
||||
context.font = font;
|
||||
out[font] = STRINGS.map((s) => context.measureText(s).width);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
"""
|
||||
|
||||
#: A dedicated worker that measures on its own OffscreenCanvas and answers with the widths.
|
||||
MEASURE_WORKER = (MEASURE_JS + """
|
||||
onmessage = () => postMessage(widths(new OffscreenCanvas(300, 60).getContext('2d')));
|
||||
""").encode()
|
||||
|
||||
#: In the page: the worker's widths, the widths of an OffscreenCanvas of the main thread (no element, no ``lang``), and the widths of a canvas
|
||||
#: ELEMENT whose ``lang`` is each of the two languages asked for.
|
||||
MEASURE_PAGE_JS = """async (languages) => {
|
||||
%s
|
||||
const worker = await new Promise((ok) => {
|
||||
const w = new Worker('/measure-worker.js');
|
||||
w.onmessage = (e) => { ok(e.data); w.terminate(); };
|
||||
w.postMessage(0);
|
||||
});
|
||||
const offscreen = widths(new OffscreenCanvas(300, 60).getContext('2d'));
|
||||
const element = {};
|
||||
for (const lang of languages) {
|
||||
const c = document.createElement('canvas');
|
||||
c.setAttribute('lang', lang);
|
||||
document.body.appendChild(c);
|
||||
element[lang] = widths(c.getContext('2d'));
|
||||
}
|
||||
return {worker, offscreen, element};
|
||||
}""" % MEASURE_JS
|
||||
@@ -0,0 +1,126 @@
|
||||
"""What the window e2e tests ask the operating system itself: which window holds the input focus, on a display of the test's own.
|
||||
|
||||
A page's ``document.hasFocus()`` is what the engine reports. A test that judges "the first session kept the focus when another one took the display" must
|
||||
first know that the OS did give the focus to the second session's window; otherwise a green means only that nothing happened (the second window never took
|
||||
it, or took it later than the read). The OS answers that without the engine:
|
||||
|
||||
* Linux: the X input focus (``XGetInputFocus`` on the display the sessions share); the display is a private Xvfb started for the test (``a_display_of_its_own``),
|
||||
so no other test's headed window moves the focus in it;
|
||||
* Windows: the foreground window (``GetForegroundWindow``), the window of the session found by the title its page gave it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import ctypes
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
from typing import Iterator, Optional
|
||||
|
||||
#: ``None`` and ``PointerRoot``: what the X input focus is when no client holds it.
|
||||
_X_NO_WINDOW = (0, 1)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def a_display_of_its_own(monkeypatch) -> Iterator[str]:
|
||||
"""Linux: a private Xvfb (the number chosen by the server, ``-displayfd``), set as ``DISPLAY`` for the test and stopped at its end.
|
||||
|
||||
Two headed sessions started inside it see each other and nothing else; the Xvfb of ``xvfb-run`` that the parallel workers share is never touched."""
|
||||
process = subprocess.Popen(["Xvfb", "-displayfd", "1", "-screen", "0", "1920x1080x24", "-nolisten", "tcp"],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
|
||||
answer = {}
|
||||
reader = threading.Thread(target=lambda: answer.setdefault("line", process.stdout.readline()), daemon=True)
|
||||
reader.start()
|
||||
try:
|
||||
reader.join(60)
|
||||
number = answer.get("line", "").strip()
|
||||
assert number.isdigit(), "the private Xvfb did not give a display number (it said %r, exit %r)" % (number, process.poll())
|
||||
monkeypatch.setenv("DISPLAY", ":" + number)
|
||||
for name in ("WAYLAND_DISPLAY", "XAUTHORITY"):
|
||||
monkeypatch.delenv(name, raising=False)
|
||||
yield ":" + number
|
||||
finally:
|
||||
process.terminate()
|
||||
try:
|
||||
process.wait(30)
|
||||
except subprocess.TimeoutExpired:
|
||||
process.kill()
|
||||
process.wait(30)
|
||||
process.stdout.close()
|
||||
|
||||
|
||||
class XFocus:
|
||||
"""The X input focus of a display, read through a connection of its own (libX11, as the engine's own client library)."""
|
||||
|
||||
def __init__(self, display: str) -> None:
|
||||
self.x11 = ctypes.CDLL("libX11.so.6")
|
||||
self.x11.XOpenDisplay.restype, self.x11.XOpenDisplay.argtypes = ctypes.c_void_p, (ctypes.c_char_p,)
|
||||
self.x11.XGetInputFocus.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_ulong), ctypes.POINTER(ctypes.c_int))
|
||||
self.x11.XCloseDisplay.argtypes = (ctypes.c_void_p,)
|
||||
self.connection = self.x11.XOpenDisplay(display.encode())
|
||||
assert self.connection, "no connection to the display %r" % display
|
||||
|
||||
def holder(self) -> int:
|
||||
window, revert = ctypes.c_ulong(), ctypes.c_int()
|
||||
self.x11.XGetInputFocus(self.connection, ctypes.byref(window), ctypes.byref(revert))
|
||||
return int(window.value)
|
||||
|
||||
def is_a_window(self, holder: int) -> bool:
|
||||
return holder not in _X_NO_WINDOW
|
||||
|
||||
def close(self) -> None:
|
||||
self.x11.XCloseDisplay(self.connection)
|
||||
self.connection = None
|
||||
|
||||
|
||||
class ForegroundWindow:
|
||||
"""Windows: the foreground window of the desktop the sessions run on, and the Firefox window a title names."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
from ctypes import wintypes
|
||||
|
||||
self.user32 = ctypes.WinDLL("user32", use_last_error=True)
|
||||
self.user32.GetForegroundWindow.restype = wintypes.HWND
|
||||
self.user32.SetForegroundWindow.argtypes = (wintypes.HWND,)
|
||||
self.enum = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
|
||||
|
||||
def holder(self) -> int:
|
||||
return self.user32.GetForegroundWindow() or 0
|
||||
|
||||
def is_a_window(self, holder: int) -> bool:
|
||||
return bool(holder)
|
||||
|
||||
def window_titled(self, title: str) -> Optional[int]:
|
||||
"""The one visible top-level Firefox window whose title starts with ``title``, or None (none, or more than one)."""
|
||||
found = []
|
||||
|
||||
def each(hwnd, _):
|
||||
name, text = ctypes.create_unicode_buffer(256), ctypes.create_unicode_buffer(512)
|
||||
self.user32.GetClassNameW(hwnd, name, 256)
|
||||
self.user32.GetWindowTextW(hwnd, text, 512)
|
||||
if name.value.startswith("MozillaWindowClass") and text.value.startswith(title) and self.user32.IsWindowVisible(hwnd):
|
||||
found.append(hwnd)
|
||||
return True
|
||||
|
||||
self.user32.EnumWindows(self.enum(each), 0)
|
||||
return found[0] if len(found) == 1 else None
|
||||
|
||||
def ask_for_the_foreground(self, hwnd: int) -> int:
|
||||
"""What a user does by clicking the window: the system may refuse it, and then the foreground is what the test reads."""
|
||||
self.user32.SetForegroundWindow(hwnd)
|
||||
return self.holder()
|
||||
|
||||
|
||||
def host_monitor_size() -> Optional[tuple]:
|
||||
"""Windows: the primary monitor in device pixels (the reading of a per-monitor-aware process, whatever the test's own awareness is); None elsewhere."""
|
||||
if sys.platform != "win32":
|
||||
return None
|
||||
user32 = ctypes.WinDLL("user32")
|
||||
user32.SetThreadDpiAwarenessContext.restype = ctypes.c_void_p
|
||||
user32.SetThreadDpiAwarenessContext.argtypes = (ctypes.c_void_p,)
|
||||
previous = user32.SetThreadDpiAwarenessContext(ctypes.c_void_p(-4))
|
||||
try:
|
||||
return (user32.GetSystemMetrics(0), user32.GetSystemMetrics(1))
|
||||
finally:
|
||||
if previous:
|
||||
user32.SetThreadDpiAwarenessContext(ctypes.c_void_p(previous))
|
||||
@@ -0,0 +1,110 @@
|
||||
"""A popup opened the way a page opens one, and what it reads of its own window.
|
||||
|
||||
Shared by `test_popup_geometry_is_the_declared_frame_e2e.py` and by the inner-size test of
|
||||
`test_fingerprint_surface.py`: both need a popup (`window.open` with features, from a click) whose document may carry an
|
||||
iframe of another site (so, under Fission, in another process), and both read the window geometry from inside it.
|
||||
|
||||
The popup is read with a CONDITION, not a pause: the reading is repeated (with the client's events being read between two
|
||||
looks) until the caller's `ready` holds or 30 s have passed, and the last reading is returned either way, so the caller's
|
||||
assertion names what was read when it never settled.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
from typing import Any, Callable, Dict, Optional
|
||||
|
||||
from _fission_frames import Sites, wait_frame
|
||||
from _waits import wait_until
|
||||
|
||||
#: The scale at which the declared window frame is the one of `WINDOW_FRAME_BY_DPR[1.0]`: border 8, popup UI 72, default
|
||||
#: 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
|
||||
|
||||
READ = """() => ({iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight,
|
||||
sx: screenX, sy: screenY, mx: mozInnerScreenX, my: mozInnerScreenY})"""
|
||||
|
||||
|
||||
def in_a_thread_of_its_own(fn: Callable[[], Any], timeout: float = 300) -> Any:
|
||||
"""Runs `fn` in a thread with no asyncio loop and gives back its result or raises its error.
|
||||
|
||||
For a module whose own fixture keeps a sync client open for the whole module: an open sync client leaves its loop marked as
|
||||
running in its thread, and a second sync client started in that thread refuses with "Playwright Sync API inside the asyncio
|
||||
loop". The second browser needs a thread of its own.
|
||||
"""
|
||||
box: Dict[str, Any] = {}
|
||||
|
||||
def run() -> None:
|
||||
try:
|
||||
box["value"] = fn()
|
||||
except BaseException as exc: # handed back to the test's thread below
|
||||
box["error"] = exc
|
||||
|
||||
worker = threading.Thread(target=run, name="second-sync-client", daemon=True)
|
||||
worker.start()
|
||||
worker.join(timeout)
|
||||
if worker.is_alive():
|
||||
raise AssertionError("the browser of the test did not end within %d s" % timeout)
|
||||
if "error" in box:
|
||||
raise box["error"]
|
||||
return box.get("value")
|
||||
|
||||
|
||||
def frame_of_the_declaration():
|
||||
"""The window frame the core declares at scale 1.0: what the engine adds to a popup's inner size."""
|
||||
from invisible_core.constants import WINDOW_FRAME_BY_DPR
|
||||
|
||||
return WINDOW_FRAME_BY_DPR[1.0]
|
||||
|
||||
|
||||
def frame_extra(border: int, popup_ui: int):
|
||||
"""What a popup adds to its inner size: (outer - inner) wide and high, for a border and a popup UI."""
|
||||
return (2 * border, popup_ui + border)
|
||||
|
||||
|
||||
def _plausible(reading: Dict[str, Any]) -> bool:
|
||||
"""Every size of every window read is above 0: the window (and its frame, if any) has been laid out."""
|
||||
return all(r["iw"] > 0 and r["ih"] > 0 and r["ow"] > 0 and r["oh"] > 0
|
||||
for r in (reading["popup"], reading["frame"]) if r is not None)
|
||||
|
||||
|
||||
def read_popup(binary: str, extra_prefs: Optional[Dict[str, Any]] = None, iframe: bool = False,
|
||||
ready: Optional[Callable[[Dict[str, Any]], bool]] = None,
|
||||
features: str = "width=500,height=400") -> Dict[str, Any]:
|
||||
"""Open `window.open(url, 'p', features)` (default `width=500,height=400`) from a click and read it.
|
||||
|
||||
Returns `{"popup": {...}, "frame": {...} or None}` with `iw ih ow oh sx sy mx my` (innerWidth, innerHeight,
|
||||
outerWidth, outerHeight, screenX, screenY, mozInnerScreenX, mozInnerScreenY) of the popup and, with `iframe`, of its
|
||||
iframe (another site, 200x150). `ready(reading)` says when the reading has settled (default: every size above 0).
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with Sites() as s:
|
||||
s.route("A", "/main", "<!doctype html><title>main</title><button id='open' onclick=\"window.open('%s', 'p', "
|
||||
"'%s')\">open</button>" % (s.url("A", "/popup"), features))
|
||||
frame_html = ("<iframe id='f' src='%s' style='position:absolute;left:0;top:0;width:200px;height:150px;border:0'>"
|
||||
"</iframe>" % s.url("B", "/frame")) if iframe else ""
|
||||
s.route("A", "/popup", "<!doctype html><title>popup</title>" + frame_html)
|
||||
s.route("B", "/frame", "<!doctype html><title>frame</title>")
|
||||
with InvisiblePlaywright(seed=42, pin=PIN, binary_path=binary, headless=True, humanize=False,
|
||||
extra_prefs=extra_prefs) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(s.url("A", "/main"), wait_until="load", timeout=30000)
|
||||
with page.expect_popup(timeout=30000) as info:
|
||||
page.click("#open", timeout=30000)
|
||||
popup = info.value
|
||||
popup.wait_for_load_state("load", timeout=30000)
|
||||
frame = wait_frame(popup, s.origin["B"], "/frame", seconds=30) if iframe else None
|
||||
seen: Dict[str, Any] = {}
|
||||
|
||||
def settled() -> bool:
|
||||
seen["now"] = {"popup": popup.evaluate(READ), "frame": frame.evaluate(READ) if frame else None}
|
||||
return _plausible(seen["now"]) and (ready is None or bool(ready(seen["now"])))
|
||||
|
||||
wait_until(settled, 30, lambda: popup.wait_for_timeout(100))
|
||||
return seen["now"]
|
||||
+105
-6
@@ -21,10 +21,20 @@ test-only: the product never sets it) a content process that hosts a site is nam
|
||||
The process gets its name before any document loads in it, so when a page of the site has run, its process already
|
||||
answers to the site. Windows names no process (ProcessUtils_none.cpp): a test that looks at sites skips there and
|
||||
says so.
|
||||
|
||||
Windows names no process, but the engine's own log names the type of every process it creates (`Setting remoteType of
|
||||
process <pid> to <type>` when a process is born with its type, `Changing remoteType of process <pid> from prealloc to
|
||||
<type>` when a spare one is given its site: `dom/ipc/ContentChild.cpp`, `RecvSetRemoteType`, log module `Process`). The
|
||||
type of a process that hosts a site is `webIsolated=<site>^<attributes>` (`dom/ipc/RemoteType.cpp`, `Stringify`), the
|
||||
same site the Linux name carries, and the process gets it before any document loads in it. So on Windows a test starts the
|
||||
engine with `LOG_ENV` and a file base (`MOZ_LOG_FILE`), and `remote_types(base)` reads which type each process was given (by pid and time, a pid being reused);
|
||||
liveness and the engine's own directory are still told by the process tree, so a process that has ended is not counted.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import calendar
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
@@ -57,9 +67,94 @@ def hosts_site(name, site):
|
||||
return len(prefix) >= NAME_LENGTH or name[len(prefix)] == "^"
|
||||
|
||||
|
||||
#: The environment that makes the engine write the type of each process it creates (`MOZ_LOG_FILE` is added by the
|
||||
#: test: a file base in its own temporary folder). Used where the system names no process (Windows).
|
||||
LOG_ENV = {"MOZ_LOG": "Process:5,timestamp,sync"}
|
||||
|
||||
_TYPE_GIVEN = re.compile(r"(?:Setting remoteType of process (\d+) to|Changing remoteType of process (\d+) from \S+ to) (\S+)")
|
||||
|
||||
#: The start of a line of `MOZ_LOG` with the `timestamp` option: `2026-11-22 10:11:12.123456 UTC - [Process 12: Thread]: ...`.
|
||||
_LOG_TIME = re.compile(r"^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)\.(\d{6}) UTC - ")
|
||||
|
||||
#: How much earlier than the creation time of a process (psutil) its first log line may be stamped: the two clocks are
|
||||
#: read at different moments of its birth.
|
||||
BIRTH_SLACK = 0.25
|
||||
|
||||
|
||||
def _natural(path):
|
||||
"""The sort key that puts `base.child-2` before `base.child-10` (the plain order of names puts it after)."""
|
||||
return [int(part) if part.isdigit() else part for part in re.split(r"(\d+)", path.name)]
|
||||
|
||||
|
||||
def _stamp(line):
|
||||
"""The time of a log line in seconds since the epoch (UTC), or None when the line carries no timestamp."""
|
||||
match = _LOG_TIME.match(line)
|
||||
if match is None:
|
||||
return None
|
||||
year, month, day, hour, minute, second, micro = (int(g) for g in match.groups())
|
||||
return calendar.timegm((year, month, day, hour, minute, second)) + micro / 1e6
|
||||
|
||||
|
||||
def remote_types(base):
|
||||
"""`{pid: [(time, remote type), ...]}` of the processes the engine has logged to the files that start with the path
|
||||
`base` (`MOZ_LOG_FILE`: the parent writes `base`, each child its own `base.child-N`), each list in the order of the
|
||||
time the lines were logged (then the child number as a number, then the line). A pid alone does not name a process:
|
||||
the system gives the number of an ended process to a later one, and a later process of another site must not
|
||||
inherit the type of the old one. So the types stay stamped, and `type_of_process` chooses the ones of the process
|
||||
instance in hand. A process that logs twice (a spare one, then the site it is given) has two entries, the last wins."""
|
||||
entries = {}
|
||||
for order, path in enumerate(sorted(base.parent.glob(base.name + "*"), key=_natural)):
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines()):
|
||||
match = _TYPE_GIVEN.search(line)
|
||||
if match is None:
|
||||
continue
|
||||
stamp = _stamp(line)
|
||||
key = (stamp if stamp is not None else float("-inf"), order, number)
|
||||
entries.setdefault(int(match.group(1) or match.group(2)), []).append((key, stamp, match.group(3)))
|
||||
return {pid: [(stamp, remote_type) for _key, stamp, remote_type in sorted(found, key=lambda entry: entry[0])]
|
||||
for pid, found in entries.items()}
|
||||
|
||||
|
||||
def type_of_process(types, pid, created):
|
||||
"""The remote type the process `pid` born at `created` (epoch seconds, `psutil.Process.create_time()`) was given: the
|
||||
last one logged for the pid at or after its birth (less `BIRTH_SLACK`). Entries logged before the process existed
|
||||
are the ones of an earlier process that had the same pid, and are ignored. A line with no timestamp counts for any
|
||||
birth. `""` when the process has not logged its type yet."""
|
||||
chosen = ""
|
||||
for stamp, remote_type in types.get(pid, ()):
|
||||
if stamp is None or stamp >= created - BIRTH_SLACK:
|
||||
chosen = remote_type
|
||||
return chosen
|
||||
|
||||
|
||||
def hosts_site_by_type(remote_type, site):
|
||||
"""True when a process of the remote type `remote_type` hosts `site` (`http://a.test`): `<kind>=<site>` or
|
||||
`<kind>=<site>^<attributes>`. A process with no site (`web`, `prealloc`, `privilegedabout`, `extension`) has no `=`."""
|
||||
meta = remote_type.partition("=")[2]
|
||||
return meta == site or meta.startswith(site + "^")
|
||||
|
||||
|
||||
def site_pids_by_type(processes, site, types, engine_dir=None):
|
||||
"""Like `site_pids`, told by the remote types the engine logged (`remote_types`) instead of by the process name."""
|
||||
return _content_pids(processes, engine_dir, lambda proc, _name: hosts_site_by_type(_type_of(types, proc), site))
|
||||
|
||||
|
||||
def _type_of(types, proc):
|
||||
import psutil
|
||||
|
||||
try:
|
||||
return type_of_process(types, proc.pid, proc.create_time())
|
||||
except psutil.Error:
|
||||
return ""
|
||||
|
||||
|
||||
def site_pids(processes, site, engine_dir=None):
|
||||
"""The pids, among `processes` (psutil-like), of the content processes (`-contentproc ... tab`) that host `site`;
|
||||
with `engine_dir`, only those of the engine in that directory."""
|
||||
return _content_pids(processes, engine_dir, lambda _proc, name: hosts_site(name, site))
|
||||
|
||||
|
||||
def _content_pids(processes, engine_dir, hosts):
|
||||
import psutil
|
||||
|
||||
pids = set()
|
||||
@@ -70,19 +165,23 @@ def site_pids(processes, site, engine_dir=None):
|
||||
name, cmd = proc.name(), proc.cmdline()
|
||||
except psutil.Error:
|
||||
continue
|
||||
if "-contentproc" in cmd and cmd and cmd[-1] == "tab" and hosts_site(name, site):
|
||||
if "-contentproc" in cmd and cmd and cmd[-1] == "tab" and hosts(proc, name):
|
||||
pids.add(proc.pid)
|
||||
return pids
|
||||
|
||||
|
||||
def site_processes_below(root_pid, site, engine_dir=None):
|
||||
"""The pids of the processes below `root_pid` that host `site`. Off Linux the test skips: no name says it."""
|
||||
def site_processes_below(root_pid, site, engine_dir=None, types=None):
|
||||
"""The pids of the processes below `root_pid` that host `site`. On Linux the name of the process says it; on Windows
|
||||
`types` (a function that returns `remote_types(base)` of the engine's log, see `LOG_ENV`) does. With neither, the test
|
||||
skips: no name says it."""
|
||||
import psutil
|
||||
|
||||
if not sys.platform.startswith("linux"):
|
||||
pytest.skip("only Linux names a content process by the site it hosts; %s names none" % sys.platform)
|
||||
if not sys.platform.startswith("linux") and types is None:
|
||||
pytest.skip("only Linux names a content process by the site it hosts; %s names none (pass `types`)" % sys.platform)
|
||||
try:
|
||||
children = psutil.Process(root_pid).children(recursive=True)
|
||||
except psutil.Error:
|
||||
return set()
|
||||
return site_pids(children, site, engine_dir)
|
||||
if sys.platform.startswith("linux"):
|
||||
return site_pids(children, site, engine_dir)
|
||||
return site_pids_by_type(children, site, types(), engine_dir)
|
||||
+155
-26
@@ -33,11 +33,20 @@ answer as the service; the plain-HTTP endpoint ``api.ipify.org:80`` is still
|
||||
answered here for the tests that ask it), and the UDP exit is what the fake STUN server puts in its XOR-MAPPED-ADDRESS.
|
||||
Both are chosen by the test (``tcp_exit`` and ``udp_exit`` arguments).
|
||||
|
||||
Any other CONNECT is really forwarded, and any other UDP datagram is really
|
||||
forwarded to its destination and the reply wrapped back, so a page, or an echo
|
||||
server on 127.0.0.1, can be reached through the gateway and the test can
|
||||
observe which road its bytes took (:attr:`Gateway.connects`,
|
||||
:attr:`Gateway.datagrams`).
|
||||
HERMETIC: a gateway of this module carries a CONNECT or a datagram only to the LAB (:func:`is_lab_destination`: loopback, the
|
||||
documentation ranges of RFC 5737 and RFC 3849 the tests use as lab exits and servers, the addresses of this host's own interfaces, where a server
|
||||
of a test may stand, and the name ``localhost``). These tests run in the gate of the candidate, where no test may depend on a real service, and the
|
||||
browser behind a gateway makes background requests of its own (a name of the vendor, a captive-portal check, a telemetry endpoint): such a
|
||||
destination is REFUSED, never forwarded (a CONNECT is answered with reply 2, "not allowed"; a datagram is dropped), and RECORDED
|
||||
(:class:`LabGuard`: the time since the gateway started, the SOCKS5 address type, the destination as it was received - the NAME for type 3 -, the
|
||||
port and the protocol, ``tcp`` or ``udp``). The record is always written, when the gateway is closed, under
|
||||
``$RUNNER_TEMP/invpw-evidence/<gateway>/<pid>-<ms>/refused-destinations.json`` (the folder the e2e jobs upload; off a runner nothing is
|
||||
written), so that a reader sees what the browser asked for besides what the test drives. There is no option that reopens it. A subclass can only
|
||||
narrow it (:meth:`Gateway._admits`); the destinations it serves itself (the fake STUN server, the page of ``WEB_NAME``, the exit questions) are
|
||||
answered before it, and a name mapped to a local server by :meth:`Gateway._target` is judged by the server it maps to. What a test sees of the
|
||||
road is :attr:`Gateway.connects`, :attr:`Gateway.datagrams` (every datagram the relay read, carried or dropped) and
|
||||
:attr:`Gateway.guard`. :class:`Socks5TcpOnly` and the SOCKS5 server of ``test_proxy_socks_auth_e2e.py`` are hermetic the same way (same rule,
|
||||
same record).
|
||||
|
||||
This is the ONE SOCKS5 gateway of the test suite. A road that needs more than the three above (a TURN server, a resolver,
|
||||
a page, by NAME: ``tests/_turn_chain.py``) subclasses :class:`Gateway` and overrides the small hooks (:meth:`Gateway._route`,
|
||||
@@ -46,7 +55,10 @@ ASSOCIATE, the relay or the round trip.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ipaddress
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import select
|
||||
import socket
|
||||
import struct
|
||||
@@ -55,7 +67,7 @@ import time
|
||||
from typing import Callable, Dict, List, Optional, Set, Tuple
|
||||
|
||||
#: The name the product's STUN probe sends through the relay. The relay maps it
|
||||
#: to the fake STUN server; every other destination is forwarded for real.
|
||||
#: to the fake STUN server; every other destination is the lab's to carry or is refused (``LabGuard``).
|
||||
STUN_NAME = "stun.l.google.com"
|
||||
STUN_PORT = 19302
|
||||
#: The same STUN server by NUMBER. A page cannot resolve a name behind the session (the engine forbids local
|
||||
@@ -79,19 +91,18 @@ _MAGIC = b"\x21\x12\xa4\x42"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
# The exit of a proxy that forwards for real. The question "where do I leave from" is HTTPS (api.ipify.org:443), and no gateway
|
||||
# of the tests can answer a TLS request as the service: a proxy that FORWARDS (a CONNECT to anything outside loopback goes out for
|
||||
# real) would carry it to the internet, and the answer would be the address of whatever machine runs the test (a GitHub runner
|
||||
# that changes NAT in the middle of a session: ``ProxyEgressDrifted``). So such a proxy DECLARES its exit (``declare_exit``) and
|
||||
# ``tests/_lab_egress.DeclaredExit`` answers the question with it; and as a backstop each of them refuses to forward the question
|
||||
# (``asks_the_world``), which records it and makes the test fail (``nobody_asked_the_world``), so that a proxy that forgot to declare
|
||||
# is a red with its name and not a flaky green.
|
||||
# The exit of a proxy that relays CONNECTs. The question "where do I leave from" is HTTPS (api.ipify.org:443), and no gateway
|
||||
# of the tests can answer a TLS request as the service. A gateway of this module is hermetic (a CONNECT outside the lab is refused, see
|
||||
# ``LabGuard``), so the question could not reach the internet through it anyway; but the product would then be told no exit at all. So such a
|
||||
# proxy DECLARES its exit (``declare_exit``) and ``tests/_lab_egress.DeclaredExit`` answers the question with it; and as a backstop each of
|
||||
# them refuses the question itself (``asks_the_world``), which records it and makes the test fail (``nobody_asked_the_world``), so that a
|
||||
# proxy that forgot to declare is a red with its name and not a flaky green.
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
#: The hosts of the services of the core that tell a caller its address (``invisible_core._geo._IP_ECHO_ENDPOINTS`` and
|
||||
#: ``_IPV6_ECHO_ENDPOINTS``; ``tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py`` checks that this list covers them).
|
||||
EXIT_SERVICES = ("api.ipify.org", "api6.ipify.org", "icanhazip.com", "ipv6.icanhazip.com", "checkip.amazonaws.com", "ifconfig.me")
|
||||
|
||||
#: ``host:port`` of a proxy of the tests that forwards for real -> the exit it declares. Filled by the proxies themselves.
|
||||
#: ``host:port`` of a proxy of the tests that relays CONNECTs -> the exit it declares. Filled by the proxies themselves.
|
||||
_DECLARED_EXITS: Dict[str, str] = {}
|
||||
#: The questions of the exit that reached a forwarding proxy and were refused there: one sentence each, until a test reads them.
|
||||
_WORLD_QUESTIONS: List[str] = []
|
||||
@@ -103,7 +114,7 @@ def _endpoint(server: str) -> str:
|
||||
|
||||
|
||||
def declare_exit(server: str, exit_ip: str) -> None:
|
||||
"""The proxy at ``server`` forwards for real and says its exit is ``exit_ip``."""
|
||||
"""The proxy at ``server`` relays CONNECTs and says its exit is ``exit_ip``."""
|
||||
_DECLARED_EXITS[_endpoint(server)] = exit_ip
|
||||
|
||||
|
||||
@@ -117,10 +128,10 @@ def declared_exit_of(server: Optional[str]) -> Optional[str]:
|
||||
|
||||
|
||||
def asks_the_world(server: str, host: str, port: int) -> bool:
|
||||
"""True, and the question is recorded, when a CONNECT to ``host:port`` is the question of the exit: the proxy must refuse it, not forward it."""
|
||||
"""True, and the question is recorded, when a CONNECT to ``host:port`` is the question of the exit: the proxy must refuse it (the lab answers it with the declared exit)."""
|
||||
if host.lower() not in EXIT_SERVICES:
|
||||
return False
|
||||
_WORLD_QUESTIONS.append("%s was asked %s:%d: the question of the exit reached a proxy that would have forwarded it to the internet" % (
|
||||
_WORLD_QUESTIONS.append("%s was asked %s:%d: the question of the exit reached a proxy of the lab, which refuses it (its exit is declared, not asked of the internet)" % (
|
||||
server, host, port))
|
||||
return True
|
||||
|
||||
@@ -149,6 +160,91 @@ def _recv_exact(s: socket.socket, n: int) -> bytes:
|
||||
return data
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
# The lab. A gateway of the tests forwards nothing that is not the lab's: the destination is refused and recorded.
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
#: The networks that are the lab's whatever the host: loopback, and the documentation ranges (RFC 5737 TEST-NET-1/2/3, RFC 3849) that the tests use
|
||||
#: for their exits and their servers (nothing routes them: a test holds the ones a server stands at on ``lo``).
|
||||
LAB_NETWORKS = tuple(ipaddress.ip_network(net) for net in (
|
||||
"127.0.0.0/8", "::1/128", "192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24", "2001:db8::/32"))
|
||||
#: The folder under ``$RUNNER_TEMP`` the e2e workflows upload (``invpw-evidence-*``).
|
||||
EVIDENCE_FOLDER = "invpw-evidence"
|
||||
|
||||
|
||||
def _own_addresses() -> Set[str]:
|
||||
"""The addresses assigned to an interface of this host (a server of a test stands at one of them), or none when they cannot be listed."""
|
||||
try:
|
||||
from _witness import host_addresses
|
||||
|
||||
return host_addresses()
|
||||
except Exception:
|
||||
return set()
|
||||
|
||||
|
||||
def is_lab_destination(host: str) -> bool:
|
||||
"""Whether ``host`` (an address, or a name as a SOCKS5 client sent it) is the lab's: loopback, a documentation range, an address of one of this host's
|
||||
own interfaces, or ``localhost``. Any other NAME is not: nothing here resolves a name for the internet's sake, and the question would leave the machine."""
|
||||
text = host.strip().strip("[]").split("%", 1)[0].rstrip(".").lower()
|
||||
try:
|
||||
address = ipaddress.ip_address(text)
|
||||
except ValueError:
|
||||
return text == "localhost" or text.endswith(".localhost")
|
||||
mapped = getattr(address, "ipv4_mapped", None)
|
||||
if mapped is not None:
|
||||
address = mapped
|
||||
if any(address in network for network in LAB_NETWORKS):
|
||||
return True
|
||||
return address.compressed in _own_addresses()
|
||||
|
||||
|
||||
class LabGuard:
|
||||
"""What refuses a destination that is not the lab's and writes it down: one per gateway.
|
||||
|
||||
:meth:`admits` is asked with the destination as RECEIVED (``atyp`` is the SOCKS5 address type: 1 IPv4, 3 a name, 4 IPv6; ``protocol`` is ``"tcp"`` or
|
||||
``"udp"``); ``target`` is where it would really go, as (host, port), when that is not the destination itself (a name a gateway maps to a local server): the lab's
|
||||
decision is about the target. A refusal is recorded in :attr:`records` as a dict with ``t`` (seconds since ``t0``, the start of the gateway), ``atyp``,
|
||||
``destination`` (as received), ``port`` and ``protocol``. :meth:`write_evidence` leaves them, always, under ``$RUNNER_TEMP/invpw-evidence/<name>/``."""
|
||||
|
||||
def __init__(self, name: str, t0: Optional[float] = None):
|
||||
self.name = name
|
||||
self.t0 = time.monotonic() if t0 is None else t0
|
||||
#: Every refusal, in order.
|
||||
self.records: List[dict] = []
|
||||
self._lock = threading.Lock()
|
||||
self._written = False
|
||||
|
||||
def admits(self, host: str, port: int, atyp: int, protocol: str, target: Optional[Tuple[str, int]] = None) -> bool:
|
||||
if is_lab_destination(host if target is None else target[0]):
|
||||
return True
|
||||
self.refuse(host, port, atyp, protocol)
|
||||
return False
|
||||
|
||||
def refuse(self, host: str, port: int, atyp: int, protocol: str) -> None:
|
||||
"""Write down a destination that was refused (by this guard's rule, or by the narrower rule of a subclass)."""
|
||||
record = {"t": round(time.monotonic() - self.t0, 3), "atyp": atyp, "destination": host, "port": port, "protocol": protocol}
|
||||
with self._lock:
|
||||
self.records.append(record)
|
||||
|
||||
def refused(self, protocol: Optional[str] = None) -> List[Tuple[str, int]]:
|
||||
"""Every refused destination as (destination as received, port), in order; of one protocol when asked."""
|
||||
with self._lock:
|
||||
return [(r["destination"], r["port"]) for r in self.records if protocol is None or r["protocol"] == protocol]
|
||||
|
||||
def write_evidence(self, extra: Optional[dict] = None) -> Optional[pathlib.Path]:
|
||||
"""Write the record, once (a gateway may be closed twice): the file written, or None off a runner (no ``$RUNNER_TEMP``) or when already written."""
|
||||
runner_temp = os.environ.get("RUNNER_TEMP")
|
||||
with self._lock:
|
||||
if self._written or not runner_temp:
|
||||
return None
|
||||
self._written = True
|
||||
records = list(self.records)
|
||||
folder = pathlib.Path(runner_temp) / EVIDENCE_FOLDER / self.name / ("%d-%d" % (os.getpid(), int(time.time() * 1000)))
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
path = folder / "refused-destinations.json"
|
||||
path.write_text(json.dumps(dict({"gateway": self.name, "refused": records}, **(extra or {})), indent=2), encoding="utf-8")
|
||||
return path
|
||||
|
||||
|
||||
class FakeStun:
|
||||
"""A UDP STUN server that answers every binding request with ``mapped_ip``."""
|
||||
|
||||
@@ -215,10 +311,12 @@ class FakeStun:
|
||||
class Gateway:
|
||||
"""A SOCKS5 server. ``udp`` is ``"relay"`` or ``"refuse"`` (reply code 7)."""
|
||||
|
||||
#: Whether a CONNECT that is not special is forwarded for real, past loopback: such a gateway declares ``tcp_exit`` as its exit
|
||||
#: Whether this gateway relays the CONNECTs that are not special (to the lab: it is hermetic): such a gateway declares ``tcp_exit`` as its exit
|
||||
#: (``declare_exit``). A subclass that refuses everything but loopback (``tests/_doh_servers.DohGateway``) sets False: it cannot carry the
|
||||
#: question of the exit anywhere, and the question is left to what answers it.
|
||||
forwards_for_real = True
|
||||
#: The name of the folder of the record of what this gateway refused under ``$RUNNER_TEMP/invpw-evidence/`` (a subclass may name its own).
|
||||
evidence_name = "socks5-gateway"
|
||||
|
||||
def __init__(self, *, udp: str, tcp_exit: str, udp_exit: str,
|
||||
user: Optional[str] = None, password: Optional[str] = None,
|
||||
@@ -269,6 +367,9 @@ class Gateway:
|
||||
self.associates = 0
|
||||
#: When the gateway started: the origin of the times below.
|
||||
self.t0 = time.monotonic()
|
||||
#: What refuses (and records, and writes under ``$RUNNER_TEMP/invpw-evidence/<evidence_name>/`` when the gateway is closed) every destination that is
|
||||
#: not the lab's, CONNECT or datagram: ``guard.records``, ``guard.refused()``.
|
||||
self.guard = LabGuard(self.evidence_name, self.t0)
|
||||
#: The same instant on the wall clock (seconds since the epoch), to compare with what a page reads from Date.now().
|
||||
self.wall0 = time.time()
|
||||
#: Every TCP connection the gateway accepted (a SOCKS handshake starts with one), as seconds from t0.
|
||||
@@ -287,8 +388,8 @@ class Gateway:
|
||||
self.exit_ports: List[int] = []
|
||||
#: A datagram the relay could not send (a socket that raised): said here and in the report of a test, never mute.
|
||||
self.send_errors: List[str] = []
|
||||
#: The hosts the relay forwards a datagram to (the fake STUN server aside); None: any host. A test that sends from an
|
||||
#: address of this host keeps its lab closed: the browser's own background QUIC does not leave the machine.
|
||||
#: The hosts the relay forwards a datagram to (the fake STUN server aside), among the lab's; None: any host of the lab. It only narrows: a host
|
||||
#: that is not the lab's is never forwarded (``guard``).
|
||||
self.forward_only_to: Optional[Set[str]] = None
|
||||
self._listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self._listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
@@ -330,6 +431,11 @@ class Gateway:
|
||||
except OSError:
|
||||
pass
|
||||
self.stun.close()
|
||||
self.guard.write_evidence(self._evidence())
|
||||
|
||||
def _evidence(self) -> dict:
|
||||
"""What a subclass adds to the record of the refusals written at the close (a dict of JSON values)."""
|
||||
return {}
|
||||
|
||||
def __enter__(self) -> "Gateway":
|
||||
return self
|
||||
@@ -397,9 +503,10 @@ class Gateway:
|
||||
self._send(c, b"\x01\x00")
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def _read_address(c: socket.socket) -> Tuple[str, int]:
|
||||
def _read_address(self, c: socket.socket) -> Tuple[str, int]:
|
||||
"""The destination of a request, as received (the NAME for address type 3); its address type is left in ``self._local.atyp``."""
|
||||
atyp = _recv_exact(c, 1)[0]
|
||||
self._local.atyp = atyp
|
||||
if atyp == 1:
|
||||
host = socket.inet_ntoa(_recv_exact(c, 4))
|
||||
elif atyp == 3:
|
||||
@@ -442,6 +549,12 @@ class Gateway:
|
||||
"""Where a CONNECT that is not a special one really goes. A subclass maps a name to a local server."""
|
||||
return host, port
|
||||
|
||||
def _admits(self, host: str, port: int, atyp: int, protocol: str, target: Optional[Tuple[str, int]] = None) -> bool:
|
||||
"""Whether the gateway carries a CONNECT (``protocol`` ``"tcp"``) or a datagram (``"udp"``) to ``host``:``port`` (as received; ``atyp`` is its SOCKS5
|
||||
address type), or to ``target`` (host, port) when it is mapped elsewhere: only the lab's, and the rest is refused and recorded (``guard``). A subclass may narrow
|
||||
it (never widen it: call this one first)."""
|
||||
return self.guard.admits(host, port, atyp, protocol, target)
|
||||
|
||||
def _open_upstream(self, target: Tuple[str, int]) -> socket.socket:
|
||||
"""The TCP connection of a CONNECT: from ``exit_host`` when ``tcp_from_exit``, else from wherever the system chooses."""
|
||||
if not self.tcp_from_exit:
|
||||
@@ -478,8 +591,12 @@ class Gateway:
|
||||
if self.forwards_for_real and asks_the_world(self.server, host, port):
|
||||
self._send(c, self._reply(2)) # not allowed: the exit of this gateway is declared, it is not asked of the internet
|
||||
return
|
||||
target = self._target(host, port)
|
||||
if not self._admits(host, port, getattr(self._local, "atyp", 3), "tcp", target):
|
||||
self._send(c, self._reply(2)) # not allowed: the gateway carries nothing outside the lab
|
||||
return
|
||||
try:
|
||||
up = self._open_upstream(self._target(host, port))
|
||||
up = self._open_upstream(target)
|
||||
except OSError:
|
||||
self._send(c, self._reply(5))
|
||||
return
|
||||
@@ -536,13 +653,15 @@ class Gateway:
|
||||
``target`` is the real address the datagram is sent to from the exit socket (``out_port`` is that socket's port);
|
||||
``reported_as`` is the address the client is told the reply came from (None: the real source). A subclass may also
|
||||
answer by itself with ``answer(host, port, data)``. By default the fake STUN server, by name or by number, is
|
||||
mapped and everything else is forwarded for real."""
|
||||
mapped and everything else is forwarded when it is the lab's (``_admits``); a datagram to any other destination is dropped and recorded."""
|
||||
if (host, dport) in ((STUN_NAME, STUN_PORT), (STUN_NUMBER, STUN_PORT), (MEASURE_NUMBER, STUN_PORT)):
|
||||
if not self.stun_answers:
|
||||
return None
|
||||
# A real server answers from the address it was asked at; the fake STUN server is mapped, so its reply is
|
||||
# reported as from the asked address (only when that was a literal: a name has no address to report).
|
||||
return self.stun.address, ((host, dport) if atyp == 1 else None)
|
||||
if not self._admits(host, dport, atyp, "udp"):
|
||||
return None # not the lab's: dropped, and recorded
|
||||
if self.forward_only_to is not None and host not in self.forward_only_to:
|
||||
return None
|
||||
return (host, dport), None
|
||||
@@ -685,12 +804,15 @@ def silent_udp(*, exit_ip: str = EXIT, user: Optional[str] = None, password: Opt
|
||||
# A tiny TCP-only SOCKS5 server for the e2e tests (the fixture `socks5_tcp_only` of conftest.py makes one).
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
class Socks5TcpOnly:
|
||||
"""Minimal SOCKS5: no-auth, CONNECT (TCP) relayed, UDP ASSOCIATE refused.
|
||||
"""Minimal SOCKS5: no-auth, CONNECT (TCP) relayed to the lab, UDP ASSOCIATE refused.
|
||||
|
||||
Reproduces a residential TCP-only proxy: pages load over TCP, but WebRTC's
|
||||
UDP path is dead - which (for a no-camera page in default_address_only mode)
|
||||
is exactly what made the default-route probe fail and ICE return zero
|
||||
candidates before Fix C.
|
||||
|
||||
Hermetic like :class:`Gateway`: a CONNECT to a destination that is not the lab's (:func:`is_lab_destination`) is refused with reply 2 and
|
||||
recorded in :attr:`guard` (written under ``$RUNNER_TEMP/invpw-evidence/socks5-tcp-only/`` when the server is closed).
|
||||
"""
|
||||
|
||||
def __init__(self, exit_ip: Optional[str] = None):
|
||||
@@ -699,10 +821,12 @@ class Socks5TcpOnly:
|
||||
self._srv.bind(("127.0.0.1", 0))
|
||||
self._srv.listen(16)
|
||||
self.port = self._srv.getsockname()[1]
|
||||
#: It relays a CONNECT for real, so it declares its exit (what a launch behind it is told: the lab's, unless a test gives another).
|
||||
#: It relays a CONNECT (to the lab), so it declares its exit (what a launch behind it is told: the lab's, unless a test gives another).
|
||||
self.exit_ip = exit_ip or _lab_exit()
|
||||
declare_exit(self.server, self.exit_ip)
|
||||
self.udp_associate_attempts = 0
|
||||
#: What refuses (and records) every CONNECT that is not the lab's.
|
||||
self.guard = LabGuard("socks5-tcp-only")
|
||||
self._stop = False
|
||||
self._t = threading.Thread(target=self._serve, daemon=True)
|
||||
self._t.start()
|
||||
@@ -762,6 +886,10 @@ class Socks5TcpOnly:
|
||||
conn.sendall(b"\x05\x02\x00\x01\x00\x00\x00\x00\x00\x00") # not allowed: the exit is declared, not asked of the internet
|
||||
conn.close()
|
||||
return
|
||||
if not self.guard.admits(addr, port, atyp, "tcp"):
|
||||
conn.sendall(b"\x05\x02\x00\x01\x00\x00\x00\x00\x00\x00") # not allowed: nothing outside the lab is carried
|
||||
conn.close()
|
||||
return
|
||||
try:
|
||||
upstream = socket.create_connection((addr, port), timeout=30)
|
||||
except OSError:
|
||||
@@ -801,3 +929,4 @@ class Socks5TcpOnly:
|
||||
self._srv.close()
|
||||
except Exception:
|
||||
pass
|
||||
self.guard.write_evidence()
|
||||
@@ -0,0 +1,173 @@
|
||||
"""The strace stand-in of the Linux font tests: the engine's directory as links, whose executable runs the real one under ``strace`` in the
|
||||
engine's place (same pid, same process group), and what reads its log (who is the parent and who a content process) and cleans its group.
|
||||
|
||||
Used by tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py. No test of its own, no browser."""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import stat
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
_SYSCALLS = ("execve,clone,clone3,fork,vfork,open,openat,stat,lstat,"
|
||||
"newfstatat,statx,access,faccessat,faccessat2,readlink")
|
||||
|
||||
|
||||
def _strace_options() -> str:
|
||||
"""strace's own flags: quiet, follow forks, and die with the traced process
|
||||
when this build knows --kill-on-exit."""
|
||||
help_text = subprocess.run([shutil.which("strace"), "-h"], capture_output=True,
|
||||
text=True).stdout
|
||||
return "-f -qq -s 4096" + (" --kill-on-exit" if "--kill-on-exit" in help_text else "")
|
||||
|
||||
|
||||
def _require_strace_can_trace(tmp: Path) -> None:
|
||||
"""strace needs ptrace: a container or yama can refuse it, and then the
|
||||
failure is the environment's, said as such, not the launch's."""
|
||||
probe = subprocess.run([shutil.which("strace"), "-o", str(tmp / "probe.log"), "true"],
|
||||
capture_output=True, text=True)
|
||||
if probe.returncode != 0:
|
||||
pytest.fail("strace cannot trace here: %s" % (probe.stderr.strip() or probe.returncode),
|
||||
pytrace=False)
|
||||
|
||||
|
||||
def _stand_in(binary: str, tree: Path, log: Path, pidfile: Path, syscalls: str = _SYSCALLS,
|
||||
timestamps: bool = False) -> str:
|
||||
"""A copy of the engine's directory made of links, whose executable runs
|
||||
the real one under strace, in the engine's place.
|
||||
|
||||
The script writes its pid and execs strace: the pid stays, and so does the
|
||||
process group its launcher gave it. The core spawns the engine as the
|
||||
leader of a process group of its own (``posix_spawn`` with ``setpgroup=0``,
|
||||
as Playwright's launcher does with ``detached: true``), so that group holds
|
||||
strace and everything it traces, and ``_kill_group`` kills the group of the
|
||||
pid (``os.getpgid``). The script used to exec ``setsid``: setsid(1) forks
|
||||
when its caller leads a process group, its parent exited 0 at once, and the
|
||||
core saw the engine exit during startup (candidate 44161687675).
|
||||
|
||||
``syscalls`` is what strace traces; ``timestamps`` adds ``-ttt`` (the epoch
|
||||
seconds after each pid), which ``_LINE`` does not read: a caller that asks
|
||||
for them strips them first (``test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e``)."""
|
||||
real = Path(os.path.realpath(binary))
|
||||
tree.mkdir()
|
||||
for entry in real.parent.iterdir():
|
||||
if entry.name != real.name:
|
||||
(tree / entry.name).symlink_to(entry)
|
||||
script = tree / real.name
|
||||
script.write_text(
|
||||
"#!/bin/sh\n"
|
||||
"echo $$ > %s\n"
|
||||
'exec %s %s -o %s -e trace=%s %s "$@"\n'
|
||||
% (pidfile, shutil.which("strace"), _strace_options() + (" -ttt" if timestamps else ""), log, syscalls, real))
|
||||
script.chmod(script.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
||||
return str(script)
|
||||
|
||||
|
||||
_LINE = re.compile(r"^(\d+)\s+(\w+)\((.*)$")
|
||||
# strace -f splits a call that another thread interrupts in two lines:
|
||||
# "PID clone3({...} <unfinished ...>" and "PID <... clone3 resumed>) = CHILD".
|
||||
_RESUMED = re.compile(r"^(\d+)\s+<\.\.\. (\w+) resumed>(.*)$")
|
||||
_RESULT = re.compile(r"=\s+(\d+)\s*$")
|
||||
|
||||
|
||||
def _roles(lines: list, real_binary: str):
|
||||
"""``(role, argv_of)`` for a strace log read as lines: ``role(pid)`` is ``"parent"``, ``"content"`` or ``"other"`` (walking up the
|
||||
clones to the process that executed the engine), ``argv_of`` maps a pid to the arguments of the last execve of the engine it made."""
|
||||
parent_of = {}
|
||||
argv_of = {}
|
||||
for line in lines:
|
||||
m = _LINE.match(line) or _RESUMED.match(line)
|
||||
if not m:
|
||||
continue
|
||||
pid, call, rest = int(m.group(1)), m.group(2), m.group(3)
|
||||
if call in ("clone", "clone3", "fork", "vfork"):
|
||||
r = _RESULT.search(rest)
|
||||
if r:
|
||||
parent_of[int(r.group(1))] = pid
|
||||
elif call == "execve" and real_binary in rest:
|
||||
# The arguments are on the first line even when the result comes
|
||||
# on a resumed one; the last execve of a process is what it runs.
|
||||
argv_of[pid] = rest
|
||||
|
||||
def role(pid: int) -> str:
|
||||
seen = set()
|
||||
while pid not in seen:
|
||||
seen.add(pid)
|
||||
argv = argv_of.get(pid)
|
||||
if argv is not None and real_binary in argv:
|
||||
return "content" if "-contentproc" in argv else "parent"
|
||||
if pid not in parent_of:
|
||||
break
|
||||
pid = parent_of[pid]
|
||||
return "other"
|
||||
|
||||
return role, argv_of
|
||||
|
||||
|
||||
def _group_of(pidfile: Path):
|
||||
"""The process group of the stand-in, read from its living pid (``os.getpgid``); None when it is gone or wrote no pid."""
|
||||
try:
|
||||
return os.getpgid(int(pidfile.read_text().strip()))
|
||||
except (OSError, ValueError):
|
||||
return None
|
||||
|
||||
|
||||
def _kill_group(pidfile: Path):
|
||||
"""Kill the stand-in's process group: strace, the browser and its children. Returns the group killed, or None.
|
||||
|
||||
Looking for the stand-in's path in the command lines found nothing (strace
|
||||
and its children carry the real binary's path), so the group is the handle:
|
||||
the group of the stand-in's pid, not the pid taken as a group id. Never the
|
||||
group of this test: a stand-in started inside it is killed alone."""
|
||||
pgid = _group_of(pidfile)
|
||||
if pgid is None:
|
||||
return None
|
||||
if pgid == os.getpgrp():
|
||||
try:
|
||||
os.kill(int(pidfile.read_text().strip()), signal.SIGKILL)
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
return None
|
||||
try:
|
||||
os.killpg(pgid, signal.SIGKILL)
|
||||
except OSError:
|
||||
pass
|
||||
return pgid
|
||||
|
||||
|
||||
def _detached(argv: list, **kwargs) -> subprocess.Popen:
|
||||
"""A process started as the core starts the engine: the leader of a process group of its own (``posix_spawn`` with
|
||||
``setpgroup=0`` in ``invisible_core.juggler.connection._spawn_posix``)."""
|
||||
return subprocess.Popen(argv, process_group=0, **kwargs)
|
||||
|
||||
|
||||
def _group_members(pgid: int) -> list:
|
||||
"""Pids still in the process group ``pgid``."""
|
||||
members = []
|
||||
for pid in os.listdir("/proc"):
|
||||
if not pid.isdigit():
|
||||
continue
|
||||
try:
|
||||
stat_line = Path("/proc/%s/stat" % pid).read_text()
|
||||
except OSError:
|
||||
continue
|
||||
fields = stat_line.rsplit(")", 1)[1].split()
|
||||
# fields: state ppid pgrp ...; a zombie is already dead.
|
||||
if fields[0] != "Z" and int(fields[2]) == pgid:
|
||||
members.append(int(pid))
|
||||
return members
|
||||
|
||||
|
||||
def _wait_for_exit(pgid: int, seconds: float = 30.0) -> list:
|
||||
end = time.monotonic() + seconds
|
||||
left = _group_members(pgid)
|
||||
while left and time.monotonic() < end:
|
||||
time.sleep(0.1)
|
||||
left = _group_members(pgid)
|
||||
return left
|
||||
@@ -0,0 +1,99 @@
|
||||
"""What the window e2e tests share: a headed session of the product, and a wait on a condition of a page.
|
||||
|
||||
The sessions are HEADED on purpose. ``headless=True`` gives every session a display of its own (a fresh Xvfb on Linux, a fresh Win32 desktop on
|
||||
Windows), so two of them never see each other; the focus and occlusion tests need two windows on ONE display, which is what two headed sessions of the
|
||||
same run have (the Linux e2e runs under ``xvfb-run``). Both sessions use the same seed, so both windows are the same declared window and the second one
|
||||
covers the first completely.
|
||||
|
||||
The first session is the one of the test's own thread; the second one lives in a thread of its own (``in_a_thread_of_its_own``, the pattern of
|
||||
``test_popups_reach_the_client_e2e.py``): an open sync client keeps its asyncio loop marked as running in the thread that started it, and a second sync client
|
||||
refuses to start there ("It looks like you are using Playwright Sync API inside the asyncio loop"). A sync client's objects belong to the thread that made
|
||||
them, so everything the test does with the second session is handed to that thread (``run``).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import queue
|
||||
import threading
|
||||
from typing import Any, Callable, Dict, Iterator, Optional
|
||||
|
||||
from _waits import Watch, watch
|
||||
|
||||
#: The seed only has to give two sessions the same window.
|
||||
SEED = 21
|
||||
|
||||
#: The deadline of a wait for something that must happen, in seconds.
|
||||
DEADLINE_S = 30
|
||||
|
||||
|
||||
def launch(firefox_binary: str, *, extra_prefs: Optional[Dict[str, Any]] = None, pin: Optional[Dict[str, Any]] = None, headless: bool = False):
|
||||
"""A session of the product (RFP off, the engine declared as the core launches it); ``extra_prefs`` and ``pin`` only where a test needs them."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
return InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=headless, locale="en-US", timezone="America/New_York",
|
||||
extra_prefs=extra_prefs, pin=pin)
|
||||
|
||||
|
||||
def wait_for_condition(page, sample: Callable[[], Any], done: Callable[[Any], Any], what: str, seconds: float = DEADLINE_S) -> Watch:
|
||||
"""Until ``done(sample())``, reading the page between two looks. Red after ``seconds`` with what was seen on the way."""
|
||||
result = watch(sample, done, seconds, lambda: page.wait_for_timeout(100))
|
||||
assert result.ok, "%s; seen: %s" % (what, result.render())
|
||||
return result
|
||||
|
||||
|
||||
class SecondSession:
|
||||
"""A session that lives in a thread of its own: ``run(fn)`` calls ``fn(session)`` in that thread and gives back its result or raises its error."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._jobs: "queue.Queue[Optional[tuple]]" = queue.Queue()
|
||||
|
||||
def run(self, fn: Callable[[Any], Any]) -> Any:
|
||||
box: Dict[str, Any] = {}
|
||||
done = threading.Event()
|
||||
self._jobs.put((fn, box, done))
|
||||
assert done.wait(300), "the second session did not answer within 300 s"
|
||||
if "error" in box:
|
||||
raise box["error"]
|
||||
return box.get("value")
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def in_a_thread_of_its_own(firefox_binary: str, *, extra_prefs: Optional[Dict[str, Any]] = None) -> Iterator[SecondSession]:
|
||||
"""A second headed session on the same display, started and closed in a thread with no asyncio loop; the test keeps the first one in its own thread."""
|
||||
handle = SecondSession()
|
||||
up = threading.Event()
|
||||
failure: Dict[str, BaseException] = {}
|
||||
|
||||
def serve() -> None:
|
||||
try:
|
||||
with launch(firefox_binary, extra_prefs=extra_prefs) as session:
|
||||
up.set()
|
||||
while True:
|
||||
job = handle._jobs.get()
|
||||
if job is None:
|
||||
return
|
||||
fn, box, done = job
|
||||
try:
|
||||
box["value"] = fn(session)
|
||||
except BaseException as exc: # handed back to the test's thread by ``run``
|
||||
box["error"] = exc
|
||||
finally:
|
||||
done.set()
|
||||
except BaseException as exc: # the launch or the close of the session
|
||||
failure["error"] = exc
|
||||
finally:
|
||||
up.set()
|
||||
|
||||
worker = threading.Thread(target=serve, name="second-session", daemon=True)
|
||||
worker.start()
|
||||
assert up.wait(300), "the second session did not start within 300 s"
|
||||
if "error" in failure:
|
||||
raise failure["error"]
|
||||
try:
|
||||
yield handle
|
||||
finally:
|
||||
handle._jobs.put(None)
|
||||
worker.join(120)
|
||||
assert not worker.is_alive(), "the second session did not close within 120 s"
|
||||
if "error" in failure:
|
||||
raise failure["error"]
|
||||
+64
-3
@@ -6,17 +6,22 @@ browser can reach directly (a documentation address held on ``lo``, see ``_turn_
|
||||
source that is not the exit of the proxy, and a test can tell a leak from a drop. It answers a STUN Binding Request with the source it
|
||||
saw, so a road that works also gives the page a server-reflexive candidate.
|
||||
|
||||
``udp`` is every datagram as (source ip, source port, length); ``tcp`` is every connection as (source ip, source port).
|
||||
``udp`` is every datagram as (source ip, source port, length); ``tcp`` is every connection as (source ip, source port), both of a source that
|
||||
is an address of THIS host. The browser runs on this host, so a direct send of it comes from an address of this host; a source that is not
|
||||
one (a runner's address is reachable from the internet, and noise arrives) cannot be the browser. Those arrivals are written down apart,
|
||||
in ``foreign_udp`` and ``foreign_tcp``, and are never answered. ``heard()`` and ``heard_from_other_than()`` speak of the host's only.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import ipaddress
|
||||
import socket
|
||||
import sys
|
||||
import struct
|
||||
import threading
|
||||
from typing import Dict, Iterable, List, Tuple
|
||||
from typing import Dict, Iterable, List, Set, Tuple
|
||||
|
||||
_MAGIC = b"\x21\x12\xa4\x42"
|
||||
_IP_FAMILIES = (socket.AF_INET, socket.AF_INET6)
|
||||
|
||||
#: How many port numbers the witness tries before it gives up, and where it draws them from after the system's own pick: the sequence of
|
||||
#: tests/_ports.py, which the HTTP/3 server and the resolver trap walk too. Below the start of Windows' dynamic range (49152), where its excluded
|
||||
@@ -25,11 +30,48 @@ _MAGIC = b"\x21\x12\xa4\x42"
|
||||
from _ports import DRAW_FROM, TRIES, candidates # noqa: E402
|
||||
|
||||
|
||||
def _normal(ip: str) -> str:
|
||||
"""``ip`` as the one spelling a set compares on (an IPv4-mapped IPv6 address is its IPv4 address; a zone id is dropped)."""
|
||||
try:
|
||||
parsed = ipaddress.ip_address(ip.split("%")[0])
|
||||
except ValueError:
|
||||
return ip
|
||||
mapped = getattr(parsed, "ipv4_mapped", None)
|
||||
return (mapped or parsed).compressed
|
||||
|
||||
|
||||
def host_addresses() -> Set[str]:
|
||||
"""Every IPv4 and IPv6 address assigned to an interface of this machine (loopback and link-local included), normalised.
|
||||
``psutil`` is a dependency of the package and answers the same on Linux and on Windows."""
|
||||
import psutil
|
||||
|
||||
found: Set[str] = set()
|
||||
for addresses in psutil.net_if_addrs().values():
|
||||
for entry in addresses:
|
||||
if entry.family in _IP_FAMILIES:
|
||||
found.add(_normal(entry.address))
|
||||
return found
|
||||
|
||||
|
||||
def is_host_source(ip: str, known: Set[str]) -> bool:
|
||||
"""Whether a source ip is an address of this host: any 127.0.0.0/8, ::1, or one of ``known`` (the host's addresses)."""
|
||||
ip = _normal(ip)
|
||||
try:
|
||||
if ipaddress.ip_address(ip).is_loopback:
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
return ip in known
|
||||
|
||||
|
||||
class Witness:
|
||||
def __init__(self, address: str, port: int = 0) -> None:
|
||||
self.address = address
|
||||
self.udp: List[Tuple[str, int, int]] = []
|
||||
self.tcp: List[Tuple[str, int]] = []
|
||||
self.foreign_udp: List[Tuple[str, int, int]] = []
|
||||
self.foreign_tcp: List[Tuple[str, int]] = []
|
||||
self._host: Set[str] = host_addresses() | {_normal(address)}
|
||||
self._lock = threading.Lock()
|
||||
self._closed = False
|
||||
# One port number for both, TCP and UDP. Each try binds TCP and then UDP on the same number; if either is refused, both
|
||||
@@ -74,6 +116,21 @@ class Witness:
|
||||
with self._lock:
|
||||
return {"udp": list(self.udp), "tcp": list(self.tcp)}
|
||||
|
||||
def heard_foreign(self) -> Dict[str, list]:
|
||||
"""What reached the witness from a source that is NOT an address of this host: not the browser, noise from the network."""
|
||||
with self._lock:
|
||||
return {"udp": list(self.foreign_udp), "tcp": list(self.foreign_tcp)}
|
||||
|
||||
def _is_host(self, ip: str) -> bool:
|
||||
"""Whether ``ip`` is an address of this host; a miss looks at the interfaces again (an address added since) before it is foreign."""
|
||||
if is_host_source(ip, self._host):
|
||||
return True
|
||||
try:
|
||||
self._host |= host_addresses()
|
||||
except Exception:
|
||||
return False
|
||||
return is_host_source(ip, self._host)
|
||||
|
||||
def heard_from_other_than(self, allowed: Iterable[str]) -> Dict[str, list]:
|
||||
"""What the witness heard from a source that is not one of ``allowed`` (the exit of the proxy): a direct send."""
|
||||
ok = set(allowed)
|
||||
@@ -107,6 +164,10 @@ class Witness:
|
||||
continue
|
||||
except OSError:
|
||||
return
|
||||
if not self._is_host(peer[0]):
|
||||
with self._lock:
|
||||
self.foreign_udp.append((peer[0], peer[1], len(data)))
|
||||
continue
|
||||
with self._lock:
|
||||
self.udp.append((peer[0], peer[1], len(data)))
|
||||
if len(data) >= 20 and data[0:2] == b"\x00\x01" and data[4:8] == _MAGIC:
|
||||
@@ -125,7 +186,7 @@ class Witness:
|
||||
except OSError:
|
||||
return
|
||||
with self._lock:
|
||||
self.tcp.append((peer[0], peer[1]))
|
||||
(self.tcp if self._is_host(peer[0]) else self.foreign_tcp).append((peer[0], peer[1]))
|
||||
try:
|
||||
conn.close()
|
||||
except OSError:
|
||||
|
||||
+8
-7
@@ -172,19 +172,20 @@ def _what_the_core_declares_for_a_proxy_is_recorded(monkeypatch):
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _a_unit_test_asks_mozilla_for_no_intermediates_list(request, monkeypatch):
|
||||
"""Outside the e2e, a launch declares no intermediates list.
|
||||
def _a_unit_test_asks_mozilla_for_no_security_state(request, monkeypatch):
|
||||
"""Outside the e2e, a launch asks Mozilla for nothing and runs no generation.
|
||||
|
||||
The core's `write_user_js` (every launch the server makes) declares Mozilla's list: on a cold cache it downloads it in line, and the line it writes would
|
||||
differ with the cache of whoever runs the test. The function is stubbed, as the core's own suite does (tests/conftest.py of invisible-core): no list, no
|
||||
request. The tests of `fetch` set their own; a test marked `e2e` gets the real one (the CI legs point it at the empty file of `ci/intermediates.json`)."""
|
||||
The core's `write_user_js` (every launch the server makes) places the security state in the profile: on a cold cache it downloads Mozilla's collections in line and
|
||||
has the engine generate the state from them, and what it copies would differ with the cache of whoever runs the test. The function the launch calls
|
||||
(`ensure_security_state`) is stubbed, as the core's own suite does (tests/conftest.py of invisible-core): nothing ready, no request, no engine. The tests of `fetch`
|
||||
set their own; a test marked `e2e` gets the real one (the CI legs point STEALTHFOX_SECURITY_STATE at the ready directory of `ci/security-state/`)."""
|
||||
if request.node.get_closest_marker("e2e") is not None:
|
||||
return
|
||||
try:
|
||||
import invisible_core._intermediates as _im
|
||||
import invisible_core._security_state as _ss
|
||||
except Exception: # the package is absent: the tests that need it say so
|
||||
return
|
||||
monkeypatch.setattr(_im, "ensure_intermediates", lambda *a, **kw: None)
|
||||
monkeypatch.setattr(_ss, "ensure_security_state", lambda *a, **kw: None)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
||||
@@ -1,297 +0,0 @@
|
||||
"""Writes the test images and ICC profiles of the canvas colour probe, standard library only.
|
||||
|
||||
python -I gen_images.py <out dir>
|
||||
|
||||
<out dir>/images/*.png|jpg, <out dir>/profiles/*.icc (built by hand: matrix/TRC, ICC v2.1),
|
||||
<out dir>/images.json (id, file, what the tag says). Nothing is downloaded. The pixels are the
|
||||
same 16x16 gradient in every image (R from x, G from y, B from x+y), so the files differ only
|
||||
in the colour tag they carry.
|
||||
"""
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
import zlib
|
||||
|
||||
D50 = (0.9642, 1.0, 0.8249)
|
||||
D65_XY = (0.3127, 0.3290)
|
||||
D50_XY = (0.3457, 0.3585)
|
||||
# name: (primaries xy R,G,B, white xy, trc)
|
||||
SPACES = {
|
||||
"displayp3": (((0.680, 0.320), (0.265, 0.690), (0.150, 0.060)), D65_XY, ("para-srgb",)),
|
||||
"adobergb": (((0.640, 0.330), (0.210, 0.710), (0.150, 0.060)), D65_XY, ("gamma", 563 / 256)),
|
||||
"rec2020": (((0.708, 0.292), (0.170, 0.797), (0.131, 0.046)), D65_XY, ("gamma", 2.4)),
|
||||
"prophoto": (((0.7347, 0.2653), (0.1596, 0.8404), (0.0366, 0.0001)), D50_XY, ("gamma", 1.8)),
|
||||
"srgb": (((0.640, 0.330), (0.300, 0.600), (0.150, 0.060)), D65_XY, ("para-srgb",)),
|
||||
}
|
||||
|
||||
|
||||
def mat_mul(a, b):
|
||||
return [[sum(a[i][k] * b[k][j] for k in range(3)) for j in range(3)] for i in range(3)]
|
||||
|
||||
|
||||
def mat_vec(m, v):
|
||||
return [sum(m[i][k] * v[k] for k in range(3)) for i in range(3)]
|
||||
|
||||
|
||||
def mat_inv(m):
|
||||
a, b, c = m[0]
|
||||
d, e, f = m[1]
|
||||
g, h, i = m[2]
|
||||
det = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g)
|
||||
return [[(e * i - f * h) / det, (c * h - b * i) / det, (b * f - c * e) / det],
|
||||
[(f * g - d * i) / det, (a * i - c * g) / det, (c * d - a * f) / det],
|
||||
[(d * h - e * g) / det, (b * g - a * h) / det, (a * e - b * d) / det]]
|
||||
|
||||
|
||||
def xy_to_xyz(xy):
|
||||
x, y = xy
|
||||
return [x / y, 1.0, (1 - x - y) / y]
|
||||
|
||||
|
||||
BRADFORD = [[0.8951, 0.2664, -0.1614], [-0.7502, 1.7135, 0.0367], [0.0389, -0.0685, 1.0296]]
|
||||
|
||||
|
||||
def adapt(src_white, dst_white):
|
||||
s = mat_vec(BRADFORD, src_white)
|
||||
d = mat_vec(BRADFORD, dst_white)
|
||||
scale = [[d[0] / s[0], 0, 0], [0, d[1] / s[1], 0], [0, 0, d[2] / s[2]]]
|
||||
return mat_mul(mat_inv(BRADFORD), mat_mul(scale, BRADFORD))
|
||||
|
||||
|
||||
def colorants_d50(prim, white_xy):
|
||||
"""The rXYZ, gXYZ, bXYZ columns adapted (Bradford) to the D50 PCS."""
|
||||
cols = [xy_to_xyz(p) for p in prim]
|
||||
m = [[cols[j][i] for j in range(3)] for i in range(3)]
|
||||
s = mat_vec(mat_inv(m), xy_to_xyz(white_xy))
|
||||
rgb2xyz = [[m[i][j] * s[j] for j in range(3)] for i in range(3)]
|
||||
ad = adapt(xy_to_xyz(white_xy), list(D50))
|
||||
out = mat_mul(ad, rgb2xyz)
|
||||
return [[out[i][j] for i in range(3)] for j in range(3)] # per channel XYZ
|
||||
|
||||
|
||||
def s15(v):
|
||||
return struct.pack(">i", int(round(v * 65536)))
|
||||
|
||||
|
||||
def tag_xyz(v):
|
||||
return b"XYZ \0\0\0\0" + s15(v[0]) + s15(v[1]) + s15(v[2])
|
||||
|
||||
|
||||
def tag_text(s):
|
||||
return b"text\0\0\0\0" + s.encode("ascii") + b"\0"
|
||||
|
||||
|
||||
def tag_desc(s):
|
||||
b = s.encode("ascii") + b"\0"
|
||||
return (b"desc\0\0\0\0" + struct.pack(">I", len(b)) + b + struct.pack(">II", 0, 0)
|
||||
+ struct.pack(">HB", 0, 0) + b"\0" * 67)
|
||||
|
||||
|
||||
def tag_trc(trc):
|
||||
if trc[0] == "gamma":
|
||||
return b"curv\0\0\0\0" + struct.pack(">IH", 1, int(round(trc[1] * 256))) + b"\0\0"
|
||||
# parametric type 3: Y = (aX+b)^g for X >= d, cX otherwise (the sRGB curve)
|
||||
return (b"para\0\0\0\0" + struct.pack(">HH", 3, 0) + s15(2.4) + s15(1 / 1.055) + s15(0.055 / 1.055)
|
||||
+ s15(1 / 12.92) + s15(0.04045))
|
||||
|
||||
|
||||
def pad4(b):
|
||||
return b + b"\0" * (-len(b) % 4)
|
||||
|
||||
|
||||
def build_icc(name):
|
||||
prim, white, trc = SPACES[name]
|
||||
cols = colorants_d50(prim, white)
|
||||
trc_b = pad4(tag_trc(trc))
|
||||
tags = [(b"desc", pad4(tag_desc("invisible probe " + name))),
|
||||
(b"cprt", pad4(tag_text("public domain, generated by gen_images.py"))),
|
||||
(b"wtpt", tag_xyz(D50)),
|
||||
(b"rXYZ", tag_xyz(cols[0])), (b"gXYZ", tag_xyz(cols[1])), (b"bXYZ", tag_xyz(cols[2])),
|
||||
(b"rTRC", trc_b), (b"gTRC", trc_b), (b"bTRC", trc_b)]
|
||||
off = 128 + 4 + 12 * len(tags)
|
||||
table = struct.pack(">I", len(tags))
|
||||
body = b""
|
||||
seen = {}
|
||||
for sig, data in tags:
|
||||
if data in seen and sig.endswith(b"TRC"):
|
||||
o = seen[data]
|
||||
else:
|
||||
o = off + len(body)
|
||||
body += data
|
||||
seen[data] = o
|
||||
table += sig + struct.pack(">II", o, len(data))
|
||||
size = 128 + len(table) + len(body)
|
||||
hdr = (struct.pack(">I", size) + b"\0\0\0\0" + bytes([2, 0x10, 0, 0]) + b"mntrRGB XYZ "
|
||||
+ struct.pack(">6H", 2026, 11, 9, 0, 0, 0) + b"acsp"
|
||||
+ b"\0" * 28 # platform, flags, manufacturer, model, attributes (8), rendering intent
|
||||
+ s15(D50[0]) + s15(D50[1]) + s15(D50[2]) + b"\0" * 4 + b"\0" * 16 + b"\0" * 28)
|
||||
assert len(hdr) == 128, len(hdr)
|
||||
return hdr + table + body
|
||||
|
||||
|
||||
def pixels():
|
||||
rows = []
|
||||
for y in range(16):
|
||||
rows.append([(x * 17, y * 17, (x + y) * 17 // 2) for x in range(16)])
|
||||
return rows
|
||||
|
||||
|
||||
def chunk(typ, data):
|
||||
c = typ + data
|
||||
return struct.pack(">I", len(data)) + c + struct.pack(">I", zlib.crc32(c) & 0xFFFFFFFF)
|
||||
|
||||
|
||||
def png(extra):
|
||||
raw = b"".join(b"\0" + bytes(v for px in row for v in px) for row in pixels())
|
||||
return (b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", struct.pack(">IIBBBBB", 16, 16, 8, 2, 0, 0, 0))
|
||||
+ b"".join(chunk(t, d) for t, d in extra) + chunk(b"IDAT", zlib.compress(raw, 9)) + chunk(b"IEND", b""))
|
||||
|
||||
|
||||
def iccp(name, profile):
|
||||
return (b"iCCP", name.encode() + b"\0\0" + zlib.compress(profile, 9))
|
||||
|
||||
|
||||
def chrm(prim, white):
|
||||
vals = [white[0], white[1]] + [c for p in prim for c in p]
|
||||
return (b"cHRM", b"".join(struct.pack(">I", int(round(v * 100000))) for v in vals))
|
||||
|
||||
|
||||
# ---- baseline JPEG, 4:4:4, quantisation all 1, own Huffman tables (no tables copied from anywhere)
|
||||
ZIGZAG = [0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14,
|
||||
21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53,
|
||||
60, 61, 54, 47, 55, 62, 63]
|
||||
AC_SYMS = [0x00, 0xF0] + [(r << 4) | s for r in range(16) for s in range(1, 11)] # 162 symbols, 8-bit codes 0..161
|
||||
|
||||
|
||||
def dct8(block):
|
||||
out = [0.0] * 64
|
||||
for u in range(8):
|
||||
for v in range(8):
|
||||
s = 0.0
|
||||
for x in range(8):
|
||||
for y in range(8):
|
||||
s += block[y * 8 + x] * math.cos((2 * x + 1) * u * math.pi / 16) * math.cos((2 * y + 1) * v * math.pi / 16)
|
||||
cu = 1 / math.sqrt(2) if u == 0 else 1
|
||||
cv = 1 / math.sqrt(2) if v == 0 else 1
|
||||
out[v * 8 + u] = 0.25 * cu * cv * s
|
||||
return out
|
||||
|
||||
|
||||
def jpeg(profile):
|
||||
ycc = []
|
||||
for row in pixels():
|
||||
r = []
|
||||
for (R, G, B) in row:
|
||||
r.append((0.299 * R + 0.587 * G + 0.114 * B,
|
||||
-0.168736 * R - 0.331264 * G + 0.5 * B + 128,
|
||||
0.5 * R - 0.418688 * G - 0.081312 * B + 128))
|
||||
ycc.append(r)
|
||||
bits = []
|
||||
|
||||
def put(code, n):
|
||||
for i in range(n - 1, -1, -1):
|
||||
bits.append((code >> i) & 1)
|
||||
|
||||
def cat(v):
|
||||
return 0 if v == 0 else abs(v).bit_length()
|
||||
|
||||
def amp(v, s):
|
||||
return v if v >= 0 else v + (1 << s) - 1
|
||||
|
||||
pred = [0, 0, 0]
|
||||
for by in range(2):
|
||||
for bx in range(2):
|
||||
for c in range(3):
|
||||
blk = [ycc[by * 8 + y][bx * 8 + x][c] - 128 for y in range(8) for x in range(8)]
|
||||
co = [int(round(v)) for v in dct8(blk)]
|
||||
zz = [co[i] for i in ZIGZAG]
|
||||
d = zz[0] - pred[c]
|
||||
pred[c] = zz[0]
|
||||
s = cat(d)
|
||||
put(s, 4) # DC symbol s has the 4-bit code s
|
||||
if s:
|
||||
put(amp(d, s), s)
|
||||
run = 0
|
||||
last = max([i for i in range(1, 64) if zz[i]] or [0])
|
||||
for i in range(1, last + 1):
|
||||
v = zz[i]
|
||||
if v == 0:
|
||||
run += 1
|
||||
continue
|
||||
while run > 15:
|
||||
put(AC_SYMS.index(0xF0), 8)
|
||||
run -= 16
|
||||
s = cat(v)
|
||||
put(AC_SYMS.index((run << 4) | s), 8)
|
||||
put(amp(v, s), s)
|
||||
run = 0
|
||||
if last < 63:
|
||||
put(AC_SYMS.index(0x00), 8)
|
||||
while len(bits) % 8:
|
||||
bits.append(1)
|
||||
data = bytearray()
|
||||
for i in range(0, len(bits), 8):
|
||||
b = int("".join(map(str, bits[i:i + 8])), 2)
|
||||
data.append(b)
|
||||
if b == 0xFF:
|
||||
data.append(0)
|
||||
|
||||
def seg(m, payload):
|
||||
return bytes([0xFF, m]) + struct.pack(">H", len(payload) + 2) + payload
|
||||
|
||||
icc = b"ICC_PROFILE\0" + bytes([1, 1]) + profile
|
||||
out = b"\xFF\xD8" + seg(0xE0, b"JFIF\0\x01\x01\0\0\x01\0\x01\0\0") + seg(0xE2, icc)
|
||||
out += seg(0xDB, bytes([0]) + bytes([1] * 64))
|
||||
out += seg(0xC0, bytes([8]) + struct.pack(">HH", 16, 16) + bytes([3, 1, 0x11, 0, 2, 0x11, 0, 3, 0x11, 0]))
|
||||
out += seg(0xC4, bytes([0x00]) + bytes([0, 0, 0, 12] + [0] * 12) + bytes(range(12)))
|
||||
out += seg(0xC4, bytes([0x10]) + bytes([0] * 7 + [len(AC_SYMS)] + [0] * 8) + bytes(AC_SYMS))
|
||||
out += seg(0xDA, bytes([3, 1, 0x00, 2, 0x00, 3, 0x00, 0, 63, 0])) + bytes(data) + b"\xFF\xD9"
|
||||
return out
|
||||
|
||||
|
||||
def build_images():
|
||||
"""The ten test images, in memory: a list of (id, extension, bytes, what the tag says),
|
||||
and the five generated ICC profiles by name. Deterministic: the same bytes on every run."""
|
||||
profs = {n: build_icc(n) for n in SPACES}
|
||||
p3prim, p3white, _ = SPACES["displayp3"]
|
||||
imgs = [
|
||||
("iccp-displayp3", "png", png([iccp("p3", profs["displayp3"])]), "iCCP Display P3 (matrix, sRGB-curve parametric TRC)"),
|
||||
("iccp-adobergb", "png", png([iccp("a98", profs["adobergb"])]), "iCCP Adobe RGB (1998) (matrix, gamma 563/256)"),
|
||||
("iccp-rec2020", "png", png([iccp("r2020", profs["rec2020"])]), "iCCP Rec.2020 primaries (matrix, gamma 2.4)"),
|
||||
("iccp-prophoto", "png", png([iccp("pp", profs["prophoto"])]), "iCCP ProPhoto RGB (matrix, gamma 1.8, D50 white)"),
|
||||
("iccp-srgb", "png", png([iccp("s", profs["srgb"])]), "iCCP sRGB primaries (matrix, sRGB parametric TRC): control"),
|
||||
("cicp-p3", "png", png([(b"cICP", bytes([12, 13, 0, 1]))]), "cICP primaries 12 (Display P3), transfer 13 (sRGB), full range"),
|
||||
("gama-chrm-p3", "png", png([(b"gAMA", struct.pack(">I", 45455)), chrm(p3prim, p3white)]), "gAMA 45455 + cHRM of Display P3"),
|
||||
("srgb-chunk", "png", png([(b"sRGB", b"\0")]), "sRGB chunk, perceptual"),
|
||||
("untagged", "png", png([]), "no colour tag"),
|
||||
("jpeg-icc-displayp3", "jpg", jpeg(profs["displayp3"]), "JPEG (own encoder) with APP2 ICC Display P3"),
|
||||
]
|
||||
return imgs, profs
|
||||
|
||||
|
||||
def images_json(imgs):
|
||||
"""What the page fetches as images.json: id, URL (relative) and the tag, per image."""
|
||||
return [{"id": iid, "file": "images/%s.%s" % (iid, ext), "tag": what}
|
||||
for iid, ext, _data, what in imgs]
|
||||
|
||||
|
||||
def main():
|
||||
out = sys.argv[1]
|
||||
os.makedirs(os.path.join(out, "images"), exist_ok=True)
|
||||
os.makedirs(os.path.join(out, "profiles"), exist_ok=True)
|
||||
imgs, profs = build_images()
|
||||
for n, p in profs.items():
|
||||
with open(os.path.join(out, "profiles", n + ".icc"), "wb") as f:
|
||||
f.write(p)
|
||||
for (iid, ext, data, _what), meta in zip(imgs, images_json(imgs)):
|
||||
with open(os.path.join(out, meta["file"]), "wb") as f:
|
||||
f.write(data)
|
||||
with open(os.path.join(out, "images.json"), "w") as f:
|
||||
json.dump(images_json(imgs), f, indent=1)
|
||||
print("wrote %d images and %d profiles to %s" % (len(imgs), len(profs), out))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,102 +0,0 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>canvas colour readback probe</title>
|
||||
<body>
|
||||
<script>
|
||||
"use strict";
|
||||
// Reads, from a page served on localhost, the bytes the canvas 2D hands back after a tagged image is
|
||||
// drawn (drawImage, createImageBitmap) and after fillRect with CSS colour functions. Result: window.R.
|
||||
const hex = (u8) => Array.from(u8, (b) => b.toString(16).padStart(2, "0")).join("");
|
||||
async function sha(u8) { return hex(new Uint8Array(await crypto.subtle.digest("SHA-256", u8))); }
|
||||
|
||||
async function readCanvas(c) {
|
||||
const ctx = c.getContext("2d");
|
||||
const d = ctx.getImageData(0, 0, c.width, c.height).data;
|
||||
const u8 = new Uint8Array(d.buffer, d.byteOffset, d.byteLength);
|
||||
return { sha256: await sha(u8), rgba_hex: hex(u8) };
|
||||
}
|
||||
|
||||
function loadImage(url) {
|
||||
return new Promise((res, rej) => {
|
||||
const i = new Image();
|
||||
i.onload = () => res(i);
|
||||
i.onerror = () => rej(new Error("image load failed " + url));
|
||||
i.src = url;
|
||||
});
|
||||
}
|
||||
|
||||
async function drawProbe(draw, size) {
|
||||
const c = document.createElement("canvas");
|
||||
c.width = size; c.height = size;
|
||||
const ctx = c.getContext("2d");
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
await draw(ctx, size);
|
||||
return readCanvas(c);
|
||||
}
|
||||
|
||||
const FILLS = [
|
||||
"color(srgb 1 0 0)", "color(srgb 0.2 0.8 0.4)",
|
||||
"color(display-p3 1 0 0)", "color(display-p3 0 1 0)", "color(display-p3 0.2 0.8 0.4)", "color(display-p3 0.5 0.5 0.5)",
|
||||
"color(a98-rgb 0.2 0.8 0.4)", "color(prophoto-rgb 0.2 0.8 0.4)", "color(rec2020 0.2 0.8 0.4)",
|
||||
"color(xyz-d65 0.2 0.3 0.4)", "color(xyz-d50 0.2 0.3 0.4)",
|
||||
"color-mix(in oklab, red 30%, blue)", "color-mix(in srgb, red 30%, blue)", "color-mix(in display-p3, color(display-p3 1 0 0) 30%, blue)",
|
||||
"color-mix(in oklch, #336699 40%, #cc9933)", "oklab(0.6 0.1 -0.1)", "oklch(0.7 0.15 150)", "lab(60 40 -30)", "lch(60 40 200)",
|
||||
"hsl(200 60% 40%)", "#336699", "rgba(51,102,153,0.5)",
|
||||
];
|
||||
|
||||
async function run() {
|
||||
const R = { env: {}, images: {}, fills: {}, canvas_colorspace: {} };
|
||||
const mq = (q) => { try { return matchMedia(q).matches; } catch (e) { return "error"; } };
|
||||
R.env = {
|
||||
"color-gamut:srgb": mq("(color-gamut: srgb)"), "color-gamut:p3": mq("(color-gamut: p3)"), "color-gamut:rec2020": mq("(color-gamut: rec2020)"),
|
||||
"dynamic-range:high": mq("(dynamic-range: high)"), "video-dynamic-range:high": mq("(video-dynamic-range: high)"),
|
||||
"prefers-color-scheme:dark": mq("(prefers-color-scheme: dark)"),
|
||||
colorDepth: screen.colorDepth, pixelDepth: screen.pixelDepth, devicePixelRatio: window.devicePixelRatio,
|
||||
};
|
||||
const list = await (await fetch("images.json")).json();
|
||||
for (const it of list) {
|
||||
const out = { tag: it.tag };
|
||||
try {
|
||||
const img = await loadImage(it.file);
|
||||
out.natural = [img.naturalWidth, img.naturalHeight];
|
||||
out.drawImage = await drawProbe((ctx) => ctx.drawImage(img, 0, 0), 16);
|
||||
out.drawImage_scaled32 = await drawProbe((ctx) => ctx.drawImage(img, 0, 0, 32, 32), 32);
|
||||
const blob = await (await fetch(it.file)).blob();
|
||||
for (const csc of ["default", "none"]) {
|
||||
try {
|
||||
const bmp = await createImageBitmap(blob, { colorSpaceConversion: csc });
|
||||
out["bitmap_" + csc] = await drawProbe((ctx) => ctx.drawImage(bmp, 0, 0), 16);
|
||||
bmp.close();
|
||||
} catch (e) { out["bitmap_" + csc] = { error: String(e) }; }
|
||||
}
|
||||
} catch (e) { out.error = String(e); }
|
||||
R.images[it.id] = out;
|
||||
}
|
||||
for (const f of FILLS) {
|
||||
try {
|
||||
const c = document.createElement("canvas"); c.width = 16; c.height = 16;
|
||||
const ctx = c.getContext("2d");
|
||||
ctx.fillStyle = "#010203"; ctx.fillStyle = f;
|
||||
if (ctx.fillStyle === "#010203") { R.fills[f] = { unsupported: true }; continue; }
|
||||
ctx.fillRect(0, 0, 16, 16);
|
||||
const r = await readCanvas(c);
|
||||
R.fills[f] = { sha256: r.sha256, rgba: r.rgba_hex.slice(0, 8), fillStyle_readback: ctx.fillStyle };
|
||||
} catch (e) { R.fills[f] = { error: String(e) }; }
|
||||
}
|
||||
// canvas with colorSpace option and putImageData/getImageData colorSpace
|
||||
try {
|
||||
const c = document.createElement("canvas"); c.width = 16; c.height = 16;
|
||||
const ctx = c.getContext("2d", { colorSpace: "display-p3" });
|
||||
const attrs = ctx.getContextAttributes ? ctx.getContextAttributes() : null;
|
||||
R.canvas_colorspace.attributes = attrs ? { colorSpace: attrs.colorSpace } : "no getContextAttributes";
|
||||
R.canvas_colorspace.ctx_colorSpace = ctx.colorSpace === undefined ? "undefined" : ctx.colorSpace;
|
||||
ctx.fillStyle = "color(display-p3 1 0 0)"; ctx.fillRect(0, 0, 16, 16);
|
||||
const r = await readCanvas(c);
|
||||
R.canvas_colorspace.p3_fill_p3_canvas = { sha256: r.sha256, rgba: r.rgba_hex.slice(0, 8) };
|
||||
} catch (e) { R.canvas_colorspace.error = String(e); }
|
||||
window.R = R;
|
||||
window.DONE = true;
|
||||
}
|
||||
run().catch((e) => { window.ERR = String(e && e.stack || e); });
|
||||
</script>
|
||||
</body>
|
||||
@@ -1,505 +0,0 @@
|
||||
{
|
||||
"test_page": "index.html",
|
||||
"image_generator": "gen_images.py",
|
||||
"source": {
|
||||
"capture": "canvas-color/canvas-color-icc-readback",
|
||||
"reference_run": "runs/a_win_default.json",
|
||||
"repeat_run": "runs/a2_win_default_repeat.json (same hashes on all probes)",
|
||||
"control_run": "runs/b_win_force_srgb.json (gfx.color_management.force_srgb=true)",
|
||||
"date": "2026-11-09"
|
||||
},
|
||||
"firefox": {
|
||||
"buildid": "20261022150525",
|
||||
"exe": "firefox.exe",
|
||||
"exe_sha256": "d8b5ed82fcd9c0f159dc86dc1c4526ceae981c4d9651f21908b6de90d0a56d85",
|
||||
"os": "Windows_NT",
|
||||
"os_version": "10.0",
|
||||
"version": "159.0",
|
||||
"prefs": {
|
||||
"gfx.canvas.accelerated": false,
|
||||
"gfx.color_management.display_profile": "",
|
||||
"gfx.color_management.force_srgb": false,
|
||||
"gfx.color_management.mode": 2,
|
||||
"gfx.color_management.native_srgb": false
|
||||
}
|
||||
},
|
||||
"display_profile": {
|
||||
"file": "sRGB Color Space Profile.icm",
|
||||
"size": 3144,
|
||||
"sha256": "2b3aa1645779a9e634744faf9b01e9102b0c9b88fd6deced7934df86b949af7e",
|
||||
"api": "GetICMProfileW"
|
||||
},
|
||||
"images": {
|
||||
"iccp-displayp3": {
|
||||
"file": "images/iccp-displayp3.png",
|
||||
"bytes": 839,
|
||||
"sha256": "d0b1cb83418856be9238914c623c62304656dca6e1f8d72fab4b1907501fc94a"
|
||||
},
|
||||
"iccp-adobergb": {
|
||||
"file": "images/iccp-adobergb.png",
|
||||
"bytes": 821,
|
||||
"sha256": "b66251789a8432ac74e80206e5a5eed6368f1244e53394b02256260b712a10e5"
|
||||
},
|
||||
"iccp-rec2020": {
|
||||
"file": "images/iccp-rec2020.png",
|
||||
"bytes": 824,
|
||||
"sha256": "7c58cc0c31435196f37288fb600c4220effd27cca4f34285e40f098f84086133"
|
||||
},
|
||||
"iccp-prophoto": {
|
||||
"file": "images/iccp-prophoto.png",
|
||||
"bytes": 812,
|
||||
"sha256": "ca661ae5c42dfda0e9fe1b1eca2a08e1f2f7137cec112afd59d2a2480cfa9b24"
|
||||
},
|
||||
"iccp-srgb": {
|
||||
"file": "images/iccp-srgb.png",
|
||||
"bytes": 833,
|
||||
"sha256": "fc84c167782b6d17d3e4f462e696f41e98c90c71adeaddeefdfde7bbc02123bb"
|
||||
},
|
||||
"cicp-p3": {
|
||||
"file": "images/cicp-p3.png",
|
||||
"bytes": 572,
|
||||
"sha256": "5c2de96dbcfd4e2255785974d33082ccfb8e297b486676222a09f2922a3972ed"
|
||||
},
|
||||
"gama-chrm-p3": {
|
||||
"file": "images/gama-chrm-p3.png",
|
||||
"bytes": 616,
|
||||
"sha256": "e07805116e2a9a40e901401c00d1beb8b47f82d6e8f9708be335f06486429f26"
|
||||
},
|
||||
"srgb-chunk": {
|
||||
"file": "images/srgb-chunk.png",
|
||||
"bytes": 569,
|
||||
"sha256": "6481d9b1e09b6b89b7d7355328ade8ceaf2fec3cfe6e7bf57e052a26c4589576"
|
||||
},
|
||||
"untagged": {
|
||||
"file": "images/untagged.png",
|
||||
"bytes": 556,
|
||||
"sha256": "d10d32213102277c1b28271a19ce56aac0553bc784023e2640b9713a5ef10677"
|
||||
},
|
||||
"jpeg-icc-displayp3": {
|
||||
"file": "images/jpeg-icc-displayp3.jpg",
|
||||
"bytes": 1044,
|
||||
"sha256": "26ecbdd5a632c531522cbbda37133dd405a6135669b6a810874ddf3a5151b61b"
|
||||
}
|
||||
},
|
||||
"probe_count": 72,
|
||||
"profile_dependent_count": 27,
|
||||
"profile_dependent": [
|
||||
"cicp-p3 | bitmap_default",
|
||||
"cicp-p3 | drawImage",
|
||||
"cicp-p3 | drawImage_scaled32",
|
||||
"gama-chrm-p3 | bitmap_default",
|
||||
"gama-chrm-p3 | drawImage",
|
||||
"gama-chrm-p3 | drawImage_scaled32",
|
||||
"iccp-adobergb | bitmap_default",
|
||||
"iccp-adobergb | drawImage",
|
||||
"iccp-adobergb | drawImage_scaled32",
|
||||
"iccp-displayp3 | bitmap_default",
|
||||
"iccp-displayp3 | drawImage",
|
||||
"iccp-displayp3 | drawImage_scaled32",
|
||||
"iccp-prophoto | bitmap_default",
|
||||
"iccp-prophoto | drawImage",
|
||||
"iccp-prophoto | drawImage_scaled32",
|
||||
"iccp-rec2020 | bitmap_default",
|
||||
"iccp-rec2020 | drawImage",
|
||||
"iccp-rec2020 | drawImage_scaled32",
|
||||
"iccp-srgb | bitmap_default",
|
||||
"iccp-srgb | drawImage",
|
||||
"iccp-srgb | drawImage_scaled32",
|
||||
"jpeg-icc-displayp3 | bitmap_default",
|
||||
"jpeg-icc-displayp3 | drawImage",
|
||||
"jpeg-icc-displayp3 | drawImage_scaled32",
|
||||
"srgb-chunk | bitmap_default",
|
||||
"srgb-chunk | drawImage",
|
||||
"srgb-chunk | drawImage_scaled32"
|
||||
],
|
||||
"probes": {
|
||||
"cicp-p3 | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "da7e0175bb0c175e3d8bd5f6c9ca408707103b4b6a2d276233eca8c92d16b577",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "36c40e179db9bda2444948eee00fa2b9af802a42b7183e5caa46ff5100d46558"
|
||||
},
|
||||
"cicp-p3 | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "dcb22689a38b7a73881b1e998bdec904b9cb4ab17b4d0f339fae9d1d2b119bd8",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "68bc6166faaabddf135829bb9ea5bcec861938cb5f304f9fca235d59737fe1d9"
|
||||
},
|
||||
"cicp-p3 | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "da7e0175bb0c175e3d8bd5f6c9ca408707103b4b6a2d276233eca8c92d16b577",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "36c40e179db9bda2444948eee00fa2b9af802a42b7183e5caa46ff5100d46558"
|
||||
},
|
||||
"cicp-p3 | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"gama-chrm-p3 | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "40794d510b713345bd0f1e972078cbc794bab9a031b93cd6993fb1d303210571",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "9e5bba7e830226a96689458592f8a51f43161d9a61c989705022fbe8027fd247"
|
||||
},
|
||||
"gama-chrm-p3 | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "cf3fb3bd1722ec5155bb4b9a04de3d6e9468ad586e0417d75e6bc21a8bd09a1a",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "65051f0a8b4ff1112fd8b37682ae481a932d08ab6a8da1fe5902192f61450027"
|
||||
},
|
||||
"gama-chrm-p3 | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "40794d510b713345bd0f1e972078cbc794bab9a031b93cd6993fb1d303210571",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "9e5bba7e830226a96689458592f8a51f43161d9a61c989705022fbe8027fd247"
|
||||
},
|
||||
"gama-chrm-p3 | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"iccp-adobergb | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "b13bc0493dfad6d36c6763077c5a9144c217777fd0f282a344a11f1966910905",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "ec8e92bb2dfedc2c4ed7a86a22e5d88aaf3176f5bf95a1bc95d4a0d9207b2145"
|
||||
},
|
||||
"iccp-adobergb | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "5902f7aab7e9420a50e6c0145ed7f192355f061eb03290279b9b57c7f44f1240",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "4641000ca8c7208c7c773a640d9e739e5893d871010ebdcf18642b34a60bc2b1"
|
||||
},
|
||||
"iccp-adobergb | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "b13bc0493dfad6d36c6763077c5a9144c217777fd0f282a344a11f1966910905",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "ec8e92bb2dfedc2c4ed7a86a22e5d88aaf3176f5bf95a1bc95d4a0d9207b2145"
|
||||
},
|
||||
"iccp-adobergb | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"iccp-displayp3 | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "1320722da92c41789949998337f35ec8159f698b123581d56a464b24c64982bc",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "551fb216de2b52c749e7010781ea575f5068907f28fe673c8d0820e67ba8ab1a"
|
||||
},
|
||||
"iccp-displayp3 | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "b387a847012c88a79c3f18ad52e32a1aef606354b846e24d66c376e1e1c9c25d",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "fb974c99747b957e44a325789effaad9a548a52a8b75077a22cc1ce7648448f8"
|
||||
},
|
||||
"iccp-displayp3 | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "1320722da92c41789949998337f35ec8159f698b123581d56a464b24c64982bc",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "551fb216de2b52c749e7010781ea575f5068907f28fe673c8d0820e67ba8ab1a"
|
||||
},
|
||||
"iccp-displayp3 | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"iccp-prophoto | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "4fab448b2199c831c15ec6ddfa4c923a73bcb5f67ec1893f53c8282525512b20",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "c3637f042c01b44fd5c7ff59a5948695e9ea6e396056be7589e475c8a46f19a0"
|
||||
},
|
||||
"iccp-prophoto | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "367bc57e1fd774471cdcd1098335af3fb54d2c009c4a530aecc8806bfceb65f4",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "840d2c6b5264364f23c63a33c21380797c61e40a75750e11a69266057d381298"
|
||||
},
|
||||
"iccp-prophoto | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "4fab448b2199c831c15ec6ddfa4c923a73bcb5f67ec1893f53c8282525512b20",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "c3637f042c01b44fd5c7ff59a5948695e9ea6e396056be7589e475c8a46f19a0"
|
||||
},
|
||||
"iccp-prophoto | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"iccp-rec2020 | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "4d837ae68e7ef5039bc2cf88812ebbf7eae8624922191741d4157f697f3283db",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "f6aca679f032c943db350b8a942dcb189e48ff097617f91441082c560ba76400"
|
||||
},
|
||||
"iccp-rec2020 | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "09fdec5e80bdff0cc09171bc2c627657484ec1c5cd390d86edc6cb8c3f9fb406",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "2aa895aa06e8b06ed0fe9629a2ba97ed3fc3ec978d21a9f9871859784a96d38f"
|
||||
},
|
||||
"iccp-rec2020 | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "4d837ae68e7ef5039bc2cf88812ebbf7eae8624922191741d4157f697f3283db",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "f6aca679f032c943db350b8a942dcb189e48ff097617f91441082c560ba76400"
|
||||
},
|
||||
"iccp-rec2020 | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"iccp-srgb | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "f0f7aa5f113b0409ec14f6ba894b5e7749d79b3cafd6ea9c88632c1f0a9dbbb7"
|
||||
},
|
||||
"iccp-srgb | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "464a7a31f6a336c88616ff1bd651e6d569287aaf9445891d65f30a5b3c019bc7",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "96d26754fcd4e0c13ab72dd3e5f569eb49bed726de3da7b16bac7094f30a8d12"
|
||||
},
|
||||
"iccp-srgb | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "f0f7aa5f113b0409ec14f6ba894b5e7749d79b3cafd6ea9c88632c1f0a9dbbb7"
|
||||
},
|
||||
"iccp-srgb | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"jpeg-icc-displayp3 | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "782dc2e3d91cedc3bd985480e0575812f790ca5788fc116483baa4e551b04115",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "4c3b8db4f93d8b0ba68891cd3fdb29627b762f594286811364ac7dbb182abb5c"
|
||||
},
|
||||
"jpeg-icc-displayp3 | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "760cb8015791f49de184209a7f9b7f0cdecf7ad6dd9f89701477f840af446291",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "0d5bcd78f2230a685636cafb732109384b42064bd710631a57fe653554865f6f"
|
||||
},
|
||||
"jpeg-icc-displayp3 | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "782dc2e3d91cedc3bd985480e0575812f790ca5788fc116483baa4e551b04115",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "4c3b8db4f93d8b0ba68891cd3fdb29627b762f594286811364ac7dbb182abb5c"
|
||||
},
|
||||
"jpeg-icc-displayp3 | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "1319eeadc9d1d109384f113e3fdcf6d66db169b5fd8ede666055b3e3da70f23c",
|
||||
"bytes": 1024
|
||||
},
|
||||
"srgb-chunk | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "ff2033eebf547bf729b8ed5cde16e5cda42729f141aa2b2eaa2d693513d61542",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73"
|
||||
},
|
||||
"srgb-chunk | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "4805ce9fad88c53aa5f9df7c5ec7352fdf55691377f4d00986c7e6b76dac9ac9",
|
||||
"bytes": 4096,
|
||||
"without_conversion_sha256": "464a7a31f6a336c88616ff1bd651e6d569287aaf9445891d65f30a5b3c019bc7"
|
||||
},
|
||||
"srgb-chunk | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "ff2033eebf547bf729b8ed5cde16e5cda42729f141aa2b2eaa2d693513d61542",
|
||||
"bytes": 1024,
|
||||
"without_conversion_sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73"
|
||||
},
|
||||
"srgb-chunk | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"untagged | drawImage": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"untagged | drawImage_scaled32": {
|
||||
"kind": "image",
|
||||
"sha256": "464a7a31f6a336c88616ff1bd651e6d569287aaf9445891d65f30a5b3c019bc7",
|
||||
"bytes": 4096
|
||||
},
|
||||
"untagged | bitmap_default": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"untagged | bitmap_none": {
|
||||
"kind": "image",
|
||||
"sha256": "4408185fd170878816ebdc7412ecc36d75d53a02ff41a07f4f76c9042a531b73",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | #336699": {
|
||||
"kind": "fill",
|
||||
"sha256": "071cae1acd9f38907222c770e611ba43fea0ade431c883ea8a88824e0aadd1c8",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(a98-rgb 0.2 0.8 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "4258c9f7552305c497331032b1ca6413b1d1edd099e0d4ffef3a896be30531eb",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(display-p3 0 1 0)": {
|
||||
"kind": "fill",
|
||||
"sha256": "0b3b4eba5c7d53beec5ac1aa3b64c56188bcbf52906e124e5ab3e77a96fdd9cd",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(display-p3 0.2 0.8 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "290e0a38d91b939f45da0a3889e4398944bbd9e5cb89fed8fadb5479bdb65cd5",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(display-p3 0.5 0.5 0.5)": {
|
||||
"kind": "fill",
|
||||
"sha256": "041338275ad973347712ad0ea33583ae668a01fbef9a12c2ebf0f6b227c1bc87",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(display-p3 1 0 0)": {
|
||||
"kind": "fill",
|
||||
"sha256": "71205eb7a329a3ead670c77eee185c0fbeb612f7a2b3d6aadbe2af4f9276b60d",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(prophoto-rgb 0.2 0.8 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "1c19bf5b233573459d494705c2ee42bd2d0238701eea614af76e28066dd2a836",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(rec2020 0.2 0.8 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "6ca68d3ad37c475f5571e34aa0233cd2ebb710cac5d12375975a5fcadfd49cd4",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(srgb 0.2 0.8 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "daed9ae3ff78acf0f758d2a4ddfad5e10f14a053f2718e7835fe3b535dabf3fb",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(srgb 1 0 0)": {
|
||||
"kind": "fill",
|
||||
"sha256": "71205eb7a329a3ead670c77eee185c0fbeb612f7a2b3d6aadbe2af4f9276b60d",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(xyz-d50 0.2 0.3 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "75fc3134903d2193aa029256f8b99c5d87cfbce7286ec890d3cf4d7477ee9947",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color(xyz-d65 0.2 0.3 0.4)": {
|
||||
"kind": "fill",
|
||||
"sha256": "966ab57aae3025be30c2452c1cc49b3e5b6711f9eb43259ffa0555db58084602",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color-mix(in display-p3, color(display-p3 1 0 0) 30%, blue)": {
|
||||
"kind": "fill",
|
||||
"sha256": "58b694deea5f11273f95ffd037423b17bc813bda6b6ea82888f9892e6528a5b0",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color-mix(in oklab, red 30%, blue)": {
|
||||
"kind": "fill",
|
||||
"sha256": "699525471658eda7a99f26181e44841d8a8202443fad2500bae3f1b4e1a8158a",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color-mix(in oklch, #336699 40%, #cc9933)": {
|
||||
"kind": "fill",
|
||||
"sha256": "d35dbf1963cff18033cc64d1991a01072b16cf2e757fbc3a1800b9319470d1f0",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | color-mix(in srgb, red 30%, blue)": {
|
||||
"kind": "fill",
|
||||
"sha256": "5f173ac28e4f26e1f70d6cac12adcd59707692664770315983ecbe9eff88458b",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | hsl(200 60% 40%)": {
|
||||
"kind": "fill",
|
||||
"sha256": "e9ae94390dabacc90a2fde5f91884eba10d5fc4cf5f1aa80a0978c36b5a8e2c7",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | lab(60 40 -30)": {
|
||||
"kind": "fill",
|
||||
"sha256": "12d7c045adeb8a76347d3fd4261593c8b80d97b1dbf55f265991037a4adac6b0",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | lch(60 40 200)": {
|
||||
"kind": "fill",
|
||||
"sha256": "8063e38ed7df66e53b13ea08a949685f03e51847f7794ec9bfbb32c45bd8e10e",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | oklab(0.6 0.1 -0.1)": {
|
||||
"kind": "fill",
|
||||
"sha256": "ec97eed8fc2beb419339539ee9687a9bee6a2126db047e813d3ab91570a4d7ce",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | oklch(0.7 0.15 150)": {
|
||||
"kind": "fill",
|
||||
"sha256": "f256508187ad893812958b37b75d739a131acf40ecf8f1a54f98fc2daf615624",
|
||||
"bytes": 1024
|
||||
},
|
||||
"fill | rgba(51,102,153,0.5)": {
|
||||
"kind": "fill",
|
||||
"sha256": "d57f26dd3a6a96762190a7fcc95bb813d10e6332a6b762aba3057d108930c62c",
|
||||
"bytes": 1024
|
||||
},
|
||||
"canvas colorSpace p3 fill": {
|
||||
"kind": "colorspace",
|
||||
"sha256": "71205eb7a329a3ead670c77eee185c0fbeb612f7a2b3d6aadbe2af4f9276b60d",
|
||||
"bytes": 1024
|
||||
},
|
||||
"env | color-gamut:p3": {
|
||||
"kind": "env",
|
||||
"sha256": "fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa",
|
||||
"value": false
|
||||
},
|
||||
"env | color-gamut:rec2020": {
|
||||
"kind": "env",
|
||||
"sha256": "fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa",
|
||||
"value": false
|
||||
},
|
||||
"env | color-gamut:srgb": {
|
||||
"kind": "env",
|
||||
"sha256": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",
|
||||
"value": true
|
||||
},
|
||||
"env | colorDepth": {
|
||||
"kind": "env",
|
||||
"sha256": "c2356069e9d1e79ca924378153cfbbfb4d4416b1f99d41a2940bfdb66c5319db",
|
||||
"value": 24
|
||||
},
|
||||
"env | devicePixelRatio": {
|
||||
"kind": "env",
|
||||
"sha256": "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b",
|
||||
"value": 1
|
||||
},
|
||||
"env | dynamic-range:high": {
|
||||
"kind": "env",
|
||||
"sha256": "fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa",
|
||||
"value": false
|
||||
},
|
||||
"env | pixelDepth": {
|
||||
"kind": "env",
|
||||
"sha256": "c2356069e9d1e79ca924378153cfbbfb4d4416b1f99d41a2940bfdb66c5319db",
|
||||
"value": 24
|
||||
},
|
||||
"env | prefers-color-scheme:dark": {
|
||||
"kind": "env",
|
||||
"sha256": "b5bea41b6c623f7c09f1bf24dcae58ebab3c0cdd90ad966bc43a45b44867e12b",
|
||||
"value": true,
|
||||
"compared": false
|
||||
},
|
||||
"env | video-dynamic-range:high": {
|
||||
"kind": "env",
|
||||
"sha256": "fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>canvas text ref</title>
|
||||
<style>
|
||||
@font-face{font-family:"Arial";src:url("bundle/arial7_04.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
@font-face{font-family:"Segoe UI";src:url("bundle/segoeui5_67.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
@font-face{font-family:"Times New Roman";src:url("bundle/times7_11.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
@font-face{font-family:"Consolas";src:url("bundle/consola7_00.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
@font-face{font-family:"Calibri";src:url("bundle/calibri6_26.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
@font-face{font-family:"Bahnschrift";src:url("bundle/bahnschrift2_07.ttf") format("truetype");font-weight:300 700;font-stretch:75% 100%;font-style:normal}
|
||||
@font-face{font-family:"Segoe UI Variable";src:url("bundle/seguivar2_03.ttf") format("truetype");font-weight:300 700;font-style:normal}
|
||||
@font-face{font-family:"Twemoji Mozilla";src:url("bundle/TwemojiMozilla.ttf") format("truetype");font-weight:400;font-style:normal}
|
||||
body{margin:16px;background:#fff;color:#000;font:13px sans-serif}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p id="status">loading fonts</p>
|
||||
<script>
|
||||
// Canvas 2D text reference page. Every case draws TEXT (or EMOJI) on a white canvas, reads the
|
||||
// pixels back with getImageData and hashes the RGBA bytes with SHA-256. Fonts are loaded
|
||||
// before anything is measured or drawn. The case ids and the drawing code are the ones retail
|
||||
// Firefox 159.0 on Windows ran to write refs.json, so the hashes compare.
|
||||
const FAMILIES5 = ["Arial", "Segoe UI", "Times New Roman", "Consolas", "Calibri"];
|
||||
const SIZES6 = [9, 12.5, 16, 33, 72, 300];
|
||||
const SIZES5 = [9, 12.5, 16, 33, 72];
|
||||
const TEXT = "Hamburgefonstiv 0123";
|
||||
const EMOJI = "\u{1F600}\u{1F389}\u{1F41F}";
|
||||
const ROT = "rot15-scale1.5x2";
|
||||
const TRANSFORMS = ["none", ROT];
|
||||
|
||||
const SPECS = [];
|
||||
const SEEN = new Set();
|
||||
function add(sp) {
|
||||
sp.style = sp.style || "normal";
|
||||
sp.weight = sp.weight || "normal";
|
||||
sp.stretch = sp.stretch || "";
|
||||
sp.op = sp.op || "fill";
|
||||
sp.transform = sp.transform || "none";
|
||||
sp.alpha = sp.alpha !== false;
|
||||
sp.text = sp.text || TEXT;
|
||||
let id = [sp.family, sp.size, sp.transform, sp.style, sp.weight, sp.op].join("|");
|
||||
if (sp.stretch) id += "|stretch=" + sp.stretch;
|
||||
if (!sp.alpha) id += "|alpha=false";
|
||||
if (sp.text !== TEXT) id += "|text=emoji";
|
||||
if (SEEN.has(id)) throw new Error("duplicate case id: " + id);
|
||||
SEEN.add(id);
|
||||
sp.id = id;
|
||||
SPECS.push(sp);
|
||||
}
|
||||
|
||||
// 0) base: fillText and strokeText, with and without a transform; synthetic italic and bold
|
||||
// on a regular face (fillText). Default canvas (alpha: true).
|
||||
for (const family of FAMILIES5) for (const size of SIZES6) for (const transform of TRANSFORMS) for (const op of ["fill", "stroke"])
|
||||
add({family, size, transform, op});
|
||||
for (const family of FAMILIES5) for (const size of SIZES6) for (const transform of TRANSFORMS) for (const syn of ["italic", "bold"])
|
||||
add({family, size, transform, style: syn === "italic" ? "italic" : "normal", weight: syn === "bold" ? "bold" : "normal"});
|
||||
|
||||
// 1) getContext("2d", {alpha: false}): an opaque canvas, where LCD text is possible
|
||||
for (const f of FAMILIES5) for (const s of SIZES5)
|
||||
add({family: f, size: s, alpha: false});
|
||||
|
||||
// 2) rotate(15deg) scale(1.5, 2) on an opaque canvas. The same cases with alpha: true are in
|
||||
// the base above (group 2a of the reference), so they are not drawn twice.
|
||||
for (const f of FAMILIES5) for (const s of SIZES5)
|
||||
add({family: f, size: s, transform: ROT, alpha: false});
|
||||
|
||||
// 3) COLR v0 emoji (Twemoji Mozilla), the one COLR v0 face of the bundle
|
||||
for (const s of [16, 33, 72]) for (const alpha of [true, false]) for (const transform of TRANSFORMS)
|
||||
add({family: "Twemoji Mozilla", size: s, transform, alpha, text: EMOJI});
|
||||
|
||||
// 4) past the glyph-size thresholds (255, 256, 257, 400 px; 300 px is in the base): fillText
|
||||
// and strokeText, Arial and Segoe UI
|
||||
for (const f of ["Arial", "Segoe UI"]) for (const s of [255, 256, 257, 400]) for (const op of ["fill", "stroke"])
|
||||
add({family: f, size: s, op});
|
||||
|
||||
// 5) the variable face Bahnschrift: weight (300, 400, 700) by stretch (75% = condensed, 100% = normal);
|
||||
// canvas has no font-variation-settings, so the axes are reached through font-weight and font-stretch
|
||||
for (const w of [300, 400, 700]) for (const st of ["condensed", "normal"]) for (const s of [16, 33])
|
||||
add({family: "Bahnschrift", size: s, weight: w, stretch: st});
|
||||
|
||||
// 6) the variable face Segoe UI Variable (wght 300-700, opsz 5-36): weight 300, 400 and 700 at four
|
||||
// sizes. font-optical-sizing is auto, so opsz follows the size; the weight reaches the face
|
||||
// through font-weight, as canvas has no font-variation-settings
|
||||
for (const w of [300, 400, 700]) for (const s of [9, 12.5, 16, 33])
|
||||
add({family: "Segoe UI Variable", size: s, weight: w});
|
||||
|
||||
const fontCss = sp => [sp.style, sp.weight, sp.stretch, sp.size + "px", '"' + sp.family + '"'].filter(Boolean).join(" ");
|
||||
const hex = buf => [...new Uint8Array(buf)].map(b => b.toString(16).padStart(2, "0")).join("");
|
||||
|
||||
function measure(sp) {
|
||||
const ctx = document.createElement("canvas").getContext("2d");
|
||||
ctx.font = fontCss(sp);
|
||||
return ctx.measureText(sp.text).width;
|
||||
}
|
||||
|
||||
async function drawCase(sp) {
|
||||
const m = measure(sp), S = sp.size;
|
||||
const W = Math.ceil(1.6 * m + 3 * S) + 80;
|
||||
const H = Math.ceil(4 * S + 0.42 * m) + 80;
|
||||
const c = document.createElement("canvas");
|
||||
c.width = W; c.height = H;
|
||||
const ctx = c.getContext("2d", {alpha: sp.alpha, willReadFrequently: true});
|
||||
ctx.fillStyle = "#fff"; ctx.fillRect(0, 0, W, H);
|
||||
ctx.fillStyle = "#000"; ctx.strokeStyle = "#000"; ctx.lineWidth = 1;
|
||||
ctx.font = fontCss(sp);
|
||||
ctx.textAlign = "start"; ctx.textBaseline = "alphabetic";
|
||||
const y0 = Math.ceil(2.5 * S) + 40;
|
||||
let x = 40, y = y0;
|
||||
if (sp.transform !== "none") {
|
||||
ctx.translate(40, y0);
|
||||
ctx.rotate(15 * Math.PI / 180);
|
||||
ctx.scale(1.5, 2);
|
||||
x = 0; y = 0;
|
||||
}
|
||||
if (sp.op === "stroke") ctx.strokeText(sp.text, x, y); else ctx.fillText(sp.text, x, y);
|
||||
const readback = ctx.font;
|
||||
let img = ctx.getImageData(0, 0, W, H);
|
||||
const digest = await crypto.subtle.digest("SHA-256", img.data.buffer);
|
||||
// The largest cases are 7727 x 3373 (100 MB of RGBA): release the canvas and its readback
|
||||
// before the next case, so that the page never holds more than one at a time.
|
||||
img = null;
|
||||
c.width = 0; c.height = 0;
|
||||
return {id: sp.id, family: sp.family, size: sp.size, transform: sp.transform,
|
||||
style: sp.style, weight: String(sp.weight), stretch: sp.stretch || "normal", op: sp.op,
|
||||
alpha: sp.alpha, text: sp.text === TEXT ? "TEXT" : "EMOJI", font_readback: readback,
|
||||
width: W, height: H, measured_width: m, sha256: hex(digest)};
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const st = document.getElementById("status");
|
||||
try {
|
||||
const LOADS = ['16px "Arial"', '16px "Segoe UI"', '16px "Times New Roman"', '16px "Consolas"',
|
||||
'16px "Calibri"', '300 condensed 16px "Bahnschrift"', '300 normal 16px "Bahnschrift"',
|
||||
'400 normal 16px "Bahnschrift"', '700 normal 16px "Bahnschrift"', '300 16px "Segoe UI Variable"',
|
||||
'400 16px "Segoe UI Variable"', '700 16px "Segoe UI Variable"', '16px "Twemoji Mozilla"'];
|
||||
window.FONTS = {};
|
||||
for (const q of LOADS) {
|
||||
const r = await document.fonts.load(q);
|
||||
window.FONTS[q] = r.map(x => x.status);
|
||||
if (!r.length || r.some(x => x.status !== "loaded")) throw new Error("font not loaded: " + q);
|
||||
}
|
||||
window.R = {};
|
||||
for (const sp of SPECS) {
|
||||
window.R[sp.id] = await drawCase(sp);
|
||||
window.PROGRESS = Object.keys(window.R).length;
|
||||
st.textContent = `cases: ${window.PROGRESS}/${SPECS.length}`;
|
||||
}
|
||||
window.CASE_COUNT = SPECS.length;
|
||||
st.textContent = `done: ${SPECS.length} cases`;
|
||||
window.DONE = true;
|
||||
} catch (e) {
|
||||
window.ERR = String(e);
|
||||
st.textContent = "error: " + e;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,41 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>canvas text colours ref</title>
|
||||
<style>@font-face{font-family:"Arial";src:url("bundle/arial7_04.ttf") format("truetype")}</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// Canvas 2D coloured text reference page. Seven colour pairs (text, background) by two sizes:
|
||||
// each case fills a 420 x 160 canvas with the background, draws TEXT in the text colour with
|
||||
// fillText, reads the pixels back with getImageData and hashes the RGBA bytes with SHA-256.
|
||||
// The case id is "<name>|<size>". The drawing code is the one retail Firefox 159.0 on Windows
|
||||
// ran to write refs.json, so the hashes compare.
|
||||
const COLORS = [["black", "#000000", "#ffffff"], ["teal", "#006699", "#ffffff"],
|
||||
["limealpha", "rgba(102,204,0,0.2)", "#ffffff"], ["grey", "#888888", "#ffffff"],
|
||||
["white_on_black", "#ffffff", "#000000"], ["red", "#ff0000", "#ffffff"],
|
||||
["white_on_blue", "#ffffff", "#0000ff"]];
|
||||
const SIZES = [16, 33];
|
||||
(async () => {
|
||||
try {
|
||||
await document.fonts.load('16px "Arial"');
|
||||
window.R = {};
|
||||
for (const [name, fg, bg] of COLORS) for (const S of SIZES) {
|
||||
const W = 420, H = 160, c = document.createElement("canvas");
|
||||
c.width = W; c.height = H;
|
||||
const ctx = c.getContext("2d", {willReadFrequently: true});
|
||||
ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
|
||||
ctx.fillStyle = fg; ctx.font = S + 'px "Arial"'; ctx.textBaseline = "alphabetic";
|
||||
ctx.fillText("Hamburgefonstiv 0123", 20, 90);
|
||||
const img = ctx.getImageData(0, 0, W, H);
|
||||
const id = name + "|" + S;
|
||||
const d = await crypto.subtle.digest("SHA-256", img.data.buffer);
|
||||
window.R[id] = {sha256: [...new Uint8Array(d)].map(b => b.toString(16).padStart(2, "0")).join("")};
|
||||
}
|
||||
window.DONE = true;
|
||||
} catch (e) { window.ERR = String(e); }
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,929 +0,0 @@
|
||||
{
|
||||
"test_page": "index.html",
|
||||
"black_page": "../canvas_text_ref/index.html",
|
||||
"text": "Hamburgefonstiv 0123",
|
||||
"firefox": {
|
||||
"version": "159.0",
|
||||
"buildid": "20261022150525",
|
||||
"browser_version_capability": "159.0",
|
||||
"exe_sha256": "d8b5ed82fcd9c0f159dc86dc1c4526ceae981c4d9651f21908b6de90d0a56d85",
|
||||
"os": "Windows_NT",
|
||||
"os_version": "10.0"
|
||||
},
|
||||
"canvas": {
|
||||
"gfx.canvas.accelerated": false,
|
||||
"pref_read_back": false
|
||||
},
|
||||
"cleartype": {
|
||||
"FontSmoothing": "2",
|
||||
"FontSmoothingType": "0x2"
|
||||
},
|
||||
"fonts": [
|
||||
{
|
||||
"family": "Arial",
|
||||
"bundle_file": "arial7_04.ttf",
|
||||
"sha256": "05c7da5fe195e04d76bbe4f22b7829ebc142f957066449f68d59afbb2d446b33",
|
||||
"version": "Version 7.04",
|
||||
"psname": "ArialMT",
|
||||
"names": {
|
||||
"1": "Arial",
|
||||
"2": "Normal",
|
||||
"4": "Arial",
|
||||
"5": "Version 7.04",
|
||||
"6": "ArialMT"
|
||||
},
|
||||
"list_entry": "f|arial7_04.ttf|0|400|400|100|100|normal|ArialMT|2048|1854|434|67|1062|1467|-217|150|530|102"
|
||||
}
|
||||
],
|
||||
"capture": {
|
||||
"date": "2026-11-09",
|
||||
"origin": "retail Firefox 159.0 (build 20261022150525, firefox.exe sha256 d8b5ed82fcd9c0f159dc86dc1c4526ceae981c4d9651f21908b6de90d0a56d85) on Windows, headless, canvases read back with getImageData; bytes saved by the measuring harness: colors/retail (the 14 coloured cases) and keys/<gamma>_<contrast>/retail (39 cases per key) of the win-asset analysis of 2026-11-09",
|
||||
"colors_prefs": {
|
||||
"gfx.canvas.accelerated": false
|
||||
},
|
||||
"keys_prefs": {
|
||||
"gfx.canvas.accelerated": false,
|
||||
"gfx.font_rendering.cleartype_params.gamma": "<gamma>",
|
||||
"gfx.font_rendering.cleartype_params.enhanced_contrast": "<contrast>",
|
||||
"gfx.font_rendering.cleartype_params.cleartype_level": 100,
|
||||
"gfx.font_rendering.cleartype_params.pixel_structure": 1,
|
||||
"gfx.font_rendering.cleartype_params.rendering_mode": 0
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
"count": 14,
|
||||
"cases": {
|
||||
"black|16": {
|
||||
"id": "black|16",
|
||||
"name": "black",
|
||||
"fg": "#000000",
|
||||
"bg": "#ffffff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "938b7381139ef4f5d5bd0ca3f12d58f11224981f494afa869e92a2f22d7e7181"
|
||||
},
|
||||
"black|33": {
|
||||
"id": "black|33",
|
||||
"name": "black",
|
||||
"fg": "#000000",
|
||||
"bg": "#ffffff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "d201f011ff0da51760a7dbd6f8b1a415173b278dd861edd19f1e240273661d21"
|
||||
},
|
||||
"teal|16": {
|
||||
"id": "teal|16",
|
||||
"name": "teal",
|
||||
"fg": "#006699",
|
||||
"bg": "#ffffff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "8746ee921e50c0b8b08d8448faaa2bdc6c71e9268621bd71c0fcf24fd5495ae7"
|
||||
},
|
||||
"teal|33": {
|
||||
"id": "teal|33",
|
||||
"name": "teal",
|
||||
"fg": "#006699",
|
||||
"bg": "#ffffff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2b3df9671621de69a4e8415db76825bb2e18ddd122778521a8ddbc79e899dd71"
|
||||
},
|
||||
"limealpha|16": {
|
||||
"id": "limealpha|16",
|
||||
"name": "limealpha",
|
||||
"fg": "rgba(102,204,0,0.2)",
|
||||
"bg": "#ffffff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2f3cac50d2b3cfdda020841414a171c06b9d42c671b1688e744ccda1587ae74e"
|
||||
},
|
||||
"limealpha|33": {
|
||||
"id": "limealpha|33",
|
||||
"name": "limealpha",
|
||||
"fg": "rgba(102,204,0,0.2)",
|
||||
"bg": "#ffffff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "4de189802d53988a14c12696b7304b5c46c43b77478b43c5174011b547e3cd71"
|
||||
},
|
||||
"grey|16": {
|
||||
"id": "grey|16",
|
||||
"name": "grey",
|
||||
"fg": "#888888",
|
||||
"bg": "#ffffff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "117520b0392502751ddab388c91e9713153a58a71c2df5ca948e78b3471c3f0d"
|
||||
},
|
||||
"grey|33": {
|
||||
"id": "grey|33",
|
||||
"name": "grey",
|
||||
"fg": "#888888",
|
||||
"bg": "#ffffff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "a20325721477839253b47e912d6ca2faca57b678dfd0684a53d2039c71b18f7d"
|
||||
},
|
||||
"white_on_black|16": {
|
||||
"id": "white_on_black|16",
|
||||
"name": "white_on_black",
|
||||
"fg": "#ffffff",
|
||||
"bg": "#000000",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "72e1b06edb977634bd70fcd9edd921a4332b526097ebb51e876eceb429cf5194"
|
||||
},
|
||||
"white_on_black|33": {
|
||||
"id": "white_on_black|33",
|
||||
"name": "white_on_black",
|
||||
"fg": "#ffffff",
|
||||
"bg": "#000000",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "5b84dd2f3a04210bb86a375e0c0d531fc1c7d90e0d50e97d19940981bee77dfc"
|
||||
},
|
||||
"red|16": {
|
||||
"id": "red|16",
|
||||
"name": "red",
|
||||
"fg": "#ff0000",
|
||||
"bg": "#ffffff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "ac0c3b25f7d973e6c77251b100130e5d2df749def5502a84c98c28645540c594"
|
||||
},
|
||||
"red|33": {
|
||||
"id": "red|33",
|
||||
"name": "red",
|
||||
"fg": "#ff0000",
|
||||
"bg": "#ffffff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "8a0a7f5461dccf8b1e87bf37c0b58333995a61ea73464c11575f40d3750e8d7e"
|
||||
},
|
||||
"white_on_blue|16": {
|
||||
"id": "white_on_blue|16",
|
||||
"name": "white_on_blue",
|
||||
"fg": "#ffffff",
|
||||
"bg": "#0000ff",
|
||||
"size": 16,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "7d3fc588aec100214021ced202515a3c51799a75540e507b1c68eadbdf5ebb80"
|
||||
},
|
||||
"white_on_blue|33": {
|
||||
"id": "white_on_blue|33",
|
||||
"name": "white_on_blue",
|
||||
"fg": "#ffffff",
|
||||
"bg": "#0000ff",
|
||||
"size": 33,
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "9b90b082b3ec5a6242f60f89d198017d0dc84d4082b26f6de7fa01b9b8929436"
|
||||
}
|
||||
}
|
||||
},
|
||||
"keys": {
|
||||
"1800_100": {
|
||||
"gamma": 1800,
|
||||
"contrast": 100,
|
||||
"count": 39,
|
||||
"black": {
|
||||
"Arial|12.5|none|normal|normal|fill": {
|
||||
"id": "Arial|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "ee3a8e3dfea9159a8497979695e096057fa49f2577fe6bf638e41d1fecec67ea"
|
||||
},
|
||||
"Arial|16|none|normal|normal|fill": {
|
||||
"id": "Arial|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "98cd2b38609078580d7cb7eda232967ee28ad53ba6159ae59298cf1c7137c164"
|
||||
},
|
||||
"Arial|16|none|normal|normal|stroke": {
|
||||
"id": "Arial|16|none|normal|normal|stroke",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "1e6571d8a74938a478548455619639476ac1d5fe556361aa227059f9a5383cc8"
|
||||
},
|
||||
"Arial|33|none|normal|normal|fill": {
|
||||
"id": "Arial|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "77d3ad98366467e10e0a7a30ec89615435d500684bd6ae14e077be083e0fd1b4"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "268661170dbf65b4087095d6572a9e5eb47df3aba92de4497ab9305ddc25969a"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "56bdb525c665af5aed8eb887d5fef9bc2cf96dc04c580f847e3ac2d7adb7facf"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill": {
|
||||
"id": "Arial|72|none|normal|normal|fill",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "cde0d587e27ae735ab3f4d48ab9db9e4ab67b428a47725e80889b05fc585cb19"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|72|none|normal|normal|fill|alpha=false",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "8f3002ed06eb19f56b436404bf270b89ef1f773c403a682d0197bb8c86193b09"
|
||||
},
|
||||
"Arial|72|none|normal|normal|stroke": {
|
||||
"id": "Arial|72|none|normal|normal|stroke",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "dcfd4e18ea49e2939fc9ed4b0125d3537129ef9db16a307bbace4ee0e404db3e"
|
||||
},
|
||||
"Arial|9|none|normal|normal|fill": {
|
||||
"id": "Arial|9|none|normal|normal|fill",
|
||||
"width": 252,
|
||||
"height": 155,
|
||||
"sha256": "3e7800055997f8c1a66b8e6743079abc1f8861a7805097be20910e23d2a94f96"
|
||||
},
|
||||
"Calibri|12.5|none|normal|normal|fill": {
|
||||
"id": "Calibri|12.5|none|normal|normal|fill",
|
||||
"width": 302,
|
||||
"height": 179,
|
||||
"sha256": "d2ffbf661f27e331c065dfaa75d9ac211e422cdd33ec7100ad440e880d9609ea"
|
||||
},
|
||||
"Calibri|16|none|normal|normal|fill": {
|
||||
"id": "Calibri|16|none|normal|normal|fill",
|
||||
"width": 364,
|
||||
"height": 206,
|
||||
"sha256": "e92b7be795a3f9c6fff81923bd19332ed197e0d4c9a435eec3007503277731f4"
|
||||
},
|
||||
"Calibri|33|none|normal|normal|fill": {
|
||||
"id": "Calibri|33|none|normal|normal|fill",
|
||||
"width": 666,
|
||||
"height": 340,
|
||||
"sha256": "51da20ad1f3cff06c7e3f03112f697c430cafe5b0ec1a02d7b81d73226389fa8"
|
||||
},
|
||||
"Calibri|9|none|normal|normal|fill": {
|
||||
"id": "Calibri|9|none|normal|normal|fill",
|
||||
"width": 240,
|
||||
"height": 151,
|
||||
"sha256": "196f471dd173d75c7eda41f9d87caa3a6321d43b2df3cf176581f82257169aad"
|
||||
},
|
||||
"Consolas|12.5|none|normal|normal|fill": {
|
||||
"id": "Consolas|12.5|none|normal|normal|fill",
|
||||
"width": 338,
|
||||
"height": 188,
|
||||
"sha256": "94e60dca493f234bea874e7a962855d2a708f00cc35f4e266c0d5f98f998b905"
|
||||
},
|
||||
"Consolas|16|none|normal|normal|fill": {
|
||||
"id": "Consolas|16|none|normal|normal|fill",
|
||||
"width": 410,
|
||||
"height": 218,
|
||||
"sha256": "50e756f75be97db95df3cb2d46511ec95a1afa2ba5d9cdb2cd73123a65bcb0e4"
|
||||
},
|
||||
"Consolas|33|none|normal|normal|fill": {
|
||||
"id": "Consolas|33|none|normal|normal|fill",
|
||||
"width": 760,
|
||||
"height": 365,
|
||||
"sha256": "f0ab5cc32841bb964b06cad8cc960a6ce7b2ff1f893b61d40f2ade0fa1a3da57"
|
||||
},
|
||||
"Consolas|9|none|normal|normal|fill": {
|
||||
"id": "Consolas|9|none|normal|normal|fill",
|
||||
"width": 266,
|
||||
"height": 158,
|
||||
"sha256": "fe35c05a55d67fa9be55edc4a3c26ec1b02ae0554c3927df65d63d7f314ba5cb"
|
||||
},
|
||||
"Segoe UI|12.5|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "2b0e2121a7cecb95627884b225686516823ecf907cdac3d16de2c9d9448e7cb4"
|
||||
},
|
||||
"Segoe UI|16|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "e2da2ca50b4a3714b344fc909f06cc21d8e70985c87fba10d02105302b050f03"
|
||||
},
|
||||
"Segoe UI|33|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "051b495e0c4c7c29ded7b83f54aaa0eca0d072c0f3b299c8429828394a614499"
|
||||
},
|
||||
"Segoe UI|9|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|9|none|normal|normal|fill",
|
||||
"width": 253,
|
||||
"height": 155,
|
||||
"sha256": "498ab34b34191205b46cce4edbd08c539c07734be633f17998dc4cc3e613360c"
|
||||
},
|
||||
"Times New Roman|16|none|normal|normal|fill": {
|
||||
"id": "Times New Roman|16|none|normal|normal|fill",
|
||||
"width": 365,
|
||||
"height": 207,
|
||||
"sha256": "3060970fff10250556c1dedda06e0602ba74f8cd62319cc4c07d79c764d0d198"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "b17a096d51b6b7226984188e54627a496863aeab998bb9f1adc9e816c8b6a64b"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "b17a096d51b6b7226984188e54627a496863aeab998bb9f1adc9e816c8b6a64b"
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
"black|16": {
|
||||
"id": "black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "938b7381139ef4f5d5bd0ca3f12d58f11224981f494afa869e92a2f22d7e7181"
|
||||
},
|
||||
"black|33": {
|
||||
"id": "black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "d201f011ff0da51760a7dbd6f8b1a415173b278dd861edd19f1e240273661d21"
|
||||
},
|
||||
"teal|16": {
|
||||
"id": "teal|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "8746ee921e50c0b8b08d8448faaa2bdc6c71e9268621bd71c0fcf24fd5495ae7"
|
||||
},
|
||||
"teal|33": {
|
||||
"id": "teal|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2b3df9671621de69a4e8415db76825bb2e18ddd122778521a8ddbc79e899dd71"
|
||||
},
|
||||
"limealpha|16": {
|
||||
"id": "limealpha|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2f3cac50d2b3cfdda020841414a171c06b9d42c671b1688e744ccda1587ae74e"
|
||||
},
|
||||
"limealpha|33": {
|
||||
"id": "limealpha|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "4de189802d53988a14c12696b7304b5c46c43b77478b43c5174011b547e3cd71"
|
||||
},
|
||||
"grey|16": {
|
||||
"id": "grey|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "117520b0392502751ddab388c91e9713153a58a71c2df5ca948e78b3471c3f0d"
|
||||
},
|
||||
"grey|33": {
|
||||
"id": "grey|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "a20325721477839253b47e912d6ca2faca57b678dfd0684a53d2039c71b18f7d"
|
||||
},
|
||||
"white_on_black|16": {
|
||||
"id": "white_on_black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "72e1b06edb977634bd70fcd9edd921a4332b526097ebb51e876eceb429cf5194"
|
||||
},
|
||||
"white_on_black|33": {
|
||||
"id": "white_on_black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "5b84dd2f3a04210bb86a375e0c0d531fc1c7d90e0d50e97d19940981bee77dfc"
|
||||
},
|
||||
"red|16": {
|
||||
"id": "red|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "ac0c3b25f7d973e6c77251b100130e5d2df749def5502a84c98c28645540c594"
|
||||
},
|
||||
"red|33": {
|
||||
"id": "red|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "8a0a7f5461dccf8b1e87bf37c0b58333995a61ea73464c11575f40d3750e8d7e"
|
||||
},
|
||||
"white_on_blue|16": {
|
||||
"id": "white_on_blue|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "7d3fc588aec100214021ced202515a3c51799a75540e507b1c68eadbdf5ebb80"
|
||||
},
|
||||
"white_on_blue|33": {
|
||||
"id": "white_on_blue|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "9b90b082b3ec5a6242f60f89d198017d0dc84d4082b26f6de7fa01b9b8929436"
|
||||
}
|
||||
}
|
||||
},
|
||||
"1400_50": {
|
||||
"gamma": 1400,
|
||||
"contrast": 50,
|
||||
"count": 39,
|
||||
"black": {
|
||||
"Arial|12.5|none|normal|normal|fill": {
|
||||
"id": "Arial|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "14c99d061e0f4a4c53418e9364cfbebb263637ff271eb88ce0174ec7f580a8d1"
|
||||
},
|
||||
"Arial|16|none|normal|normal|fill": {
|
||||
"id": "Arial|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "460090856e361a9d1c8b8e508f1389bb18d6ed4bcbcb54de0a41def27df66c60"
|
||||
},
|
||||
"Arial|16|none|normal|normal|stroke": {
|
||||
"id": "Arial|16|none|normal|normal|stroke",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "d430dc9d241cbcf3163cf3c84819e296695b271ce5e4c0cbb81ff5e52fb7f888"
|
||||
},
|
||||
"Arial|33|none|normal|normal|fill": {
|
||||
"id": "Arial|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "133696ab25926088783d52f37a1e0b38b6c05d89b5f8be9ba526a6d40b3ac9cc"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "60be668ad5c98d4f6c1a882c991ac2bf716c370e7ddad2fc33727382729540e1"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "a6d3ed8f876b2549de27d495a18275a8d1d57aabb12b366a5ea010f64ff2a487"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill": {
|
||||
"id": "Arial|72|none|normal|normal|fill",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "e94fec8095a60639e7f032a83010c67d2cb903c564963a7502736424b031cfd1"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|72|none|normal|normal|fill|alpha=false",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "7e99bff1907801acadcbac04269a7d12ffb3bd7f51866dfc530160150b323042"
|
||||
},
|
||||
"Arial|72|none|normal|normal|stroke": {
|
||||
"id": "Arial|72|none|normal|normal|stroke",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "2f6e77afccf808b8093d8401eff74063579e20878aa92b9dee79e9772bb9557a"
|
||||
},
|
||||
"Arial|9|none|normal|normal|fill": {
|
||||
"id": "Arial|9|none|normal|normal|fill",
|
||||
"width": 252,
|
||||
"height": 155,
|
||||
"sha256": "f6f0f83c38699bac16c911ffb08bb4d65bcd2eb310af96999c86ed1a3849b1c1"
|
||||
},
|
||||
"Calibri|12.5|none|normal|normal|fill": {
|
||||
"id": "Calibri|12.5|none|normal|normal|fill",
|
||||
"width": 302,
|
||||
"height": 179,
|
||||
"sha256": "9245eea21c147ff68d9939442dd706a543c5d330aac23bf8b3d98763c6b4be49"
|
||||
},
|
||||
"Calibri|16|none|normal|normal|fill": {
|
||||
"id": "Calibri|16|none|normal|normal|fill",
|
||||
"width": 364,
|
||||
"height": 206,
|
||||
"sha256": "99267623a24e50c9b8780c9164466c3e87eeba0f1121e3a967388b2270c1f4e0"
|
||||
},
|
||||
"Calibri|33|none|normal|normal|fill": {
|
||||
"id": "Calibri|33|none|normal|normal|fill",
|
||||
"width": 666,
|
||||
"height": 340,
|
||||
"sha256": "015bb14578ca98863179cf6cf8f081141895919caa5b40bbbeb5850d6daf1dd6"
|
||||
},
|
||||
"Calibri|9|none|normal|normal|fill": {
|
||||
"id": "Calibri|9|none|normal|normal|fill",
|
||||
"width": 240,
|
||||
"height": 151,
|
||||
"sha256": "3032e62b1f242f40a929515e8c7c0795df490ee8689b7ff8edb5576cb281039f"
|
||||
},
|
||||
"Consolas|12.5|none|normal|normal|fill": {
|
||||
"id": "Consolas|12.5|none|normal|normal|fill",
|
||||
"width": 338,
|
||||
"height": 188,
|
||||
"sha256": "940e7b60291c65c0478370523b110ba443a154bb9adbfeb6a8f2f05aa5bf64f9"
|
||||
},
|
||||
"Consolas|16|none|normal|normal|fill": {
|
||||
"id": "Consolas|16|none|normal|normal|fill",
|
||||
"width": 410,
|
||||
"height": 218,
|
||||
"sha256": "627d72ba3944f9f7d75f7656022c3e2721d40c7c58bb54066231ed87be12997c"
|
||||
},
|
||||
"Consolas|33|none|normal|normal|fill": {
|
||||
"id": "Consolas|33|none|normal|normal|fill",
|
||||
"width": 760,
|
||||
"height": 365,
|
||||
"sha256": "75658b28d60aa33498c7beab0672416a0e1aa1e90ea1a5baec103b687725552a"
|
||||
},
|
||||
"Consolas|9|none|normal|normal|fill": {
|
||||
"id": "Consolas|9|none|normal|normal|fill",
|
||||
"width": 266,
|
||||
"height": 158,
|
||||
"sha256": "5a9fa9c242e44227bbb68d45b58324c7e16d3a4b36c7e97a0113b945c72147d9"
|
||||
},
|
||||
"Segoe UI|12.5|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "659a72b345f342f4bd4d4a7cdd444f68e802302d199ac59ba619441414a3cf5a"
|
||||
},
|
||||
"Segoe UI|16|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "7ed00e70c9ad30aa78faa09a0781197a4fe511af65f72e14b6b65ec8081d8ffd"
|
||||
},
|
||||
"Segoe UI|33|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "85598e54157f9c74091a92cd86653e6f4b10956c47aa63791ea4f799a41e0cda"
|
||||
},
|
||||
"Segoe UI|9|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|9|none|normal|normal|fill",
|
||||
"width": 253,
|
||||
"height": 155,
|
||||
"sha256": "ba4e8c10825da7b2ca987a159345da51bd15892465a7e4102cd8ea28cf6861a1"
|
||||
},
|
||||
"Times New Roman|16|none|normal|normal|fill": {
|
||||
"id": "Times New Roman|16|none|normal|normal|fill",
|
||||
"width": 365,
|
||||
"height": 207,
|
||||
"sha256": "05f8cc92764a333044b3ea5ff03f8cfc52616670c2ac89b351a1a94bd0ac3316"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "09d0464c8a0da0cdde22392a6e02df35f02ba67c7e89ff415f37302630b076df"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "09d0464c8a0da0cdde22392a6e02df35f02ba67c7e89ff415f37302630b076df"
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
"black|16": {
|
||||
"id": "black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "52ad1861583860289040685f6d12360e17707b94a0e518c5484cffd4e022e4bb"
|
||||
},
|
||||
"black|33": {
|
||||
"id": "black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "980ea0631ee5813905f894ebfbca8ce859402b3eeb11cc3069c265d594610f84"
|
||||
},
|
||||
"teal|16": {
|
||||
"id": "teal|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "019ef31ba5e38bba0e0ed00c1f7872d1f752d4faef964220728b703689b8e0ea"
|
||||
},
|
||||
"teal|33": {
|
||||
"id": "teal|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "3a46c08e48f0adb86e68d95a211eb61ac2f9dcc9a6279913b1d9698f50a33fb1"
|
||||
},
|
||||
"limealpha|16": {
|
||||
"id": "limealpha|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "10e296a606b3c506a4d9046dfc593d901d49e6eaaa5803d18ff51d8e49dd10ac"
|
||||
},
|
||||
"limealpha|33": {
|
||||
"id": "limealpha|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "40e733728a6aae4ab7e78993ad2e2eb8689b8761f3698dc1054bf6d0615da30f"
|
||||
},
|
||||
"grey|16": {
|
||||
"id": "grey|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "a6b24c09f8364adf1190ae3c33d6c8b575d179cc6c2de98a342cd321c82dffe7"
|
||||
},
|
||||
"grey|33": {
|
||||
"id": "grey|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "fd6f0d41ebb37ceff9ae9d476f297293be36279bed196d66a13708298322d3ff"
|
||||
},
|
||||
"white_on_black|16": {
|
||||
"id": "white_on_black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "acc160da81e8cddd293c5bce6a0d24f382cb778c4df90488ad21e3cc0177099c"
|
||||
},
|
||||
"white_on_black|33": {
|
||||
"id": "white_on_black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2b457056b9add984d1f09f3194b116399d6f1313cb7b5c006adb59662d8011c1"
|
||||
},
|
||||
"red|16": {
|
||||
"id": "red|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "bbafe01fa867809ef60b23de34292b6130e018f06cecb5dc4036fde01ad8524c"
|
||||
},
|
||||
"red|33": {
|
||||
"id": "red|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "00c7c3b8114a536a2e305b9c995456501553c158a572288a6382c7addcd6ab9f"
|
||||
},
|
||||
"white_on_blue|16": {
|
||||
"id": "white_on_blue|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "2114b54a0da2799c310357e1f3e88255228bd6b10277b5bb4c28be9dd0e8309f"
|
||||
},
|
||||
"white_on_blue|33": {
|
||||
"id": "white_on_blue|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "42df0d6244b32216364af6dbfaba48a44ef3689a28786529715372688e1da443"
|
||||
}
|
||||
}
|
||||
},
|
||||
"2200_0": {
|
||||
"gamma": 2200,
|
||||
"contrast": 0,
|
||||
"count": 39,
|
||||
"black": {
|
||||
"Arial|12.5|none|normal|normal|fill": {
|
||||
"id": "Arial|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "bc41b0f4665d48690f6acaf86575e90045da6eeeb1e21c1d71cee9eb0fdadf97"
|
||||
},
|
||||
"Arial|16|none|normal|normal|fill": {
|
||||
"id": "Arial|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "494f8937cfabe6df194df5942b4a1a7dc11de5e891784bd743467714cc905bb2"
|
||||
},
|
||||
"Arial|16|none|normal|normal|stroke": {
|
||||
"id": "Arial|16|none|normal|normal|stroke",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "c59f1864698754e5f010baa4b2af1c65e9e74d6bdf6d84cafada9bae1fbeeb6f"
|
||||
},
|
||||
"Arial|33|none|normal|normal|fill": {
|
||||
"id": "Arial|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "46753d78e39d6d7d472e805e46b062256705d2622ad1a0441b34b622e20fbe30"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "dc2d1220bfc481f561e0ee1c1093f9a2e7484a137e1fa4a7054e88a8cde8efee"
|
||||
},
|
||||
"Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|33|rot15-scale1.5x2|normal|normal|fill|alpha=false",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "d766613d927d0402f64875a3f84d730c05e8334f04d538550669eb60a6f7c90b"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill": {
|
||||
"id": "Arial|72|none|normal|normal|fill",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "bff75224bc88dad497d360779bd999a2c327651e68a29df0332a025f27414b60"
|
||||
},
|
||||
"Arial|72|none|normal|normal|fill|alpha=false": {
|
||||
"id": "Arial|72|none|normal|normal|fill|alpha=false",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "3b1d63436b498024c8fa5dd191aaec66a720920f4f5cbebcec4fb10cafbad543"
|
||||
},
|
||||
"Arial|72|none|normal|normal|stroke": {
|
||||
"id": "Arial|72|none|normal|normal|stroke",
|
||||
"width": 1456,
|
||||
"height": 673,
|
||||
"sha256": "44fd511bb9097a9344524a9ce88a2832767b93310274790de08ca68a76da971d"
|
||||
},
|
||||
"Arial|9|none|normal|normal|fill": {
|
||||
"id": "Arial|9|none|normal|normal|fill",
|
||||
"width": 252,
|
||||
"height": 155,
|
||||
"sha256": "7f1c0a53a28d5d1928788db178742643435c6576e0df291b6d68688d306ebeb1"
|
||||
},
|
||||
"Calibri|12.5|none|normal|normal|fill": {
|
||||
"id": "Calibri|12.5|none|normal|normal|fill",
|
||||
"width": 302,
|
||||
"height": 179,
|
||||
"sha256": "c6834082d739490f9486ff17e13b07d97c47bf823e14864d18ae752db88193ed"
|
||||
},
|
||||
"Calibri|16|none|normal|normal|fill": {
|
||||
"id": "Calibri|16|none|normal|normal|fill",
|
||||
"width": 364,
|
||||
"height": 206,
|
||||
"sha256": "48d1d575a8e73c17c89b57bcadaf94a21d66956ab3406c81d0462a3d5f1e7f42"
|
||||
},
|
||||
"Calibri|33|none|normal|normal|fill": {
|
||||
"id": "Calibri|33|none|normal|normal|fill",
|
||||
"width": 666,
|
||||
"height": 340,
|
||||
"sha256": "823a7c1037ba76cee297b77e26de62d698bd8f8055fbdde556949248c01eb5c4"
|
||||
},
|
||||
"Calibri|9|none|normal|normal|fill": {
|
||||
"id": "Calibri|9|none|normal|normal|fill",
|
||||
"width": 240,
|
||||
"height": 151,
|
||||
"sha256": "d22432b47834f0426de5e2bcfa199e39f54db75e5cd503aa7175fa125f52a9c4"
|
||||
},
|
||||
"Consolas|12.5|none|normal|normal|fill": {
|
||||
"id": "Consolas|12.5|none|normal|normal|fill",
|
||||
"width": 338,
|
||||
"height": 188,
|
||||
"sha256": "2038306771f3c80c528cceca6a5045367dfb2789e0fac6c3b063a1979262ff82"
|
||||
},
|
||||
"Consolas|16|none|normal|normal|fill": {
|
||||
"id": "Consolas|16|none|normal|normal|fill",
|
||||
"width": 410,
|
||||
"height": 218,
|
||||
"sha256": "8e4d6ffa72d864c811647613554a9e9f044c949688566e84847be8d544b0c57b"
|
||||
},
|
||||
"Consolas|33|none|normal|normal|fill": {
|
||||
"id": "Consolas|33|none|normal|normal|fill",
|
||||
"width": 760,
|
||||
"height": 365,
|
||||
"sha256": "d79a5a9f2134bbbeb509fac67eaedddbba88a71a901ebc498c9e3c2b0f42178b"
|
||||
},
|
||||
"Consolas|9|none|normal|normal|fill": {
|
||||
"id": "Consolas|9|none|normal|normal|fill",
|
||||
"width": 266,
|
||||
"height": 158,
|
||||
"sha256": "9d76f6b720d844f961d74c8779849f701a10b6b088cb8f6b73d1ac181a01179e"
|
||||
},
|
||||
"Segoe UI|12.5|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|12.5|none|normal|normal|fill",
|
||||
"width": 319,
|
||||
"height": 183,
|
||||
"sha256": "6f05277c4eea92d7d1ca86471bcf47f42172d9ab43d11e784c14650b86b7f744"
|
||||
},
|
||||
"Segoe UI|16|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|16|none|normal|normal|fill",
|
||||
"width": 386,
|
||||
"height": 212,
|
||||
"sha256": "7fed78964672e26bfc878ab65910c9c59abf57af85f8d01af330f0d8e6a890e4"
|
||||
},
|
||||
"Segoe UI|33|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|33|none|normal|normal|fill",
|
||||
"width": 711,
|
||||
"height": 352,
|
||||
"sha256": "af8d02cec31673a205a5a389f478e8270474bd025936cd11fd01478a706da04b"
|
||||
},
|
||||
"Segoe UI|9|none|normal|normal|fill": {
|
||||
"id": "Segoe UI|9|none|normal|normal|fill",
|
||||
"width": 253,
|
||||
"height": 155,
|
||||
"sha256": "5bc7924b646811c83d2a6f31bb02236ccae08abdc39c98f574c41c6211ee0413"
|
||||
},
|
||||
"Times New Roman|16|none|normal|normal|fill": {
|
||||
"id": "Times New Roman|16|none|normal|normal|fill",
|
||||
"width": 365,
|
||||
"height": 207,
|
||||
"sha256": "cfff39b7d31293c20e44353c76ed717424e375ad59f98a74b800f24c5934316b"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|alpha=false|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "4aac8af7051ea57f30eeb0a18bc56e1f73d74c1751df3a45a78c874eb0a4a5f2"
|
||||
},
|
||||
"Twemoji Mozilla|33|none|normal|normal|fill|text=emoji": {
|
||||
"id": "Twemoji Mozilla|33|none|normal|normal|fill|text=emoji",
|
||||
"width": 338,
|
||||
"height": 254,
|
||||
"sha256": "4aac8af7051ea57f30eeb0a18bc56e1f73d74c1751df3a45a78c874eb0a4a5f2"
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
"black|16": {
|
||||
"id": "black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "77d5557ee05bc85c9ecd875517422c0516ac9d979933fc4c50a00c2a85c4a8a1"
|
||||
},
|
||||
"black|33": {
|
||||
"id": "black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "580a367613617a17978fe64bc2514e0c34414fbbfdbfea4a81f6f41a9048fd02"
|
||||
},
|
||||
"teal|16": {
|
||||
"id": "teal|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "226470fa83fe2039c31e073cb620c1aadd4c0c615be2e40b53905c2132554ef5"
|
||||
},
|
||||
"teal|33": {
|
||||
"id": "teal|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "20ee0972b2582b55c1532bbc98fd00550ae6af110bc92ac65f09ae7a5e4c1ae0"
|
||||
},
|
||||
"limealpha|16": {
|
||||
"id": "limealpha|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "8674bbefa9ce1106172929a986f6a98b37a1394d13c537c4d4388a7600816ef7"
|
||||
},
|
||||
"limealpha|33": {
|
||||
"id": "limealpha|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "643b28b21d276d940d892b5fb393f845e3bb74a87b388b609d057d5901fe9469"
|
||||
},
|
||||
"grey|16": {
|
||||
"id": "grey|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "022631fc03d1610531248ef4a927231ec6e23194e1e1f4afa89c4c3948cd0629"
|
||||
},
|
||||
"grey|33": {
|
||||
"id": "grey|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "df655c2f29a1dc0c478fe57f9bbc5201f465d56b77de99504cb775bc519df987"
|
||||
},
|
||||
"white_on_black|16": {
|
||||
"id": "white_on_black|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "5b80cc5864ab3e7b53fae364eaf9328938f2170312201ec0e27a0c42bfd02bd9"
|
||||
},
|
||||
"white_on_black|33": {
|
||||
"id": "white_on_black|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "7abbe06b0ae934fde081a8e9e7abdba2c74268a4703b3fd14ec91165ba9e0643"
|
||||
},
|
||||
"red|16": {
|
||||
"id": "red|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "11d2b4bbd971feb10b866a8aed895b944c68c3094eab90f4fbe1c4e75cdbfe84"
|
||||
},
|
||||
"red|33": {
|
||||
"id": "red|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "b4ff984d6faf7c7a7c17c5bd347dfd243196fbcd55ce2754b05b684b775edaed"
|
||||
},
|
||||
"white_on_blue|16": {
|
||||
"id": "white_on_blue|16",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "806b730875ad3b0223aa3acb435fbc5490a7240e5e4e0f1df4d9422001232ae5"
|
||||
},
|
||||
"white_on_blue|33": {
|
||||
"id": "white_on_blue|33",
|
||||
"width": 420,
|
||||
"height": 160,
|
||||
"sha256": "46035656360248005c49c9bd0e9db1ac47223689b96993ccb2370c82e7f726f2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"firefox-68": {
|
||||
"carries": [
|
||||
"the in-memory caches of the core are gone (core 67.78.0, no engine change)",
|
||||
"revocations and intermediates as ready-made files (the security-state component)",
|
||||
"a navigation that committed is not cut by the parent (the held cut: networkidle)",
|
||||
"the Juggler trace and the MOZ_LOG modules of the gate",
|
||||
"TEMP on D: in the Windows jobs"
|
||||
],
|
||||
"files": {
|
||||
"tests/test_a_page_that_moves_on_e2e.py": "a navigation that committed is not cut by the parent: goto answers on our own page, networkidle is reached on the one that replaced it",
|
||||
"tests/test_fakeweb_p2_e2e.py": "under a load of other browsers the page that leaves with beacons reaches networkidle every round (the held cut of a committed navigation); on an older engine the run is made and not judged"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
{
|
||||
"fonts": {
|
||||
"menu": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"caption": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"icon": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"message-box": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"small-caption": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"status-bar": {
|
||||
"family": "Segoe UI",
|
||||
"size": "12px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
},
|
||||
"system-ui": {
|
||||
"family": "system-ui",
|
||||
"size": "16px",
|
||||
"weight": "400",
|
||||
"style": "normal",
|
||||
"stretch": "100%"
|
||||
}
|
||||
},
|
||||
"light": {
|
||||
"Canvas": "rgb(255, 255, 255)",
|
||||
"CanvasText": "rgb(0, 0, 0)",
|
||||
"LinkText": "rgb(0, 0, 238)",
|
||||
"VisitedText": "rgb(85, 26, 139)",
|
||||
"ActiveText": "rgb(238, 0, 0)",
|
||||
"ButtonFace": "rgb(233, 233, 237)",
|
||||
"ButtonText": "rgb(0, 0, 0)",
|
||||
"ButtonBorder": "rgb(129, 127, 132)",
|
||||
"Field": "rgb(255, 255, 255)",
|
||||
"FieldText": "rgb(0, 0, 0)",
|
||||
"GrayText": "rgb(109, 109, 109)",
|
||||
"Highlight": "rgb(0, 120, 212)",
|
||||
"HighlightText": "rgb(255, 255, 255)",
|
||||
"Mark": "rgb(255, 255, 0)",
|
||||
"MarkText": "rgb(0, 0, 0)",
|
||||
"SelectedItem": "rgb(0, 120, 212)",
|
||||
"SelectedItemText": "rgb(255, 255, 255)",
|
||||
"AccentColor": "rgb(0, 96, 223)",
|
||||
"AccentColorText": "rgb(255, 255, 255)",
|
||||
"ActiveBorder": "rgb(129, 127, 132)",
|
||||
"ActiveCaption": "rgb(255, 255, 255)",
|
||||
"AppWorkspace": "rgb(255, 255, 255)",
|
||||
"Background": "rgb(255, 255, 255)",
|
||||
"ButtonHighlight": "rgb(233, 233, 237)",
|
||||
"ButtonShadow": "rgb(233, 233, 237)",
|
||||
"CaptionText": "rgb(0, 0, 0)",
|
||||
"InactiveBorder": "rgb(129, 127, 132)",
|
||||
"InactiveCaption": "rgb(255, 255, 255)",
|
||||
"InactiveCaptionText": "rgb(109, 109, 109)",
|
||||
"InfoBackground": "rgb(255, 255, 255)",
|
||||
"InfoText": "rgb(0, 0, 0)",
|
||||
"Menu": "rgb(255, 255, 255)",
|
||||
"MenuText": "rgb(0, 0, 0)",
|
||||
"Scrollbar": "rgb(255, 255, 255)",
|
||||
"ThreeDDarkShadow": "rgb(129, 127, 132)",
|
||||
"ThreeDFace": "rgb(233, 233, 237)",
|
||||
"ThreeDHighlight": "rgb(129, 127, 132)",
|
||||
"ThreeDLightShadow": "rgb(129, 127, 132)",
|
||||
"ThreeDShadow": "rgb(129, 127, 132)",
|
||||
"Window": "rgb(255, 255, 255)",
|
||||
"WindowFrame": "rgb(129, 127, 132)",
|
||||
"WindowText": "rgb(0, 0, 0)"
|
||||
},
|
||||
"dark": {
|
||||
"Canvas": "rgb(28, 27, 34)",
|
||||
"CanvasText": "rgb(251, 251, 254)",
|
||||
"LinkText": "rgb(0, 202, 219)",
|
||||
"VisitedText": "rgb(255, 173, 255)",
|
||||
"ActiveText": "rgb(255, 102, 102)",
|
||||
"ButtonFace": "rgb(43, 42, 51)",
|
||||
"ButtonText": "rgb(251, 251, 254)",
|
||||
"ButtonBorder": "rgb(148, 146, 151)",
|
||||
"Field": "rgb(43, 42, 51)",
|
||||
"FieldText": "rgb(251, 251, 254)",
|
||||
"GrayText": "rgb(117, 116, 122)",
|
||||
"Highlight": "rgba(0, 221, 255, 0.306)",
|
||||
"HighlightText": "rgb(0, 0, 0)",
|
||||
"Mark": "rgb(255, 255, 0)",
|
||||
"MarkText": "rgb(0, 0, 0)",
|
||||
"SelectedItem": "rgb(0, 221, 255)",
|
||||
"SelectedItemText": "rgb(43, 42, 51)",
|
||||
"AccentColor": "rgb(0, 96, 223)",
|
||||
"AccentColorText": "rgb(255, 255, 255)",
|
||||
"ActiveBorder": "rgb(57, 57, 57)",
|
||||
"ActiveCaption": "rgb(28, 27, 34)",
|
||||
"AppWorkspace": "rgb(28, 27, 34)",
|
||||
"Background": "rgb(28, 27, 34)",
|
||||
"ButtonHighlight": "rgb(43, 42, 51)",
|
||||
"ButtonShadow": "rgb(43, 42, 51)",
|
||||
"CaptionText": "rgb(251, 251, 254)",
|
||||
"InactiveBorder": "rgb(57, 57, 57)",
|
||||
"InactiveCaption": "rgb(28, 27, 34)",
|
||||
"InactiveCaptionText": "rgb(251, 251, 254)",
|
||||
"InfoBackground": "rgb(28, 27, 34)",
|
||||
"InfoText": "rgb(251, 251, 254)",
|
||||
"Menu": "rgb(43, 42, 51)",
|
||||
"MenuText": "rgb(251, 251, 254)",
|
||||
"Scrollbar": "rgb(28, 27, 34)",
|
||||
"ThreeDDarkShadow": "rgb(34, 33, 40)",
|
||||
"ThreeDFace": "rgb(43, 42, 51)",
|
||||
"ThreeDHighlight": "rgb(148, 146, 151)",
|
||||
"ThreeDLightShadow": "rgb(148, 146, 151)",
|
||||
"ThreeDShadow": "rgb(148, 146, 151)",
|
||||
"Window": "rgb(28, 27, 34)",
|
||||
"WindowFrame": "rgb(117, 116, 122)",
|
||||
"WindowText": "rgb(251, 251, 254)"
|
||||
},
|
||||
"selection": {
|
||||
"light": {
|
||||
"color": "rgb(0, 0, 0)",
|
||||
"bg": "rgba(0, 0, 0, 0)"
|
||||
},
|
||||
"dark": {
|
||||
"color": "rgb(0, 0, 0)",
|
||||
"bg": "rgba(0, 0, 0, 0)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"format":1,"source":"Mozilla's security/manager/ssl/tests/unit/test_crlite_filters","files":{"20200101-0-filter":{"path":"security/manager/ssl/tests/unit/test_crlite_filters/20200101-0-filter","sha256":"3c116fb9feacdf83b74fd0a4d38b9427df19733021b97ff40e9aa53f8e81b71b","base64":"AwABAAAAAAAAAFQiJZjzPTZIBULa7ODmuU3hXA7ujFkUykjXXjxIToA/AAAAAAAAAAB/TnFOGAkAAAEAAAAAAAAAIAAAAAAAAABUIiWY8z02SAVC2uzg5rlN4VwO7oxZFMpI1148SE6APwIAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABgAAAAAAAAA="},"20200101-1-filter.delta":{"path":"security/manager/ssl/tests/unit/test_crlite_filters/20200101-1-filter.delta","sha256":"27a608525e50b97ca3b8d6e9b91a517be681731576efda99a6b02d3024b968bb","base64":"AwABAAAAAAAAAFQiJZjzPTZIBULa7ODmuU3hXA7ujFkUykjXXjxIToA/AAAAAAAAAAB/TnFOGAkAAAEAAAAAAAAAIAAAAAAAAABUIiWY8z02SAVC2uzg5rlN4VwO7oxZFMpI1148SE6APwEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAA=="},"int.pem":{"path":"security/manager/ssl/tests/unit/test_crlite_filters/int.pem","sha256":"4b604e9b4254131a85fad2bca65fde30e53b68feeab9144e9db08b84ada5a365","base64":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5akNDQWJLZ0F3SUJBZ0lVVXhuMGYrZFl5bFNtUzM1Nkx2RFZQWWFYdHlzd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0RURUxNQWtHQTFVRUF3d0NZMkV3SWhnUE1qQXlNREF4TURFd01EQXdNREJhR0E4eU1ESXdNREl3TVRBdwpNREF3TUZvd0RqRU1NQW9HQTFVRUF3d0RhVzUwTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCCkNnS0NBUUVBdW9oUnFFU09GdFpCL1c2MmlBWTJFRDA4RTlucTVEVkt0T3oxYUZkc0pIdkJ4eVdvNE5nZnZiR2MKQnB0dUdvYnlhK0t2V25WcmFtUnhDSHFsV3FkRmgvY2MxU1NjQW43TlEvd2VhZEE0SUNtVHF5RERTZVRidVV6QwphMndPN1JXQ0QvRityV2thc2RNQ09vc3FRZTZuY09BUERZMzlaZ3Nyc0NTU3BIMjVpR0Y1a0xGWGtEM1NPOFhnCnVFZ2ZxRGZUaUVQdkp4YllWYmRtV3FwK0FwQXZPbnNRZ0FZa3pCeHNsNjJXWVZ1MzRwWVN3SFV4b3d5UjNiVEsKOS95dEhTWFRDZSs1Rnc2bmFPR3pleThpYjJuanRJcVZZUjN1SnRZbG5hdVJDRTQyeXh3a0JDeS9Gb3N2NWZHUAptUmN4dUxQK1NTUDZjbEhFTWRVRHJOb1lDalh0alFJREFRQUJveDB3R3pBTUJnTlZIUk1FQlRBREFRSC9NQXNHCkExVWREd1FFQXdJQkJqQU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFodEdyNlZoZHJiOXJIZEpoTUhIck9YNEsKbFlDL0ZBVmhkY2R4RG8vN2JGam5ON1RYWFd4VjgzUzBwK01SRmw5Tk9Xa1A0SzJGSGVOUDd4OTdPcE4xOTIvSgo2V3ZsT01Wbk8zc0o0c21GRlFscVpYNVBoZzNTYk5rU01EdFJJOUd0TllSTHNJanpTb2d4VzFCZldpTDNZdnJSCnNIYlROV01DR2d1cUZlUkdZVjhQQ2ZhMjBJcDdqZDZwbXRsQ0ZTWmY1T3JYQjl2QnA5azZTS0hhSXpXMk5xTDUKTjV6TUwvcXIrS0x3cFRjVGVweEcrVHkzUzZIVnE0eWMwaVUrMDRWNS9yM0V1Rk5VTTIvTTV0OXRQN1lxTnA1QwprU1BEVGw0RzRsQU1NN1hHOXVHYytrR0JURHI3QmZyY0RBM0hqZG00NVE0UUJ4ZkZYNGhzN2JFOGp6OHFWdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"},"valid.example.com.pem":{"path":"security/manager/ssl/tests/unit/test_crlite_filters/valid.example.com.pem","sha256":"14cf7809b590b9eb7a6fa0263f38a7b8113b701d1969462eb7e7c0ae8614676b","base64":"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVYekNDQTBlZ0F3SUJBZ0lVZmNreElWR3pIVzE4SW1YZG9YNEFreHZmRll3d0RRWUpLb1pJaHZjTkFRRUwKQlFBd0RqRU1NQW9HQTFVRUF3d0RhVzUwTUNJWUR6SXdNakF3TVRBeE1EQXdNREF3V2hnUE1qQXlNREF5TURFdwpNREF3TURCYU1Cd3hHakFZQmdOVkJBTU1FWFpoYkdsa0xtVjRZVzF3YkdVdVkyOXRNSUlCSWpBTkJna3Foa2lHCjl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF1b2hScUVTT0Z0WkIvVzYyaUFZMkVEMDhFOW5xNURWS3RPejEKYUZkc0pIdkJ4eVdvNE5nZnZiR2NCcHR1R29ieWErS3ZXblZyYW1SeENIcWxXcWRGaC9jYzFTU2NBbjdOUS93ZQphZEE0SUNtVHF5RERTZVRidVV6Q2Eyd083UldDRC9GK3JXa2FzZE1DT29zcVFlNm5jT0FQRFkzOVpnc3JzQ1NTCnBIMjVpR0Y1a0xGWGtEM1NPOFhndUVnZnFEZlRpRVB2SnhiWVZiZG1XcXArQXBBdk9uc1FnQVlrekJ4c2w2MlcKWVZ1MzRwWVN3SFV4b3d5UjNiVEs5L3l0SFNYVENlKzVGdzZuYU9HemV5OGliMm5qdElxVllSM3VKdFlsbmF1UgpDRTQyeXh3a0JDeS9Gb3N2NWZHUG1SY3h1TFArU1NQNmNsSEVNZFVEck5vWUNqWHRqUUlEQVFBQm80SUJvVENDCkFaMHdIQVlEVlIwUkJCVXdFNElSZG1Gc2FXUXVaWGhoYlhCc1pTNWpiMjB3TWdZSUt3WUJCUVVIQVFFRUpqQWsKTUNJR0NDc0dBUVVGQnpBQmhoWm9kSFJ3T2k4dmJHOWpZV3hvYjNOME9qZzRPRGd2TUlJQlJ3WUtLd1lCQkFIVwplUUlFQWdTQ0FUY0VnZ0V6QVRFQkx3QlVJaVdZOHowMlNBVkMydXpnNXJsTjRWd083b3haRk1wSTExNDhTRTZBClB3QUFBVzllWnVnQUFBQUVBUUVBYlNsdmRPeGM1bmtEbDJlY1hDL0NxZStRTHRRNzhqWkJmbDZPZCs0TlNVTloKK1lYVUkxSk93aXYwdHNlMmhjTDR4cHBkMHlnbzRGV2VYSDVwbkFCOTBCdnJZQXcraXh0VzNHQ0VyRzVGVE1KTwpNUVZlUE8yd2I1dDB3VWJrQlRpYmZ4NjlhcTU5dW43T211R25TZDBCbnJrK2x5eVo4VHdhaDRQMmlzOHJCTnB6Cis2ZDBjd0ZWTnJCU2tNWkhTUWdpWnIySS84Z2ZuY0VDcVBTSzhFMjV4cUdVY0UwT0JkczdDcW9EL0txTzUzQ0sKeWhzdTEvbG55MGpFQnhyTDZ5dDlKZ2VqeVF0dzF4TW5uQWlFY0dsTGtCbUFYNVR4VGMvZGtnMWtXY3ZRYTM0ZgpnbEZieUpDM3hrWThpK2dJcDRsTVJ1QVV3VWRiVHROTTFqNktUSVgzU1RBTkJna3Foa2lHOXcwQkFRc0ZBQU9DCkFRRUFRejRFYmFsOFgzb084Unl4V29oRHByTndNVGVnR1ZYY3Ntd1lsSUhJQjFYa0xsb2Q4aVk0dGNNQ2Y4UmsKbEFURE9vSXNsZjdNenNZcVd6dHBpT1RSREczUTFmS25qa0tzak9mRTQzMkxwNitDVEdWVm9aSTlMeFdkL25EegpPd01rbm1NRDJiWHVxK1pzdG1LRDRxanN3Yi9ZRy9rN2VtQ21EQ0s2Q1l4T05nRzNSSkpmUDZ0UW84b1hVQ3RFCnpIQ1M0bEhTWjcxOEFqTnpBZURxNEc2WHBzN0RNVHVEYmRMVEhMVFdVUTZ1N2o5c3k1cTFzUmU2S2VZWklUU20KMWZ2WjYwWG5zblF5cVdYSGVTekxCb2pVdzlTQVlEOC9ZVnZQWXRWaHNnR0JXeHFOY0VBNmJCZUxXbkVNeUhocgpDMVlkZEFSd1FDM1JJSjZ5MFk0eTRHek42QT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"},"revoked-in-delta.example.com.pem":{"path":"security/manager/ssl/tests/unit/test_crlite_filters/revoked-in-delta.example.com.pem","sha256":"93bc3e3494e14ec7a828c205678d1736ca6310288Line truncated
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"format": 1,
|
||||
"source": "security/manager/tools/pykey.py, RSAKey.shared* (the key of the specification `default`)",
|
||||
"pem": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC6iFGoRI4W1kH9\nbraIBjYQPTwT2erkNUq07PVoV2wke8HHJajg2B+9sZwGm24ahvJr4q9adWtqZHEI\neqVap0WH9xzVJJwCfs1D/B5p0DggKZOrIMNJ5Nu5TMJrbA7tFYIP8X6taRqx0wI6\niypB7qdw4A8Njf1mCyuwJJKkfbmIYXmQsVeQPdI7xeC4SB+oN9OIQ+8nFthVt2Za\nqn4CkC86exCABiTMHGyXrZZhW7filhLAdTGjDJHdtMr3/K0dJdMJ77kXDqdo4bN7\nLyJvaeO0ipVhHe4m1iWdq5EITjbLHCQELL8Wiy/l8Y+ZFzG4s/5JI/pyUcQx1QOs\n2hgKNe2NAgMBAAECggEBAJ7LzjhhpFTsseD+j4XdQ8kvWCXOLpl4hNDhqUnaosWs\nVZskBFDlrJ/gw+McDu+mUlpl8MIhlABO4atGPd6e6CKHzJPnRqkZKcXmrD2IdT9s\nJbpZeec+XY+yOREaPNq4pLDN9fnKsF8SM6ODNcZLVWBSXn47kq18dQTPHcfLAFeI\nr8vh6Pld90AqFRUw1YCDRoZOs3CqeZVqWHhiy1M3kTB/cNkcltItABppAJuSPGgz\niMnzbLm16+ZDAgQceNkIIGuHAJy4yrrK09vbJ5L7kRss9NtmA1hb6a4Mo7jmQXqg\nSwbkcOoaO1gcoDpngckxW2KzDmAR8iRyWUbuxXxtlEECgYEA3W4dT//r9o2InE0R\nTNqqnKpjpZN0KGyKXCmnF7umA3VkTVyqZ0xLi8cyY1hkYiDkVQ12CKwn1Vttt0+N\ngSfvj6CQmLaRR94GVXNEfhg9Iv59iFrOtRPZWB3V4HwakPXOCHneExNx7O/JznLp\nxD3BJ9I4GQ3oEXc8pdGTAfSMdCsCgYEA16dz2evDgKdn0v7Ak0rU6LVmckB3Gs3r\nta15b0eP7E1FmF77yVMpaCicjYkQL63yHzTi3UlA66jAnW0fFtzClyl3TEMnXpJR\n3b5JCeH9O/Hkvt9Go5uLODMo70rjuVuS8gcK8myefFybWH/t3gXo59hspXiG+xZY\nEKd7mEW8MScCgYEAlkcrQaYQwK3hryJmwWAONnE1W6QtS1oOtOnX6zWBQAul3RMs\n2xpekyjHu8C7sBVeoZKXLt+X0SdR2Pz2rlcqMLHqMJqHEt1OMyQdse5FX8CT9byb\nWS11bmYhR08ywHryL7J100B5KzK6JZC7smGu+5WiWO6lN2VTFb6cJNGRmS0CgYAo\ntFCnp1qFZBOyvab3pj49lk+57PUOOCPvbMjo+ibuQT+LnRIFVA8Su+egx2got7pl\nrYPMpND+KiIBFOGzXQPVqFv+Jwa9UPzmz83VcbRspiG47UfWBbvnZbCqSgZlrCU2\nTaIBVAMuEgS4VZ0+NPtbF3yaVv+TUQpaSmKHwVHeLQKBgCgGe5NVgB0u9S36ltit\ntYlnPPjuipxv9yruq+nva+WKT0q/BfeIlH3IUf2qNFQhR6caJGv7BU7naqNGq80m\nks/J5ExR5vBpxzXgc7oBn2pyFJYckbJoccrqv48GRBigJpDjmo1f8wZ7fNt/ULH1\nNBinA5ZsT8d0v3QCr2xDJH9D\n-----END PRIVATE KEY-----\n"
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
# Expected text of getComputedStyle for calc(1px * f(args)) (word-spacing)
|
||||
# and of rotate: f(args) for the angle functions, from ucrtbase.dll's f32
|
||||
# functions. Generated by scripts/ucrt_css_calc.py (python -I) - do not edit.
|
||||
# <fn> <args...> <text on Windows>
|
||||
sin -12.2958984375 0.267186px
|
||||
sin -3.3349609375 0.192165px
|
||||
sin -8.728515625 -0.641354px
|
||||
sin -9.603515625 0.177787px
|
||||
sin 2.6865234375 0.439525px
|
||||
sin 5.9267578125 -0.348928px
|
||||
sin -15.998046875 0.286032px
|
||||
sin 0 0px
|
||||
sin 15.9970703125 -0.285096px
|
||||
cos -10.3515625 -0.600409px
|
||||
cos -2.0146484375 -0.429422px
|
||||
cos -3.9794921875 -0.669025px
|
||||
cos 10.3515625 -0.600409px
|
||||
cos 2.0146484375 -0.429422px
|
||||
cos 3.9794921875 -0.669025px
|
||||
cos -16 -0.95766px
|
||||
cos 0 1px
|
||||
cos 15.9990234375 -0.95794px
|
||||
tan -2 2.18504px
|
||||
tan 0 0px
|
||||
tan 16 0.300632px
|
||||
asin -0.27099609375 -15.7235deg
|
||||
asin -0.6416015625 -39.9114deg
|
||||
asin -0.859619140625 -59.2738deg
|
||||
asin -0.982421875 -79.2413deg
|
||||
asin 0.59423828125 36.4583deg
|
||||
asin 0.751953125 48.7598deg
|
||||
asin -0.4990234375 -29.9354deg
|
||||
asin -1 -90deg
|
||||
asin 0.49853515625 29.9031deg
|
||||
acos -0.61669921875 128.076deg
|
||||
acos 0.499267578125 60.0484deg
|
||||
acos 0.615234375 52.031deg
|
||||
acos -0.5 120deg
|
||||
acos -1 180deg
|
||||
acos 0.499755859375 60.0161deg
|
||||
atan -4.000244140625 -75.9646deg
|
||||
atan 0 0deg
|
||||
atan 4 75.9638deg
|
||||
atan2 -1.125 1.890625 -30.7544deg
|
||||
atan2 0 0.015625 0deg
|
||||
atan2 1.125 -1.90625 149.452deg
|
||||
exp -2.1875 0.112197px
|
||||
exp 0 1px
|
||||
exp 2.187255859375 8.91073px
|
||||
log 1.0966796875 0.0922872px
|
||||
log 24.4873046875 3.19816px
|
||||
log 31.2861328125 3.44317px
|
||||
log 16.7880859375 2.82067px
|
||||
log 24.5703125 3.20154px
|
||||
log 35.609375 3.57261px
|
||||
pow 1.125 -1.5 0.838052px
|
||||
pow 4.4375 4 387.751px
|
||||
pow 12.1875 -2.0625 0.00575839px
|
||||
pow 2.0625 -4 0.0552617px
|
||||
pow 6 1.9375 32.1861px
|
||||
hypot -3.1875 -5 5.9296px
|
||||
hypot 0 0 0px
|
||||
hypot 3 4.6875 5.56531px
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -1,110 +0,0 @@
|
||||
{
|
||||
"source": "C:/ff/invisible_WebCodecs/captures/h264-1080p-bframes/retail-win/result.json",
|
||||
"source_meta": "C:/ff/invisible_WebCodecs/captures/h264-1080p-bframes/retail-win/meta.json",
|
||||
"browser": "ff159-win-1080p",
|
||||
"codecString": "avc3.640028",
|
||||
"codedWidth": 1920,
|
||||
"codedHeight": 1080,
|
||||
"frameCount": 96,
|
||||
"frameDurationUs": 41667,
|
||||
"rgbaAllocationSize": 8294400,
|
||||
"rgbaFormat": "RGBA",
|
||||
"rgbaSha256ByIndex": [
|
||||
"ec86f786dfd4fb31be388382b7132df8f692c166f0398047454bbef38abf280c",
|
||||
"612a924786de8460f6ebcd5893921a8ae04fb41b441cd9f0087cf6183fb960a9",
|
||||
"e9aa87d893e542f53c3900fcd37f7a9ad40bc89b5e456d4a6ae73f142df04759",
|
||||
"441e299f66fca23ff0716ebb32982f919558967fbaa4bf877040e8e0e41f67f7",
|
||||
"c9b54bf73bc6d87c90196e128ee21aa5ae8c855d8474b1a967fbf6ba2110e22b",
|
||||
"2ab4b1709f2f049541095d386e7cd7297e3ebe1503d120d1138ca61d74a1b8af",
|
||||
"8fa4df13e422b44d585ba7413be439069b7911b7be4916aa6f338821be6665fc",
|
||||
"ce2e7286c19a9c461342c439ccdc31a8573f50dd9318dc836ba8adbc1c6f8958",
|
||||
"b64915b1f2d8fbb9795002736543baaf65339458c8ff204c370f78e1a0ff4da1",
|
||||
"ae82fff8551a99dee31cdda4fb1154b58382cf6e9d6a275b320b35db14fb47fe",
|
||||
"bbcc0181e5beeb699abfd810f2598e66d8f151b5e2712b030b9b8d8506cd9f64",
|
||||
"2b52fcb494ae4b3fa8bc4f7c66da19cf3816c4928c2861ca807f079a835c69dd",
|
||||
"6eeb0e0293a7447ea85227a04fba74b72f4b16573ddb457f4f7ec0b96a05a5dc",
|
||||
"8c3dc83cd33c5411cdba6123cfb62ee8c53fe181a325b4abb450ce7afb9edfa7",
|
||||
"d4d9297594c0af1c331c6d403cb78bedfcf33d82707f06873b48155287f33139",
|
||||
"f01b715b011494cf2bf5f97212507d07a48a00282ce8d2bd4afd8f76aa8f4f65",
|
||||
"976790562ae138a42395663d66d8fb987b83e1cc40b067821f3d438fe496765a",
|
||||
"5896a442951c90479e6093ee92fc51b00734c8fafe84061c6ad2988c5c9719ce",
|
||||
"dc84a9c2e608daf77ee25c881d0df69f9ddf6715b07b8eba3cbbfaaa692f4aa2",
|
||||
"98dc9edd09bf0ce330fdc8eafa675f509adccd92e21b231f4d82b67e0448b172",
|
||||
"1cc5bcb92c1947231e63a034675233933928d318962cca2598631dda4ea0398d",
|
||||
"7851d124d7665bbc63decfde6035775bc29b7fc9466513789cafd7db49c9fb03",
|
||||
"d00140e72758644c62ea0be72ff6d6371b27b1a8e488bb30b43931501def5719",
|
||||
"3fa367ee394ed399a41f60d4b0fc9a9a93c36daffb8da37d44a09999a88c8929",
|
||||
"b724e7bdd2e08efd665aeb1d088bdb6fa860c80d0e1c810f4b60e017d75b4060",
|
||||
"26920b0129c66dcc1f5df0832f7a7fa5dec50e7b0841c4bf4cbf75d886b1bd14",
|
||||
"bea97dc4d9550ab244ca648458c46cca3a8c278488e9add218af26fc37caf96e",
|
||||
"330907a28b53c8d1f97e854c827960c7a1da7fd8460694a1a145ae9bdd90a48b",
|
||||
"ac7bd746456764639eea4bb43b5d60502ee3b18cc7e7266a62960b2b1f21a3bd",
|
||||
"9797886bc01f7ab73470850cc79fe21541e286dab9f818a73e7b0f1d5f8ab838",
|
||||
"017db98229f47489c899fcedcb41c3fdace8d00adbf2c828a930eeac0adc9d3a",
|
||||
"2258e361a2762ded437a2d3b0793670d790d4e829d406f5a1c26c04d9b3272b2",
|
||||
"07ea8b535e731f51cb197015e82ebdd1b61ceff43397df94959c3bf4244bfdb8",
|
||||
"37e0a701d67c6a06b81783e27f0646071a788f0820d0d8a27d206a0e5e1bab87",
|
||||
"9e9c465245061255dea8f3e4263e500ddd96ae6555a2935771688572aa57904e",
|
||||
"ca8696c5c343ab883ee48998b20fdede0ea89da43921ce6aa010988091ad7ffe",
|
||||
"37c760b0eafc7f9b58f43cff84ff5ea4297085645a96b5b089ace4bed6579654",
|
||||
"306bd7874a05f7ee13a1977a677a901d9a803cc63a5ef51234cd09f4343b2578",
|
||||
"9e862bd1ef856d4d6e897f765b3a34405a2b33f08748135fa49782b36ebd018e",
|
||||
"9bdf82e391f7a415200b564cdb41e30b1d79e8550aaa2e100d0c93214dd02f84",
|
||||
"c58f9d86f624efcbae62ee01cadf7f1b974a9a0d1741c5a5add3d4baa4d54a57",
|
||||
"a41205a558148bc2c24c25d3f08abec0eb76371ac071cddba1a0b74f0b00b2d5",
|
||||
"8799abc56859269cc034e87b4c795b7c756db289b66d4944843bd88d44bcee0f",
|
||||
"ccfd5404af0d7ee5866e65ad1d420152be2591a339bb8cbfc8946f5789c5d46e",
|
||||
"ea56bed52ff1544be1fa04010a8a6d50c3beb9b249bd125b253006798c9c146e",
|
||||
"9f5c23b53933d5f52430f6c8d2e20b501e4747517856ee6f9e42b3c2ab3dfd93",
|
||||
"13c6283059d08e83b7a3e2823887746105c8161df2c43172a21ce81d73bf8e94",
|
||||
"62e109d54a8359628072dbd611f7c7d86a4aeb24093a79bd5e62a6212946f058",
|
||||
"00d37fb6a8bd4746bdee78fd703dbc21d571d281d270b90d315f47f807a9c8f7",
|
||||
"72b5749554816682dfb490f9a6e84c031fb257e066257de5ca38f9e61d8336e3",
|
||||
"5f736aae1dc7165be27fcbcde0424a7e81efe6ba23ea3b9ff18fe33e85edeadf",
|
||||
"82e781edecfed6f8cff7217aa7bb9843cfa050223670313f53439e5bb1cd581d",
|
||||
"2a7c33ab17ae5b68ddb6ab18157e29cd3146c170d638747d9f850bf820a0c106",
|
||||
"54638e8b4dd3721bd5e1b6ebb92d0d6269d7b3d1bb532f754860d0496657aca5",
|
||||
"f609d30438dc792107ed97d1040d5ab51d6dcf74b023429eb4cb7b687058fe44",
|
||||
"f4416eccaa2b90b2b28907dfc4560e63a4880c5c627cbf24225d68d17e3bad0d",
|
||||
"27ba6138b23ce0c3979de1943b282cbafff52a212db9665833bfefc22e1cd6a9",
|
||||
"7d3cd0fe51defbe28fac6447250b2c57614046739fb5fb9704d191470a88b629",
|
||||
"3d34c42f7038328efcffd83f12448f79d1b601aee0bb5aa9559a161715309b6e",
|
||||
"da3253068d029fcc47026cd1698316c65e9b8e30f1c33cea367e4af87569309b",
|
||||
"5b7ca1d07a9185644749ca361db6faa04b2c2fa7b6e23eba0d5e824e2294f4d3",
|
||||
"82522459c674f01cfeacc600ebbb5cffeabcd371613f5632f5c496c4018057f9",
|
||||
"72dc38d3ea4c917495c4c7eaa34f372d90dbedb9e41b6c6d2fd14649bcde3f11",
|
||||
"b6fa4a96d2aa0be036845b6180c8cbd03cf0e37f8f68cee4f13972bd29ba5dcc",
|
||||
"e4ddf2cdc4a372df492d9a3babd06b2e2e8eb3ff0f065332b066f54bf801718e",
|
||||
"7feaf1dc3f234c715e107461be06c7952c497374ad6feb1f352de690a62b5f8d",
|
||||
"edcd3c7d093d2e0bfeefaedd493c4f7bd8a2a13733b072c9c009308e45830dcb",
|
||||
"a5be7f4f6ae2aa30f391de192f89e83a2f494f0b0a29c9d4c25072e7cdbd4e8c",
|
||||
"a85212783e0614f7191cb6ea96361fd136be9afaa74c2dfe011f2a02b51acade",
|
||||
"bd3f233278c255bb4ef6cb83f2b2a3dd7daf8788aedb4f37db893ed2eb233055",
|
||||
"da0646ae2080593fe95ad475e9f88a61aaa5c67f45c88db1159afc6c808a395e",
|
||||
"635d187d98ca46b0916f83a3cb8c5e306c87519b0d97efd0b3a053be10726cae",
|
||||
"493463e004d5e760427057f25a9309dd1a7ccd8db7ff678385c0956a0df4ed6b",
|
||||
"f551dad30b92a9dc572768ec8b7d5cfdea6cbdf3d6a2612caa0a446604948d81",
|
||||
"7fccc7de25a0723a7fb96c82da7b3dfb90d13a040912e28390aa1893cfb9544c",
|
||||
"994aa24a02e2a4767c4b8c505a798d4ef2a9b6a56f457b165662951e087827ff",
|
||||
"ddcd5fcb63faeb2de4736f716384ba8033e4caf80531c6be879abcb7d1e2e3c4",
|
||||
"de319d6d3cc31892b31798aa382d3bbadbfb5c63b5d085d44535753cd1154d88",
|
||||
"bf0a1dee65b36efc72d9d47081064cd1478a41eb2930f5f209efde82ad81a90f",
|
||||
"58250251ac29c974e1c172ed7891f7b8918dc92722738051a2d47652fa15cb0c",
|
||||
"9d54d9c89ba4bb7bc44eaa92ba162851c425e6da7061712971a816d2f76226e9",
|
||||
"f8606f3d9cc85dd938e7c81c80bf459b704ee2fcf90dd5db2b22a57e9063b2d1",
|
||||
"9146f5fbfa4b9d0c6fb5d3fc754114f45b2960b0160bc5ec8049c766cb159a8f",
|
||||
"2a8fcf1082f08ad75bd679e43c331d8c68dd125583a0215a9d791f2dedacd252",
|
||||
"1cc30cac847d1f4cb3be1a6548320587083f8a140360720cf6e602643604db55",
|
||||
"f12ee7fa2a4f6c67ff363515af5d5ff269c2888c5cb0b1ef65b51c532c6513fe",
|
||||
"1fb7c9b0e42cc75c72f80ceab00ddbf1c53b79f0079afdc7f2d12a0b1362d470",
|
||||
"4204700c6c144ea21dcf35004c506abf1b4c31c7e56cb7593fe91a0df7a7e4bf",
|
||||
"1604b6be565a34d390015a69d4ce4939d1223a2a7340c665516cc268896f7302",
|
||||
"945f03992308869fd8c3cb866d587bc02cce18718491eb014e4c3a2d2b9910db",
|
||||
"b1483d183ecec1757c21ea90abe833ec6c7473e69be22fab59a804f469844fbc",
|
||||
"699ec626d2c4044b8fd95a6187b6b670f00b3e357f6147b5225f8b0b53855c08",
|
||||
"07b37382fee8cebab882854cf3ea1c05ada71ea88288333a878271c9a2d11c83",
|
||||
"4210279021308f9a52367d78c3527904da8d3488388dc78e49c435695f300f15",
|
||||
"616e4309c7b433d282b0727984cd797d0f384975749b34c12cba56b3bc6ec770",
|
||||
"6791837bb4b63b58877031e95b7e5d8556310b5f5bcbe40432ea41cd3d0a29e6"
|
||||
]
|
||||
}
|
||||
@@ -17,13 +17,25 @@ def install_route(context):
|
||||
context.route("**/*", lambda route: route.abort() if route.request.resource_type in BLOCKED else route.continue_())
|
||||
|
||||
|
||||
def navigate(page, url, *, idle_timeout_ms):
|
||||
def navigate(page, url, *, idle_timeout_ms, client_log=None):
|
||||
"""`client_log`, a list (default None: nothing kept), gets one entry per event the client heard (wall time `t`, time.time(), and `m`, time.perf_counter()):
|
||||
the navigation's start and end, and every request, its response and its end. A test that saves evidence when it fails passes it."""
|
||||
rec = {"idle": False, "err": None, "seconds": None}
|
||||
# The requests the client has heard of and not yet heard the end of: a navigation that does not idle says who is still in flight
|
||||
# (type, method, url, frame). The process that hosts a request is not readable by a client.
|
||||
open_requests = {}
|
||||
|
||||
def note(event, request=None, **more):
|
||||
if client_log is None:
|
||||
return
|
||||
entry = {"ev": event, "t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "url": url}
|
||||
if request is not None:
|
||||
entry.update(req=id(request), type=request.resource_type, method=request.method, target=request.url[:160])
|
||||
entry.update(more)
|
||||
client_log.append(entry)
|
||||
|
||||
def started(request):
|
||||
note("request", request)
|
||||
try:
|
||||
frame = request.frame.url[:100]
|
||||
except Exception:
|
||||
@@ -33,11 +45,18 @@ def navigate(page, url, *, idle_timeout_ms):
|
||||
|
||||
def ended(request):
|
||||
open_requests.pop(id(request), None)
|
||||
note("ended", request)
|
||||
|
||||
def answered(response):
|
||||
note("response", response.request, status=response.status)
|
||||
|
||||
t0 = time.monotonic()
|
||||
page.on("request", started)
|
||||
if client_log is not None:
|
||||
page.on("response", answered)
|
||||
page.on("requestfinished", ended)
|
||||
page.on("requestfailed", ended)
|
||||
note("navigation_start")
|
||||
try:
|
||||
page.goto(url, wait_until="commit", timeout=15000)
|
||||
page.wait_for_load_state("networkidle", timeout=idle_timeout_ms)
|
||||
@@ -47,16 +66,17 @@ def navigate(page, url, *, idle_timeout_ms):
|
||||
rec["err"] = (text.splitlines()[0] if text else repr(exc))[:200]
|
||||
rec["in_flight"] = list(open_requests.values())[:30]
|
||||
finally:
|
||||
for event, handler in (("request", started), ("requestfinished", ended), ("requestfailed", ended)):
|
||||
for event, handler in (("request", started), ("response", answered), ("requestfinished", ended), ("requestfailed", ended)):
|
||||
try:
|
||||
page.remove_listener(event, handler)
|
||||
except Exception:
|
||||
pass
|
||||
rec["seconds"] = round(time.monotonic() - t0, 2)
|
||||
note("navigation_end", idle=rec["idle"], err=rec["err"])
|
||||
return rec
|
||||
|
||||
|
||||
def drive(browser, origin, patterns, repetitions, idle_timeout_ms=10000):
|
||||
def drive(browser, origin, patterns, repetitions, idle_timeout_ms=10000, client_log=None):
|
||||
"""Every pattern `repetitions` times, each followed by the canary. Returns a list of cells."""
|
||||
cells = []
|
||||
context = browser.new_context()
|
||||
@@ -66,7 +86,7 @@ def drive(browser, origin, patterns, repetitions, idle_timeout_ms=10000):
|
||||
for rep in range(1, repetitions + 1):
|
||||
for name in patterns:
|
||||
for pattern, canary in ((name, False), ("quiet", True)):
|
||||
cell = navigate(page, "%s/p/%s" % (origin, pattern), idle_timeout_ms=idle_timeout_ms)
|
||||
cell = navigate(page, "%s/p/%s" % (origin, pattern), idle_timeout_ms=idle_timeout_ms, client_log=client_log)
|
||||
cell.update(round=rep, pattern=pattern, canary=canary, after=name if canary else None)
|
||||
cells.append(cell)
|
||||
finally:
|
||||
|
||||
+43
-1
@@ -302,11 +302,27 @@ def frame_html(kind, own, other, params):
|
||||
) % (kind, kind, body)
|
||||
|
||||
|
||||
#: Most records kept per start(): a long run of the fake web is not a memory leak.
|
||||
MAX_RECORDS = 50000
|
||||
|
||||
|
||||
class State:
|
||||
def __init__(self):
|
||||
self.origins = ["", ""]
|
||||
self.hits = {}
|
||||
self.lock = threading.Lock()
|
||||
#: What the server itself saw, in order: one `accept` per TCP connection and one `request` per request, each with its
|
||||
#: wall times (time.time(): arrival of the request, answer written, handler done; the Windows wall clock ticks every 15 ms, so
|
||||
#: the same moments are also kept as `m_*`, time.perf_counter() of this process, the scale of the client's log) and, if the
|
||||
#: client went away, the error.
|
||||
#: Read by a test that saves it as evidence when it fails (`start(...)[2].state.records`); nothing else reads it.
|
||||
self.records = []
|
||||
|
||||
def note(self, record):
|
||||
with self.lock:
|
||||
if len(self.records) < MAX_RECORDS:
|
||||
self.records.append(record)
|
||||
return record
|
||||
|
||||
def hit(self, path):
|
||||
with self.lock:
|
||||
@@ -323,6 +339,11 @@ class Site(ThreadingHTTPServer):
|
||||
self.idx = idx
|
||||
self.state = state
|
||||
|
||||
def process_request(self, request, client_address):
|
||||
self.state.note({"ev": "accept", "t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "site": self.idx,
|
||||
"peer": client_address[1]})
|
||||
super().process_request(request, client_address)
|
||||
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
protocol_version = "HTTP/1.1"
|
||||
@@ -340,15 +361,34 @@ class Handler(BaseHTTPRequestHandler):
|
||||
for k, v in (extra or {}).items():
|
||||
self.send_header(k, v)
|
||||
self.end_headers()
|
||||
rec = getattr(self, "_rec", None)
|
||||
if rec is not None:
|
||||
rec["status"] = code
|
||||
if body and self.command != "HEAD":
|
||||
self.wfile.write(body)
|
||||
if rec is not None:
|
||||
rec["t_answer"] = round(time.time(), 4)
|
||||
rec["m_answer"] = round(time.perf_counter(), 6)
|
||||
|
||||
def _guard(self, fn):
|
||||
# Browsers abort requests on purpose; a dropped socket is not an error here.
|
||||
wanted = ("Host", "Origin", "Referer", "Content-Type", "Content-Length", "Sec-Fetch-Site", "Sec-Fetch-Dest")
|
||||
rec = self._rec = self.server.state.note({
|
||||
"ev": "request", "t_arrive": round(time.time(), 4), "m_arrive": round(time.perf_counter(), 6), "site": self.server.idx, "peer": self.client_address[1],
|
||||
"method": self.command, "path": self.path,
|
||||
"headers": {k: self.headers.get(k) for k in wanted if self.headers.get(k) is not None},
|
||||
"status": None, "t_body": None, "t_answer": None, "t_done": None, "error": None})
|
||||
try:
|
||||
fn()
|
||||
except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError, TimeoutError):
|
||||
except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError, TimeoutError) as exc:
|
||||
rec["error"] = type(exc).__name__
|
||||
self.close_connection = True
|
||||
except BaseException as exc:
|
||||
rec["error"] = type(exc).__name__
|
||||
raise
|
||||
finally:
|
||||
rec["t_done"] = round(time.time(), 4)
|
||||
rec["m_done"] = round(time.perf_counter(), 6)
|
||||
|
||||
def do_GET(self):
|
||||
self._guard(self._get)
|
||||
@@ -367,6 +407,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
n = int(self.headers.get("Content-Length") or 0)
|
||||
if n:
|
||||
self.rfile.read(n)
|
||||
self._rec["t_body"] = round(time.time(), 4)
|
||||
self.server.state.hit(u.path)
|
||||
self._send(204, None, b"")
|
||||
|
||||
@@ -453,6 +494,7 @@ def start(ports=(8311, 8312), bind="127.0.0.1", public_host=("127.0.0.1", "local
|
||||
s.shutdown()
|
||||
s.server_close()
|
||||
|
||||
stop.state = state # the server's own record (`state.records`), kept after stop()
|
||||
return state.origins[0], state.origins[1], stop
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
"""A real click inside an iframe: `screenX - clientX` is the iframe's own `mozInnerScreenX`.
|
||||
|
||||
What it fixes: the relation a page checks with one subtraction on every mouse event, `event.screenX - event.clientX ==
|
||||
window.mozInnerScreenX` (and the same on Y), INSIDE an iframe placed at (220, 150) of the page. The defect of 2026-08-10:
|
||||
`mozInnerScreenX/Y` answered the origin of the top-level content to every window, so the iframe read (top origin) while
|
||||
its events still carried the iframe's offset, and `screenX - clientX` was 220 against a `mozInnerScreenX` of 0.
|
||||
|
||||
Engine hook: `fingerprint/screen-window/geometry` of the engine series: `nsGlobalWindowOuter::GetMozInnerScreenX/Y` and
|
||||
`Event::GetScreenCoords` both add the ONE content origin shift (`nsGlobalWindowOuter::StealthContentOriginShift`, declared
|
||||
window against real one) to the window's OWN real rectangle, so the offset between frames stays true at every depth.
|
||||
|
||||
Control, in the same test: the top window's `mozInnerScreenX/Y` is a different number (the iframe sits 220 and 150 CSS
|
||||
pixels off it). The test asserts the iframe's `mozInnerScreenX/Y` is the top's plus the iframe's rectangle, and that what
|
||||
the events carry (`screenX - clientX`) is NOT the top's origin: a window that answered the top origin to every frame fails
|
||||
both.
|
||||
|
||||
The click is a real one (`page.mouse.click` at a point inside the iframe, the pointer events the engine makes), not a
|
||||
dispatched event. The page and the iframe are one site, so the page may read the iframe's `mozInnerScreenX`.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from _fission_frames import Sites
|
||||
from _waits import wait_until
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
LEFT, TOP = 220, 150
|
||||
|
||||
PARENT = """<!doctype html><meta charset=utf-8><title>parent</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%%}
|
||||
#f{position:absolute;left:%dpx;top:%dpx;width:360px;height:220px;border:0}</style>
|
||||
<body><iframe id=f src="/child"></iframe>
|
||||
<script>
|
||||
window.__geom = () => {
|
||||
const w = document.getElementById('f').contentWindow;
|
||||
const r = document.getElementById('f').getBoundingClientRect();
|
||||
return {top_x: window.mozInnerScreenX, top_y: window.mozInnerScreenY,
|
||||
ifr_x: w.mozInnerScreenX, ifr_y: w.mozInnerScreenY, rect_x: r.x, rect_y: r.y};
|
||||
};
|
||||
</script>""" % (LEFT, TOP)
|
||||
|
||||
CHILD = """<!doctype html><meta charset=utf-8><title>child</title>
|
||||
<style>html,body{margin:0;padding:0;height:100%}
|
||||
#g{position:absolute;left:30px;top:40px;width:220px;height:130px;background:#06c}</style>
|
||||
<body><div id=g>y</div>
|
||||
<script>
|
||||
window.__ev = [];
|
||||
for (const t of ['mousemove', 'mousedown', 'mouseup', 'click']) {
|
||||
window.addEventListener(t, e => {
|
||||
window.__ev.push({t: t, cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY});
|
||||
}, true);
|
||||
}
|
||||
window.__inner = () => [window.mozInnerScreenX, window.mozInnerScreenY];
|
||||
</script>"""
|
||||
|
||||
|
||||
def test_a_real_click_in_an_iframe_has_the_screen_origin_of_the_iframe(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with Sites() as s:
|
||||
s.route("A", "/parent", PARENT)
|
||||
s.route("A", "/child", CHILD)
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary, headless=True, humanize=False) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(s.url("A", "/parent"), wait_until="load", timeout=30000)
|
||||
geom = page.evaluate("() => window.__geom()")
|
||||
frame = page.frames[1]
|
||||
frame.evaluate("() => { window.__ev = []; }")
|
||||
# a point inside the blue square of the iframe, in the coordinates of the page
|
||||
page.mouse.click(LEFT + 30 + 100, TOP + 40 + 60)
|
||||
kinds = {"mousedown", "mouseup", "click"}
|
||||
assert wait_until(lambda: kinds <= {e["t"] for e in frame.evaluate("() => window.__ev")}, 30,
|
||||
lambda: page.wait_for_timeout(100)), (
|
||||
"the iframe heard %r of the click" % [e["t"] for e in frame.evaluate("() => window.__ev")])
|
||||
events = frame.evaluate("() => window.__ev")
|
||||
inner = frame.evaluate("() => window.__inner()")
|
||||
|
||||
# the iframe is where it was put, and answers its OWN origin: the top's plus the iframe's rectangle
|
||||
assert (geom["rect_x"], geom["rect_y"]) == (LEFT, TOP)
|
||||
assert (geom["ifr_x"], geom["ifr_y"]) == (geom["top_x"] + geom["rect_x"], geom["top_y"] + geom["rect_y"]), (
|
||||
"the iframe reads mozInnerScreen (%r, %r), the page's is (%r, %r) and the iframe sits at (%d, %d)"
|
||||
% (geom["ifr_x"], geom["ifr_y"], geom["top_x"], geom["top_y"], LEFT, TOP))
|
||||
assert (inner[0], inner[1]) != (geom["top_x"], geom["top_y"]), "the iframe answers the origin of the top-level content"
|
||||
clicks = [e for e in events if e["t"] == "click"]
|
||||
assert clicks, "no click event in the iframe: %r" % events
|
||||
for e in events:
|
||||
assert e["sx"] - e["cx"] == inner[0], (
|
||||
"%s in the iframe: screenX - clientX = %r against mozInnerScreenX = %r" % (e["t"], e["sx"] - e["cx"], inner[0]))
|
||||
assert e["sy"] - e["cy"] == inner[1], (
|
||||
"%s in the iframe: screenY - clientY = %r against mozInnerScreenY = %r" % (e["t"], e["sy"] - e["cy"], inner[1]))
|
||||
# the control: the top window's origin is NOT what the events carry
|
||||
assert (e["sx"] - e["cx"], e["sy"] - e["cy"]) != (geom["top_x"], geom["top_y"])
|
||||
@@ -0,0 +1,162 @@
|
||||
"""A context's language is the Accept-Language of every request that context makes, byte for byte, whatever the kind of request.
|
||||
|
||||
Characterisation of firefox-68 for the hook of fingerprint/locale-time/accept-language (nsHttpHandler.cpp: the list a language override
|
||||
is prepared into). The sibling file
|
||||
``test_accept_language_on_the_wire_e2e.py`` pins the LAUNCH language; this one pins the language of a CONTEXT that asks for its own,
|
||||
which reaches the engine another way (``Browser.setLocaleOverride`` writes the BrowsingContext's LanguageOverride, where the launch
|
||||
language is seeded from a pref) and which a request that has no BrowsingContext (a fetch of a worker, a service worker's) gets from the
|
||||
owner's data instead.
|
||||
|
||||
The header is read where a server reads it: the raw header line on a local socket. A retail Firefox 151 whose only pref is the
|
||||
``intl.accept_languages`` the core writes for it-IT ("it-IT, it, en-US, en") sends ``it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7`` on every
|
||||
request below (measured, see the sibling file). The kinds: the navigation, a sub-frame, an image, a stylesheet, a script, a ``fetch``, an
|
||||
XHR, a dedicated worker's script and its ``fetch``, a shared worker's script and its ``fetch``, a service worker's script and its ``fetch``.
|
||||
|
||||
The control is the other context of the same browser, which asked for nothing and keeps the launch's de-DE: every one of ITS requests
|
||||
carries the de-DE header and none carries Italian, so the header the first context sends is its own and not the session's.
|
||||
|
||||
On firefox-68 the four kinds a shared worker and a service worker make (the worker's script and its ``fetch``) carry the SESSION's de-DE
|
||||
header even from the it-IT context, on Linux and on Windows alike: the engine does not give those workers the context's language. They
|
||||
are left out of the it-IT context's check here and pinned, asking for it-IT, in
|
||||
``test_accept_language_of_the_context_in_shared_and_service_workers_e2e.py``. The de-DE control is checked on all of them.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import socket
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: invisible_core's list for it-IT / de-DE, prepared the way Firefox prepares intl.accept_languages (retail 151, measured).
|
||||
RETAIL_IT_IT = "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
RETAIL_DE_DE = "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"
|
||||
|
||||
#: A 1x1 PNG.
|
||||
PNG = bytes.fromhex(
|
||||
"89504e470d0a1a0a0000000d4948445200000001000000010806000000"
|
||||
"1f15c4890000000d49444154789c6360f8cfc0f01f0005000201a5f645400000000049454e44ae426082")
|
||||
|
||||
PAGE = b"""<!doctype html><meta charset=utf-8><title>al</title>
|
||||
<link rel=stylesheet href=/style.css><script src=/script.js></script>
|
||||
<iframe src=/frame></iframe><img src=/image.png>
|
||||
<script>
|
||||
(async () => {
|
||||
await fetch('/fetch').then((r) => r.text());
|
||||
await new Promise((ok) => { const x = new XMLHttpRequest(); x.open('GET', '/xhr'); x.onloadend = ok; x.send(); });
|
||||
await new Promise((ok) => { const w = new Worker('/worker.js'); w.onmessage = ok; });
|
||||
await new Promise((ok) => { const s = new SharedWorker('/shared.js'); s.port.onmessage = ok; });
|
||||
await navigator.serviceWorker.register('/sw.js');
|
||||
await navigator.serviceWorker.ready;
|
||||
document.title = 'done';
|
||||
})();
|
||||
</script>"""
|
||||
|
||||
BODIES = {
|
||||
"/": (PAGE, b"text/html"),
|
||||
"/frame": (b"<!doctype html><title>frame</title>", b"text/html"),
|
||||
"/style.css": (b"body{}", b"text/css"),
|
||||
"/script.js": (b"window.loaded = 1;", b"text/javascript"),
|
||||
"/image.png": (PNG, b"image/png"),
|
||||
"/worker.js": (b"fetch('/worker-fetch').then((r) => r.text()).then(() => postMessage(1));", b"text/javascript"),
|
||||
"/shared.js": (b"onconnect = (e) => { fetch('/shared-fetch').then((r) => r.text()).then(() => e.ports[0].postMessage(1)); };",
|
||||
b"text/javascript"),
|
||||
# The install waits for the service worker's own fetch, so `ready` resolves after it.
|
||||
"/sw.js": (b"addEventListener('install', (e) => e.waitUntil(fetch('/sw-fetch').then((r) => r.text())));", b"text/javascript"),
|
||||
}
|
||||
|
||||
#: Every path a page of the site makes a request for (the favicon is the browser's own and is left out).
|
||||
KINDS = {
|
||||
"/": "navigation", "/frame": "sub-frame navigation", "/style.css": "stylesheet", "/script.js": "script", "/image.png": "image",
|
||||
"/fetch": "fetch", "/xhr": "XHR", "/worker.js": "dedicated worker script", "/worker-fetch": "dedicated worker fetch",
|
||||
"/shared.js": "shared worker script", "/shared-fetch": "shared worker fetch", "/sw.js": "service worker script",
|
||||
"/sw-fetch": "service worker fetch",
|
||||
}
|
||||
|
||||
#: The kinds that carry the session's header, not the context's, on firefox-68 (the context's own list is asserted for them elsewhere).
|
||||
SESSION_HEADER_KINDS = {"shared worker script", "shared worker fetch", "service worker script", "service worker fetch"}
|
||||
|
||||
|
||||
def _serve(seen):
|
||||
"""A server that keeps each request's path and raw Accept-Language lines."""
|
||||
s = socket.socket()
|
||||
s.bind(("127.0.0.1", 0))
|
||||
s.listen(16)
|
||||
|
||||
def one(conn):
|
||||
buf = b""
|
||||
try:
|
||||
while True:
|
||||
while b"\r\n\r\n" not in buf:
|
||||
chunk = conn.recv(65536)
|
||||
if not chunk:
|
||||
return
|
||||
buf += chunk
|
||||
head, buf = buf.split(b"\r\n\r\n", 1)
|
||||
lines = head.split(b"\r\n")
|
||||
path = lines[0].split(b" ")[1].decode("latin-1").split("?", 1)[0]
|
||||
seen.append((path, [ln.decode("latin-1") for ln in lines[1:] if ln.lower().startswith(b"accept-language:")]))
|
||||
body, ctype = BODIES.get(path, (b"ok", b"text/plain"))
|
||||
conn.sendall(b"HTTP/1.1 200 OK\r\nContent-Type: " + ctype + b"\r\nCache-Control: no-store\r\nContent-Length: "
|
||||
+ str(len(body)).encode() + b"\r\n\r\n" + body)
|
||||
except OSError:
|
||||
return
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def loop():
|
||||
while True:
|
||||
try:
|
||||
conn, _ = s.accept()
|
||||
except OSError:
|
||||
return
|
||||
threading.Thread(target=one, args=(conn,), daemon=True).start()
|
||||
|
||||
threading.Thread(target=loop, daemon=True).start()
|
||||
return s
|
||||
|
||||
|
||||
def _headers_by_kind(seen):
|
||||
"""Each kind of request -> the Accept-Language lines of EVERY request of that kind (a script is fetched again on an update check)."""
|
||||
out = {}
|
||||
for path, lines in seen:
|
||||
if path in KINDS:
|
||||
out.setdefault(KINDS[path], []).append(lines)
|
||||
return out
|
||||
|
||||
|
||||
def test_a_context_list_is_the_retail_accept_language_on_every_request_kind(firefox_binary):
|
||||
"""⛔ A CONTEXT'S LANGUAGE REACHED THE PAGE AND NOT EVERY REQUEST. ``new_context(locale=...)`` is the language of that context's
|
||||
pages, and the header of a navigation followed it while the requests that carry no BrowsingContext (a worker's ``fetch``, a service
|
||||
worker's) kept what the session sent, or the raw list with its spaces and no q-values; a server then saw two languages and two
|
||||
spellings from one client. The context asks for it-IT inside a de-DE session; every request kind of it carries the retail it-IT
|
||||
header (but for the four kinds of shared and service workers, see the module docstring), and the other context's, which asked for
|
||||
nothing, the retail de-DE one on every kind.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
seen = {"it": [], "de": []}
|
||||
servers = {name: _serve(log) for name, log in seen.items()}
|
||||
urls = {name: "http://127.0.0.1:%d/" % srv.getsockname()[1] for name, srv in servers.items()}
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="de-DE", timezone="Europe/Berlin") as browser:
|
||||
for name, options in (("it", {"locale": "it-IT"}), ("de", {})):
|
||||
page = browser.new_context(**options).new_page()
|
||||
page.goto(urls[name], wait_until="load", timeout=30_000)
|
||||
page.wait_for_function("document.title === 'done'", timeout=30_000)
|
||||
languages = page.evaluate("[...navigator.languages]")
|
||||
assert languages == (["it-IT", "it", "en-US", "en"] if name == "it" else ["de-DE", "de", "en-US", "en"]), (
|
||||
"navigator.languages of the %s context" % name)
|
||||
finally:
|
||||
for srv in servers.values():
|
||||
srv.close()
|
||||
for name, retail, other, left_out in (("it", RETAIL_IT_IT, RETAIL_DE_DE, SESSION_HEADER_KINDS), ("de", RETAIL_DE_DE, RETAIL_IT_IT, set())):
|
||||
by_kind = _headers_by_kind(seen[name])
|
||||
assert set(by_kind) == set(KINDS.values()), "the %s context: kinds of request seen %r" % (name, sorted(by_kind))
|
||||
checked = {kind: sent for kind, sent in by_kind.items() if kind not in left_out}
|
||||
wrong = {kind: sent for kind, sent in checked.items() if any(lines != ["Accept-Language: " + retail] for lines in sent)}
|
||||
assert not wrong, "the %s context must send %r on every request kind: %r" % (name, retail, wrong)
|
||||
assert not any(other in " ".join(lines) for sent in checked.values() for lines in sent), (
|
||||
"the %s context sent the other context's language" % name)
|
||||
assert RETAIL_IT_IT != RETAIL_DE_DE
|
||||
@@ -16,7 +16,8 @@ from `http://127.0.0.1:<port>`; a site never includes the port). The browser sta
|
||||
counting every content process, or every one that hosts any site, read them as a leak ([2, 2, 2, 5, 5] on the e2e
|
||||
of the 0.50.0 commit, three "Web Content" and no site left; a process for a Mozilla site started by the New Tab
|
||||
page). If the name were not what the test expects, the count while the page is open would be 0 and the first assert
|
||||
says so. Off Linux the test skips: no other system names the process.
|
||||
says so. On Windows, which names no process, the engine is started with `LOG_ENV` and the type each process was given
|
||||
is read from its log (tests/_processes.py `remote_types`).
|
||||
|
||||
The engine that does it is not published when this file is written: `engine_at_least` makes the test wait for
|
||||
it, and on an older engine it is skipped, never passed.
|
||||
@@ -25,6 +26,7 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
@@ -32,7 +34,7 @@ import pytest
|
||||
import websockets # noqa: F401 - the dev extra installs it: a missing one is a failure, never a skip
|
||||
from websockets.asyncio.client import connect # noqa: E402
|
||||
|
||||
from _processes import NAMED_BY_SITE, site_processes_below # noqa: E402
|
||||
from _processes import LOG_ENV, NAMED_BY_SITE, remote_types, site_processes_below # noqa: E402
|
||||
from _servers import LocalServer # noqa: E402
|
||||
from _waits import awatch # noqa: E402
|
||||
|
||||
@@ -110,17 +112,23 @@ DEADLINE_S = 30
|
||||
REGISTERED = ("navigator.serviceWorker.getRegistration().then(r => !!r && !!(r.installing || r.waiting || r.active))")
|
||||
|
||||
|
||||
def test_closed_contexts_with_a_never_stopping_service_worker_leave_no_process(firefox_binary, engine_at_least):
|
||||
def test_closed_contexts_with_a_never_stopping_service_worker_leave_no_process(firefox_binary, engine_at_least, monkeypatch, tmp_path):
|
||||
engine_at_least(ENGINE_WITH_THE_FIX)
|
||||
from invisible_playwright import launch_server
|
||||
|
||||
# Windows names no process: the engine's own log says which type (so which site) each one was given
|
||||
log_base = tmp_path / "process-types"
|
||||
if sys.platform == "win32":
|
||||
monkeypatch.setenv("MOZ_LOG", LOG_ENV["MOZ_LOG"])
|
||||
monkeypatch.setenv("MOZ_LOG_FILE", str(log_base))
|
||||
|
||||
server, base = _serve()
|
||||
launched = launch_server(host="127.0.0.1", port=0, headless=True, virtual_display=False, humanize=False,
|
||||
seed=4266, binary_path=firefox_binary, launch_timeout_ms=180_000,
|
||||
extra_prefs=NAMED_BY_SITE)
|
||||
|
||||
def sites():
|
||||
return site_processes_below(launched.process.pid, SITE)
|
||||
return site_processes_below(launched.process.pid, SITE, types=lambda: remote_types(log_base))
|
||||
|
||||
async def drive():
|
||||
opened, left = [], []
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
"""A `goto` to an address Firefox refuses before it opens a channel ends, and says why.
|
||||
|
||||
`http://127.0.0.1:9/` is a restricted port (Firefox's list of ports it will not
|
||||
connect to): the load is refused inside the docshell, before any channel exists
|
||||
(`DocumentChannelChild::AsyncOpen` -> `nsDocShell::DoURILoad` fails ->
|
||||
`InternalLoad` shows the error page). No channel ever reports progress, so
|
||||
nothing that watches a request can end the navigation: the engine reports the
|
||||
failure itself, with the load identifier and the status
|
||||
(`StealthNavigationLoad::Failed` in `nsDocShell::DoURILoad`, folder
|
||||
`automation/navigation` of the engine series, `docshell/base/StealthNavigation.cpp`),
|
||||
and the client's `goto` raises with the name of the status,
|
||||
`NS_ERROR_PORT_ACCESS_NOT_ALLOWED`. Until firefox-55 the navigation was announced
|
||||
(`Page.navigationStarted`) and never ended: `goto` waited out its timeout, and
|
||||
the reason was only in the URL of the error page.
|
||||
|
||||
**What is asserted, and not a clock.** The `goto` raises, the text of the error
|
||||
is the status (and not a timeout: a deadline of 30 s is only the longest a
|
||||
healthy run is given), and the page is usable afterwards.
|
||||
|
||||
**Negative control.** A `goto` to an allowed local port where nothing listens
|
||||
also ends, with a DIFFERENT error (the connection is refused by the peer, a
|
||||
channel did open): the first test's text is the answer to the port, not what
|
||||
every failed `goto` says.
|
||||
|
||||
Why a page cares: a script that loads a refused address must learn it at once,
|
||||
by the name Firefox gives, and not hang until its own deadline.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import socket
|
||||
import threading
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
|
||||
import pytest
|
||||
|
||||
from _servers import LocalServer
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
REFUSED_PORT_URL = "http://127.0.0.1:9/"
|
||||
PORT_REASON = "NS_ERROR_PORT_ACCESS_NOT_ALLOWED"
|
||||
REFUSED_REASON = "NS_ERROR_CONNECTION_REFUSED"
|
||||
|
||||
|
||||
class _Page(BaseHTTPRequestHandler):
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
body = b"<html><title>after</title><body>after</body></html>"
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "text/html")
|
||||
self.send_header("content-length", str(len(body)))
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
|
||||
def _goto_error(page, url):
|
||||
"""The text of the error a `goto` ends with (the test fails if it ends without one).
|
||||
|
||||
A failed `goto` is followed by Firefox's error page, a navigation of its own that commits after the call has
|
||||
raised (on Windows, late enough to land inside the next `goto`, which then reads as "interrupted by another
|
||||
navigation to" the refused address). The call is therefore made inside a wait for that navigation's
|
||||
`framenavigated`: it returns only once the error page has committed and the frame is quiet.
|
||||
"""
|
||||
with page.expect_event("framenavigated", timeout=30_000):
|
||||
with pytest.raises(Exception) as ended:
|
||||
page.goto(url, timeout=30_000)
|
||||
return str(ended.value)
|
||||
|
||||
|
||||
def test_a_goto_to_a_refused_port_ends_with_its_reason(firefox_binary):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
# a port nobody listens on, and that Firefox allows: bound and never listening, so no other program can take it
|
||||
closed = socket.socket()
|
||||
closed.bind(("127.0.0.1", 0))
|
||||
closed_url = "http://127.0.0.1:%d/" % closed.getsockname()[1]
|
||||
site = LocalServer(("127.0.0.1", 0), _Page)
|
||||
threading.Thread(target=site.serve_forever, daemon=True).start()
|
||||
try:
|
||||
with InvisiblePlaywright(seed=4242, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
|
||||
refused = _goto_error(page, REFUSED_PORT_URL)
|
||||
assert PORT_REASON in refused, refused
|
||||
assert "Timeout" not in refused, refused
|
||||
|
||||
# the control: the same call to an allowed port that is closed ends with another reason
|
||||
control = _goto_error(page, closed_url)
|
||||
assert REFUSED_REASON in control, control
|
||||
assert PORT_REASON not in control, control
|
||||
|
||||
# and the page the refused navigation left behind is a page that navigates
|
||||
page.goto("http://127.0.0.1:%d/" % site.server_address[1], timeout=30_000)
|
||||
assert page.title() == "after"
|
||||
finally:
|
||||
site.shutdown()
|
||||
site.server_close()
|
||||
closed.close()
|
||||
@@ -0,0 +1,156 @@
|
||||
"""The zone a launch declares, and the one a context asks for, reach everything a page reads the time from.
|
||||
|
||||
Characterisation of firefox-68; the hooks of fingerprint/locale-time/timezone in the engine series cite
|
||||
``test_a_launch_and_a_context_timezone_reach_the_page``. A page learns the zone of a machine from more places than ``Intl``:
|
||||
|
||||
* the realm's ``Intl`` and the offset of ``Date`` (``getTimezoneOffset``, ``toLocaleTimeString``), in the page's own realm
|
||||
(read by an INLINE script, the way a site reads it) and in a dedicated worker;
|
||||
* ``document.lastModified``, which formats the ``Last-Modified`` of the response, or the present moment when there is none, as a wall
|
||||
clock in the zone (Document.cpp, GetFormattedTimeString);
|
||||
* EXSLT's ``date:date-time()`` in an XSLT transform (txEXSLTFunctions.cpp), which is the wall clock too.
|
||||
|
||||
None of them may be read from the host. A launch declares its zone (``timezone="Pacific/Chatham"``, a zone with a quarter-hour offset
|
||||
and daylight time, which no runner has) and a context may ask for its own (``timezone_id="Asia/Kolkata"``, +05:30, no daylight time);
|
||||
every one of those places answers the zone of the context the page is in.
|
||||
|
||||
The control is the same reads on a launch whose declaration is EMPTY (``juggler.timezone.override`` empty, and a context that asks for no
|
||||
zone): the engine then has nothing to give and the values are the host's, which are not Chatham's. A control that agreed with Chatham
|
||||
would mean the test cannot tell a declared zone from the host's.
|
||||
|
||||
Expected values: the offsets of Pacific/Chatham on a date in January (daylight time, +13:45) and in July (+12:45) and of Asia/Kolkata
|
||||
(+05:30 all year) are the IANA database's; ``Last-Modified: Mon, 15 Jan 2024 10:00:00 GMT`` is 23:45:00 in Chatham and 15:30:00 in
|
||||
Kolkata. The present moment, with no ``Last-Modified``, is compared with the page's own offset: the wall clock minus the clock of the
|
||||
machine, rounded to a quarter of an hour, has to be the offset of the zone.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import _locale_probe as probe
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
CHATHAM = "Pacific/Chatham"
|
||||
KOLKATA = "Asia/Kolkata"
|
||||
|
||||
#: Minutes AHEAD of UTC, the sign of ``-getTimezoneOffset()``: what the zone is on 15 January and on 15 July 2024.
|
||||
EXPECTED = {
|
||||
CHATHAM: {"january": 825, "july": 765, "time": "23:45:00", "last_modified": "01/15/2024 23:45:00"},
|
||||
KOLKATA: {"january": 330, "july": 330, "time": "15:30:00", "last_modified": "01/15/2024 15:30:00"},
|
||||
}
|
||||
|
||||
LAST_MODIFIED = "Mon, 15 Jan 2024 10:00:00 GMT"
|
||||
|
||||
#: An XSLT sheet whose only output is the current date-time of EXSLT.
|
||||
EXSLT_SHEET = (
|
||||
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" '
|
||||
'xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">'
|
||||
'<xsl:output method="text"/><xsl:template match="/"><xsl:value-of select="date:date-time()"/></xsl:template></xsl:stylesheet>'
|
||||
)
|
||||
|
||||
#: What an inline script of the page reads. ``wall`` turns "MM/DD/YYYY HH:MM:SS" or an ISO date-time into the minutes it is AHEAD of the
|
||||
#: clock of the machine, to a quarter of an hour: the zone's offset, whatever the date.
|
||||
PAGE_READ = """
|
||||
const o = Intl.DateTimeFormat().resolvedOptions();
|
||||
const instant = new Date(Date.UTC(2024, 0, 15, 10, 0, 0));
|
||||
const ahead = (y, mo, d, h, mi, s) => Math.round((Date.UTC(y, mo - 1, d, h, mi, s) - Date.now()) / 60000 / 15) * 15;
|
||||
const lm = document.lastModified.match(/(\\d\\d)\\/(\\d\\d)\\/(\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d)/);
|
||||
const processor = new XSLTProcessor();
|
||||
processor.importStylesheet(new DOMParser().parseFromString(%(sheet)s, 'application/xml'));
|
||||
const exslt = processor.transformToDocument(document).documentElement.textContent;
|
||||
const ex = exslt.match(/(\\d{4})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)/);
|
||||
return {
|
||||
timeZone: o.timeZone,
|
||||
january: -new Date(Date.UTC(2024, 0, 15, 12)).getTimezoneOffset(),
|
||||
july: -new Date(Date.UTC(2024, 6, 15, 12)).getTimezoneOffset(),
|
||||
now: -new Date().getTimezoneOffset(),
|
||||
time: instant.toLocaleTimeString('en-GB'),
|
||||
lastModified: document.lastModified,
|
||||
lastModifiedAhead: lm ? ahead(+lm[3], +lm[1], +lm[2], +lm[4], +lm[5], +lm[6]) : null,
|
||||
exslt: exslt,
|
||||
exsltAhead: ex ? ahead(+ex[1], +ex[2], +ex[3], +ex[4], +ex[5], +ex[6]) : null,
|
||||
};
|
||||
""" % {"sheet": "`" + EXSLT_SHEET + "`"}
|
||||
|
||||
WORKER = b"""
|
||||
onmessage = () => postMessage({
|
||||
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
january: -new Date(Date.UTC(2024, 0, 15, 12)).getTimezoneOffset(),
|
||||
july: -new Date(Date.UTC(2024, 6, 15, 12)).getTimezoneOffset(),
|
||||
time: new Date(Date.UTC(2024, 0, 15, 10, 0, 0)).toLocaleTimeString('en-GB'),
|
||||
});
|
||||
"""
|
||||
|
||||
WORKER_JS = """() => new Promise((ok) => {
|
||||
const w = new Worker('/zone-worker.js');
|
||||
w.onmessage = (e) => { ok(e.data); w.terminate(); };
|
||||
w.postMessage(0);
|
||||
})"""
|
||||
|
||||
SITE = {
|
||||
"/with": (probe.PAGE, "text/html; charset=utf-8", {"Last-Modified": LAST_MODIFIED}),
|
||||
"/without": probe.PAGE,
|
||||
"/zone-worker.js": (WORKER, "text/javascript"),
|
||||
}
|
||||
|
||||
|
||||
def _read(page, base, with_last_modified):
|
||||
"""The page's reads of the zone, from an inline script of its own realm, and a dedicated worker's."""
|
||||
page.goto("%s/%s" % (base, "with" if with_last_modified else "without"), wait_until="load", timeout=30_000)
|
||||
return {"page": probe.read_in_page_realm(page, PAGE_READ), "worker": page.evaluate(WORKER_JS)}
|
||||
|
||||
|
||||
def _assert_zone(read, zone, label):
|
||||
want = EXPECTED[zone]
|
||||
page, worker = read["with"]["page"], read["with"]["worker"]
|
||||
assert page["timeZone"] == zone, "%s: Intl timeZone in the page realm" % label
|
||||
assert (page["january"], page["july"]) == (want["january"], want["july"]), "%s: getTimezoneOffset in the page realm: %r" % (label, page)
|
||||
assert page["time"] == want["time"], "%s: a date's wall clock in the page realm" % label
|
||||
assert page["lastModified"] == want["last_modified"], "%s: document.lastModified with a Last-Modified header" % label
|
||||
assert worker == {"timeZone": zone, "january": want["january"], "july": want["july"], "time": want["time"]}, (
|
||||
"%s: a dedicated worker" % label)
|
||||
# With no Last-Modified the page, the clock of the document and EXSLT's date-time agree on the zone's present offset.
|
||||
now = read["without"]["page"]
|
||||
assert now["timeZone"] == zone, "%s: Intl timeZone on a page with no Last-Modified" % label
|
||||
assert now["lastModifiedAhead"] == now["now"], (
|
||||
"%s: document.lastModified with no Last-Modified is %r, %d minutes ahead of the machine, the offset says %d"
|
||||
% (label, now["lastModified"], now["lastModifiedAhead"] or 0, now["now"]))
|
||||
assert now["exsltAhead"] == now["now"], (
|
||||
"%s: EXSLT date:date-time() is %r, %r minutes ahead of the machine, the offset says %d" % (label, now["exslt"], now["exsltAhead"], now["now"]))
|
||||
|
||||
|
||||
def test_a_launch_and_a_context_timezone_reach_the_page(firefox_binary):
|
||||
"""⛔ THE ZONE OF A MACHINE LEAKS FROM MANY PLACES, AND ONE OF THEM IS ALWAYS THE LAST TO BE CLOSED. ``Intl`` and ``Date`` were
|
||||
declared first; ``document.lastModified`` and EXSLT's ``date:date-time()`` format a time in the C library's local zone, which is the
|
||||
host's, and a worker's realm took the process's zone. A page reads all of them in one breath.
|
||||
|
||||
A launch with ``timezone="Pacific/Chatham"``: its default context reads Chatham in every place above. A second context with
|
||||
``timezone_id="Asia/Kolkata"`` of the same browser reads Kolkata in every place, with and without a ``Last-Modified`` header. The
|
||||
control is a launch whose declaration is empty (``juggler.timezone.override`` empty, a context that asks for no zone): there the
|
||||
values are the host's, and none of them is Chatham's, so the declared zone is what the first reads had.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
srv, base = probe.serve(SITE)
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="en-US", timezone=CHATHAM) as browser:
|
||||
for label, zone, options in (("the launch's context", CHATHAM, {}), ("a context with timezone_id", KOLKATA, {"timezone_id": KOLKATA})):
|
||||
page = browser.new_context(**options).new_page()
|
||||
read = {"with": _read(page, base, True), "without": _read(page, base, False)}
|
||||
_assert_zone(read, zone, label)
|
||||
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="en-US", timezone=CHATHAM,
|
||||
extra_prefs={"juggler.timezone.override": ""}) as browser:
|
||||
page = browser.new_context(timezone_id=None).new_page()
|
||||
host = {"with": _read(page, base, True), "without": _read(page, base, False)}
|
||||
chatham = EXPECTED[CHATHAM]
|
||||
seen = host["with"]["page"]
|
||||
assert seen["timeZone"] != CHATHAM, "the launch with no declared zone reads Chatham: the control cannot tell a declaration from the host"
|
||||
assert (seen["january"], seen["july"]) != (chatham["january"], chatham["july"]), seen
|
||||
assert seen["lastModified"] != chatham["last_modified"], seen
|
||||
assert host["with"]["worker"]["timeZone"] != CHATHAM, host["with"]["worker"]
|
||||
# What the host reads is consistent with itself: the same clock in every place (the offset the page has now is the wall clock's).
|
||||
now = host["without"]["page"]
|
||||
assert now["lastModifiedAhead"] == now["now"] and now["exsltAhead"] == now["now"], now
|
||||
finally:
|
||||
probe.stop(srv)
|
||||
@@ -0,0 +1,69 @@
|
||||
"""A launch tells the core WHICH ENGINE it runs, so the security state it copies into the profile was generated by that engine.
|
||||
|
||||
The core places the security state (intermediates, OneCRL, CRLite) in a profile inside `write_user_js`, and a generation is tied to the engine's build id. The server's one
|
||||
call `write_user_js(profile, prefs)` named no engine, so the core fell back to the SEALED engine: with an engine the caller chose (`executable_path=`) the state was looked up
|
||||
and, on a cold cache, generated for another binary. The launch passes `engine=<the executable it runs>`; `engine_argv` stays the core's default, because the line this launch
|
||||
runs (`-juggler-pipe`, headed or headless, the caller's `args`) is not a line a generation may use.
|
||||
|
||||
Known-bad: the call without `engine=`; it reaches `ensure_security_state` with `engine=None`.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.juggler.connection import EventListeners
|
||||
from invisible_playwright._juggler import server as module
|
||||
from invisible_playwright._juggler.server import BrowserTypeDispatcher, JugglerServer
|
||||
from _browser_census import closes_with_the_test
|
||||
|
||||
|
||||
class _Engine(EventListeners):
|
||||
def __init__(self):
|
||||
EventListeners.__init__(self)
|
||||
closes_with_the_test(self)
|
||||
|
||||
def send(self, method, params=None, session=None, timeout=30.0):
|
||||
return {"browserContextId": "ctx-1", "targetId": "t-1"}
|
||||
|
||||
def startup_send(self, method, params=None):
|
||||
return self.send(method, params, timeout=None)
|
||||
|
||||
def close(self, timeout=5.0):
|
||||
pass
|
||||
|
||||
|
||||
def _launch(monkeypatch, **params):
|
||||
server = JugglerServer()
|
||||
server.attach(type("R", (), {"emit_message": lambda self, m: None})())
|
||||
monkeypatch.setattr(module.juggler, "launch", lambda executable, profile_dir, **kwargs: _Engine())
|
||||
try:
|
||||
BrowserTypeDispatcher(server).op_launch(dict({"executablePath": "the-engine-of-this-launch", "firefoxUserPrefs": {}}, **params))
|
||||
finally:
|
||||
server.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_the_launch_asks_the_core_for_the_security_state_of_the_engine_it_runs(monkeypatch):
|
||||
"""Through the core's real `write_user_js` and `place_security_state`: what reaches `ensure_security_state` is the engine of the launch and no launch line."""
|
||||
import invisible_core._security_state as security_state
|
||||
|
||||
seen = []
|
||||
monkeypatch.setattr(security_state, "ensure_security_state", lambda *a, **kw: seen.append(kw) or None)
|
||||
|
||||
_launch(monkeypatch)
|
||||
|
||||
assert len(seen) == 1, seen
|
||||
assert seen[0].get("engine") == "the-engine-of-this-launch"
|
||||
assert seen[0].get("engine_argv") is None, "the launch line of the session is not a generation's line"
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_the_engine_is_the_one_the_caller_chose_for_a_headed_launch_with_arguments_too(monkeypatch):
|
||||
import invisible_core._security_state as security_state
|
||||
|
||||
seen = []
|
||||
monkeypatch.setattr(security_state, "ensure_security_state", lambda *a, **kw: seen.append(kw) or None)
|
||||
|
||||
_launch(monkeypatch, headless=False, args=["-width", "800"])
|
||||
|
||||
assert [(kw.get("engine"), kw.get("engine_argv")) for kw in seen] == [("the-engine-of-this-launch", None)]
|
||||
@@ -1,98 +0,0 @@
|
||||
"""A launch missing a system font or colour declaration is refused.
|
||||
|
||||
The engine reads the CSS system fonts (ui.font.*) and the system colours no
|
||||
stand-in covers (ui.highlight, ui.-moz-field, ...) from what invisible_core
|
||||
declares, and never from the toolkit. With the stealth engine on and one of
|
||||
them missing, the browser must refuse to start - before a page can load - and
|
||||
say which pref, instead of answering from GTK. With every pref declared the
|
||||
same launch succeeds (the control).
|
||||
|
||||
The profile and its user.js are the ones build_launch_plan writes, with the
|
||||
named pref removed; the engine is started the way the Juggler connection tests
|
||||
start it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
MISSING = [
|
||||
"ui.highlight",
|
||||
"ui.-moz-field",
|
||||
"ui.font.menu",
|
||||
]
|
||||
|
||||
|
||||
def _drop(user_js: Path, names) -> int:
|
||||
"""Remove the user_pref lines of exactly these names (the .dark and .size
|
||||
variants are other prefs and stay). Returns how many lines went."""
|
||||
kept, dropped = [], 0
|
||||
for line in user_js.read_text(encoding="utf-8").splitlines():
|
||||
m = re.match(r'user_pref\(("(?:[^"\\]|\\.)*"),', line)
|
||||
if m and json.loads(m.group(1)) in names:
|
||||
dropped += 1
|
||||
else:
|
||||
kept.append(line)
|
||||
user_js.write_text("\n".join(kept) + "\n", encoding="utf-8")
|
||||
return dropped
|
||||
|
||||
|
||||
def _launch(firefox_binary, drop):
|
||||
from invisible_core.juggler import connection as conn
|
||||
from invisible_core.launch import build_launch_plan
|
||||
|
||||
profile_dir = tempfile.mkdtemp(prefix="system_theme_")
|
||||
try:
|
||||
plan = build_launch_plan(6023, profile_dir=profile_dir, binary_path=firefox_binary,
|
||||
timezone="UTC", locale="en-US")
|
||||
if drop:
|
||||
assert _drop(Path(profile_dir) / "user.js", {drop}) == 1, (
|
||||
"%s is not declared by this core, so there is nothing to remove" % drop)
|
||||
return conn.launch(firefox_binary, profile_dir, headless=True,
|
||||
# A refusal ends in an abort on purpose, and the crash reporter would open
|
||||
# a window on the desktop of whoever runs the test.
|
||||
env=dict(plan.env, MOZ_CRASHREPORTER_DISABLE="1"),
|
||||
ready_timeout=60.0), profile_dir
|
||||
except BaseException:
|
||||
shutil.rmtree(profile_dir, ignore_errors=True)
|
||||
raise
|
||||
|
||||
|
||||
# Linux only: on Windows the engine takes these from the Windows toolkit as retail does
|
||||
# (StealthVerifySystemTheme in widget/StealthSystemFonts.cpp returns unless MOZ_WIDGET_GTK), so a
|
||||
# missing ui.* pref does not refuse there (candidate 42673795394's Windows gate: DID NOT RAISE).
|
||||
ON_WINDOWS = sys.platform == "win32"
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.skipif(ON_WINDOWS, reason="the system theme is declared, and its absence refused, on Linux only")
|
||||
@pytest.mark.parametrize("pref", MISSING)
|
||||
def test_a_missing_pref_refuses_the_launch(firefox_binary, engine_at_least, pref):
|
||||
engine_at_least("firefox-68")
|
||||
with pytest.raises(RuntimeError) as err:
|
||||
c, profile_dir = _launch(firefox_binary, pref)
|
||||
# Not reached when the engine refuses: close what must not be running.
|
||||
c.close()
|
||||
shutil.rmtree(profile_dir, ignore_errors=True)
|
||||
message = str(err.value)
|
||||
assert "exited during startup" in message, message
|
||||
assert pref in message, "the refusal does not name %s:\n%s" % (pref, message)
|
||||
assert "is not declared" in message, message
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_every_pref_declared_the_launch_succeeds(firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
c, profile_dir = _launch(firefox_binary, None)
|
||||
try:
|
||||
assert c.ready_seen, "the browser did not announce the protocol"
|
||||
assert c._process.poll() is None, "the browser is not running"
|
||||
finally:
|
||||
c.close()
|
||||
shutil.rmtree(profile_dir, ignore_errors=True)
|
||||
@@ -48,9 +48,13 @@ from __future__ import annotations
|
||||
|
||||
import http.server
|
||||
import threading
|
||||
import time
|
||||
import types
|
||||
|
||||
import pytest
|
||||
|
||||
from _evidence_on_failure import FailureEvidence
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
ROUNDS = 5
|
||||
@@ -64,6 +68,14 @@ def _landing(url: str) -> str:
|
||||
#: The address each page (by `id`) was last sent to, or the page it went with instead (`_goto`).
|
||||
_SENT: dict = {}
|
||||
|
||||
#: What the client heard, for the evidence a failing test leaves (`FailureEvidence`; it only listens and changes no wait or assertion).
|
||||
_CLIENT_LOG: list = []
|
||||
|
||||
|
||||
def _note(what: str, **fields) -> None:
|
||||
"""One line of the client's own view of the module: what the test sent or heard, on the clocks of the evidence (`t` wall, `m` perf_counter)."""
|
||||
_CLIENT_LOG.append({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "what": what, **fields})
|
||||
|
||||
|
||||
def _goto(page, url, *, the_page_before_may_move, our_page_may_stop_ours, **kwargs) -> str:
|
||||
"""`page.goto`, and the address of the page the frame went with: `url` when `goto` answers.
|
||||
@@ -82,11 +94,14 @@ def _goto(page, url, *, the_page_before_may_move, our_page_may_stop_ours, **kwar
|
||||
|
||||
before = _SENT.get(id(page)) if the_page_before_may_move else None
|
||||
_SENT[id(page)] = url
|
||||
_note("goto", url=url, before=before)
|
||||
try:
|
||||
page.goto(url, **kwargs)
|
||||
_note("goto-answered", url=url)
|
||||
return url
|
||||
except Error as e:
|
||||
text = str(e)
|
||||
_note("goto-raised", url=url, error=text[:300])
|
||||
if "NS_BINDING_ABORTED" in text:
|
||||
ends = tuple(_landing(u) for u in (before, url if our_page_may_stop_ours else None) if u)
|
||||
assert ends, e
|
||||
@@ -160,12 +175,18 @@ for _name, _held in (("0", False), ("50", True)):
|
||||
HELD_DOCUMENTS = {"/hdr": _replace_while_the_document_is_held(False), "/hdx": _replace_while_the_document_is_held(True)}
|
||||
|
||||
|
||||
#: The test server's own record of every request it served, in the shape `FailureEvidence.watch_server` reads (`.state.lock`, `.state.records`).
|
||||
RECORD = types.SimpleNamespace(lock=threading.Lock(), records=[])
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def site():
|
||||
release = threading.Event()
|
||||
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
with RECORD.lock:
|
||||
RECORD.records.append({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "method": "GET", "path": self.path})
|
||||
if self.path.split("?")[0] == "/hold":
|
||||
# a response that has begun and does not end: 16 KiB so the first chunk is delivered at once,
|
||||
# then it stays open until the page that asked for it moves away (or the module's teardown)
|
||||
@@ -215,17 +236,60 @@ def site():
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def page(firefox_binary):
|
||||
def evidence():
|
||||
"""What a failing test of this module leaves for a reader (only on a failure; nothing is changed in what the tests wait for or assert):
|
||||
the client's view of every request and navigation, the Juggler wire, the engine's own trace, the record of the test server.
|
||||
Armed before the browser is launched (the engine reads its trace folder at launch) and held for the module."""
|
||||
held = FailureEvidence("a-page-that-moves-on")
|
||||
held.client_log = _CLIENT_LOG
|
||||
held.watch_server(types.SimpleNamespace(state=RECORD))
|
||||
held.arm()
|
||||
try:
|
||||
yield held
|
||||
finally:
|
||||
held.__exit__(None, None, None)
|
||||
|
||||
|
||||
class _on_failure:
|
||||
"""``with _on_failure(evidence):`` around the body of a test: when the body raises, the evidence held for the module is saved
|
||||
(the folder the e2e jobs upload), and the exception goes on."""
|
||||
|
||||
def __init__(self, held):
|
||||
self.held = held
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc, tb):
|
||||
if exc_type is not None:
|
||||
self.held._save(exc_type, exc)
|
||||
return False
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def page(firefox_binary, evidence):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4321, binary_path=firefox_binary,
|
||||
headless=True) as browser:
|
||||
yield browser.new_page()
|
||||
new = browser.new_page()
|
||||
new.on("request", lambda r: _note("request", url=r.url, navigation=r.is_navigation_request()))
|
||||
new.on("requestfinished", lambda r: _note("requestfinished", url=r.url))
|
||||
new.on("requestfailed", lambda r: _note("requestfailed", url=r.url, failure=str(r.failure)))
|
||||
new.on("framenavigated", lambda f: _note("framenavigated", url=f.url, main=f.parent_frame is None))
|
||||
new.on("domcontentloaded", lambda p: _note("domcontentloaded", url=p.url))
|
||||
new.on("load", lambda p: _note("load", url=p.url))
|
||||
yield new
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", ["/head", "/r0", "/r50", "/r300",
|
||||
"/x0", "/x50", "/x300"])
|
||||
def test_a_read_right_after_goto_answers(page, site, path, engine_reaches):
|
||||
def test_a_read_right_after_goto_answers(page, site, path, engine_reaches, evidence):
|
||||
with _on_failure(evidence):
|
||||
_a_read_right_after_goto_answers(page, site, path, engine_reaches)
|
||||
|
||||
|
||||
def _a_read_right_after_goto_answers(page, site, path, engine_reaches):
|
||||
older = not engine_reaches("firefox-68")
|
||||
for i in range(ROUNDS):
|
||||
_goto(page, "%s%s?i=%s-%d" % (site, path, path[1:], i), the_page_before_may_move=True,
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
"""``measureText`` of a regional-indicator pair does not depend on what the page measured before it (e2e, every OS, firefox-68).
|
||||
|
||||
What the engine fixes. A flag (two regional-indicator code points, U+1F1EE U+1F1F9) set in Arial is a run that needs a FALLBACK font. The fallback
|
||||
search may skip a family whose character maps are not loaded yet, start an asynchronous load and go on (``gfx.font_rendering.fallback.async``);
|
||||
then the answer depends on which maps this process happens to have loaded already, and a page sees it in the width. Measured on the engine when
|
||||
the site was missed: the pair through "Arial" gave 52.63 on both platforms when it was the first thing a fresh page measured, and 63.53 (Windows)
|
||||
against 80.07 (Linux) once other families had been measured first: same binary, same page, another answer by load order. The font list is the
|
||||
bundle (always bundle-only), so there is nothing to defer: ``gfxPlatformFontList::MayDeferCmapLoading`` answers false and both sites that ask it
|
||||
(``GlobalFontFallback`` and ``gfxFontGroup::FindFallbackFaceForChar``) search synchronously (folders ``fingerprint/fonts/bundle`` and
|
||||
``fingerprint/fonts/font-list`` of the series; ``StealthFallbackMayDefer`` in ``gfx/thebes/StealthBundleFontList.cpp``).
|
||||
|
||||
What the test reads. A browser is launched and its first page is opened on ``about:blank``; the pair of three flags is measured through
|
||||
``16px Arial`` and ``40px Arial`` as the FIRST text the page measures. Then the page measures a string of Latin, Han, Arabic and an emoji through
|
||||
EVERY family of the bundle manifest (the manifest the core hands the engine, ``tests/_font_names.py``), which loads the character maps of the
|
||||
bundle, and measures the pairs again: the widths must be the same numbers as the first time. A second context's first page of the same browser
|
||||
measures them as its first text too, and must read the same. Nothing is a timer: each read is the answer of the page to one call.
|
||||
|
||||
The negative control, in the same test. The assertion is about what a changed load order does; the same test runs again with the engine not declared
|
||||
(``zoom.stealth.fpp.hw_seed`` = 0). On 68 bundle-only does not depend on the declaration, so the relation holds in both runs; the widths themselves
|
||||
are written in the failure message and the test does not fix them (they are measurements of the first CI round: see the report of the filone).
|
||||
|
||||
Why a page reads it: ``CanvasRenderingContext2D.measureText().width`` is plain web API, and a flag emoji is in every fingerprinting canvas probe.
|
||||
|
||||
Run: pytest tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import _font_names as fn
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: Flags of Italy, the United States and Japan: pairs of regional indicators.
|
||||
PAIRS = ["\U0001F1EE\U0001F1F9", "\U0001F1FA\U0001F1F8", "\U0001F1EF\U0001F1F5"]
|
||||
SIZES = [16, 40]
|
||||
|
||||
#: Latin, Han, Arabic and an emoji: what makes the engine look for a fallback face in every family.
|
||||
SAMPLE = "Hamburgefonstiv 日本語 中文 مرحبا \U0001F600"
|
||||
|
||||
MEASURE_PAIRS = """(args) => {
|
||||
const [pairs, sizes] = args;
|
||||
const ctx = document.createElement('canvas').getContext('2d');
|
||||
const out = {};
|
||||
for (const size of sizes) {
|
||||
ctx.font = size + 'px Arial';
|
||||
for (const pair of pairs) out[size + 'px ' + Array.from(pair).map(c => c.codePointAt(0).toString(16)).join('+')] = ctx.measureText(pair).width;
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
MEASURE_FAMILIES = """(args) => {
|
||||
const [families, sample] = args;
|
||||
const ctx = document.createElement('canvas').getContext('2d');
|
||||
const out = {};
|
||||
for (const family of families) {
|
||||
ctx.font = '24px "' + family + '"';
|
||||
out[family] = ctx.measureText(sample).width;
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
def _readings(firefox_binary, families, engine_declared):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {} if engine_declared else {"zoom.stealth.fpp.hw_seed": 0}
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True, extra_prefs=prefs) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("about:blank", timeout=30_000)
|
||||
first = page.evaluate(MEASURE_PAIRS, [PAIRS, SIZES])
|
||||
measured = page.evaluate(MEASURE_FAMILIES, [families, SAMPLE])
|
||||
after = page.evaluate(MEASURE_PAIRS, [PAIRS, SIZES])
|
||||
other = browser.new_context().new_page()
|
||||
other.goto("about:blank", timeout=30_000)
|
||||
in_a_fresh_page = other.evaluate(MEASURE_PAIRS, [PAIRS, SIZES])
|
||||
return first, after, in_a_fresh_page, len(measured)
|
||||
|
||||
|
||||
def test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families(firefox_binary):
|
||||
families = fn.bundle_manifest().families
|
||||
for declared in (True, False):
|
||||
mode = "engine declared" if declared else "engine not declared (hw_seed 0)"
|
||||
first, after, fresh, measured = _readings(firefox_binary, families, declared)
|
||||
assert measured == len(families), "%s: the page measured %d families, not the %d of the bundle" % (mode, measured, len(families))
|
||||
assert set(first) == {"%dpx %s" % (size, "+".join(format(ord(c), "x") for c in pair)) for size in SIZES for pair in PAIRS}
|
||||
assert all(width > 0 for width in first.values()), "%s: a flag measures no width at all: %r" % (mode, first)
|
||||
assert first == after, (
|
||||
"%s: the regional-indicator pairs measure %r as the first thing on a fresh page and %r once every family of the bundle was measured: "
|
||||
"the answer depends on the load order of the character maps" % (mode, first, after))
|
||||
assert first == fresh, (
|
||||
"%s: the pairs measure %r in the first page and %r as the first text of another context's page: the answer depends on what the "
|
||||
"process measured before" % (mode, first, fresh))
|
||||
@@ -0,0 +1,54 @@
|
||||
"""`AudioContext.outputLatency` and `destination.maxChannelCount` are the values the session declares.
|
||||
|
||||
What it fixes, in the published engine (firefox-68, series folder `fingerprint/audio/context-values`): the hooks at the top of
|
||||
`AudioContext::OutputLatency` and `AudioContext::MaxChannelCount` (`dom/media/webaudio/AudioContext.cpp`) answer
|
||||
`zoom.stealth.audio.output_latency_ms` / 1000 and `zoom.stealth.audio.max_channel_count` when the pref is > 0, before the engine
|
||||
asks the audio device. The core declares both for every persona, because the host's answer is the machine's sound card.
|
||||
|
||||
A page reads both on a new `AudioContext()` with no permission. The values declared here (37 ms and 6 channels) are ones no runner
|
||||
produces: a runner with no audio device answers 0 or 2.
|
||||
|
||||
Negative control, in the same test: with the engine off (`hw_seed` 0, stock Firefox: an active engine refuses a declaration pref cleared) the same page reads the host's values,
|
||||
and they differ from the declared ones. The control reads what the host answers without asserting what it is: a runner with no audio
|
||||
device may refuse the context, and that refusal is also not the declared value.
|
||||
|
||||
The prefs are set through `extra_prefs`, the overlay the core applies last.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
OUTPUT_LATENCY = "zoom.stealth.audio.output_latency_ms"
|
||||
MAX_CHANNELS = "zoom.stealth.audio.max_channel_count"
|
||||
HW_SEED = "zoom.stealth.fpp.hw_seed"
|
||||
|
||||
READ = """() => {
|
||||
try {
|
||||
const ctx = new (window.AudioContext || window.webkitAudioContext)();
|
||||
return {outputLatency: ctx.outputLatency, maxChannelCount: ctx.destination.maxChannelCount};
|
||||
} catch (e) {
|
||||
return {error: String(e)};
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
def read(binary, prefs):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=42, binary_path=binary, headless=True, locale="en-US",
|
||||
timezone="America/New_York", extra_prefs=prefs) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank", timeout=60_000)
|
||||
return page.evaluate(READ)
|
||||
|
||||
|
||||
def test_the_audio_context_answers_the_declared_latency_and_channel_count(firefox_binary):
|
||||
declared = read(firefox_binary, {OUTPUT_LATENCY: 37, MAX_CHANNELS: 6})
|
||||
assert declared == {"outputLatency": 0.037, "maxChannelCount": 6}, declared
|
||||
|
||||
host = read(firefox_binary, {HW_SEED: 0})
|
||||
assert host != declared, (host, declared)
|
||||
assert host.get("outputLatency") != 0.037, host
|
||||
assert host.get("maxChannelCount") != 6, host
|
||||
@@ -0,0 +1,103 @@
|
||||
"""The audio values a page reads follow the seed only when the audio noise is on.
|
||||
|
||||
What it fixes, in the published engine (firefox-68, series folder `fingerprint/audio/noise`): the audio noise hooks of
|
||||
`dom/media/webaudio/` (`AnalyserNode.cpp` for `getFloatFrequencyData` and `getFloatTimeDomainData`, `AudioDestinationNode.cpp` for the
|
||||
`OfflineAudioContext` render, `DynamicsCompressorNode.h` for `compressor.reduction`). When `zoom.stealth.audio.fp_noise` is true the
|
||||
engine adds noise derived from `zoom.stealth.fpp.hw_seed` to those four values; the wrapper ships the pref false, so the values
|
||||
of a product session are the stock ones.
|
||||
|
||||
Four values are read in one rendered graph (oscillator, compressor, analyser, destination of an `OfflineAudioContext(1, 5000, 44100)`):
|
||||
the rendered samples, the analyser's frequency data, the analyser's time-domain data and the compressor's reduction.
|
||||
Each is hashed over its float bits in the page, so a one-bit change shows.
|
||||
|
||||
With the noise ON: the same `hw_seed` gives the same four values on a fresh browser, and two seeds (11 and 22) give different ones;
|
||||
the values also differ from the noise-off ones. The negative control is the same two seeds with `fp_noise` false: the four values are equal
|
||||
across seeds, because the noise is the only thing that carries the seed. A page reads these values with no permission and no device (an
|
||||
offline context renders without an audio output), so a runner with no sound card gives the same answers.
|
||||
|
||||
The seed is the engine's `hw_seed`, set directly (`extra_prefs`): the wrapper maps its own seed to a small pool of render seeds, so two
|
||||
wrapper seeds can share one.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
NOISE = "zoom.stealth.audio.fp_noise"
|
||||
HW_SEED = "zoom.stealth.fpp.hw_seed"
|
||||
VALUES = ("offline", "frequency", "time", "reduction")
|
||||
|
||||
# FNV-1a over the 32-bit patterns of a float array, so equality is bit equality and -Infinity (a silent analyser bin) needs no JSON.
|
||||
RENDER = """async () => {
|
||||
const hash = (floats) => {
|
||||
const bits = new Uint32Array(new Float32Array(floats).buffer);
|
||||
let h = 0x811c9dc5;
|
||||
for (let i = 0; i < bits.length; i++) { h ^= bits[i]; h = Math.imul(h, 0x01000193) >>> 0; }
|
||||
return h.toString(16) + ':' + bits.length;
|
||||
};
|
||||
const ctx = new OfflineAudioContext(1, 5000, 44100);
|
||||
const osc = ctx.createOscillator();
|
||||
osc.type = 'triangle';
|
||||
osc.frequency.value = 10000;
|
||||
const comp = ctx.createDynamicsCompressor();
|
||||
comp.threshold.value = -50;
|
||||
comp.knee.value = 40;
|
||||
comp.ratio.value = 12;
|
||||
comp.attack.value = 0;
|
||||
comp.release.value = 0.25;
|
||||
const analyser = ctx.createAnalyser();
|
||||
osc.connect(comp);
|
||||
comp.connect(analyser);
|
||||
analyser.connect(ctx.destination);
|
||||
osc.start(0);
|
||||
const rendered = await ctx.startRendering();
|
||||
const freq = new Float32Array(analyser.frequencyBinCount);
|
||||
analyser.getFloatFrequencyData(freq);
|
||||
const time = new Float32Array(analyser.fftSize);
|
||||
analyser.getFloatTimeDomainData(time);
|
||||
return {
|
||||
offline: hash(rendered.getChannelData(0)),
|
||||
frequency: hash(freq),
|
||||
time: hash(time),
|
||||
reduction: hash([comp.reduction]),
|
||||
};
|
||||
}"""
|
||||
|
||||
|
||||
def read_values(binary, fixture_server, noise, hw_seed):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {NOISE: noise, HW_SEED: hw_seed}
|
||||
with InvisiblePlaywright(seed=42, binary_path=binary, headless=True, locale="en-US",
|
||||
timezone="America/New_York", extra_prefs=prefs) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto(fixture_server + "/from-network", timeout=60_000)
|
||||
return page.evaluate(RENDER)
|
||||
|
||||
|
||||
def test_audio_values_follow_the_seed_only_when_fp_noise_is_on(firefox_binary, fixture_server):
|
||||
on_11 = read_values(firefox_binary, fixture_server, True, 11)
|
||||
on_11_again = read_values(firefox_binary, fixture_server, True, 11)
|
||||
on_22 = read_values(firefox_binary, fixture_server, True, 22)
|
||||
off_11 = read_values(firefox_binary, fixture_server, False, 11)
|
||||
off_22 = read_values(firefox_binary, fixture_server, False, 22)
|
||||
|
||||
# Every value was read (a hash of N floats, N > 0).
|
||||
for name in VALUES:
|
||||
for run in (on_11, on_22, off_11, off_22):
|
||||
assert not run[name].endswith(":0"), (name, run)
|
||||
|
||||
# Noise on: the same seed, the same values, on a fresh browser.
|
||||
assert on_11 == on_11_again, (on_11, on_11_again)
|
||||
|
||||
# Noise on: two seeds, different values, one by one.
|
||||
for name in VALUES:
|
||||
assert on_11[name] != on_22[name], (name, on_11, on_22)
|
||||
|
||||
# Noise on is not noise off: the noise is what moves each value.
|
||||
for name in VALUES:
|
||||
assert on_11[name] != off_11[name], (name, on_11, off_11)
|
||||
|
||||
# Control, noise off: the seed carries nothing, the values are equal across seeds.
|
||||
assert off_11 == off_22, (off_11, off_22)
|
||||
@@ -0,0 +1,50 @@
|
||||
"""`new AudioContext().sampleRate` is the rate the session declares.
|
||||
|
||||
What it fixes, in the published engine (firefox-68, series folder `fingerprint/audio/sample-rate`): the hook in
|
||||
`mozilla::CubebUtils::PreferredSampleRate` (`dom/media/CubebUtils.cpp`) returns `zoom.stealth.audio.sample_rate` when it is > 0,
|
||||
before the resist-fingerprinting 44100 and before the audio device is asked. The core declares a rate for every persona, because the
|
||||
host's rate is the machine's sound card (44100, 48000, 96000...).
|
||||
|
||||
A page reads it on a new `AudioContext()` with no permission. The rate declared here, 22050, is one no sound card reports.
|
||||
|
||||
Negative control, in the same test: with the engine off (`hw_seed` 0, stock Firefox: an active engine refuses a declaration pref cleared) the same page reads the host's rate,
|
||||
which is not 22050. The control does not assert what the host answers: a runner with no audio device answers its fallback, and a
|
||||
refused context is also not the declared rate.
|
||||
|
||||
The pref is set through `extra_prefs`, the overlay the core applies last.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SAMPLE_RATE = "zoom.stealth.audio.sample_rate"
|
||||
HW_SEED = "zoom.stealth.fpp.hw_seed"
|
||||
|
||||
READ = """() => {
|
||||
try {
|
||||
return {sampleRate: new (window.AudioContext || window.webkitAudioContext)().sampleRate};
|
||||
} catch (e) {
|
||||
return {error: String(e)};
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
def read(binary, prefs):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=42, binary_path=binary, headless=True, locale="en-US",
|
||||
timezone="America/New_York", extra_prefs=prefs) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank", timeout=60_000)
|
||||
return page.evaluate(READ)
|
||||
|
||||
|
||||
def test_the_audio_context_answers_the_declared_sample_rate(firefox_binary):
|
||||
declared = read(firefox_binary, {SAMPLE_RATE: 22050})
|
||||
assert declared == {"sampleRate": 22050}, declared
|
||||
|
||||
host = read(firefox_binary, {HW_SEED: 0})
|
||||
assert host != declared, (host, declared)
|
||||
assert host.get("sampleRate") != 22050, host
|
||||
@@ -0,0 +1,131 @@
|
||||
"""``@font-face { src: local(<name>) }`` finds the faces of the bundle by their PostScript name, and never a font that only the host has (e2e, every OS, firefox-68).
|
||||
|
||||
What the engine fixes. A page can ask for an installed font by name with ``src: local("ArialMT")`` (the PostScript name or the full name of a face)
|
||||
and learn from ``FontFace.status`` whether the browser has it. The font list of the engine is the bundle and nothing else
|
||||
(``gfxPlatformFontList::mStealthBundleOnly``, set in the constructor, on every platform and whether or not the engine is declared): the face
|
||||
names the ``local()`` lookup searches are read from the ``name`` tables of the bundle's files (``RecordFaceNamesFromTable``,
|
||||
``ReadFaceNamesForFamily``; folders ``fingerprint/fonts/font-list`` and ``fingerprint/fonts/bundle`` of the series), never from DirectWrite
|
||||
or fontconfig. So the PostScript name of a bundled face resolves, a name that only the host's fonts carry does not, and the answer is the same
|
||||
on every machine: a page that probes ``local()`` learns the bundle, not the machine.
|
||||
|
||||
What the test reads. One page declares, for each name, ``@font-face { font-family: <probe>; src: local("<name>") }`` and loads it
|
||||
(``document.fonts.load``), then reads the ``status`` of that face (``loaded`` or ``error``, an event of the page: no timer) and the width of one
|
||||
string through the probe family. Four PostScript names of the bundle come from the manifest the core hands to the engine (``ArialMT``,
|
||||
``TimesNewRomanPSMT``, and the faces ``MS-PGothic`` and ``NSimSun``, which are NOT the first face of their ``.ttc`` file): each must be ``loaded``
|
||||
and draw with the same width as the family it belongs to (the same face, not another one that happened to load). The host-only face is read from
|
||||
the host's own font files (``tests/_font_names.py``: the ``name`` table of every file of the folders the system installs fonts in, minus every
|
||||
name the bundle knows): its PostScript name AND its full name must be ``error``. On Linux the face asked for is DejaVu Sans when the host has
|
||||
it, on Windows the first font of ``%WINDIR%\\Fonts`` the bundle does not carry; no value is typed in the test, and a host that has no such font
|
||||
fails the test (there would be nothing the control could find).
|
||||
|
||||
The negative control, in the same test. The names the host has are the ones that must NOT resolve, so the same page runs a second time with the
|
||||
engine not declared (``zoom.stealth.fpp.hw_seed`` = 0, the pref the core uses to tell the engine to stay stock). On firefox-68 bundle-only
|
||||
does NOT depend on the engine being declared (the member is set unconditionally in the constructor), so the control reads the same: the bundled
|
||||
names resolve and the host-only names do not, engine on or off. The test asserts that equality; it is the characterization of what 68 does, and
|
||||
the day the engine changes it (the host fonts reaching ``local()`` with the engine off) this test is red. A name that exists nowhere
|
||||
(``NoSuchFace-ZZ``) is read in both runs as the control of the probe itself: it is ``error``, so the probe can tell a missing face from a
|
||||
loaded one.
|
||||
|
||||
Why a page reads it: ``FontFace.status`` after ``document.fonts.load()`` is plain web API; fingerprinting scripts probe installed fonts this
|
||||
way as well as by width.
|
||||
|
||||
Run: pytest tests/test_bundle_font_names_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
import _font_names as fn
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: PostScript name -> the family it belongs to in the bundle manifest. The last two are faces of a collection that are not face 0 of their file.
|
||||
BUNDLED = [("ArialMT", "Arial"), ("TimesNewRomanPSMT", "Times New Roman"), ("MS-PGothic", "MS PGothic"), ("NSimSun", "NSimSun")]
|
||||
|
||||
#: Declared by no machine: the control of the probe.
|
||||
NOWHERE = "NoSuchFace-ZZ"
|
||||
|
||||
TEXT = "mmmmmmmmmmlliWWW0Oq@"
|
||||
|
||||
#: The page. `cases` is [[local name, family it must draw like or null], ...]. It reports, for each: the status of the face once its load settled
|
||||
#: and the widths of TEXT through the probe family, through the target family, and through the generics (the width of a face that is not there).
|
||||
PROBE = """async (args) => {
|
||||
const [cases, text] = args;
|
||||
const span = document.createElement('span');
|
||||
span.style.cssText = 'position:absolute;left:-9999px;top:0;white-space:pre;font-size:48px;font-style:normal;font-weight:400;';
|
||||
span.textContent = text;
|
||||
document.body.appendChild(span);
|
||||
const width = (family) => { span.style.fontFamily = family; return span.getBoundingClientRect().width; };
|
||||
const generics = ['monospace', 'sans-serif', 'serif'].map(width);
|
||||
const out = [];
|
||||
let n = 0;
|
||||
for (const [name, target] of cases) {
|
||||
const probe = 'LocalProbe' + (n++);
|
||||
const style = document.createElement('style');
|
||||
style.textContent = '@font-face { font-family: ' + probe + '; src: local("' + name + '"); }';
|
||||
document.head.appendChild(style);
|
||||
await document.fonts.load('48px ' + probe).catch(() => null);
|
||||
const face = Array.from(document.fonts).find(f => f.family.replace(/["']/g, '') === probe);
|
||||
out.push({
|
||||
name: name, status: face ? face.status : 'no-face',
|
||||
probe: width(probe + ', monospace'),
|
||||
target: target ? width('"' + target + '", monospace') : null,
|
||||
generics: generics,
|
||||
});
|
||||
}
|
||||
span.remove();
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
def _read(firefox_binary, cases, engine_declared):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {} if engine_declared else {"zoom.stealth.fpp.hw_seed": 0}
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True, extra_prefs=prefs) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("about:blank", timeout=30_000)
|
||||
return page.evaluate(PROBE, [cases, TEXT])
|
||||
|
||||
|
||||
def test_src_local_resolves_a_bundled_postscript_name_and_not_a_host_only_name(firefox_binary):
|
||||
manifest = fn.bundle_manifest()
|
||||
for psname, family in BUNDLED:
|
||||
assert manifest.family_of_psname(psname) == family, (
|
||||
"the manifest of the core has no face %r in the family %r: the names this test asks for are not the bundle's" % (psname, family))
|
||||
|
||||
known = fn.bundle_file_names(manifest, firefox_binary)
|
||||
prefer = ["DejaVu Sans"] if sys.platform != "win32" else []
|
||||
host = fn.a_host_only_face(manifest, prefer=prefer, extra_known=known)
|
||||
|
||||
cases = [[psname, family] for psname, family in BUNDLED]
|
||||
cases += [[host["psname"], None], [host["full"], None], [NOWHERE, None]]
|
||||
host_names = (host["psname"], host["full"])
|
||||
|
||||
runs = {declared: {row["name"]: row for row in _read(firefox_binary, cases, declared)} for declared in (True, False)}
|
||||
|
||||
for declared, rows in runs.items():
|
||||
mode = "engine declared" if declared else "engine not declared (hw_seed 0)"
|
||||
# the probe tells a missing face from a loaded one
|
||||
assert rows[NOWHERE]["status"] == "error", "%s: a name that exists nowhere read as %r, not error: the probe cannot tell a missing face" % (mode, rows[NOWHERE])
|
||||
# the bundle: found, and it is the face of its family
|
||||
for psname, family in BUNDLED:
|
||||
row = rows[psname]
|
||||
assert row["status"] == "loaded", "%s: src:local(%s) is %r, not loaded: a PostScript name of the bundle does not resolve (%r)" % (mode, psname, row["status"], row)
|
||||
assert row["probe"] == row["target"], (
|
||||
"%s: src:local(%s) draws %r wide and the family %s %r wide: it loaded another face than the bundle's" % (mode, psname, row["probe"], family, row["target"]))
|
||||
assert any(row["probe"] != g for g in row["generics"]), (
|
||||
"%s: src:local(%s) draws as a generic (%r): the face drew nothing of its own" % (mode, psname, row))
|
||||
# the host: the file is on this machine's disk, and the engine does not know its names
|
||||
for name in host_names:
|
||||
row = rows[name]
|
||||
assert row["status"] == "error", (
|
||||
"%s: src:local(%s) is %r: the name belongs to the host font %s (%s) and the bundle has no such face, so a page learns the machine "
|
||||
"from it" % (mode, name, row["status"], host["file"], host["families"]))
|
||||
|
||||
# on 68 the bundle-only list does not depend on the engine being declared: the same answers with it off
|
||||
on = {name: runs[True][name]["status"] for name in runs[True]}
|
||||
off = {name: runs[False][name]["status"] for name in runs[False]}
|
||||
assert on == off, "the statuses of src:local() differ between the engine declared (%r) and not declared (%r)" % (on, off)
|
||||
@@ -0,0 +1,135 @@
|
||||
"""``createPattern`` of a WebGL canvas reads the pixels the page would read from it, with the engine's projection; a 2D source is untouched (e2e, every OS, firefox-68).
|
||||
|
||||
What the engine fixes. The engine's per-seed noise (the projection, ``fingerprint/canvas/noise-projection``) is applied where a WebGL or WebGPU
|
||||
canvas hands its pixels out: readPixels, toDataURL, and the snapshot a canvas gives when another canvas draws it. ``CanvasRenderingContext2D::
|
||||
CreatePattern`` used to read its source canvas through the pattern's own context, a path the noise does not pass, so
|
||||
``createPattern(webglCanvas)`` + ``fill`` + ``getImageData`` returned the CLEAN pixels of the render while ``drawImage(webglCanvas)`` returned the
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Run: pytest tests/test_canvas_create_pattern_projection_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SIZE = 64
|
||||
|
||||
READ = """(args) => {
|
||||
const [kind, size] = args;
|
||||
let source;
|
||||
if (kind === 'webgl' || kind === 'offscreen-webgl') {
|
||||
source = kind === 'webgl' ? document.createElement('canvas') : new OffscreenCanvas(size, size);
|
||||
source.width = size; source.height = size;
|
||||
const gl = source.getContext('webgl', {preserveDrawingBuffer: true, antialias: true});
|
||||
if (!gl) return {error: 'no webgl context for ' + kind};
|
||||
const vs = gl.createShader(gl.VERTEX_SHADER);
|
||||
gl.shaderSource(vs, 'attribute vec2 p; attribute vec3 c; varying vec3 v; void main(){v=c;gl_Position=vec4(p,0.,1.);}');
|
||||
gl.compileShader(vs);
|
||||
const fs = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
gl.shaderSource(fs, 'precision mediump float; varying vec3 v; void main(){gl_FragColor=vec4(v,1.);}');
|
||||
gl.compileShader(fs);
|
||||
const pr = gl.createProgram(); gl.attachShader(pr, vs); gl.attachShader(pr, fs);
|
||||
gl.linkProgram(pr); gl.useProgram(pr);
|
||||
const b = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, b);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
|
||||
[-0.9, -0.8, 1, 0, 0, 0.85, -0.6, 0, 1, 0, 0.1, 0.9, 0, 0, 1]), gl.STATIC_DRAW);
|
||||
const pl = gl.getAttribLocation(pr, 'p'), cl = gl.getAttribLocation(pr, 'c');
|
||||
gl.enableVertexAttribArray(pl); gl.vertexAttribPointer(pl, 2, gl.FLOAT, false, 20, 0);
|
||||
gl.enableVertexAttribArray(cl); gl.vertexAttribPointer(cl, 3, gl.FLOAT, false, 20, 8);
|
||||
gl.clearColor(1, 1, 1, 1); gl.clear(gl.COLOR_BUFFER_BIT); gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||
gl.finish();
|
||||
} else {
|
||||
source = document.createElement('canvas'); source.width = size; source.height = size;
|
||||
const s = source.getContext('2d');
|
||||
const g = s.createLinearGradient(0, 0, size, size);
|
||||
g.addColorStop(0, '#f60'); g.addColorStop(0.5, '#069'); g.addColorStop(1, '#6c0');
|
||||
s.fillStyle = g; s.fillRect(0, 0, size, size);
|
||||
s.strokeStyle = 'rgba(20, 20, 20, 0.8)'; s.lineWidth = 3.3;
|
||||
s.beginPath(); s.arc(size * 0.5, size * 0.45, size * 0.31, 0, 2 * Math.PI * 0.83); s.stroke();
|
||||
s.save(); s.translate(size * 0.6, size * 0.6); s.rotate(0.37); s.fillStyle = 'rgba(255, 255, 255, 0.6)';
|
||||
s.fillRect(-size * 0.2, -size * 0.1, size * 0.4, size * 0.2); s.restore();
|
||||
}
|
||||
const dst = document.createElement('canvas'); dst.width = size; dst.height = size;
|
||||
const d = dst.getContext('2d');
|
||||
d.fillStyle = d.createPattern(source, 'no-repeat');
|
||||
d.fillRect(0, 0, size, size);
|
||||
const viaPattern = Array.from(d.getImageData(0, 0, size, size).data);
|
||||
d.clearRect(0, 0, size, size);
|
||||
d.drawImage(source, 0, 0);
|
||||
const viaDraw = Array.from(d.getImageData(0, 0, size, size).data);
|
||||
return {viaPattern: viaPattern, viaDraw: viaDraw};
|
||||
}"""
|
||||
|
||||
KINDS = ["webgl", "offscreen-webgl", "2d"]
|
||||
|
||||
|
||||
def _read(firefox_binary, engine_declared):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {} if engine_declared else {"zoom.stealth.fpp.hw_seed": 0}
|
||||
out = {}
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True, extra_prefs=prefs) 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()}
|
||||
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)):
|
||||
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}
|
||||
|
||||
|
||||
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 "
|
||||
"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, "
|
||||
"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 "
|
||||
"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"
|
||||
@@ -1,187 +0,0 @@
|
||||
"""Tagged images drawn on a canvas read back as retail Windows Firefox reads them.
|
||||
|
||||
Retail Firefox 159.0 on Windows with the default prefs converts an image that carries a colour
|
||||
tag (an iCCP chunk, cICP, gAMA + cHRM, an sRGB chunk, a JPEG APP2 profile) from its own space
|
||||
to the output profile with qcms, and the output profile is the monitor's: on a stock Windows
|
||||
that is "sRGB Color Space Profile.icm", which qcms does not take for sRGB, so the bytes
|
||||
getImageData returns for drawImage and createImageBitmap change by a few units. The engine
|
||||
declares that profile (it never reads the host's) and converts like retail from firefox-64.
|
||||
Until firefox-59 it skipped the conversion (force_srgb): 27 of the 72 probes below differ
|
||||
there, and this test fails on such an engine, naming each of them. It is gated on
|
||||
firefox-64 only so that those releases skip it instead of failing the run.
|
||||
|
||||
tests/data/canvas_icc_ref/index.html, a page served on localhost, measures 72 probes:
|
||||
|
||||
40 the ten images of gen_images.py (iccp Display P3, Adobe RGB, Rec.2020 primaries,
|
||||
ProPhoto, sRGB primaries; cicp-p3; gama-chrm-p3; srgb-chunk; untagged; a JPEG with a
|
||||
Display P3 profile) each drawn with drawImage (16 px), drawImage scaled to 32 px,
|
||||
createImageBitmap with the default colorSpaceConversion and with "none"
|
||||
22 fillRect with CSS colours (color(display-p3 ...), color-mix(), oklab, ...)
|
||||
1 a canvas opened with colorSpace "display-p3"
|
||||
9 environment values (color-gamut, dynamic-range, colour depth, devicePixelRatio, the
|
||||
colour scheme); the colour scheme is the machine's theme and is not compared
|
||||
|
||||
The 27 that depend on the profile are the drawImage, drawImage at 32 px and
|
||||
createImageBitmap-default probes of the nine tagged images. Each probe's RGBA bytes
|
||||
(getImageData) are hashed with SHA-256. The images are not files of the repository: the test
|
||||
builds them with tests/data/canvas_icc_ref/gen_images.py (standard library, the bytes the
|
||||
measurement used, checked against refs.json before the browser starts) and serves them.
|
||||
|
||||
tests/data/canvas_icc_ref/refs.json holds the hashes retail Firefox 159.0 gave on Windows
|
||||
(build 20261022150525, firefox.exe sha256 d8b5ed82...) with default prefs, gfx.canvas.accelerated
|
||||
off and the monitor profile above (sha256 2b3aa164...), measured twice with equal results; for
|
||||
the 27 probes it also holds the hash without the conversion (force_srgb=true on the same
|
||||
machine), which the failure message names when the engine gave that value. The file is built
|
||||
by scripts/build_canvas_icc_refs.py from the run files.
|
||||
|
||||
Every differing probe is listed (name, expected hash, hash got), not just the first. Set
|
||||
INVISIBLE_CANVAS_ICC_OUT to a directory and the run writes the hashes it got there
|
||||
(canvas_icc_<tag>.json).
|
||||
|
||||
Run: pytest tests/test_canvas_icc_readback_is_windows_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import http.server
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DATA = Path(__file__).parent / "data" / "canvas_icc_ref"
|
||||
|
||||
#: The page's result without the pixel hex (only the hashes are compared; the hex of every
|
||||
#: probe would cross the pipe for nothing).
|
||||
_RESULT = """
|
||||
() => {
|
||||
const strip = (o) => {
|
||||
if (o === null || typeof o !== "object") return o;
|
||||
const out = {};
|
||||
for (const [k, v] of Object.entries(o)) if (k !== "rgba_hex") out[k] = strip(v);
|
||||
return out;
|
||||
};
|
||||
return strip(window.R);
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
def _load(path, name):
|
||||
spec = importlib.util.spec_from_file_location(name, path)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
return mod
|
||||
|
||||
|
||||
def _serve(imgs, listing):
|
||||
"""index.html, images.json and the generated images, on 127.0.0.1."""
|
||||
page = (DATA / "index.html").read_bytes()
|
||||
routes = {"/": (page, "text/html"), "/index.html": (page, "text/html")}
|
||||
routes["/images.json"] = (json.dumps(listing).encode(), "application/json")
|
||||
for iid, ext, data, _what in imgs:
|
||||
kind = "image/jpeg" if ext == "jpg" else "image/png"
|
||||
routes["/images/%s.%s" % (iid, ext)] = (data, kind)
|
||||
|
||||
class _H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
hit = routes.get(self.path.split("?")[0])
|
||||
if hit is None:
|
||||
self.send_error(404)
|
||||
return
|
||||
body, kind = hit
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", kind)
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def log_message(self, *args):
|
||||
pass
|
||||
|
||||
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), _H)
|
||||
threading.Thread(target=server.serve_forever, daemon=True).start()
|
||||
return server
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.timeout(300, method="thread")
|
||||
def test_tagged_images_read_back_as_retail_windows_reads_them(firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
refs_path = DATA / "refs.json"
|
||||
if not refs_path.is_file():
|
||||
pytest.fail("tests/data/canvas_icc_ref/refs.json is missing: it is the reference "
|
||||
"retail Firefox on Windows wrote for this page (see the module docstring)")
|
||||
refs = json.loads(refs_path.read_text(encoding="utf-8"))
|
||||
want = refs["probes"]
|
||||
|
||||
gen = _load(DATA / "gen_images.py", "canvas_icc_gen_images")
|
||||
imgs, _profiles = gen.build_images()
|
||||
drift = ["%s: %s bytes, sha256 %s, the reference was made with %s"
|
||||
% (iid, len(data), hashlib.sha256(data).hexdigest(), refs["images"][iid]["sha256"])
|
||||
for iid, _ext, data, _what in imgs
|
||||
if hashlib.sha256(data).hexdigest() != refs["images"][iid]["sha256"]]
|
||||
assert not drift, ("gen_images.py no longer writes the images the reference was measured "
|
||||
"with, so it compares nothing:\n " + "\n ".join(drift))
|
||||
|
||||
builder = _load(ROOT / "scripts" / "build_canvas_icc_refs.py", "canvas_icc_build_refs")
|
||||
server = _serve(imgs, gen.images_json(imgs))
|
||||
try:
|
||||
url = "http://127.0.0.1:%d/" % server.server_address[1]
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True,
|
||||
pin={"screen.dpr": 1.0}) as b:
|
||||
page = b.new_context().new_page()
|
||||
page.goto(url, timeout=60_000)
|
||||
page.wait_for_function("window.DONE === true || window.ERR", timeout=240_000)
|
||||
err = page.evaluate("window.ERR || null")
|
||||
assert err is None, "the reference page failed: %s" % err
|
||||
result = page.evaluate(_RESULT)
|
||||
finally:
|
||||
server.shutdown()
|
||||
|
||||
try:
|
||||
got = builder.probes(result)
|
||||
except builder.RefError as e:
|
||||
pytest.fail("the page did not give a hash for every probe: %s" % e)
|
||||
|
||||
out_dir = os.environ.get("INVISIBLE_CANVAS_ICC_OUT")
|
||||
if out_dir:
|
||||
from invisible_core.seal import active_seal
|
||||
Path(out_dir).mkdir(parents=True, exist_ok=True)
|
||||
(Path(out_dir) / ("canvas_icc_%s.json" % active_seal().tag)).write_text(
|
||||
json.dumps({k: v["sha256"] for k, v in got.items()}, indent=1, sort_keys=True),
|
||||
encoding="utf-8")
|
||||
|
||||
compared = sorted(k for k, v in want.items() if v.get("compared", True))
|
||||
missing = sorted(k for k in want if k not in got)
|
||||
extra = sorted(set(got) - set(want))
|
||||
differ = [k for k in compared if k in got and got[k]["sha256"] != want[k]["sha256"]]
|
||||
|
||||
lines = []
|
||||
for k in differ:
|
||||
note = ""
|
||||
if got[k]["sha256"] == want[k].get("without_conversion_sha256"):
|
||||
note = " (the value without the conversion: qcms did not convert)"
|
||||
elif "without_conversion_sha256" in want[k]:
|
||||
note = " (depends on the display profile)"
|
||||
shown = ("; reference value %r, got %r" % (want[k]["value"], got[k]["value"])
|
||||
if want[k]["kind"] == "env" else "")
|
||||
lines.append("%s: expected %s, got %s%s%s"
|
||||
% (k, want[k]["sha256"], got[k]["sha256"], shown, note))
|
||||
lines += ["not drawn: " + k for k in missing]
|
||||
if extra:
|
||||
lines.append("drawn but not in the reference: " + ", ".join(extra))
|
||||
unconverted = [k for k in differ
|
||||
if got[k]["sha256"] == want[k].get("without_conversion_sha256")]
|
||||
assert not lines, (
|
||||
"%d of %d canvas colour probes differ from retail Firefox 159.0 on Windows, %d were not "
|
||||
"drawn; %d of the %d that depend on the display profile gave the value without the "
|
||||
"conversion.\n %s"
|
||||
% (len(differ), len(compared), len(missing), len(unconverted),
|
||||
refs["profile_dependent_count"], "\n ".join(lines)))
|
||||
@@ -0,0 +1,122 @@
|
||||
"""``measureText`` answers the vertical metrics of the bundled font as whole numbers, as retail Windows Firefox does (e2e, every OS, firefox-68).
|
||||
|
||||
What the engine fixes. With the engine declared, ``CanvasRenderingContext2D::DrawOrMeasureText`` hands the run to ``StealthHostIndepTextMetrics``
|
||||
(``fingerprint/canvas/text-metrics``, ``dom/canvas/StealthCanvasTextMetrics.h`` of the series), which takes the font's vertical metrics from the
|
||||
bundled font's own OS/2 table (usWinAscent and usWinDescent, from the manifest the core hands to the engine) instead of the host's rasteriser, and
|
||||
ROUNDS them the way a Windows Firefox does (``gfxDWriteFont::ComputeMetrics`` rounds the pair, then derives the em box from the rounded pair). On
|
||||
retail, ``fontBoundingBoxAscent`` and ``fontBoundingBoxDescent`` are therefore whole numbers at every size, and so are the four
|
||||
``actualBoundingBox*`` of the empty string (it has no ink); a public fingerprinting page measures exactly that
|
||||
string and flags any value that is not whole. Fractional values (65.1796875 for 72px Arial) are what a FreeType host computes from the same table.
|
||||
|
||||
What the test reads. One page measures ``Hamburgefonstiv`` and the empty string through ``Arial`` at 10, 12, 16, 20 and 72 px
|
||||
(``ctx.font = "<n>px Arial"``) and returns the twelve fields of every TextMetrics. The expected font-box values are the rounded
|
||||
``usWin`` metrics of the Arial face in the bundle manifest (``tests/_font_names.py``: ascent 1854, descent 434, unit 2048): round(1854 x px / 2048)
|
||||
and round(434 x px / 2048); four of them are also written as the retail measurements recorded with the engine source (72px ascent 65, 20px
|
||||
ascent 18, 12px ascent 11, 10px descent 2).
|
||||
|
||||
The negative control, in the same test. The page runs again with the engine not declared (``zoom.stealth.fpp.hw_seed`` = 0), which keeps the
|
||||
stock code. The control is adapted to the OS because the stock code is a different one on each:
|
||||
|
||||
* Linux: the stock path is FreeType's, which does not round like DirectWrite: the twelve fields over the five sizes DIFFER from the engine's.
|
||||
The page is the one that tells the host's values from the declared ones.
|
||||
* Windows: the stock path IS DirectWrite's (the retail path the engine reproduces), so the font box with the engine off is the same whole numbers
|
||||
the engine declares: the test asserts that they are equal, which is the engine matching the Windows rasteriser and not an invented rounding.
|
||||
|
||||
Why a page reads it: ``CanvasRenderingContext2D.measureText`` is plain web API; ``fontBoundingBoxAscent`` is in the probe of every canvas
|
||||
fingerprint.
|
||||
|
||||
Run: pytest tests/test_canvas_measure_text_metrics_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
import _font_names as fn
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SIZES = [10, 12, 16, 20, 72]
|
||||
TEXT = "Hamburgefonstiv"
|
||||
|
||||
FIELDS = ["width", "actualBoundingBoxLeft", "actualBoundingBoxRight", "actualBoundingBoxAscent", "actualBoundingBoxDescent",
|
||||
"fontBoundingBoxAscent", "fontBoundingBoxDescent", "emHeightAscent", "emHeightDescent", "hangingBaseline", "alphabeticBaseline",
|
||||
"ideographicBaseline"]
|
||||
|
||||
#: Retail Windows Firefox, Arial, recorded with the engine source: (size, field) -> value.
|
||||
RETAIL = {(72, "fontBoundingBoxAscent"): 65, (20, "fontBoundingBoxAscent"): 18, (12, "fontBoundingBoxAscent"): 11,
|
||||
(10, "fontBoundingBoxDescent"): 2}
|
||||
|
||||
MEASURE = """(args) => {
|
||||
const [sizes, text, fields] = args;
|
||||
const ctx = document.createElement('canvas').getContext('2d');
|
||||
const read = (m) => { const o = {}; for (const f of fields) o[f] = m[f]; return o; };
|
||||
const out = {};
|
||||
for (const size of sizes) {
|
||||
ctx.font = size + 'px Arial';
|
||||
out[size] = {text: read(ctx.measureText(text)), empty: read(ctx.measureText(''))};
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
def _read(firefox_binary, engine_declared):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
prefs = {} if engine_declared else {"zoom.stealth.fpp.hw_seed": 0}
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True, extra_prefs=prefs) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("about:blank", timeout=30_000)
|
||||
raw = page.evaluate(MEASURE, [SIZES, TEXT, FIELDS])
|
||||
return {int(size): rows for size, rows in raw.items()}
|
||||
|
||||
|
||||
def _whole(value):
|
||||
return float(value).is_integer()
|
||||
|
||||
|
||||
def _round(value):
|
||||
"""std::round: halves away from zero (the values here are positive)."""
|
||||
return int(math.floor(value + 0.5))
|
||||
|
||||
|
||||
def test_measure_text_vertical_metrics_are_whole_and_retail(firefox_binary):
|
||||
arial = fn.bundle_manifest().face_with_psname("ArialMT")
|
||||
upem, ascent, descent = arial["upem"], arial["ascent"], arial["descent"]
|
||||
expected = {size: {"fontBoundingBoxAscent": _round(ascent * size / upem), "fontBoundingBoxDescent": _round(descent * size / upem)}
|
||||
for size in SIZES}
|
||||
for (size, field), value in RETAIL.items():
|
||||
assert expected[size][field] == value, (
|
||||
"the rounded OS/2 metric of the manifest's Arial (%s at %dpx = %r) is not the retail value %r the engine source records: the manifest "
|
||||
"is not the face this test was written for" % (field, size, expected[size][field], value))
|
||||
|
||||
declared = _read(firefox_binary, True)
|
||||
for size in SIZES:
|
||||
for kind in ("text", "empty"):
|
||||
row = declared[size][kind]
|
||||
for field in ("fontBoundingBoxAscent", "fontBoundingBoxDescent"):
|
||||
assert _whole(row[field]), "engine declared: %dpx Arial %s of %r is %r, not a whole number" % (size, field, kind, row[field])
|
||||
assert row[field] == expected[size][field], (
|
||||
"engine declared: %dpx Arial %s of %r is %r, the rounded OS/2 metric of the bundled face is %r"
|
||||
% (size, field, kind, row[field], expected[size][field]))
|
||||
for field in ("actualBoundingBoxLeft", "actualBoundingBoxRight", "actualBoundingBoxAscent", "actualBoundingBoxDescent"):
|
||||
assert _whole(declared[size]["empty"][field]), (
|
||||
"engine declared: %dpx Arial %s of the empty string is %r, not a whole number: a page that measures the empty string reads a "
|
||||
"host rasteriser" % (size, field, declared[size]["empty"][field]))
|
||||
|
||||
stock = _read(firefox_binary, False)
|
||||
if sys.platform == "win32":
|
||||
for size in SIZES:
|
||||
for kind in ("text", "empty"):
|
||||
for field in ("fontBoundingBoxAscent", "fontBoundingBoxDescent"):
|
||||
assert stock[size][kind][field] == declared[size][kind][field], (
|
||||
"engine not declared: %dpx Arial %s of %r is %r on the DirectWrite path and %r with the engine: the engine's rounding is "
|
||||
"not the Windows rasteriser's" % (size, field, kind, stock[size][kind][field], declared[size][kind][field]))
|
||||
else:
|
||||
different = [(size, kind, field) for size in SIZES for kind in ("text", "empty") for field in FIELDS
|
||||
if stock[size][kind][field] != declared[size][kind][field]]
|
||||
assert different, (
|
||||
"engine not declared: the twelve fields over five sizes are the same as with the engine declared: the page cannot tell the host's "
|
||||
"values from the declared ones, so the control proves nothing")
|
||||
@@ -15,6 +15,9 @@ known-bad:
|
||||
same text canvas: what separates two machines is how they draw, never a
|
||||
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).
|
||||
|
||||
Runs against about:blank and a local http page, no network/proxy. Part of the
|
||||
e2e release gate.
|
||||
@@ -154,3 +157,84 @@ def test_two_seeds_on_the_same_machine_draw_the_same_text(firefox_binary):
|
||||
assert hashlib.sha256(bytes(a)).digest() == hashlib.sha256(bytes(b)).digest(), (
|
||||
"two seeds declaring the same display scale and ClearType tuning read "
|
||||
"different text pixels: something per-seed still changes a 2D canvas")
|
||||
|
||||
|
||||
_NON_PREMULTIPLIED_JS = """async () => {
|
||||
const c = document.createElement('canvas'); c.width = 128; c.height = 128;
|
||||
const gl = c.getContext('webgl', {premultipliedAlpha: false, alpha: true,
|
||||
preserveDrawingBuffer: true, antialias: true});
|
||||
if (!gl) return null;
|
||||
const alpha = 128 / 255;
|
||||
const vs = gl.createShader(gl.VERTEX_SHADER);
|
||||
gl.shaderSource(vs, 'attribute vec2 p; attribute vec3 c; varying vec3 v;'
|
||||
+ ' void main(){v=c;gl_Position=vec4(p,0.,1.);}');
|
||||
gl.compileShader(vs);
|
||||
const fs = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
gl.shaderSource(fs, 'precision mediump float; varying vec3 v; void main(){gl_FragColor=vec4(v,'
|
||||
+ alpha.toFixed(8) + ');}');
|
||||
gl.compileShader(fs);
|
||||
const pr = gl.createProgram(); gl.attachShader(pr, vs); gl.attachShader(pr, fs);
|
||||
gl.linkProgram(pr); gl.useProgram(pr);
|
||||
const b = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, b);
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
|
||||
[-0.9, -0.8, 1, 0, 0, 0.85, -0.6, 0, 1, 0, 0.1, 0.9, 0, 0, 1]), gl.STATIC_DRAW);
|
||||
const pl = gl.getAttribLocation(pr, 'p'), cl = gl.getAttribLocation(pr, 'c');
|
||||
gl.enableVertexAttribArray(pl); gl.vertexAttribPointer(pl, 2, gl.FLOAT, false, 20, 0);
|
||||
gl.enableVertexAttribArray(cl); gl.vertexAttribPointer(cl, 3, gl.FLOAT, false, 20, 8);
|
||||
gl.clearColor(1, 1, 1, alpha); gl.clear(gl.COLOR_BUFFER_BIT); gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||
gl.finish();
|
||||
const url = c.toDataURL();
|
||||
const blob = await new Promise(resolve => c.toBlob(resolve, 'image/png'));
|
||||
const bytes = new Uint8Array(await blob.arrayBuffer());
|
||||
let binary = '';
|
||||
for (let i = 0; i < bytes.length; i += 8192) binary += String.fromCharCode.apply(null, bytes.subarray(i, i + 8192));
|
||||
return {url, blob: btoa(binary), premultipliedAlpha: gl.getContextAttributes().premultipliedAlpha};
|
||||
}"""
|
||||
|
||||
|
||||
def _non_premultiplied(firefox_binary, hw_seed):
|
||||
"""(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)."""
|
||||
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},
|
||||
) 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"
|
||||
assert got["premultipliedAlpha"] is False, "the context is premultiplied: %r" % got["premultipliedAlpha"]
|
||||
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
|
||||
return images[0]["data"], images[1]["data"]
|
||||
|
||||
|
||||
@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.
|
||||
|
||||
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)
|
||||
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))
|
||||
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)))
|
||||
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 "
|
||||
"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"
|
||||
% (differing(on_blob, on_url), len(on_url)))
|
||||
@@ -1,143 +0,0 @@
|
||||
"""Coloured canvas text, and text under other ClearType keys, is what retail Windows draws.
|
||||
|
||||
tests/test_canvas_text_is_windows_e2e.py compares 342 cases of black text on white, drawn
|
||||
with one ClearType state (the seed's: gamma 1.8, contrast 1.0). The text of a page is not
|
||||
always black, and a machine's ClearType gamma and contrast are not always the untuned ones
|
||||
(the registry values the Windows tuner writes), so this test adds what that one does not
|
||||
reach, each with the hashes retail Firefox 159.0 on Windows gave for the same page:
|
||||
|
||||
coloured text tests/data/canvas_text_ref_colors/index.html draws Arial 16 and 33 px, fillText,
|
||||
of seven colour pairs (black, teal, rgba(102,204,0,0.2) on white, grey, white on
|
||||
black, red, white on blue): 14 cases, with the seed's configuration. An
|
||||
engine that quantises its A8 text masks to 17 levels (a hook, which firefox-64
|
||||
removes) moves a coloured edge pixel by a few units, and black on white hides
|
||||
it: 12 of the 14 differ on such an engine.
|
||||
ClearType keys gamma/contrast 1800/100 (the seed's), 1400/50 and 2200/0: 39 cases for each,
|
||||
the 14 coloured ones and 25 black ones of tests/data/canvas_text_ref (Arial,
|
||||
Calibri, Consolas, Segoe UI at 9, 12.5, 16 and 33 px; stroke, opaque canvas
|
||||
above 48 px, rotated and scaled, Twemoji COLR v0). The engine is launched with
|
||||
the pins font.cleartype_gamma and font.cleartype_contrast of the key, one
|
||||
launch for each; the page is the same, the bytes are not (the keys give
|
||||
different hashes in refs.json, which tests/unit/test_canvas_text_colors_refs.py
|
||||
checks, so the test tells them apart).
|
||||
|
||||
Each canvas is read back with getImageData and its RGBA bytes are hashed with SHA-256. The
|
||||
fonts are the engine's own bundled files, served by this test (their sha256 is checked
|
||||
against the reference first). tests/data/canvas_text_ref_colors/refs.json is built by
|
||||
scripts/build_canvas_text_colors_refs.py from the bytes retail drew.
|
||||
|
||||
Every differing case is listed (name, expected hash, hash got), not just the first.
|
||||
|
||||
Run: pytest tests/test_canvas_text_colors_and_cleartype_is_windows_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from _canvas_text import DATA as BASE_DATA, diff_lines, only_cases, pin, serve, wrong_fonts
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
DATA = Path(__file__).parent / "data" / "canvas_text_ref_colors"
|
||||
SEED = 21
|
||||
|
||||
|
||||
def _refs():
|
||||
path = DATA / "refs.json"
|
||||
if not path.is_file():
|
||||
pytest.fail("tests/data/canvas_text_ref_colors/refs.json is missing: it is the reference "
|
||||
"retail Firefox on Windows wrote for these pages (see the module docstring)")
|
||||
return json.loads(path.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def _draw(url, page):
|
||||
"""The sha256 of each case the page at ``url`` draws, by case id."""
|
||||
page.goto(url, timeout=60_000)
|
||||
page.wait_for_function("window.DONE === true || window.ERR", timeout=300_000)
|
||||
err = page.evaluate("window.ERR || null")
|
||||
assert err is None, "the reference page %s failed: %s" % (url, err)
|
||||
return page.evaluate(
|
||||
"Object.fromEntries(Object.entries(window.R).map(([k, v]) => [k, v.sha256]))")
|
||||
|
||||
|
||||
def _launch(firefox_binary, refs, key, pages_for):
|
||||
"""One engine launch with the persona's pin (and the ClearType ``key`` when given, a
|
||||
(gamma, contrast) pair); returns what each page of ``pages_for`` ({name: (path, ids)})
|
||||
drew."""
|
||||
base = json.loads((BASE_DATA / "refs.json").read_text(encoding="utf-8"))
|
||||
fonts_dir = Path(firefox_binary).parent / "fonts"
|
||||
wrong = wrong_fonts(fonts_dir, base["fonts"])
|
||||
assert not wrong, (
|
||||
"the reference was measured with other font files than the engine's bundle, so it "
|
||||
"compares nothing; rebuild the references from the bundled files:\n "
|
||||
+ "\n ".join(wrong))
|
||||
|
||||
prefs = pin(base)
|
||||
if key is not None:
|
||||
prefs["font.cleartype_gamma"], prefs["font.cleartype_contrast"] = key
|
||||
colors_page = (DATA / "index.html").read_bytes()
|
||||
black_page = only_cases((BASE_DATA / "index.html").read_text(encoding="utf-8"),
|
||||
pages_for.get("black", []))
|
||||
server = serve(fonts_dir, base["fonts"],
|
||||
{"/": colors_page, "/index.html": colors_page,
|
||||
"/black.html": black_page.encode("utf-8")})
|
||||
try:
|
||||
root = "http://127.0.0.1:%d" % server.server_address[1]
|
||||
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True,
|
||||
pin=prefs) as b:
|
||||
page = b.new_context().new_page()
|
||||
got = {}
|
||||
if pages_for.get("black"):
|
||||
got["black"] = _draw(root + "/black.html", page)
|
||||
got["colors"] = _draw(root + "/", page)
|
||||
return got
|
||||
finally:
|
||||
server.shutdown()
|
||||
|
||||
|
||||
def _want(cases):
|
||||
return {cid: c["sha256"] for cid, c in cases.items()}
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.timeout(600, method="thread")
|
||||
def test_coloured_text_is_what_retail_windows_draws(firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
refs = _refs()
|
||||
assert refs["colors"]["count"] == len(refs["colors"]["cases"]) == 14
|
||||
got = _launch(firefox_binary, refs, None, {})
|
||||
lines = diff_lines(_want(refs["colors"]["cases"]), got["colors"])
|
||||
assert not lines, (
|
||||
"%d of %d coloured canvas text cases differ from retail Firefox on Windows "
|
||||
"(seed ClearType state, gamma 1800 contrast 100):\n %s"
|
||||
% (len(lines), len(refs["colors"]["cases"]), "\n ".join(lines)))
|
||||
|
||||
|
||||
def _keys():
|
||||
# collected without the reference file: a missing one fails the test, not the collection
|
||||
path = DATA / "refs.json"
|
||||
if not path.is_file():
|
||||
return ["1800_100", "1400_50", "2200_0"]
|
||||
return list(json.loads(path.read_text(encoding="utf-8"))["keys"])
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.timeout(900, method="thread")
|
||||
@pytest.mark.parametrize("tag", _keys())
|
||||
def test_text_under_a_cleartype_key_is_what_retail_windows_draws(
|
||||
tag, firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
refs = _refs()
|
||||
k = refs["keys"][tag]
|
||||
want_black, want_colors = _want(k["black"]), _want(k["colors"])
|
||||
assert len(want_black) + len(want_colors) == k["count"] == 39
|
||||
|
||||
got = _launch(firefox_binary, refs, (k["gamma"], k["contrast"]), {"black": list(want_black)})
|
||||
lines = (diff_lines(want_black, got["black"], "black ")
|
||||
+ diff_lines(want_colors, got["colors"], "colour "))
|
||||
assert not lines, (
|
||||
"%d of %d canvas text cases differ from retail Firefox on Windows under ClearType "
|
||||
"gamma %d contrast %d:\n %s"
|
||||
% (len(lines), k["count"], k["gamma"], k["contrast"], "\n ".join(lines)))
|
||||
@@ -1,119 +0,0 @@
|
||||
"""Canvas 2D text is drawn as retail Firefox on Windows draws it, on every OS.
|
||||
|
||||
Retail Firefox on Windows draws canvas text with Skia over DirectWrite. The engine draws it
|
||||
with Skia over idwr (DirectWrite 10.0.26100.9711 in portable C) from firefox-64, so the
|
||||
same page gives the same RGBA bytes on Windows, on Debian 12 and on Ubuntu 24.04.
|
||||
|
||||
tests/data/canvas_text_ref/index.html draws 342 cases, in groups (the ``gruppo`` field of
|
||||
each case in refs.json):
|
||||
|
||||
0_base 211 Arial, Segoe UI, Times New Roman, Consolas and Calibri at 9,
|
||||
12.5, 16, 33, 72 and 300 px, with and without a rotate(15deg)
|
||||
scale(1.5, 2) transform; fillText, strokeText, synthetic
|
||||
italic and bold
|
||||
1_alpha_false 25 the same faces at 5 sizes on getContext('2d', {alpha: false})
|
||||
(an opaque canvas, where LCD text is possible)
|
||||
2a_rot_alpha_true_controllo 25 rotated and scaled, alpha true (the base's cases, drawn once)
|
||||
2b_rot_alpha_false 25 rotated and scaled, alpha false
|
||||
3_emoji_colr0 12 COLR v0 emoji, Twemoji Mozilla, alpha true and false
|
||||
4_soglie 20 255, 256, 257, 300 and 400 px, fillText and strokeText
|
||||
5_variabile_bahnschrift 12 font-weight 300/400/700 by font-stretch 75%/100%
|
||||
6_variabile_seguivar 12 Segoe UI Variable, font-weight 300/400/700 at 9, 12.5, 16 and
|
||||
33 px (opsz follows the size): the instance the scaled font
|
||||
asks of idwr, on every OS
|
||||
|
||||
Each canvas is read back with getImageData and its RGBA bytes are hashed with SHA-256. The
|
||||
fonts are @font-face webfonts: the files of the engine's own ``fonts`` directory, served by
|
||||
this test, so the comparison does not depend on what the host has installed.
|
||||
tests/data/canvas_text_ref/refs.json holds the hashes retail Firefox 159.0 on Windows gave for
|
||||
the same page and the same bundled files (gfx.canvas.accelerated off, white background), and
|
||||
the ClearType state of that machine, which the test declares as the persona (system text
|
||||
quality 5). Its ``fonts`` entries carry the sha256 of each file, which must be the engine's
|
||||
bundled one (Arial 05c7da5fe195...; Twemoji Mozilla, Bahnschrift and Segoe UI Variable too): a reference made with
|
||||
other font files compares nothing. The file is built by scripts/build_canvas_text_refs.py from
|
||||
the two measurements.
|
||||
|
||||
The largest canvases (400 px: 7727 x 3373, 100 MB of RGBA) are drawn one at a time and
|
||||
released after their hash is taken, as the measuring page did.
|
||||
|
||||
Every differing case is listed, group by group, not just the first. Set INVISIBLE_CANVAS_TEXT_OUT to a
|
||||
directory and the run writes its hashes there (canvas_text_<tag>.json); scripts/
|
||||
compare_canvas_text_runs.py says which cases two runs, the Debian one and the Ubuntu one,
|
||||
draw differently.
|
||||
|
||||
Run: pytest tests/test_canvas_text_is_windows_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from _canvas_text import DATA, pin as _pin, serve as _serve, wrong_fonts
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@pytest.mark.timeout(1800, method="thread")
|
||||
def test_canvas_text_is_what_retail_windows_draws(firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
refs_path = DATA / "refs.json"
|
||||
if not refs_path.is_file():
|
||||
pytest.fail("tests/data/canvas_text_ref/refs.json is missing: it is the reference "
|
||||
"retail Firefox on Windows wrote for this page (see the module docstring)")
|
||||
refs = json.loads(refs_path.read_text(encoding="utf-8"))
|
||||
fonts_dir = Path(firefox_binary).parent / "fonts"
|
||||
|
||||
wrong = wrong_fonts(fonts_dir, refs["fonts"])
|
||||
assert not wrong, (
|
||||
"the reference was measured with other font files than the engine's bundle, so it "
|
||||
"compares nothing; rebuild refs.json from the bundled files:\n " + "\n ".join(wrong))
|
||||
|
||||
pin = _pin(refs)
|
||||
page = (DATA / "index.html").read_bytes()
|
||||
server = _serve(fonts_dir, refs["fonts"], {"/": page, "/index.html": page})
|
||||
try:
|
||||
url = "http://127.0.0.1:%d/" % server.server_address[1]
|
||||
with InvisiblePlaywright(seed=21, binary_path=firefox_binary, headless=True,
|
||||
pin=pin) as b:
|
||||
page = b.new_context().new_page()
|
||||
page.goto(url, timeout=60_000)
|
||||
page.wait_for_function("window.DONE === true || window.ERR", timeout=1_500_000)
|
||||
err = page.evaluate("window.ERR || null")
|
||||
assert err is None, "the reference page failed: %s" % err
|
||||
got = page.evaluate(
|
||||
"Object.fromEntries(Object.entries(window.R).map(([k, v]) => [k, v.sha256]))")
|
||||
finally:
|
||||
server.shutdown()
|
||||
|
||||
out_dir = os.environ.get("INVISIBLE_CANVAS_TEXT_OUT")
|
||||
if out_dir:
|
||||
from invisible_core.seal import active_seal
|
||||
Path(out_dir).mkdir(parents=True, exist_ok=True)
|
||||
(Path(out_dir) / ("canvas_text_%s.json" % active_seal().tag)).write_text(
|
||||
json.dumps(got, indent=1, sort_keys=True), encoding="utf-8")
|
||||
|
||||
cases = refs["cases"]
|
||||
want = {k: v["sha256"] for k, v in cases.items()}
|
||||
missing = sorted(set(want) - set(got))
|
||||
extra = sorted(set(got) - set(want))
|
||||
differ = sorted(k for k in want if k in got and got[k] != want[k])
|
||||
|
||||
lines = []
|
||||
for group in sorted({v["gruppo"] for v in cases.values()}):
|
||||
ids = sorted(k for k, v in cases.items() if v["gruppo"] == group)
|
||||
bad = [k for k in ids if k in differ]
|
||||
gone = [k for k in ids if k in missing]
|
||||
if bad or gone:
|
||||
lines.append("%s: %d of %d differ, %d not drawn" % (group, len(bad), len(ids), len(gone)))
|
||||
lines += [" differs: " + k for k in bad[:40]]
|
||||
if len(bad) > 40:
|
||||
lines.append(" ... and %d more" % (len(bad) - 40))
|
||||
lines += [" not drawn: " + k for k in gone[:20]]
|
||||
if extra:
|
||||
lines.append("drawn but not in the reference: " + ", ".join(extra[:20]))
|
||||
assert not lines, (
|
||||
"%d of %d canvas text cases differ from retail Firefox on Windows, %d were not drawn.\n%s"
|
||||
% (len(differ), len(want), len(missing), "\n".join(lines)))
|
||||
@@ -1,7 +1,10 @@
|
||||
"""scripts/ci_lab_intermediates.py: a CI leg launches with a fixed list of intermediates that the repository holds, and the core is told so."""
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
"""The intermediates lab of the CI is gone: the security state replaced it (scripts/ci_lab_security_state.py, ci/security-state/).
|
||||
|
||||
The core no longer declares an intermediates list: it copies a ready security state (intermediates, OneCRL and the CRLite filters, generated by the
|
||||
engine) into every profile, and a CI leg points STEALTHFOX_SECURITY_STATE at a fixed directory of the repository. A leftover of the old lab (the
|
||||
script, its pinned list, a workflow that still exports STEALTHFOX_INTERMEDIATES) would be a second road that nothing reads. The file keeps its name
|
||||
because ci/required-suites.json only grows (scripts/ci_verdict.py, against main): its tests now guard that the old road stays gone.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -11,78 +14,13 @@ pytestmark = pytest.mark.unit
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _load():
|
||||
spec = importlib.util.spec_from_file_location("ci_lab_intermediates_under_test", ROOT / "scripts" / "ci_lab_intermediates.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
def test_the_files_of_the_intermediates_lab_are_gone():
|
||||
for rel in ("scripts/ci_lab_intermediates.py", "ci/intermediates.json", "ci/intermediates.pin.json"):
|
||||
assert not (ROOT / rel).exists(), "%s is a leftover of the intermediates lab" % rel
|
||||
|
||||
|
||||
lab = _load()
|
||||
PIN = ROOT / "ci" / "intermediates.pin.json"
|
||||
LIST = ROOT / "ci" / "intermediates.json"
|
||||
RUN = "python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json"
|
||||
|
||||
|
||||
def test_the_pin_is_the_hash_of_the_file_it_names():
|
||||
pin = lab.load_pin(PIN)
|
||||
assert pin["file"] == "ci/intermediates.json" and pin["comment"]
|
||||
assert hashlib.sha256(LIST.read_bytes()).hexdigest() == pin["sha256"]
|
||||
assert len(LIST.read_bytes()) == pin["bytes"]
|
||||
|
||||
|
||||
def test_the_file_is_a_valid_list_of_format_1_with_no_certificate():
|
||||
raw = LIST.read_bytes()
|
||||
listing = json.loads(raw)
|
||||
assert listing["format"] == 1 and listing["collection"] == "security-state/intermediates"
|
||||
assert listing["count"] == len(listing["certs"]) == 0
|
||||
assert listing["set_sha256"] == hashlib.sha256(b"").hexdigest() # the hash of no derHash at all
|
||||
assert list(listing) == ["format", "collection", "collection_timestamp", "fetched_utc", "count", "set_sha256", "certs"]
|
||||
assert raw == json.dumps(listing, separators=(",", ":"), ensure_ascii=True).encode("utf-8"), "not written as the core writes it (compact, no final newline)"
|
||||
|
||||
|
||||
def test_set_writes_the_variable_with_the_absolute_path_to_github_env(tmp_path, monkeypatch):
|
||||
env_file = tmp_path / "github_env"
|
||||
monkeypatch.setenv("GITHUB_ENV", str(env_file))
|
||||
assert lab.main(["set", "--pin", str(PIN)]) == 0
|
||||
assert env_file.read_text(encoding="utf-8") == "STEALTHFOX_INTERMEDIATES=%s\n" % LIST.resolve()
|
||||
assert Path(LIST.resolve()).is_absolute()
|
||||
|
||||
|
||||
def test_without_github_env_it_prints_the_line(monkeypatch, capsys):
|
||||
monkeypatch.delenv("GITHUB_ENV", raising=False)
|
||||
assert lab.main(["set", "--pin", str(PIN)]) == 0
|
||||
assert capsys.readouterr().out == "STEALTHFOX_INTERMEDIATES=%s\n" % LIST.resolve()
|
||||
|
||||
|
||||
def test_a_file_that_is_not_the_pinned_one_is_refused_and_exports_nothing(tmp_path, monkeypatch, capsys):
|
||||
other = tmp_path / "other.json"
|
||||
other.write_bytes(LIST.read_bytes() + b"\n")
|
||||
pin = tmp_path / "pin.json"
|
||||
pin.write_text(json.dumps({"file": str(other), "sha256": lab.load_pin(PIN)["sha256"]}), encoding="utf-8")
|
||||
env_file = tmp_path / "github_env"
|
||||
monkeypatch.setenv("GITHUB_ENV", str(env_file))
|
||||
assert lab.main(["set", "--pin", str(pin)]) == 1
|
||||
assert not env_file.exists()
|
||||
assert "change both in one commit" in capsys.readouterr().err
|
||||
|
||||
|
||||
def test_a_pin_that_is_not_a_pin_or_names_a_missing_file_is_refused(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv("GITHUB_ENV", raising=False)
|
||||
bad = tmp_path / "pin.json"
|
||||
for text in ("not json", "{}", json.dumps({"file": "x", "sha256": "xyz"}), json.dumps({"sha256": "0" * 64})):
|
||||
bad.write_text(text, encoding="utf-8")
|
||||
with pytest.raises(lab.Refused):
|
||||
lab.load_pin(bad)
|
||||
assert lab.main(["set", "--pin", str(bad)]) == 1
|
||||
bad.write_text(json.dumps({"file": str(tmp_path / "nowhere.json"), "sha256": "0" * 64}), encoding="utf-8")
|
||||
assert lab.main(["set", "--pin", str(bad)]) == 1
|
||||
|
||||
|
||||
def test_the_command_runs_as_the_workflows_run_it():
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
done = subprocess.run([sys.executable] + RUN.split()[1:], cwd=ROOT, capture_output=True, text=True, env={k: v for k, v in __import__("os").environ.items() if k != "GITHUB_ENV"})
|
||||
assert done.returncode == 0, done.stderr
|
||||
assert done.stdout == "STEALTHFOX_INTERMEDIATES=%s\n" % LIST.resolve()
|
||||
def test_no_workflow_names_the_intermediates_lab():
|
||||
for wf in sorted((ROOT / ".github" / "workflows").glob("*.yml")):
|
||||
text = wf.read_text(encoding="utf-8")
|
||||
for word in ("STEALTHFOX_INTERMEDIATES", "ci_lab_intermediates", "intermediates.pin.json"):
|
||||
assert word not in text, "%s still names %s" % (wf.name, word)
|
||||
@@ -0,0 +1,110 @@
|
||||
"""scripts/ci_lab_security_state.py: a CI leg launches with a fixed, ready security state that the repository holds, and the core is told so."""
|
||||
import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _load():
|
||||
spec = importlib.util.spec_from_file_location("ci_lab_security_state_under_test", ROOT / "scripts" / "ci_lab_security_state.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
lab = _load()
|
||||
PIN = ROOT / "ci" / "security-state.pin.json"
|
||||
RESULT = ROOT / "ci" / "security-state" / "securitystate-result.json"
|
||||
RUN = "python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json"
|
||||
|
||||
|
||||
def test_the_pin_is_the_hash_of_the_file_it_names():
|
||||
pin = lab.load_pin(PIN)
|
||||
assert pin["file"] == "ci/security-state/securitystate-result.json" and pin["comment"]
|
||||
assert hashlib.sha256(RESULT.read_bytes()).hexdigest() == pin["sha256"]
|
||||
assert len(RESULT.read_bytes()) == pin["bytes"]
|
||||
|
||||
|
||||
def test_the_directory_is_a_ready_state_with_no_data():
|
||||
"""A result with no data: ok, no engine, zero timestamps, no CRLite hashes; and no `security_state/`, so a launch copies nothing."""
|
||||
result = json.loads(RESULT.read_bytes())
|
||||
assert result["format"] == 1 and result["ok"] is True and result["error"] is None
|
||||
assert result["engine"] == {"version": "", "build_id": ""}
|
||||
assert result["crlite_filter_hashes"] == []
|
||||
assert all(c["collection_timestamp"] == 0 for c in result["collections"].values())
|
||||
assert sorted(p.name for p in RESULT.parent.iterdir()) == ["securitystate-result.json"]
|
||||
|
||||
|
||||
def test_set_writes_the_variable_with_the_absolute_directory_to_github_env(tmp_path, monkeypatch):
|
||||
env_file = tmp_path / "github_env"
|
||||
monkeypatch.setenv("GITHUB_ENV", str(env_file))
|
||||
assert lab.main(["set", "--pin", str(PIN)]) == 0
|
||||
assert env_file.read_text(encoding="utf-8") == "STEALTHFOX_SECURITY_STATE=%s\n" % RESULT.parent.resolve()
|
||||
assert Path(RESULT.parent.resolve()).is_absolute()
|
||||
|
||||
|
||||
def test_without_github_env_it_prints_the_line(monkeypatch, capsys):
|
||||
monkeypatch.delenv("GITHUB_ENV", raising=False)
|
||||
assert lab.main(["set", "--pin", str(PIN)]) == 0
|
||||
assert capsys.readouterr().out == "STEALTHFOX_SECURITY_STATE=%s\n" % RESULT.parent.resolve()
|
||||
|
||||
|
||||
def _copy_of_the_state(tmp_path):
|
||||
directory = tmp_path / "state"
|
||||
directory.mkdir()
|
||||
shutil.copy(RESULT, directory / RESULT.name)
|
||||
pin = tmp_path / "pin.json"
|
||||
pin.write_text(json.dumps({"file": str(directory / RESULT.name), "sha256": lab.load_pin(PIN)["sha256"]}), encoding="utf-8")
|
||||
return directory, pin
|
||||
|
||||
|
||||
def test_a_file_that_is_not_the_pinned_one_is_refused_and_exports_nothing(tmp_path, monkeypatch, capsys):
|
||||
directory, pin = _copy_of_the_state(tmp_path)
|
||||
(directory / RESULT.name).write_bytes(RESULT.read_bytes() + b"\n")
|
||||
env_file = tmp_path / "github_env"
|
||||
monkeypatch.setenv("GITHUB_ENV", str(env_file))
|
||||
assert lab.main(["set", "--pin", str(pin)]) == 1
|
||||
assert not env_file.exists()
|
||||
assert "change both in one commit" in capsys.readouterr().err
|
||||
|
||||
|
||||
def test_a_directory_that_holds_anything_else_is_refused_and_exports_nothing(tmp_path, monkeypatch, capsys):
|
||||
"""Data in the directory would be copied into every profile of the leg: the leg launches with NO data, and the pin only vouches for the one file."""
|
||||
directory, pin = _copy_of_the_state(tmp_path)
|
||||
env_file = tmp_path / "github_env"
|
||||
monkeypatch.setenv("GITHUB_ENV", str(env_file))
|
||||
assert lab.main(["set", "--pin", str(pin)]) == 0
|
||||
env_file.unlink()
|
||||
(directory / "security_state").mkdir()
|
||||
(directory / "security_state" / "data.safe.bin").write_bytes(b"x")
|
||||
assert lab.main(["set", "--pin", str(pin)]) == 1
|
||||
assert not env_file.exists()
|
||||
assert "security_state" in capsys.readouterr().err
|
||||
|
||||
|
||||
def test_a_pin_that_is_not_a_pin_or_names_a_missing_file_is_refused(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv("GITHUB_ENV", raising=False)
|
||||
bad = tmp_path / "pin.json"
|
||||
for text in ("not json", "{}", json.dumps({"file": "x", "sha256": "xyz"}), json.dumps({"sha256": "0" * 64})):
|
||||
bad.write_text(text, encoding="utf-8")
|
||||
with pytest.raises(lab.Refused):
|
||||
lab.load_pin(bad)
|
||||
assert lab.main(["set", "--pin", str(bad)]) == 1
|
||||
bad.write_text(json.dumps({"file": str(tmp_path / "nowhere.json"), "sha256": "0" * 64}), encoding="utf-8")
|
||||
assert lab.main(["set", "--pin", str(bad)]) == 1
|
||||
|
||||
|
||||
def test_the_command_runs_as_the_workflows_run_it():
|
||||
done = subprocess.run([sys.executable] + RUN.split()[1:], cwd=ROOT, capture_output=True, text=True, env={k: v for k, v in os.environ.items() if k != "GITHUB_ENV"})
|
||||
assert done.returncode == 0, done.stderr
|
||||
assert done.stdout == "STEALTHFOX_SECURITY_STATE=%s\n" % RESULT.parent.resolve()
|
||||
@@ -0,0 +1,162 @@
|
||||
"""scripts/ci_suite_run.py runs one row of the whole-e2e suite and hands the judge ONE junit (no browser here: the run of the core is a fake).
|
||||
|
||||
What is held: the arguments of the run are the files and node ids of the row, in its order, and nothing else of the row (the passes bring their own marker); the
|
||||
two junit files of the passes become one xunit2 file with every testcase kept as pytest wrote it, counted from the cases and not from the headers, and the judge
|
||||
reads it; the run reaches the judge when a test is red (exit 0 for the passes that ran to their end) and does not when a pass did not run to its end or nothing
|
||||
was written; the variable that tells the core where its junit goes is set for the run and put back after it.
|
||||
|
||||
Known-bad inputs: a pass that wrote nothing, a second pass with no test, a skipped and a failed case among the passed, a row that is not in the list, a row of
|
||||
the other system, a pass that died (exit 2), a run that wrote no junit at all.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import json
|
||||
import xml.etree.ElementTree as ET
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _load(name):
|
||||
spec = importlib.util.spec_from_file_location(name + "_under_test", ROOT / "scripts" / (name + ".py"))
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
suite_run = _load("ci_suite_run")
|
||||
from invisible_core.testing import e2e as core_e2e # noqa: E402
|
||||
|
||||
ROW = "s.e2e.one"
|
||||
TESTS = ["tests/test_a_e2e.py", "tests/test_b_e2e.py::test_one", "tests/test_c_e2e.py"]
|
||||
|
||||
|
||||
def _required(tmp_path, **over):
|
||||
row = {"id": ROW, "giro": "G2", "os": ["linux"], "min_tests": 4, "exact": True, "tests": TESTS, "marker": "e2e", "needs_root": False}
|
||||
row.update(over)
|
||||
path = tmp_path / "required.json"
|
||||
path.write_text(json.dumps([row]), encoding="utf-8")
|
||||
return str(path)
|
||||
|
||||
|
||||
def _case(classname, name, outcome="passed", seconds="1.500"):
|
||||
case = ET.Element("testcase", {"classname": classname, "name": name, "time": seconds})
|
||||
if outcome != "passed":
|
||||
ET.SubElement(case, outcome, {"message": "x"})
|
||||
return case
|
||||
|
||||
|
||||
def _write(path, cases):
|
||||
suite = ET.Element("testsuite", {"name": "pytest", "errors": "0", "failures": "0", "skipped": "0", "tests": str(len(cases)), "time": "9.999"})
|
||||
suite.extend(cases)
|
||||
root = ET.Element("testsuites")
|
||||
root.append(suite)
|
||||
ET.ElementTree(root).write(path, encoding="utf-8", xml_declaration=True)
|
||||
|
||||
|
||||
def _fake_run(code, per_pass, seen):
|
||||
"""A stand-in for ``invisible_core.testing.e2e.main``: records its call and writes the junit of each pass where the core would."""
|
||||
def run(argv, repo):
|
||||
seen.append({"argv": list(argv), "repo": repo, "dir": suite_run.os.environ.get(core_e2e.JUNIT_DIR_ENV)})
|
||||
for (_width, selection), cases in zip(core_e2e.passes("4"), per_pass):
|
||||
if cases is not None:
|
||||
_write(core_e2e.junit_file(Path(seen[-1]["dir"]), selection), cases)
|
||||
return code
|
||||
return run
|
||||
|
||||
|
||||
def test_the_arguments_are_the_files_and_the_nodes_of_the_row_in_its_order(tmp_path):
|
||||
assert suite_run.row_arguments(_required(tmp_path), ROW, "linux") == TESTS
|
||||
|
||||
|
||||
def test_a_row_that_is_not_in_the_list_or_is_of_the_other_system_is_refused(tmp_path):
|
||||
required = _required(tmp_path)
|
||||
for suite, os_name in (("s.e2e.none", "linux"), (ROW, "windows")):
|
||||
with pytest.raises(suite_run.ci_verdict.Usage):
|
||||
suite_run.row_arguments(required, suite, os_name)
|
||||
assert suite_run.main(["--required", required, "--suite", "s.e2e.none", "--os", "linux", "--binary", "x", "--junit", str(tmp_path / "o.xml")]) == 2
|
||||
|
||||
|
||||
def test_the_two_junit_files_of_the_passes_become_one_xunit2_file_the_judge_reads(tmp_path):
|
||||
first, second, out = tmp_path / "a.xml", tmp_path / "b.xml", tmp_path / "out" / "merged.xml"
|
||||
_write(first, [_case("tests.test_a_e2e", "test_x"), _case("tests.test_b_e2e", "test_one[p1]", "failure"), _case("tests.test_c_e2e", "test_y", "skipped")])
|
||||
_write(second, [_case("tests.test_c_e2e", "test_clock", "error", "2.000")])
|
||||
assert suite_run.merge_junits([first, second], out) == 4
|
||||
root = ET.parse(out).getroot()
|
||||
suites = list(root.iter("testsuite"))
|
||||
assert len(suites) == 1 and suites[0].attrib["tests"] == "4"
|
||||
assert (suites[0].attrib["failures"], suites[0].attrib["errors"], suites[0].attrib["skipped"]) == ("1", "1", "1")
|
||||
assert suites[0].attrib["time"] == "6.500"
|
||||
cases, no_class = suite_run.ci_verdict.parse_junit(out)
|
||||
assert no_class == [] and [n for n, _o in cases] == ["tests/test_a_e2e.py::test_x", "tests/test_b_e2e.py::test_one[p1]", "tests/test_c_e2e.py::test_y",
|
||||
"tests/test_c_e2e.py::test_clock"]
|
||||
assert [o for _n, o in cases] == ["passed", "failed", "skipped", "errors"]
|
||||
|
||||
|
||||
def test_a_pass_that_wrote_nothing_is_not_an_error_of_the_merge_and_a_pass_with_no_test_adds_none(tmp_path):
|
||||
first, empty, out = tmp_path / "a.xml", tmp_path / "e.xml", tmp_path / "m.xml"
|
||||
_write(first, [_case("tests.test_a_e2e", "test_x")])
|
||||
_write(empty, [])
|
||||
assert suite_run.merge_junits([first, tmp_path / "never.xml", empty], out) == 1
|
||||
assert suite_run.merge_junits([tmp_path / "never.xml"], out) == 0
|
||||
assert ET.parse(out).getroot().find("testsuite").attrib["tests"] == "0"
|
||||
|
||||
|
||||
def test_the_counts_are_those_of_the_cases_and_not_of_the_headers(tmp_path):
|
||||
path, out = tmp_path / "a.xml", tmp_path / "m.xml"
|
||||
_write(path, [_case("tests.test_a_e2e", "test_x")])
|
||||
root = ET.parse(path).getroot()
|
||||
root.find("testsuite").attrib.update(tests="99", failures="7")
|
||||
ET.ElementTree(root).write(path)
|
||||
suite_run.merge_junits([path], out)
|
||||
attrs = ET.parse(out).getroot().find("testsuite").attrib
|
||||
assert (attrs["tests"], attrs["failures"]) == ("1", "0")
|
||||
|
||||
|
||||
def test_a_run_with_a_red_test_still_hands_the_junit_to_the_judge_and_exits_zero(tmp_path):
|
||||
seen, out = [], tmp_path / "result" / "s.xml"
|
||||
run = _fake_run(1, [[_case("tests.test_a_e2e", "test_x"), _case("tests.test_c_e2e", "test_z", "failure")], [_case("tests.test_c_e2e", "test_clock")]], seen)
|
||||
code = suite_run.run(_required(tmp_path), ROW, "linux", "/ff/firefox", str(out), repo=tmp_path, run_e2e=run)
|
||||
assert code == 0
|
||||
assert seen[0]["argv"] == ["/ff/firefox"] + TESTS and seen[0]["repo"] == tmp_path
|
||||
assert [o for _n, o in suite_run.ci_verdict.parse_junit(out)[0]] == ["passed", "failed", "passed"]
|
||||
|
||||
|
||||
def test_the_number_of_browsers_is_passed_to_the_run_only_when_asked(tmp_path):
|
||||
seen = []
|
||||
suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(tmp_path / "o.xml"), repo=tmp_path, procs="2", run_e2e=_fake_run(0, [[_case("tests.t", "a")], None], seen))
|
||||
assert seen[0]["argv"][:3] == ["ff", "-n", "2"] and seen[0]["argv"][3:] == TESTS
|
||||
|
||||
|
||||
def test_a_pass_that_did_not_run_to_its_end_is_not_zero(tmp_path):
|
||||
seen, out = [], tmp_path / "o.xml"
|
||||
code = suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(out), repo=tmp_path, run_e2e=_fake_run(2, [[_case("tests.t", "a")], None], seen))
|
||||
assert code == 2
|
||||
assert out.is_file(), "what the passes wrote is still handed to the judge, which says the suite is short"
|
||||
|
||||
|
||||
def test_a_run_that_wrote_no_junit_is_not_zero(tmp_path):
|
||||
out = tmp_path / "o.xml"
|
||||
assert suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(out), repo=tmp_path, run_e2e=_fake_run(0, [None, None], [])) == 3
|
||||
assert suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(out), repo=tmp_path, run_e2e=_fake_run(5, [None, None], [])) == 3
|
||||
|
||||
|
||||
def test_the_directory_of_the_junit_is_set_for_the_run_and_put_back_after_it(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv(core_e2e.JUNIT_DIR_ENV, raising=False)
|
||||
seen = []
|
||||
suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(tmp_path / "o.xml"), repo=tmp_path, run_e2e=_fake_run(0, [[_case("tests.t", "a")], None], seen))
|
||||
assert seen[0]["dir"] and core_e2e.JUNIT_DIR_ENV not in suite_run.os.environ
|
||||
monkeypatch.setenv(core_e2e.JUNIT_DIR_ENV, "somewhere")
|
||||
suite_run.run(_required(tmp_path), ROW, "linux", "ff", str(tmp_path / "o.xml"), repo=tmp_path, run_e2e=_fake_run(0, [[_case("tests.t", "a")], None], seen))
|
||||
assert suite_run.os.environ[core_e2e.JUNIT_DIR_ENV] == "somewhere"
|
||||
|
||||
|
||||
def test_the_passes_of_the_run_are_the_core_s_and_the_junit_names_are_its_own():
|
||||
names = [p.name for p in suite_run.pass_junits(Path("d"))]
|
||||
assert names == ["e2e-junit-e2e-and-not-wall_clock.xml", "e2e-junit-e2e-and-wall_clock.xml"], names
|
||||
assert [p.name for p in suite_run.pass_junits(Path("d"), "1")] == ["e2e-junit-e2e.xml"]
|
||||
@@ -256,6 +256,95 @@ def test_a_main_list_older_than_the_format_is_still_compared(tmp_path):
|
||||
assert _judge(tmp_path, GREEN, extra=["--main-required", str(main)])[0] == 0
|
||||
|
||||
|
||||
# --- retired files: the one way a test leaves a row -----------------------------------------------------------
|
||||
GONE = "tests/test_d.py"
|
||||
|
||||
|
||||
def _main_with(tmp_path, rows, retired=None):
|
||||
"""main's list in its own folder, and the retired list of main next to it."""
|
||||
folder = tmp_path / "main"
|
||||
folder.mkdir()
|
||||
required = _write_required(folder / "required.json", rows)
|
||||
if retired is not None:
|
||||
(folder / verdict.RETIRED_NAME).write_text(json.dumps(retired), encoding="utf-8")
|
||||
return required
|
||||
|
||||
|
||||
def _retired(file=GONE, n=1, row="s.one"):
|
||||
return {"file": file, "reason": "feature cancelled", "date": "2026-11-21", "tests": {row: n}}
|
||||
|
||||
|
||||
def _main_that_had_d(tmp_path, retired, min_tests=5):
|
||||
return _main_with(tmp_path, [_suite(min_tests=min_tests, tests=[FILE_A, FILE_B, NODE, GONE])], retired)
|
||||
|
||||
|
||||
def test_a_retired_file_that_is_gone_may_leave_its_row_with_its_tests_is_green(tmp_path, monkeypatch):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, [_retired()])
|
||||
assert _judge(tmp_path, GREEN, extra=["--main-required", str(main)])[0] == 0
|
||||
|
||||
|
||||
def test_a_file_that_main_did_not_retire_leaving_its_row_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, [_retired("tests/test_other.py")])
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and GONE in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_main_with_no_retired_list_excuses_nothing(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, None)
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and GONE in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_retired_file_that_is_still_on_disk_is_not_excused(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
(tmp_path / "tests").mkdir()
|
||||
(tmp_path / GONE).write_text("def test_d(): pass", encoding="utf-8")
|
||||
main = _main_that_had_d(tmp_path, [_retired()])
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
out = capsys.readouterr().out
|
||||
assert code == 1 and GONE in out and "went down" in out
|
||||
|
||||
|
||||
def test_a_minimum_that_went_down_by_more_than_the_retired_tests_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, [_retired(n=1)], min_tests=6) # the file had 1 test: 6 - 1 = 5, and the row says 4
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_the_tests_of_a_retired_file_are_counted_per_row(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, [_retired(row="s.another")]) # the file had its tests in another row: none here
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "went down" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_retired_list_of_the_branch_excuses_nothing(tmp_path, monkeypatch, capsys):
|
||||
"""The judge reads the retired list next to main's list: a branch that writes its own next to its own list gets nothing."""
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, None)
|
||||
(tmp_path / verdict.RETIRED_NAME).write_text(json.dumps([_retired()]), encoding="utf-8")
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and GONE in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_malformed_retired_list_of_main_is_red(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_that_had_d(tmp_path, [{"file": GONE}])
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "retired list of main" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_a_retired_file_does_not_excuse_another_loss_in_the_same_row(tmp_path, monkeypatch, capsys):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
main = _main_with(tmp_path, [_suite(min_tests=6, tests=[FILE_A, FILE_B, NODE, GONE, "tests/test_e.py"])], [_retired()])
|
||||
code, _r = _judge(tmp_path, GREEN, extra=["--main-required", str(main)])
|
||||
assert code == 1 and "tests/test_e.py" in capsys.readouterr().out
|
||||
|
||||
|
||||
# --- args --------------------------------------------------------------------------------------------------------
|
||||
def test_args_prints_the_files_and_node_ids_one_per_line(tmp_path, capsys):
|
||||
required = _write_required(tmp_path / "required.json", [_suite()])
|
||||
@@ -592,6 +681,33 @@ def test_the_real_list_has_unique_ids_and_sane_rows():
|
||||
assert isinstance(root, bool) or (isinstance(root, list) and set(root) <= set(r["os"])), r["id"]
|
||||
|
||||
|
||||
RETIRED = ROOT / "ci" / verdict.RETIRED_NAME
|
||||
|
||||
|
||||
def test_the_real_retired_list_is_well_formed_and_names_rows_that_exist():
|
||||
data = json.loads(RETIRED.read_text(encoding="utf-8"))
|
||||
assert verdict.validate_retired(data) == []
|
||||
ids = {r["id"] for r in _real()}
|
||||
for entry in data:
|
||||
assert set(entry["tests"]) <= ids, entry["file"]
|
||||
|
||||
|
||||
def test_the_tests_a_retired_file_had_are_what_the_collection_counts_while_it_exists():
|
||||
"""The number that lets a minimum go down is exact: for a retired file still in the tree (the one that retires it deletes it, and this
|
||||
asks nothing of a file that is gone) it is the number of tests the row's marker collects in it."""
|
||||
import subprocess
|
||||
import sys
|
||||
markers = {r["id"]: r["marker"] for r in _real()}
|
||||
for entry in json.loads(RETIRED.read_text(encoding="utf-8")):
|
||||
if not (ROOT / entry["file"]).is_file():
|
||||
continue
|
||||
for row, declared in entry["tests"].items():
|
||||
done = subprocess.run([sys.executable, "-m", "pytest", "--collect-only", "-q", "-p", "no:cacheprovider", "-o", "addopts=",
|
||||
"-m", markers[row], entry["file"]], cwd=str(ROOT), capture_output=True, text=True)
|
||||
counted = sum(1 for line in done.stdout.splitlines() if "::" in line)
|
||||
assert counted == declared, "%s in %s: declared %d, collected %d" % (entry["file"], row, declared, counted)
|
||||
|
||||
|
||||
WHOLE_SUITE_MARKER = "not slow and not e2e" # the exact expression of the unit job of tests.yml (pyproject addopts)
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"""The workflows that run the wrapper's tests launch with the intermediates list of ci/intermediates.json, so the core asks Mozilla for nothing.
|
||||
"""No workflow sets an intermediates list any more: the legs that did set the security state in its place.
|
||||
|
||||
Without STEALTHFOX_INTERMEDIATES the core downloads Mozilla's intermediates list on a cold cache (`invisible_playwright fetch` and the first launch) and checks
|
||||
it once a week. tests.yml and e2e.yml (its Linux run, its Windows parts and the Windows job of Control+A) set the variable (scripts/ci_lab_intermediates.py set) ONCE, before the step that
|
||||
runs pytest and, where the leg has one, before the step that fetches the engine (`fetch` makes the list present, so it would be the first to download).
|
||||
user-install.yml proves the installation a user gets and is left as it is.
|
||||
The step "The intermediates list (a fixed file of the repository)" of e2e.yml, fakeweb.yml and tests.yml became "The security state (a fixed
|
||||
directory of the repository)" (tests/test_ci_workflows_set_the_security_state.py says where and how). The file keeps its name because
|
||||
ci/required-suites.json only grows (scripts/ci_verdict.py, against main): its test now guards that no leg goes back to the old step.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
@@ -12,48 +11,11 @@ import pytest
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
WORKFLOWS = Path(__file__).resolve().parents[1] / ".github" / "workflows"
|
||||
SET = "python scripts/ci_lab_intermediates.py set --pin ci/intermediates.pin.json"
|
||||
FETCH = " - name: Fetch the published firefox binary\n"
|
||||
RUNS_PYTEST = {
|
||||
"tests.yml": " - name: Run pytest\n",
|
||||
"e2e.yml": " - name: Run the full e2e suite under a virtual display, without the root ones\n",
|
||||
"e2e.yml#windows": " - name: Run this part of the e2e\n",
|
||||
"e2e.yml#control-a": " - name: The keyboard shortcut selects all",
|
||||
"fakeweb.yml": " - name: Profile P2, stock first and ours second",
|
||||
}
|
||||
COMMAND = "python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json"
|
||||
|
||||
|
||||
def _scope(name):
|
||||
"""The text of one workflow, or of one leg of it: `e2e.yml` is its Linux job, `e2e.yml#windows` its Windows parts, `e2e.yml#control-a` the
|
||||
Windows job of the keyboard shortcut (it fetches and launches too)."""
|
||||
file, _, leg = name.partition("#")
|
||||
text = (WORKFLOWS / file).read_text(encoding="utf-8")
|
||||
if file != "e2e.yml":
|
||||
return text
|
||||
windows = text.index("\n e2e-windows:\n")
|
||||
if leg == "windows":
|
||||
return text[windows:]
|
||||
if leg == "control-a":
|
||||
start = text.index("\n e2e-windows-control-a:\n")
|
||||
return text[start:windows] if start < windows else text[start:]
|
||||
ends = [i for i in (text.find("\n e2e-windows-control-a:\n"), windows) if i >= 0]
|
||||
return text[:min(ends)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, pytest_step", sorted(RUNS_PYTEST.items()))
|
||||
def test_the_list_is_set_once_before_the_step_that_runs_the_tests(name, pytest_step):
|
||||
text = _scope(name)
|
||||
assert text.count(SET) == 1, "%s sets the intermediates list %d times" % (name, text.count(SET))
|
||||
assert pytest_step in text, "the step that runs the tests of %s moved: update this test with it" % name
|
||||
assert text.index(SET) < text.index(pytest_step), "%s sets the list after the tests started" % name
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["e2e.yml", "e2e.yml#windows", "e2e.yml#control-a", "fakeweb.yml"])
|
||||
def test_the_list_is_set_before_the_engine_is_fetched(name):
|
||||
text = _scope(name)
|
||||
assert FETCH in text, "the fetch step of %s moved: update this test with it" % name
|
||||
assert text.index(SET) < text.index(FETCH), "%s fetches before the list is set: `fetch` would download Mozilla's" % name
|
||||
|
||||
|
||||
def test_the_workflow_that_proves_the_installation_is_left_alone():
|
||||
assert SET not in (WORKFLOWS / "user-install.yml").read_text(encoding="utf-8")
|
||||
@pytest.mark.parametrize("name", ["e2e.yml", "fakeweb.yml", "tests.yml"])
|
||||
def test_the_leg_sets_the_security_state_and_no_intermediates_list(name):
|
||||
text = (WORKFLOWS / name).read_text(encoding="utf-8")
|
||||
assert "- name: The intermediates list" not in text, "%s still has the intermediates step" % name
|
||||
assert COMMAND in text, "%s does not set the security state" % name
|
||||
@@ -0,0 +1,60 @@
|
||||
"""The workflows that run the wrapper's tests launch with the ready security state of ci/security-state/, so the core asks Mozilla for nothing and runs no generation.
|
||||
|
||||
Without STEALTHFOX_SECURITY_STATE the core downloads Mozilla's security-state collections on a cold cache (`invisible_playwright fetch` and the first launch) and has the
|
||||
engine generate the state from them. tests.yml, fakeweb.yml and e2e.yml (its Linux run, its Windows parts and the Windows job of Control+A) set the variable
|
||||
(scripts/ci_lab_security_state.py set) ONCE, before the step that runs pytest and, where the leg has one, before the step that fetches the engine (`fetch` makes the state
|
||||
present, so it would be the first to download and generate).
|
||||
user-install.yml proves the installation a user gets and is left as it is.
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
WORKFLOWS = Path(__file__).resolve().parents[1] / ".github" / "workflows"
|
||||
SET = "python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json"
|
||||
FETCH = " - name: Fetch the published firefox binary\n"
|
||||
RUNS_PYTEST = {
|
||||
"tests.yml": " - name: Run pytest\n",
|
||||
"e2e.yml": " - name: Run the full e2e suite under a virtual display, without the root ones\n",
|
||||
"e2e.yml#windows": " - name: Run this part of the e2e\n",
|
||||
"e2e.yml#control-a": " - name: The keyboard shortcut selects all",
|
||||
"fakeweb.yml": " - name: Profile P2, stock first and ours second",
|
||||
}
|
||||
|
||||
|
||||
def _scope(name):
|
||||
"""The text of one workflow, or of one leg of it: `e2e.yml` is its Linux job, `e2e.yml#windows` its Windows parts, `e2e.yml#control-a` the
|
||||
Windows job of the keyboard shortcut (it fetches and launches too)."""
|
||||
file, _, leg = name.partition("#")
|
||||
text = (WORKFLOWS / file).read_text(encoding="utf-8")
|
||||
if file != "e2e.yml":
|
||||
return text
|
||||
windows = text.index("\n e2e-windows:\n")
|
||||
if leg == "windows":
|
||||
return text[windows:]
|
||||
if leg == "control-a":
|
||||
start = text.index("\n e2e-windows-control-a:\n")
|
||||
return text[start:windows] if start < windows else text[start:]
|
||||
ends = [i for i in (text.find("\n e2e-windows-control-a:\n"), windows) if i >= 0]
|
||||
return text[:min(ends)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, pytest_step", sorted(RUNS_PYTEST.items()))
|
||||
def test_the_security_state_is_set_once_before_the_step_that_runs_the_tests(name, pytest_step):
|
||||
text = _scope(name)
|
||||
assert text.count(SET) == 1, "%s sets the security state %d times" % (name, text.count(SET))
|
||||
assert pytest_step in text, "the step that runs the tests of %s moved: update this test with it" % name
|
||||
assert text.index(SET) < text.index(pytest_step), "%s sets the security state after the tests started" % name
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["e2e.yml", "e2e.yml#windows", "e2e.yml#control-a", "fakeweb.yml"])
|
||||
def test_the_security_state_is_set_before_the_engine_is_fetched(name):
|
||||
text = _scope(name)
|
||||
assert FETCH in text, "the fetch step of %s moved: update this test with it" % name
|
||||
assert text.index(SET) < text.index(FETCH), "%s fetches before the security state is set: `fetch` would download Mozilla's and generate" % name
|
||||
|
||||
|
||||
def test_the_workflow_that_proves_the_installation_is_left_alone():
|
||||
assert SET not in (WORKFLOWS / "user-install.yml").read_text(encoding="utf-8")
|
||||
+15
-13
@@ -8,9 +8,9 @@ from invisible_playwright import cli
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _fetch_does_not_download_the_intermediates(monkeypatch):
|
||||
"""`fetch` also looks for a newer intermediates list (`update_intermediates`), which reaches Mozilla: a test that is not about it does not."""
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", lambda *a, **k: (None, False), raising=False)
|
||||
def _fetch_does_not_download_the_security_state(monkeypatch):
|
||||
"""`fetch` also looks for a newer security state (`update_security_state`), which reaches Mozilla and runs the engine: a test that is not about it does not."""
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_security_state", lambda *a, **k: (None, False))
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@@ -105,27 +105,29 @@ def test_fetch_prints_the_path_as_its_last_line(tmp_path, monkeypatch, capsys):
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_fetch_looks_for_a_newer_intermediates_list_after_the_engine(tmp_path, monkeypatch, capsys):
|
||||
"""The known-bad is a `fetch` that only makes sure a list is cached (`ensure_intermediates`, no request on a warm cache): a user who runs `fetch` asking for
|
||||
what is current keeps a stale list. The engine is made present, then `update_intermediates` is called (and `ensure_intermediates` is not), in that
|
||||
order, and the path of the engine is still the last line."""
|
||||
def test_fetch_looks_for_a_newer_security_state_after_the_engine_and_for_that_engine(tmp_path, monkeypatch, capsys):
|
||||
"""The known-bad is a `fetch` that still calls the removed `update_intermediates` (or none at all): a user who runs `fetch` asking for what is current keeps a stale
|
||||
state, or the engine is never asked to generate one. The engine is made present, then `update_security_state` is called with THAT engine (and
|
||||
`update_intermediates` is not), in that order, and the path of the engine is still the last line."""
|
||||
fake = tmp_path / "firefox.exe"
|
||||
fake.write_text("x")
|
||||
calls = []
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_binary", lambda: calls.append("engine") or fake)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", lambda *a, **k: calls.append("update") or (None, False), raising=False)
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_intermediates", lambda *a, **k: calls.append("ensure"), raising=False)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_security_state", lambda *a, **k: calls.append(("update", a, k)) or (None, False))
|
||||
monkeypatch.setattr("invisible_core.update_security_state", lambda *a, **k: calls.append(("core", a, k)) or (None, False))
|
||||
monkeypatch.setattr("invisible_core.update_intermediates", lambda *a, **k: calls.append("intermediates"), raising=False)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", lambda *a, **k: calls.append("intermediates"), raising=False)
|
||||
monkeypatch.setattr("invisible_core.download.iter_cached_engines", lambda: [])
|
||||
|
||||
rc = cli.main(["fetch"])
|
||||
|
||||
assert rc == 0
|
||||
assert calls == ["engine", "update"]
|
||||
assert calls == ["engine", ("update", (), {"engine": fake})]
|
||||
assert capsys.readouterr().out.strip().splitlines()[-1] == str(fake)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_a_failing_intermediates_list_is_a_warning_and_changes_neither_the_exit_nor_the_last_line(tmp_path, monkeypatch, capsys):
|
||||
def test_a_failing_security_state_is_a_warning_and_changes_neither_the_exit_nor_the_last_line(tmp_path, monkeypatch, capsys):
|
||||
fake = tmp_path / "firefox.exe"
|
||||
fake.write_text("x")
|
||||
|
||||
@@ -133,14 +135,14 @@ def test_a_failing_intermediates_list_is_a_warning_and_changes_neither_the_exit_
|
||||
raise RuntimeError("no route to host")
|
||||
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_binary", lambda: fake)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", refuses)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_security_state", refuses)
|
||||
monkeypatch.setattr("invisible_core.download.iter_cached_engines", lambda: [])
|
||||
|
||||
rc = cli.main(["fetch"])
|
||||
|
||||
cap = capsys.readouterr()
|
||||
assert rc == 0
|
||||
assert "no route to host" in cap.err and "intermediates" in cap.err
|
||||
assert "no route to host" in cap.err and "security state" in cap.err
|
||||
assert cap.out.strip().splitlines()[-1] == str(fake)
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,11 @@ that could not see a held loop does not pass the test for nothing.
|
||||
|
||||
Nothing here is judged by how long it took (that is a verdict on the runner: a loop that a starved machine runs late is late without
|
||||
a defect). The loop is held when its thread was SEEN inside a step of the close that waits (`_close_loop_verdicts.blocked_by`), and the
|
||||
other browsers keep answering when, in the order of the events, a call of each began and ended while the close was in flight and
|
||||
while the removal of the closing browser's profile was held.
|
||||
other browsers keep answering when, in the order of the events, the loop read replies of them while the close was in flight (a reply
|
||||
that ARRIVED inside it counts, whenever its call began: a call that straddles the start of the close is a call the loop answered) and
|
||||
every one of them answered while the removal of the closing browser's profile was held. A browser that is silent inside the close
|
||||
while the others answer and the loop was never seen held is an engine the machine did not run (the printed spans say where it was):
|
||||
it is red only with a loop seen held, or with every browser silent (nothing shows that the loop ran).
|
||||
|
||||
THE REMOVAL OF THE PROFILE IS NOT THE CLOSE'S. `close()` returns once the browser has exited; the removal of its session's directories
|
||||
is handed to the launch's reaper (`invisible_core.process.Reaper.then`) and runs on the thread that ends the tree, or on the
|
||||
@@ -211,14 +214,22 @@ _CLIENT = textwrap.dedent("""
|
||||
|
||||
|
||||
async def pinger(page, record, closing, gate, records):
|
||||
# A call counts as answered DURING the close when it began after the close began and ended before it ended, and as answered
|
||||
# DURING THE REMOVAL when it began after the removal of the profile was reached and ended while it was still held: the order
|
||||
# of the events, not how long it took. The close has returned by then or not: the removal is the reaper's, not the close's.
|
||||
# A reply counts as ARRIVED DURING the close (`answered`) when the close was in flight at the moment the loop read it, whenever
|
||||
# its call began: that is what shows the loop ran then. `inside` counts the calls that began AND ended in the close (printed,
|
||||
# not judged); `spans` keeps (began, ended) of every call and `open_since` the call that is still waiting, to say WHERE a silent
|
||||
# browser was (its engine did not reply, or the loop did not read it). A call is answered DURING THE REMOVAL when it began after
|
||||
# the removal of the profile was reached and ended while it was still held. The order of the events, not how long it took. The
|
||||
# close has returned by then or not: the removal is the reaper's, not the close's.
|
||||
while not record["stop"]:
|
||||
while_closing = closing.is_set()
|
||||
started = time.monotonic()
|
||||
started = record["open_since"] = time.monotonic()
|
||||
await page.evaluate("1 + 1")
|
||||
took = time.monotonic() - started
|
||||
record["open_since"] = None
|
||||
ended = time.monotonic()
|
||||
took = ended - started
|
||||
record["spans"].append((started, ended))
|
||||
if closing.is_set():
|
||||
record["answered"] += 1
|
||||
if while_closing and closing.is_set():
|
||||
record["inside"] += 1
|
||||
record["slowest"] = max(record["slowest"], took) # printed, never judged
|
||||
@@ -322,7 +333,7 @@ _CLIENT = textwrap.dedent("""
|
||||
records = []
|
||||
tasks = []
|
||||
for page in pages[1:]:
|
||||
record = {"stop": False, "inside": 0, "during_removal": 0, "slowest": 0.0}
|
||||
record = {"stop": False, "answered": 0, "inside": 0, "during_removal": 0, "slowest": 0.0, "open_since": None, "spans": []}
|
||||
records.append(record)
|
||||
tasks.append(asyncio.create_task(pinger(page, record, closing, gate, records)))
|
||||
await asyncio.sleep(0.5)
|
||||
@@ -333,9 +344,12 @@ _CLIENT = textwrap.dedent("""
|
||||
closing.set()
|
||||
started = time.monotonic()
|
||||
await sessions[0].__aexit__(None, None, None)
|
||||
took = time.monotonic() - started
|
||||
returned = time.monotonic()
|
||||
took = returned - started
|
||||
with gate_lock:
|
||||
gate["order"].append("close_returned")
|
||||
# Where each other browser was when the close returned: the age of the call it was still waiting for, if any.
|
||||
open_for = [round(returned - r["open_since"], 3) if r["open_since"] is not None else 0.0 for r in records]
|
||||
closing.clear()
|
||||
await instrument.finish()
|
||||
report = instrument.report()
|
||||
@@ -360,7 +374,12 @@ _CLIENT = textwrap.dedent("""
|
||||
"took": took, "launched": launched,
|
||||
"control": control.report(),
|
||||
"unscheduled": unscheduled.report(),
|
||||
"others": [{"inside": r["inside"], "during_removal": r["during_removal"], "slowest": r["slowest"]} for r in records],
|
||||
"others": [{"answered": r["answered"], "inside": r["inside"], "during_removal": r["during_removal"],
|
||||
"slowest": r["slowest"], "open_for": open_for[i],
|
||||
# the calls that touched the close, as (began, ended) in seconds from the close's start; the first eight
|
||||
"spans": [[round(a - started, 3), round(b - started, 3)] for a, b in r["spans"]
|
||||
if b >= started and a <= returned][:8]}
|
||||
for i, r in enumerate(records)],
|
||||
"gate": {"reached": gate["since"] is not None, "released_by": gate["released_by"], "order": gate["order"],
|
||||
"removal": gate["removal"]},
|
||||
"ended": {"reaped": reaped, "profile_gone": gone},
|
||||
@@ -492,12 +511,18 @@ def test_no_blocking_step_of_the_close_runs_on_the_loop_s_thread(report):
|
||||
|
||||
|
||||
def test_the_other_three_keep_answering_during_the_close(report):
|
||||
"""Each of the other three browsers answers a call that began and ended while the first one closes, the removal of the first one's
|
||||
profile is held until every one of them has answered, and the three are alive after. The order of the events decides; the
|
||||
seconds a call took are printed."""
|
||||
problem = others_answered_problem(report["others"], report["gate"])
|
||||
assert problem is None, "%s\n(printed, not judged: the slowest call of each browser inside the close, in s: %s)" % (
|
||||
problem, [round(r["slowest"], 3) for r in report["others"]])
|
||||
"""The loop reads replies of the other three browsers while the first one closes (a reply that ARRIVED inside the close counts,
|
||||
whenever its call began), the removal of the first one's profile is held until every one of them has answered, and the three are
|
||||
alive after. A browser whose engine did not reply during the close while the others did, and the loop was never seen held, is a
|
||||
browser the machine did not run: it is the removal's hold that asks every one of them to answer afterwards. The order of the
|
||||
events decides; the seconds are printed."""
|
||||
problem = others_answered_problem(report["others"], report["gate"], report["inside"])
|
||||
assert problem is None, (
|
||||
"%s\n(printed, not judged: the close took %.0f ms; per browser: replies that arrived inside the close, calls that began and "
|
||||
"ended inside it, the slowest of those in s, the age in s of the call still waiting when the close returned, and the calls that "
|
||||
"touched the close as (began, ended) in s from its start: %s)" % (
|
||||
problem, report["took"] * 1000,
|
||||
[(r["answered"], r["inside"], round(r["slowest"], 3), r["open_for"], r["spans"]) for r in report["others"]]))
|
||||
assert report["texts"] == ["browser 1", "browser 2", "browser 3"]
|
||||
|
||||
|
||||
|
||||
@@ -163,3 +163,269 @@ def test_a_context_locale_reaches_navigator_intl_and_the_header(firefox_binary):
|
||||
ctx.close()
|
||||
finally:
|
||||
srv.shutdown()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
# What a worker, a worklet, a canvas and the page's own realm say of the language and the zone of their context.
|
||||
#
|
||||
# Characterisation of firefox-68 (the hooks of fingerprint/locale-time/{workers,language,timezone} in the engine series cite these
|
||||
# tests by name): each one is green on the published engine and has to stay green on the one that replaces its hooks. The language
|
||||
# and the zone are read where a page reads them (a worker's own `navigator` and `Intl`, a worklet's processor, a canvas's text
|
||||
# metrics, an inline script of the page). Where a context's value is compared with another value, the other is a control that can
|
||||
# fail: the context left on the launch language, or a context with a language of its own that the change must not reach.
|
||||
# ---------------------------------------------------------------------------------------------------------------------------------
|
||||
import _locale_probe as probe # noqa: E402
|
||||
|
||||
DE_LIST = ["de-DE", "de", "en-US", "en"]
|
||||
|
||||
#: One page for every tab the tests below open: the URL is what tells the tabs apart for the chrome scope, so each one carries a query.
|
||||
SITE = {
|
||||
"/page": probe.PAGE,
|
||||
"/lang-worker.js": (probe.LANG_WORKER, "text/javascript"),
|
||||
"/measure-worker.js": (probe.MEASURE_WORKER, "text/javascript"),
|
||||
}
|
||||
|
||||
|
||||
def _wait_for(condition, page):
|
||||
"""True once ``condition()`` holds, polled with the page's event loop as the pump; the deadline is the one of ``wait_until``."""
|
||||
from _waits import wait_until
|
||||
|
||||
return wait_until(condition, 30, lambda: page.wait_for_timeout(100))
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_worker_with_its_own_language_ignores_the_accept_languages_pref(firefox_binary, monkeypatch):
|
||||
"""⛔ ``intl.accept_languages`` IS THE LANGUAGE OF A BROWSER THAT DECLARED NONE. When the pref changes Firefox tells every worker, and
|
||||
a worker that has no language of its own takes the new list. A worker whose context declares a language reads that list from its
|
||||
owner and has to ignore the broadcast (WorkerPrivate::UpdateLanguagesInternal): a site cannot see two languages move apart in
|
||||
one browser because a pref moved. The engine's own refusal is what is pinned here.
|
||||
|
||||
One session with nothing declared at launch (``juggler.locale.override`` empty: no language falls back to the session) and two
|
||||
contexts: one asks for de-DE, the other for nothing (``locale=None``). The pref goes to "ja, en-US" from the chrome scope. The worker
|
||||
of the context with nothing declared takes it (the control: the broadcast reaches workers, so the other worker's silence is
|
||||
its own); the worker with de-DE keeps de-DE and its four entries. The two contexts are in different content processes, so the change of
|
||||
the other worker proves nothing about the process of the silent one: before the silent worker is read, the test waits on the
|
||||
CONDITION "the content process of each of the two tabs reports ``intl.accept_languages`` = "ja, en-US"" (a process script reads the pref
|
||||
in each process). A process that reports it has applied the change and queued the broadcast to its workers before it answered, so the
|
||||
answer of the worker with de-DE comes after the broadcast was handled in its own process.
|
||||
"""
|
||||
import webfont_probe
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope write below
|
||||
srv, base = probe.serve(SITE)
|
||||
marionette = None
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="it-IT", timezone="Europe/Rome",
|
||||
extra_args=probe.MARIONETTE_ARGS,
|
||||
extra_prefs={"marionette.port": 0, "juggler.locale.override": ""}) as browser:
|
||||
own = browser.new_context(locale="de-DE").new_page()
|
||||
none = browser.new_context(locale=None).new_page()
|
||||
for name, page in (("own", own), ("none", none)):
|
||||
page.goto("%s/page?%s" % (base, name), wait_until="load", timeout=30_000)
|
||||
page.evaluate(probe.START_LANG_WORKER_JS)
|
||||
kept = {"languages": DE_LIST, "intl": "de-DE"}
|
||||
assert own.evaluate(probe.ASK_LANG_WORKER_JS) == kept, "the worker with its own language before the pref moves"
|
||||
before = none.evaluate(probe.ASK_LANG_WORKER_JS)["languages"]
|
||||
assert before != ["ja", "en-US"], "the control worker already speaks the list the pref is about to take: %r" % (before,)
|
||||
|
||||
marionette = probe.open_chrome(webfont_probe.marionette_active_port())
|
||||
assert probe.set_pref(marionette, "intl.accept_languages", "ja, en-US") == "ja, en-US"
|
||||
|
||||
# The barrier: the content process of EACH tab holds the new value (read in that process), so the worker with de-DE is read after its
|
||||
# own process handled the change.
|
||||
processes = []
|
||||
|
||||
def every_process_has_it():
|
||||
processes.append(probe.content_process_prefs(marionette, "intl.accept_languages", ("own", "none")))
|
||||
return processes[-1].get("prefs") == {"own": "ja, en-US", "none": "ja, en-US"}
|
||||
|
||||
assert _wait_for(every_process_has_it, none), (
|
||||
"a content process never reported the new intl.accept_languages (last answers: %r)" % (processes[-3:],))
|
||||
|
||||
seen = []
|
||||
|
||||
def follows():
|
||||
seen.append(none.evaluate(probe.ASK_LANG_WORKER_JS)["languages"])
|
||||
return seen[-1] == ["ja", "en-US"]
|
||||
|
||||
assert _wait_for(follows, none), (
|
||||
"the worker with no language of its own never took the pref (it answered %r): the broadcast does not reach workers, "
|
||||
"so the silence of the other worker proves nothing" % (seen[-3:],))
|
||||
assert own.evaluate(probe.ASK_LANG_WORKER_JS) == kept, (
|
||||
"the worker with its own language followed intl.accept_languages instead of its context")
|
||||
finally:
|
||||
if marionette is not None:
|
||||
marionette.close()
|
||||
probe.stop(srv)
|
||||
|
||||
|
||||
SW_ZONE = b"""
|
||||
const read = () => ({timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
january: new Date(Date.UTC(2024, 0, 15, 12)).getTimezoneOffset()});
|
||||
onmessage = (e) => e.source.postMessage(read());
|
||||
"""
|
||||
|
||||
SW_JS = """async () => {
|
||||
const reg = await navigator.serviceWorker.register('/sw-zone.js');
|
||||
const sw = reg.active || reg.waiting || reg.installing;
|
||||
return await new Promise((ok) => {
|
||||
navigator.serviceWorker.onmessage = (e) => ok(e.data);
|
||||
const send = () => sw.postMessage(0);
|
||||
if (sw.state === 'activated') send();
|
||||
else sw.addEventListener('statechange', () => sw.state === 'activated' && send());
|
||||
});
|
||||
}"""
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_service_worker_of_a_context_with_its_own_zone_has_it(firefox_binary):
|
||||
"""⛔ A SERVICE WORKER IS BORN FAR FROM ITS PAGE. It has no window; the engine hands it the language and the zone of its context in
|
||||
the data it is started with (ServiceWorkerPrivate::RefreshRemoteWorkerData), and a worker that missed them told a site the
|
||||
SESSION's zone while the page in the same context told another: the one clock of a context, read twice. A context asks for its own
|
||||
zone with ``timezone_id``; the service worker it registers reads it back in ``Intl`` and in the offset of a date.
|
||||
|
||||
An Europe/Rome session, a context with ``timezone_id="Asia/Tokyo"``: its service worker answers Asia/Tokyo and -540 (no daylight
|
||||
time, one answer all year). The control is the session's own context: its service worker answers Europe/Rome and -60 in January.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
srv, base = probe.serve(dict(SITE, **{"/sw-zone.js": (SW_ZONE, "text/javascript")}))
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="it-IT",
|
||||
timezone="Europe/Rome") as browser:
|
||||
answers = {}
|
||||
for name, options in (("session", {}), ("tokyo", {"timezone_id": "Asia/Tokyo"})):
|
||||
page = browser.new_context(**options).new_page()
|
||||
page.goto("%s/page?%s" % (base, name), wait_until="load", timeout=30_000)
|
||||
answers[name] = page.evaluate(SW_JS)
|
||||
assert answers["tokyo"] == {"timeZone": "Asia/Tokyo", "january": -540}, "the service worker of the Asia/Tokyo context"
|
||||
assert answers["session"] == {"timeZone": "Europe/Rome", "january": -60}, (
|
||||
"the service worker of the context that asked for no zone (the session's)")
|
||||
finally:
|
||||
probe.stop(srv)
|
||||
|
||||
|
||||
WORKLET = b"""
|
||||
class Probe extends AudioWorkletProcessor {
|
||||
constructor() {
|
||||
super();
|
||||
const options = Intl.DateTimeFormat().resolvedOptions();
|
||||
this.port.postMessage({locale: options.locale, timeZone: options.timeZone,
|
||||
january: new Date(Date.UTC(2024, 0, 15, 12)).getTimezoneOffset()});
|
||||
}
|
||||
process() { return false; }
|
||||
}
|
||||
registerProcessor('probe', Probe);
|
||||
"""
|
||||
|
||||
# An OfflineAudioContext: a worklet needs no sound device, and the processor is built when its node is.
|
||||
WORKLET_JS = """async () => {
|
||||
const ctx = new OfflineAudioContext(1, 128, 44100);
|
||||
await ctx.audioWorklet.addModule('/worklet.js');
|
||||
const node = new AudioWorkletNode(ctx, 'probe');
|
||||
const heard = new Promise((ok) => { node.port.onmessage = (e) => ok(e.data); });
|
||||
node.connect(ctx.destination);
|
||||
ctx.startRendering();
|
||||
return await heard;
|
||||
}"""
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_an_audio_worklet_of_a_context_speaks_its_language_and_zone(firefox_binary):
|
||||
"""⛔ A WORKLET IS A GLOBAL OF ITS OWN AND ASKS ITS OWN QUESTIONS. An AudioWorkletProcessor runs on the audio thread in a realm that is
|
||||
not the page's and not a worker's (WorkletGlobalScope::CreateRealmOptions); a realm built from the process's sources told a site that
|
||||
reads ``Intl`` in a processor the host's language and zone. The engine reads the language and the zone from the window that added the
|
||||
module (WorkletLoadInfo) and gives them to the realm it builds.
|
||||
|
||||
An it-IT, Europe/Rome session; a context with ``locale="de-DE"`` and ``timezone_id="Asia/Tokyo"``; the processor posts what its own
|
||||
``Intl`` says. The context's worklet answers de-DE, Asia/Tokyo and -540 for a January date. The control is the context that asked
|
||||
for neither: its worklet answers it-IT, Europe/Rome and -60. The two answers differ in each field.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
srv, base = probe.serve(dict(SITE, **{"/worklet.js": (WORKLET, "text/javascript")}))
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="it-IT",
|
||||
timezone="Europe/Rome") as browser:
|
||||
answers = {}
|
||||
for name, options in (("session", {}), ("own", {"locale": "de-DE", "timezone_id": "Asia/Tokyo"})):
|
||||
page = browser.new_context(**options).new_page()
|
||||
page.goto("%s/page?%s" % (base, name), wait_until="load", timeout=30_000)
|
||||
answers[name] = page.evaluate(WORKLET_JS)
|
||||
assert answers["own"] == {"locale": "de-DE", "timeZone": "Asia/Tokyo", "january": -540}, (
|
||||
"the worklet of the de-DE, Asia/Tokyo context")
|
||||
assert answers["session"] == {"locale": "it-IT", "timeZone": "Europe/Rome", "january": -60}, (
|
||||
"the worklet of the context that asked for neither (the session's)")
|
||||
assert all(answers["own"][key] != answers["session"][key] for key in answers["own"]), answers
|
||||
finally:
|
||||
probe.stop(srv)
|
||||
|
||||
|
||||
def _canvas_widths(page):
|
||||
return page.evaluate(probe.MEASURE_PAGE_JS, ["ja", "en"])
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_text_without_lang_takes_the_language_group_of_the_session_language(firefox_binary):
|
||||
"""⛔ TEXT WITH NO ``lang`` TAKES THE LANGUAGE OF THE MACHINE, AND THE MACHINE IS THE SESSION. An OffscreenCanvas on the main thread has
|
||||
no element and no document: its font comes from nsLanguageAtomService::GetLocaleLanguage, which asked the host's regional settings
|
||||
and now asks the language the session declares. Two sessions launched with two languages measure the same strings differently, each
|
||||
as the canvas of its own language group.
|
||||
|
||||
A ja-JP launch and an en-US launch (one browser at a time). In each, a main-thread OffscreenCanvas with no ``lang`` measures as the
|
||||
canvas element with the session's language and not as the one with the other language, and as a worker of the session's own context
|
||||
(another reader of the same language). The control is the pair of sessions: their OffscreenCanvases do not measure alike.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
srv, base = probe.serve(SITE)
|
||||
try:
|
||||
read = {}
|
||||
for name, locale, zone in (("ja", "ja-JP", "Asia/Tokyo"), ("en", "en-US", "America/New_York")):
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale=locale, timezone=zone) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
page.goto("%s/page?%s" % (base, name), wait_until="load", timeout=30_000)
|
||||
read[name] = _canvas_widths(page)
|
||||
for name, other in (("ja", "en"), ("en", "ja")):
|
||||
got = read[name]
|
||||
assert got["element"]["ja"] != got["element"]["en"], (
|
||||
"the two language groups draw these strings alike here, so nothing can tell them apart: %r" % (got["element"],))
|
||||
assert got["offscreen"] == got["element"][name], (
|
||||
"the %s session's OffscreenCanvas measures %r, a canvas of the %s group %r" % (name, got["offscreen"], name, got["element"][name]))
|
||||
assert got["offscreen"] != got["element"][other], "the %s session's OffscreenCanvas measures as the %s group" % (name, other)
|
||||
assert got["offscreen"] == got["worker"], "the %s session: the main thread and a worker of the session's context disagree" % name
|
||||
assert read["ja"]["offscreen"] != read["en"]["offscreen"], "the two sessions' OffscreenCanvases measure alike"
|
||||
finally:
|
||||
probe.stop(srv)
|
||||
|
||||
|
||||
INTL_JS = "const o = Intl.DateTimeFormat().resolvedOptions(); return {locale: o.locale, timeZone: o.timeZone};"
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_intl_in_the_page_realm_follows_the_language_and_zone_of_its_context(firefox_binary):
|
||||
"""The page's own global is built from the language and the zone of its context (xpc::InitGlobalObjectOptions, fed by
|
||||
nsGlobalWindowOuter::CreateNativeGlobalForInner), and that realm is the one a site's inline script runs in. It is read here the way a
|
||||
site reads it: an INLINE script writes ``Intl.DateTimeFormat().resolvedOptions()`` into the DOM (``page.evaluate`` is not necessarily
|
||||
that realm on this engine, so a read through it would say nothing about it).
|
||||
|
||||
An it-IT, Europe/Rome launch: the default context's page realm says it-IT and Europe/Rome. A context with ``locale="de-DE"`` and
|
||||
``timezone_id="Asia/Tokyo"``: de-DE and Asia/Tokyo. The control is the pair: the two contexts' answers differ in both fields.
|
||||
"""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
srv, base = probe.serve(SITE)
|
||||
try:
|
||||
with InvisiblePlaywright(seed=5150, binary_path=firefox_binary, headless=True, locale="it-IT",
|
||||
timezone="Europe/Rome") as browser:
|
||||
read = {}
|
||||
for name, options in (("session", {}), ("own", {"locale": "de-DE", "timezone_id": "Asia/Tokyo"})):
|
||||
page = browser.new_context(**options).new_page()
|
||||
page.goto("%s/page?%s" % (base, name), wait_until="load", timeout=30_000)
|
||||
read[name] = probe.read_in_page_realm(page, INTL_JS)
|
||||
assert read["session"] == {"locale": "it-IT", "timeZone": "Europe/Rome"}, "the page realm of the default context"
|
||||
assert read["own"] == {"locale": "de-DE", "timeZone": "Asia/Tokyo"}, "the page realm of the de-DE, Asia/Tokyo context"
|
||||
assert all(read["own"][key] != read["session"][key] for key in read["own"]), read
|
||||
finally:
|
||||
probe.stop(srv)
|
||||
@@ -1,88 +0,0 @@
|
||||
"""CSS calc() functions give Windows' text on every OS.
|
||||
|
||||
The style engine evaluates ``calc(1px * sin(x))``, ``asin``, ``pow``, ``log``
|
||||
and the others in f32 with the C library's f32 functions (sinf, asinf, powf,
|
||||
logf...), and writes the number with 6 significant digits. Windows Firefox gets
|
||||
them from ucrtbase.dll; Linux Firefox got glibc's, whose last f32 bit differs
|
||||
for some inputs - and for some of those the difference moves the 6th digit,
|
||||
which is what a page reads with getComputedStyle.
|
||||
|
||||
tests/data/ucrt_css_calc.txt holds, per function, inputs where ucrtbase.dll and
|
||||
glibc write a different text (and a few where they agree), with the text
|
||||
ucrtbase.dll gives; scripts/ucrt_css_calc.py makes it. A function with no
|
||||
differing input in the searched grid (tan, atan, atan2, exp: 0 of 65,000 to
|
||||
90,000 each; hypot is a sum and a square root, exact) is in the file with
|
||||
control inputs only, so it checks that the page computes at all.
|
||||
|
||||
A number is read with ``word-spacing`` (px) and an angle with ``rotate``
|
||||
(deg): both are computed values that getComputedStyle writes as the style
|
||||
engine serialized them, with no layout in between.
|
||||
|
||||
Every mismatch is listed in the failure, not just the first.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
DATA = Path(__file__).parent / "data" / "ucrt_css_calc.txt"
|
||||
ANGLE_FUNCTIONS = ("asin", "acos", "atan", "atan2")
|
||||
|
||||
READ = """
|
||||
(cases) => cases.map(([prop, value]) => {
|
||||
const el = document.createElement("div");
|
||||
el.style.setProperty(prop, value);
|
||||
document.body.appendChild(el);
|
||||
const got = getComputedStyle(el).getPropertyValue(prop);
|
||||
el.remove();
|
||||
return got;
|
||||
})
|
||||
"""
|
||||
|
||||
|
||||
def _cases():
|
||||
out = []
|
||||
for line in DATA.read_text().splitlines():
|
||||
if line and not line.startswith("#"):
|
||||
parts = line.split()
|
||||
out.append((parts[0], parts[1:-1], parts[-1]))
|
||||
return out
|
||||
|
||||
|
||||
def _css(fn, args):
|
||||
"""(property, value) that makes the style engine compute fn(args)."""
|
||||
call = "%s(%s)" % (fn, ", ".join(args))
|
||||
if fn in ANGLE_FUNCTIONS:
|
||||
return "rotate", call
|
||||
return "word-spacing", "calc(1px * %s)" % call
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_the_data_has_every_function_and_the_inputs_that_tell_the_libraries_apart():
|
||||
cases = _cases()
|
||||
assert {c[0] for c in cases} == {
|
||||
"sin", "cos", "tan", "asin", "acos", "atan", "atan2", "exp", "log", "pow", "hypot"}
|
||||
# The cases that make this test about the library and not only the engine.
|
||||
for fn in ("sin", "cos", "asin", "acos", "log", "pow"):
|
||||
assert sum(1 for c in cases if c[0] == fn) >= 4, fn
|
||||
# sin(-12.2958984375): ucrtbase 0.267186, glibc 0.267187.
|
||||
assert ("sin", ["-12.2958984375"], "0.267186px") in cases
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_css_calc_functions_are_ucrtbase_bytes(firefox_binary, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
cases = _cases()
|
||||
with InvisiblePlaywright(seed=6021, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank")
|
||||
got = page.evaluate(READ, [list(_css(fn, args)) for fn, args, _ in cases])
|
||||
|
||||
wrong = ["%s(%s): page %r, ucrtbase %r" % (fn, ", ".join(args), g, want)
|
||||
for (fn, args, want), g in zip(cases, got) if g != want]
|
||||
assert not wrong, ("%d of %d calc() results are not ucrtbase's:\n %s"
|
||||
% (len(wrong), len(cases), "\n ".join(wrong)))
|
||||
@@ -0,0 +1,136 @@
|
||||
"""The size and pointer media queries answer the declaration, not the host.
|
||||
|
||||
What it fixes, from the page's side (`matchMedia`):
|
||||
|
||||
* `(device-width: Wpx)` / `(device-height: Hpx)` are the declared screen (`zoom.stealth.screen.width/height`), not the
|
||||
host's monitor.
|
||||
* `(pointer: ...)` / `(any-pointer: ...)` / `(hover: ...)` are the declared pointer capabilities
|
||||
(`zoom.stealth.pointer.primary` / `.all`, the bitmask Coarse 1, Fine 2, Hover 4), not the host's (a Windows machine
|
||||
with a digitizer adds Coarse by itself).
|
||||
* A context made with `has_touch=True` (Juggler's touch override) still reads a COARSE pointer when a fine one is
|
||||
declared: the override of the context decides before the declaration does.
|
||||
|
||||
Engine hook: `fingerprint/screen-window/css-media` of the engine series (`layout/style/nsMediaFeatures.cpp`:
|
||||
`GetDeviceSize`, `GetPointerCapabilities`; the declarations in `StealthMediaFeatures.h`).
|
||||
|
||||
Negative controls, in the same test: the device size is read on a launch declared with ANOTHER screen (2623x1411): the
|
||||
wrapper hands the declared screen to the browser by two roads (the screen prefs and the screen of the context, which Juggler
|
||||
emulates), so a launch with the prefs at 0 still reads the pinned screen; the queries must follow each declaration. The
|
||||
pointer is read with the engine off (`hw_seed` 0, stock Firefox: an active engine refuses a declaration cleared with -1), the
|
||||
host's answer; and has_touch is read in a context without it, on the same launch.
|
||||
|
||||
Linux and Windows run the same assertions: the declared values are the ones no runner has (a 2731x1537 screen; a coarse
|
||||
primary pointer on a machine with a mouse).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
#: A screen no runner has.
|
||||
SCREEN = {"screen.width": 2731, "screen.height": 1537, "screen.dpr": 1.0}
|
||||
|
||||
#: Another screen no runner has: the control of the device size is a launch declared with this one.
|
||||
OTHER_SCREEN = {"screen.width": 2623, "screen.height": 1411, "screen.dpr": 1.0}
|
||||
|
||||
#: The engine off (stock Firefox): the control of the pointer. The engine refuses an active launch with a declaration cleared.
|
||||
ENGINE_OFF = {"zoom.stealth.fpp.hw_seed": 0}
|
||||
|
||||
COARSE, FINE, HOVER = 1, 2, 4
|
||||
|
||||
QUERIES = {name: "matchMedia('%s').matches" % query for name, query in {
|
||||
"pointer_coarse": "(pointer: coarse)", "pointer_fine": "(pointer: fine)",
|
||||
"any_coarse": "(any-pointer: coarse)", "any_fine": "(any-pointer: fine)",
|
||||
"hover_none": "(hover: none)", "any_hover_none": "(any-hover: none)"}.items()}
|
||||
|
||||
READ_POINTER = "() => ({%s})" % ", ".join("%s: %s" % (k, v) for k, v in QUERIES.items())
|
||||
|
||||
|
||||
def _launch(binary, pin=None, extra_prefs=None):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
return InvisiblePlaywright(seed=42, pin=pin, binary_path=binary, headless=True, humanize=False,
|
||||
extra_prefs=extra_prefs)
|
||||
|
||||
|
||||
def _read_pointer(binary, primary=None, every=None):
|
||||
"""Declared pointer prefs, or (both None) the engine off."""
|
||||
prefs = ENGINE_OFF if primary is None else {"zoom.stealth.pointer.primary": primary, "zoom.stealth.pointer.all": every}
|
||||
with _launch(binary, extra_prefs=prefs) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank", timeout=30000)
|
||||
return page.evaluate(READ_POINTER)
|
||||
|
||||
|
||||
def test_a_declared_pointer_is_what_the_media_queries_read(firefox_binary):
|
||||
declared = _read_pointer(firefox_binary, COARSE, COARSE)
|
||||
assert declared == {"pointer_coarse": True, "pointer_fine": False, "any_coarse": True, "any_fine": False,
|
||||
"hover_none": True, "any_hover_none": True}, (
|
||||
"a coarse pointer without hover is declared and the page reads %r" % declared)
|
||||
|
||||
# The control: the engine off is not that machine. A fine pointer with hover is the declaration of a desktop; the host
|
||||
# with no declaration answers its own, and it is not a coarse one without hover.
|
||||
undeclared = _read_pointer(firefox_binary)
|
||||
assert undeclared != declared, "with no pointer declared the page reads the same as with a coarse one: %r" % undeclared
|
||||
assert undeclared["pointer_coarse"] is False and undeclared["any_coarse"] is False, (
|
||||
"with no pointer declared the page reads %r" % undeclared)
|
||||
|
||||
fine = _read_pointer(firefox_binary, FINE | HOVER, FINE | HOVER)
|
||||
assert fine == {"pointer_coarse": False, "pointer_fine": True, "any_coarse": False, "any_fine": True,
|
||||
"hover_none": False, "any_hover_none": False}, (
|
||||
"a fine pointer with hover is declared and the page reads %r" % fine)
|
||||
|
||||
|
||||
def test_has_touch_reads_a_coarse_pointer_even_when_a_fine_one_is_declared(firefox_binary):
|
||||
with _launch(firefox_binary, extra_prefs={"zoom.stealth.pointer.primary": FINE | HOVER,
|
||||
"zoom.stealth.pointer.all": FINE | HOVER}) as browser:
|
||||
plain = browser.new_context().new_page()
|
||||
plain.goto("about:blank", timeout=30000)
|
||||
touch = browser.new_context(has_touch=True).new_page()
|
||||
touch.goto("about:blank", timeout=30000)
|
||||
without = plain.evaluate(READ_POINTER)
|
||||
with_touch = touch.evaluate(READ_POINTER)
|
||||
# the control: the same launch, a context without the override, reads the declared fine pointer
|
||||
assert without["pointer_fine"] is True and without["pointer_coarse"] is False, (
|
||||
"a context without has_touch reads %r under a declared fine pointer" % without)
|
||||
assert with_touch["pointer_coarse"] is True and with_touch["pointer_fine"] is False, (
|
||||
"a context with has_touch reads %r under a declared fine pointer: the touch override must win" % with_touch)
|
||||
assert with_touch["any_coarse"] is True, "any-pointer in a has_touch context reads %r" % with_touch
|
||||
|
||||
|
||||
def _read_device_size(binary, pin, ask):
|
||||
"""The page of a launch pinned to ``pin``, asked for the device size ``ask`` (width, height) and for its own."""
|
||||
with _launch(binary, pin=pin) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank", timeout=30000)
|
||||
return page.evaluate("""([w, h]) => ({
|
||||
screen_w: screen.width, screen_h: screen.height,
|
||||
device_width: matchMedia('(device-width: ' + w + 'px)').matches,
|
||||
device_height: matchMedia('(device-height: ' + h + 'px)').matches,
|
||||
own_width: matchMedia('(device-width: ' + screen.width + 'px)').matches,
|
||||
own_height: matchMedia('(device-height: ' + screen.height + 'px)').matches})""", list(ask))
|
||||
|
||||
|
||||
def test_the_device_size_media_queries_read_the_declared_screen(firefox_binary):
|
||||
first = (SCREEN["screen.width"], SCREEN["screen.height"])
|
||||
second = (OTHER_SCREEN["screen.width"], OTHER_SCREEN["screen.height"])
|
||||
|
||||
declared = _read_device_size(firefox_binary, SCREEN, first)
|
||||
assert declared["device_width"] is True and declared["device_height"] is True, (
|
||||
"(device-width: 2731px) and (device-height: 1537px) do not match under a declared 2731x1537 screen: %r" % declared)
|
||||
assert (declared["screen_w"], declared["screen_h"]) == first
|
||||
assert declared["own_width"] is True and declared["own_height"] is True, (
|
||||
"the device size the media queries read is not the screen the page reads: %r" % declared)
|
||||
|
||||
# The control: the wrapper hands the declared screen to the browser by two roads (the prefs, and the screen of the context
|
||||
# that Juggler emulates), so the absent declaration is not a control. A launch with ANOTHER declared screen is: the same
|
||||
# query for the first size does not match there, and the queries follow that declaration.
|
||||
other = _read_device_size(firefox_binary, OTHER_SCREEN, first)
|
||||
assert (other["screen_w"], other["screen_h"]) == second, other
|
||||
assert other["device_width"] is False and other["device_height"] is False, (
|
||||
"(device-width: 2731px) matches under a declared %dx%d screen: the media queries do not follow the declaration, %r"
|
||||
% (second + (other,)))
|
||||
assert other["own_width"] is True and other["own_height"] is True, (
|
||||
"the device size the media queries read is not the screen the page reads: %r" % other)
|
||||
assert second != first and other != declared
|
||||
@@ -0,0 +1,107 @@
|
||||
"""Iterating a DOM iterable from `page.evaluate` works, one case per iterable.
|
||||
|
||||
Upstream Playwright evaluates in the page's main world, so `[...x]` of any
|
||||
iterable works there. Our wrapper evaluates in the caller's world (Xrays), and
|
||||
on retail-like Windows `page.evaluate("async () => [...(await
|
||||
navigator.gpu.requestAdapter()).features]")` failed with "Xray wrapping of
|
||||
iterators not supported". This file holds the iterables that do work: one
|
||||
test per case, each spreading an iterable inside `evaluate` and returning plain
|
||||
values, so a case that fails names the iterable that does and the error text.
|
||||
|
||||
A page reads these iterables with its own scripts (every site does
|
||||
`[...new URLSearchParams(location.search)]` or `[...document.querySelectorAll(..)]`)
|
||||
and a framework or a test harness does the same from `evaluate`, so a call that
|
||||
throws where stock Playwright answers is a product difference.
|
||||
|
||||
Cases: URLSearchParams, FormData (empty and with a field), Headers, `document.fonts`,
|
||||
`querySelectorAll`, and a Map created by the PAGE's own script: all green on firefox-68
|
||||
(run 44979351495, Linux and Windows), so this file characterizes them. The WebGPU
|
||||
`adapter.features` Set-like is NOT here: on firefox-68 spreading it from `evaluate` throws
|
||||
"Xray wrapping of iterators not supported" on both systems; its red proof is kept on the
|
||||
branch tests/dom-iterables-from-evaluate.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import http.server
|
||||
import threading
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
PAGE = b"""<!doctype html><html><head><meta charset="utf-8"><title>iterables</title></head>
|
||||
<body><p>one</p><p>two</p>
|
||||
<script>window.m = new Map([["x", 1]]);</script></body></html>"""
|
||||
|
||||
|
||||
# id -> (expression run by page.evaluate, check on its answer, what is expected)
|
||||
CASES = {
|
||||
"url-search-params": (
|
||||
'() => [...new URLSearchParams("a=1")]',
|
||||
lambda v: v == [["a", "1"]], '[["a", "1"]]'),
|
||||
"form-data-empty": (
|
||||
"() => [...new FormData()]",
|
||||
lambda v: v == [], "[]"),
|
||||
"form-data-with-a-field": (
|
||||
'() => { const f = new FormData(); f.append("k", "v"); return [...f]; }',
|
||||
lambda v: v == [["k", "v"]], '[["k", "v"]]'),
|
||||
"headers": (
|
||||
'() => [...new Headers({a: "1"})]',
|
||||
lambda v: v == [["a", "1"]], '[["a", "1"]]'),
|
||||
"document-fonts": (
|
||||
"() => { const a = [...document.fonts]; return [Array.isArray(a), a.length >= 0]; }",
|
||||
lambda v: v == [True, True], "[true, true]"),
|
||||
"query-selector-all": (
|
||||
'() => [...document.querySelectorAll("*")].length',
|
||||
lambda v: isinstance(v, int) and v > 0, "a length > 0"),
|
||||
"a-map-made-by-the-page": (
|
||||
"() => [...window.m]",
|
||||
lambda v: v == [["x", 1]], '[["x", 1]]'),
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def site():
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/html; charset=utf-8")
|
||||
self.send_header("Content-Length", str(len(PAGE)))
|
||||
self.end_headers()
|
||||
self.wfile.write(PAGE)
|
||||
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
from _servers import LocalServer
|
||||
|
||||
srv = LocalServer(("127.0.0.1", 0), H)
|
||||
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
||||
yield f"http://127.0.0.1:{srv.server_address[1]}/"
|
||||
srv.shutdown()
|
||||
srv.server_close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def browser(firefox_binary):
|
||||
# One browser per case: a crash in one case reddens that case only, not the ones after it.
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4321, binary_path=firefox_binary,
|
||||
headless=True) as b:
|
||||
yield b
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", list(CASES), ids=list(CASES))
|
||||
def test_iterating_from_evaluate_works(browser, site, case):
|
||||
expression, ok, expected = CASES[case]
|
||||
page = browser.new_page()
|
||||
try:
|
||||
page.goto(site, wait_until="domcontentloaded")
|
||||
try:
|
||||
answer = page.evaluate(expression)
|
||||
except Exception as exc: # noqa: BLE001 - the error text of any kind is the finding
|
||||
pytest.fail(f"{case}: evaluate threw {type(exc).__name__}: {exc}")
|
||||
assert ok(answer), f"{case}: evaluate answered {answer!r}, expected {expected}"
|
||||
finally:
|
||||
page.close()
|
||||
@@ -11,23 +11,82 @@ reports completion from OnSaveComplete and Cancel. Reported 2026-10-30 on the
|
||||
|
||||
Known-bad input: the engine before the fix -> every test here goes red
|
||||
(expect_download times out).
|
||||
|
||||
**The end of a download, and what is left to Firefox.** Two more tests hold the
|
||||
other half of the hook (`StealthDownloadIntercept`, folder `automation/downloads`
|
||||
of the engine series, hooks in `uriloader/exthandler/nsExternalHelperAppService.cpp`):
|
||||
|
||||
* a download the client cancels (`download.cancel()`) reports its end ONCE, as
|
||||
`canceled`: `Cancel` and `OnSaveComplete` both end in the interceptor's
|
||||
`onDownloadComplete`, and a second `Browser.downloadFinished` for the same
|
||||
uuid would be a second report of one download. Counted on the engine's own
|
||||
events (the connection's listener), not on the client's objects: the client
|
||||
ignores a repeated finish.
|
||||
* a context that has NO download options is not intercepted: the engine sends
|
||||
no `Browser.downloadCreated` and no `Browser.downloadFinished`, and the file
|
||||
goes where Firefox puts it (`browser.download.dir`). The same context, with
|
||||
its options, is the control: its download is announced and saved in the
|
||||
wrapper's directory, so the silence of the second download is the absence of
|
||||
the hook and not a page that never downloaded.
|
||||
|
||||
**A slow save is kept, not judged.** Firefox's own save of the last test has taken, on the runners, from about ten seconds to
|
||||
more than eighty for the same bytes: that is the product (a user's download would wait as long), so nothing of it is switched
|
||||
off. The seconds from the click to the file are recorded (a junit property), and a run slower than any healthy one
|
||||
(``SLOW_SAVE_S``, judged after the fact, never a verdict) keeps what says where the time went, in
|
||||
``$RUNNER_TEMP/invpw-evidence/download-left-to-firefox/`` (``tests/_evidence_on_failure.py``, the same on a failure): the requests
|
||||
the test's server saw, with times; every request the client heard (request, response, requestfinished, requestfailed), with
|
||||
times; the Juggler wire and the engine's Juggler trace; the engine's log of the download machinery (``DOWNLOAD_LOG``).
|
||||
|
||||
Why a page cares: a download that ends twice, or that lands in the wrong place,
|
||||
is a script that waits for a file that never comes, and a context that was given
|
||||
no options must behave as retail Firefox does.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import http.server
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import types
|
||||
|
||||
import pytest
|
||||
|
||||
from _evidence_on_failure import FailureEvidence
|
||||
from _waits import wait_until, watch
|
||||
|
||||
BODY = b"invisible download body\n" * 64
|
||||
|
||||
#: Seconds from the click to the file in Firefox's directory beyond which a run keeps its evidence: no healthy run comes near
|
||||
#: it. Judged after the fact, never a verdict (the test's deadline is the `watch` below).
|
||||
SLOW_SAVE_S = 40.0
|
||||
|
||||
#: The engine's log of the download machinery, kept in the evidence: the external helper (`nsExternalHelperAppService.cpp`,
|
||||
#: `HelperAppService`), the URI loader that hands it the response (`URILoader`), the reputation check of a finished download
|
||||
#: (`ApplicationReputation`) and the url-classifier it asks (`UrlClassifierDbService`, `UrlClassifierStreamUpdater`).
|
||||
DOWNLOAD_LOG = ("HelperAppService:5,URILoader:5,ApplicationReputation:5,UrlClassifierDbService:5,UrlClassifierStreamUpdater:5,"
|
||||
"timestamp,sync")
|
||||
|
||||
|
||||
def _note(state, **fields):
|
||||
"""One line of a record, on the clocks of the evidence (`t` wall, `m` perf_counter)."""
|
||||
with state.lock:
|
||||
state.records.append({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), **fields})
|
||||
|
||||
|
||||
def _serve(record=None):
|
||||
"""The site of the quick download. `record` (``.lock``, ``.records``), when given, gets every request the server saw and the
|
||||
end of every answer it wrote, with times."""
|
||||
def note(handler, what, **more):
|
||||
if record is not None:
|
||||
_note(record, what=what, method=handler.command, path=handler.path, peer=handler.client_address[1],
|
||||
agent=handler.headers.get("User-Agent"), **more)
|
||||
|
||||
def _serve():
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
note(self, "request")
|
||||
if self.path.startswith("/file"):
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "application/octet-stream")
|
||||
@@ -35,11 +94,13 @@ def _serve():
|
||||
self.send_header("content-length", str(len(BODY)))
|
||||
self.end_headers()
|
||||
self.wfile.write(BODY)
|
||||
note(self, "answered", bytes=len(BODY))
|
||||
return
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "text/html")
|
||||
self.end_headers()
|
||||
self.wfile.write(b'<title>d</title><a id=dl href="/file">get</a>')
|
||||
note(self, "answered")
|
||||
|
||||
srv = http.server.ThreadingHTTPServer(("127.0.0.1", 0), H)
|
||||
srv.daemon_threads = True
|
||||
@@ -56,6 +117,17 @@ def served():
|
||||
srv.shutdown()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def served_and_recorded():
|
||||
"""The same site, and its record of every request (``.lock``, ``.records``), for the evidence of a slow run."""
|
||||
record = types.SimpleNamespace(lock=threading.Lock(), records=[])
|
||||
srv, url = _serve(record)
|
||||
try:
|
||||
yield url, record
|
||||
finally:
|
||||
srv.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_clicked_download_is_reported_and_saved(firefox_binary, served, tmp_path):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
@@ -86,3 +158,219 @@ def test_a_navigation_that_ends_in_a_download_is_reported(firefox_binary, served
|
||||
# not hang until the timeout.
|
||||
assert "download" in str(nav.value).lower(), str(nav.value)
|
||||
assert info.value.suggested_filename == "report.bin"
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------
|
||||
# The end of a download, and the context that has no download options
|
||||
# --------------------------------------------------------------------------------------------------------------------
|
||||
#: What the held answer promises: far more than the first chunk, so the transfer cannot end by itself.
|
||||
HELD_LENGTH = 64 * 1024 * 1024
|
||||
|
||||
#: The longest the held answer waits for the test to let it go (only so that a failed test leaves no thread behind).
|
||||
HELD_GIVES_UP_AFTER = 120
|
||||
|
||||
|
||||
def _serve_held():
|
||||
"""A site with `/file` (a quick attachment) and `/slow` (an attachment whose answer stops after its first chunk
|
||||
and goes on only when `release` is set): the held transfer is what a `cancel()` interrupts, with no clock."""
|
||||
release = threading.Event()
|
||||
|
||||
class H(http.server.BaseHTTPRequestHandler):
|
||||
def log_message(self, *a):
|
||||
pass
|
||||
|
||||
def do_GET(self):
|
||||
try:
|
||||
if self.path.startswith("/file"):
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "application/octet-stream")
|
||||
self.send_header("content-disposition", 'attachment; filename="report.bin"')
|
||||
self.send_header("content-length", str(len(BODY)))
|
||||
self.end_headers()
|
||||
self.wfile.write(BODY)
|
||||
elif self.path.startswith("/slow"):
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "application/octet-stream")
|
||||
self.send_header("content-disposition", 'attachment; filename="held.bin"')
|
||||
self.send_header("content-length", str(HELD_LENGTH))
|
||||
self.end_headers()
|
||||
self.wfile.write(b"x" * 65536)
|
||||
self.wfile.flush()
|
||||
release.wait(HELD_GIVES_UP_AFTER)
|
||||
else:
|
||||
self.send_response(200)
|
||||
self.send_header("content-type", "text/html")
|
||||
self.end_headers()
|
||||
self.wfile.write(b'<title>d</title><a id=dl href="/file">get</a>'
|
||||
b'<a id=slow href="/slow">slow</a>')
|
||||
except OSError:
|
||||
pass # the browser dropped the connection: that is the cancel
|
||||
|
||||
srv = http.server.ThreadingHTTPServer(("127.0.0.1", 0), H)
|
||||
srv.daemon_threads = True
|
||||
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
||||
return srv, "http://127.0.0.1:%d/" % srv.server_address[1], release
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def held_site():
|
||||
srv, url, release = _serve_held()
|
||||
try:
|
||||
yield url
|
||||
finally:
|
||||
release.set()
|
||||
srv.shutdown()
|
||||
|
||||
|
||||
def _engine_side(context):
|
||||
"""The browser dispatcher (with the engine connection, `.conn`) and the context dispatcher of the in-process server
|
||||
that answers this context.
|
||||
|
||||
The server runs IN THIS PROCESS (as `test_injected_node_surface.py` uses it), so the test can listen to the
|
||||
engine's own events and send the one command the client API never sends: `Browser.setDownloadOptions` with no
|
||||
options, which is a context that was never given any."""
|
||||
impl = context._impl_obj
|
||||
server = impl._connection._transport._server
|
||||
dispatcher = server.object(impl._guid)
|
||||
return dispatcher.browser, dispatcher
|
||||
|
||||
|
||||
def _record(conn):
|
||||
"""Every `Browser.downloadCreated` and `Browser.downloadFinished` the engine sends, as `(method, params)`."""
|
||||
events = []
|
||||
|
||||
def listener(method, params, session):
|
||||
if method in ("Browser.downloadCreated", "Browser.downloadFinished"):
|
||||
events.append((method, dict(params or {})))
|
||||
|
||||
conn.add_listener(listener)
|
||||
return events
|
||||
|
||||
|
||||
def _of(events, method, uuid=None):
|
||||
return [p for m, p in events if m == method and (uuid is None or p.get("uuid") == uuid)]
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_canceled_download_reports_once_as_canceled(firefox_binary, held_site):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=4242, binary_path=firefox_binary, headless=True) as browser:
|
||||
context = browser.new_context(accept_downloads=True)
|
||||
page = context.new_page()
|
||||
engine, _context = _engine_side(context)
|
||||
events = _record(engine.conn)
|
||||
page.goto(held_site, timeout=30_000)
|
||||
|
||||
with page.expect_download(timeout=30_000) as info:
|
||||
page.click("#slow")
|
||||
held = info.value
|
||||
assert held.suggested_filename == "held.bin"
|
||||
held.cancel()
|
||||
assert held.failure() == "canceled"
|
||||
|
||||
# The engine announced this download once, and it must say its end once. A later duplicate of the same end
|
||||
# would follow the first one on the same stream, so a second download, run to its end, is the barrier: the
|
||||
# events are read in order, and when the second download has finished anything the first had left to say has
|
||||
# been said.
|
||||
created = _of(events, "Browser.downloadCreated")
|
||||
assert len(created) == 1, created
|
||||
held_uuid = created[0]["uuid"]
|
||||
|
||||
with page.expect_download(timeout=30_000) as info:
|
||||
page.click("#dl")
|
||||
quick = info.value
|
||||
assert quick.failure() is None
|
||||
quick_uuid = _of(events, "Browser.downloadCreated")[1]["uuid"]
|
||||
assert wait_until(lambda: _of(events, "Browser.downloadFinished", quick_uuid), 60,
|
||||
pump=lambda: page.wait_for_timeout(100)), events
|
||||
|
||||
ended = _of(events, "Browser.downloadFinished", held_uuid)
|
||||
assert len(ended) == 1, "the canceled download reported its end %d times: %r" % (len(ended), events)
|
||||
assert ended[0].get("canceled") is True, ended
|
||||
assert not ended[0].get("error"), ended
|
||||
# and the quick one, after it, ends clean: a cancel does not leave the interceptor in a state of its own
|
||||
assert len(_of(events, "Browser.downloadFinished", quick_uuid)) == 1, events
|
||||
assert not _of(events, "Browser.downloadFinished", quick_uuid)[0].get("canceled"), events
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_context_without_download_options_is_left_to_firefox(firefox_binary, served_and_recorded, tmp_path, record_property):
|
||||
"""The negative control of the interception: the same context, the same link, the same file.
|
||||
|
||||
With its options the download is taken (announced, saved in the wrapper's directory). After
|
||||
`Browser.setDownloadOptions` with no options the engine does not take it: no `downloadCreated`, no
|
||||
`downloadFinished`, no `download` event of the client, and the file is where Firefox's own preference says."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
served, record = served_and_recorded
|
||||
where = tmp_path / "firefox"
|
||||
where.mkdir()
|
||||
prefs = {"browser.download.folderList": 2,
|
||||
"browser.download.dir": str(where),
|
||||
"browser.download.useDownloadDir": True}
|
||||
with FailureEvidence("download-left-to-firefox") as evidence:
|
||||
evidence.note_records("server-record", record)
|
||||
client = types.SimpleNamespace(lock=threading.Lock(), records=[])
|
||||
evidence.client_log = client.records
|
||||
evidence.arm(moz_log=DOWNLOAD_LOG)
|
||||
with InvisiblePlaywright(seed=4242, binary_path=firefox_binary, headless=True,
|
||||
extra_prefs=prefs) as browser:
|
||||
context = browser.new_context(accept_downloads=True)
|
||||
page = context.new_page()
|
||||
# what the client heard of every request, with times (it only listens)
|
||||
page.on("request", lambda r: _note(client, what="request", url=r.url, navigation=r.is_navigation_request()))
|
||||
page.on("response", lambda r: _note(client, what="response", url=r.url, status=r.status))
|
||||
page.on("requestfinished", lambda r: _note(client, what="requestfinished", url=r.url))
|
||||
page.on("requestfailed", lambda r: _note(client, what="requestfailed", url=r.url, failure=str(r.failure)))
|
||||
engine, ctx = _engine_side(context)
|
||||
events = _record(engine.conn)
|
||||
announced = []
|
||||
|
||||
def on_download(download):
|
||||
announced.append(download)
|
||||
_note(client, what="download", url=download.url)
|
||||
|
||||
page.on("download", on_download)
|
||||
page.goto(served, timeout=30_000)
|
||||
|
||||
# the control: with its options the download is taken
|
||||
with page.expect_download(timeout=30_000) as info:
|
||||
page.click("#dl")
|
||||
info.value.path()
|
||||
assert wait_until(lambda: _of(events, "Browser.downloadFinished"), 60,
|
||||
pump=lambda: page.wait_for_timeout(100)), events
|
||||
assert len(_of(events, "Browser.downloadCreated")) == 1, events
|
||||
assert len(_of(events, "Browser.downloadFinished")) == 1, events
|
||||
downloads_dir = engine._downloads_dir(ctx.context_id)
|
||||
saved_by_the_wrapper = sorted(os.listdir(downloads_dir))
|
||||
assert len(saved_by_the_wrapper) == 1, saved_by_the_wrapper
|
||||
assert os.listdir(str(where)) == [], "the taken download landed in Firefox's directory"
|
||||
|
||||
# the context loses its download options: Firefox's own path takes the download
|
||||
engine.conn.send("Browser.setDownloadOptions",
|
||||
{"browserContextId": ctx.context_id, "downloadOptions": None}, timeout=None)
|
||||
# The click on a download Firefox keeps plans a navigation that never completes (nothing commits: the response is a download),
|
||||
# so the click does not wait for it; the end of the test waits on the CONDITION, the file in Firefox's directory.
|
||||
_note(client, what="click", target="#dl", download_options=None)
|
||||
clicked = time.perf_counter()
|
||||
page.click("#dl", no_wait_after=True, timeout=30_000)
|
||||
landed = where / "report.bin"
|
||||
landing = watch(lambda: landed.exists() and landed.read_bytes() == BODY, bool, 120,
|
||||
pump=lambda: page.wait_for_timeout(100))
|
||||
seconds_to_the_file = time.perf_counter() - clicked
|
||||
_note(client, what="file-landed" if landing.ok else "file-not-landed", history=landing.history)
|
||||
# not a verdict: how long Firefox's own save took, from the click to the file
|
||||
record_property("seconds_until_the_file_landed", "%.1f" % seconds_to_the_file)
|
||||
assert landing.ok, os.listdir(str(where))
|
||||
|
||||
assert len(_of(events, "Browser.downloadCreated")) == 1, "the engine took a download of a context with no options"
|
||||
assert len(_of(events, "Browser.downloadFinished")) == 1, events
|
||||
assert len(announced) == 1, announced
|
||||
assert sorted(os.listdir(downloads_dir)) == saved_by_the_wrapper, "the wrapper's directory got a second file"
|
||||
# The browser is closed, so its log and its trace are whole. A save slower than any healthy run is kept to be read, not judged.
|
||||
slow = seconds_to_the_file > SLOW_SAVE_S
|
||||
record_property("evidence_kept_for_a_slow_save", str(slow))
|
||||
if slow:
|
||||
evidence.keep("Firefox's own save took %.1f s from the click to the file (more than %.0f s)"
|
||||
% (seconds_to_the_file, SLOW_SAVE_S))
|
||||
@@ -0,0 +1,180 @@
|
||||
"""Every road by which a page reads a WebGL canvas gives it the same bytes: the element, an OffscreenCanvas, the placeholder of
|
||||
``transferControlToOffscreen`` (e2e, every OS; written on firefox-68, which the engine of the series must keep).
|
||||
|
||||
The engine applies its canvas noise (``gfx::StealthProjectPixels``, a pure function of the seed and of what the canvas holds) when a page
|
||||
reads a WebGL or WebGPU canvas, and does not touch a 2D canvas, as on retail. Until firefox-50 the noise was bolted onto five read methods
|
||||
and every other road read the real pixels: a page saw it by reading the canvas twice. The hooks that keep it one function are the page snapshot of
|
||||
``HTMLCanvasElement`` (``GetSurfaceSnapshot``, whose Mozilla body is the as-drawn reader), the snapshot of ``OffscreenCanvas``, and the snapshot of
|
||||
the display helper behind a transferred placeholder (``fingerprint/canvas/noise-projection``: dom/html/HTMLCanvasElement.cpp,
|
||||
dom/canvas/OffscreenCanvas.cpp, dom/canvas/OffscreenCanvasDisplayHelper.cpp). A page reads each of these roads with its own API and compares
|
||||
the answers.
|
||||
|
||||
Three properties, each with its control IN THE SAME TEST (the canvas noise declared off, ``zoom.stealth.canvas.substitute_pixels`` false, every
|
||||
other declaration the same: a second launch of the same page):
|
||||
|
||||
* ``test_every_reader_of_a_webgl_canvas_element_reads_the_same_bytes``: ``readPixels``, ``drawImage``, ``createImageBitmap``, the PNG of
|
||||
``toDataURL`` and of ``toBlob`` read the same bytes, which are not the bytes of the un-noised canvas (the noise is there) and differ from them
|
||||
only in the low bit of R, G and B. A 2D canvas drawn with the same triangles, translucent fills and a shadow reads as drawn through every reader,
|
||||
noised or not: its bytes are equal in the two launches.
|
||||
* ``test_an_offscreen_webgl_canvas_reads_as_its_element_does``: an ``OffscreenCanvas`` on the page's thread and one in a worker, each with a WebGL
|
||||
context, read through every reader (``drawImage`` onto a 2D canvas, ``createImageBitmap``, ``convertToBlob``, ``transferToImageBitmap``,
|
||||
``readPixels``) the bytes the element of the same scene reads.
|
||||
* ``test_a_transferred_placeholder_reads_noised_like_its_worker``: the worker draws WebGL on the offscreen canvas it was given by
|
||||
``transferControlToOffscreen``; the page reads the placeholder element (``drawImage``, ``createImageBitmap``) once the frame reached it, and reads
|
||||
what the worker reads from its own canvas.
|
||||
|
||||
The scene and the readers are in ``tests/_canvas_readers.py``. The noise seed (12345) is one no runner has, so a passing run is not the host's.
|
||||
The page ends its readers on events (a promise, a message of the worker, a frame of the page); the one wait that polls (the frame reaching the
|
||||
placeholder) ends on the placeholder holding the frame, and the deadline is the test's, not a measure of speed.
|
||||
|
||||
Kept apart from other canvas modules: each test launches two short-lived browsers one after the other (the sync API does not nest).
|
||||
Run: pytest tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py -m e2e -v
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
import _canvas_readers as cr
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
PAGE_JS = r"""
|
||||
async function theElement() {
|
||||
const g = document.createElement('canvas'); g.width = W; g.height = H;
|
||||
const gl = drawGL(g);
|
||||
const c = document.createElement('canvas'); c.width = W; c.height = H;
|
||||
const x = c.getContext('2d'); draw2D(x);
|
||||
return {webgl: await readersOf(g, () => readGL(gl), makeElement, false),
|
||||
flat2d: await readersOf(c, () => readCtx(x), makeElement, false)};
|
||||
}
|
||||
|
||||
const WORKER_OFFSCREEN = `
|
||||
onmessage = async () => {
|
||||
try {
|
||||
const c = new OffscreenCanvas(W, H); const gl = drawGL(c);
|
||||
postMessage({readers: await readersOf(c, () => readGL(gl), makeOffscreen, true)});
|
||||
} catch (e) { postMessage({err: String((e && e.stack) || e)}); }
|
||||
};`;
|
||||
|
||||
async function theOffscreens() {
|
||||
const g = document.createElement('canvas'); g.width = W; g.height = H;
|
||||
const gl = drawGL(g);
|
||||
const element = await readersOf(g, () => readGL(gl), makeElement, false);
|
||||
const o = new OffscreenCanvas(W, H);
|
||||
const ogl = drawGL(o);
|
||||
const main = await readersOf(o, () => readGL(ogl), makeOffscreen, true);
|
||||
const w = new Worker(URL.createObjectURL(new Blob([WORKER_LIB + WORKER_OFFSCREEN])));
|
||||
const worker = await new Promise((ok, bad) => {
|
||||
w.onmessage = e => (e.data.err ? bad(new Error(e.data.err)) : ok(e.data.readers));
|
||||
w.onerror = e => bad(new Error('worker: ' + e.message));
|
||||
w.postMessage(0);
|
||||
});
|
||||
w.terminate();
|
||||
return {element, main, worker};
|
||||
}
|
||||
|
||||
const WORKER_PLACEHOLDER = `
|
||||
onmessage = async (e) => {
|
||||
try {
|
||||
const c = e.data.canvas; const gl = drawGL(c);
|
||||
postMessage({readers: await readersOf(c, () => readGL(gl), makeOffscreen, false)});
|
||||
} catch (err) { postMessage({err: String((err && err.stack) || err)}); }
|
||||
};`;
|
||||
|
||||
async function thePlaceholder() {
|
||||
const el = document.createElement('canvas'); el.width = W; el.height = H;
|
||||
document.body.appendChild(el);
|
||||
const off = el.transferControlToOffscreen();
|
||||
const w = new Worker(URL.createObjectURL(new Blob([WORKER_LIB + WORKER_PLACEHOLDER])));
|
||||
const worker = await new Promise((ok, bad) => {
|
||||
w.onmessage = e => (e.data.err ? bad(new Error(e.data.err)) : ok(e.data.readers));
|
||||
w.onerror = e => bad(new Error('worker: ' + e.message));
|
||||
w.postMessage({canvas: off}, [off]);
|
||||
});
|
||||
// the frame the worker drew reaches the placeholder after the worker's task: the page waits on what it can read (the alpha of
|
||||
// the middle pixel, 255 in the whole scene, 0 before the frame), one frame of the page at a time
|
||||
const seen = () => pixelsOf(makeElement, x => x.drawImage(el, 0, 0));
|
||||
const middle = ((H / 2) * W + W / 2) * 4 + 3;
|
||||
while (seen()[middle] !== 255) await new Promise(r => requestAnimationFrame(r));
|
||||
const placeholder = {drawImage: b64(seen())};
|
||||
const bm = await createImageBitmap(el);
|
||||
placeholder.createImageBitmap = b64(pixelsOf(makeElement, x => x.drawImage(bm, 0, 0)));
|
||||
bm.close();
|
||||
w.terminate();
|
||||
return {placeholder, worker};
|
||||
}
|
||||
"""
|
||||
|
||||
HTML = cr.page_html(PAGE_JS)
|
||||
|
||||
|
||||
def _read(firefox_binary, noised, call):
|
||||
with cr.launched(firefox_binary, HTML, noised=noised) as page:
|
||||
return cr.run(page, call)
|
||||
|
||||
|
||||
def _the_noise_is_a_change_of_low_bits(what, noised, plain):
|
||||
"""The control: the noise is there (the reads differ), and it is only the low bit of R, G and B."""
|
||||
n = cr.differing_pixels(noised, plain)
|
||||
assert n > 0, (
|
||||
"%s: the canvas read with the noise declared on is byte for byte the canvas read with it declared off: no pixel of the scene was "
|
||||
"touched, so this test would pass on an engine that applies no noise at all" % what)
|
||||
beyond = cr.only_the_low_bit_of_rgb(noised, plain)
|
||||
assert not beyond, (
|
||||
"%s: %d pixels of the noised read differ from the plain one by more than the low bit of R, G and B (first: %r); the noise writes "
|
||||
"nothing else" % (what, len(beyond), beyond[:5]))
|
||||
return n
|
||||
|
||||
|
||||
@pytest.mark.timeout(300, method="thread")
|
||||
def test_every_reader_of_a_webgl_canvas_element_reads_the_same_bytes(firefox_binary):
|
||||
on = _read(firefox_binary, True, "theElement()")
|
||||
off = _read(firefox_binary, False, "theElement()")
|
||||
webgl_on, webgl_off = cr.decode(on["webgl"]), cr.decode(off["webgl"])
|
||||
flat_on, flat_off = cr.decode(on["flat2d"]), cr.decode(off["flat2d"])
|
||||
|
||||
cr.assert_agree("WebGL element, noise on", webgl_on)
|
||||
cr.assert_agree("WebGL element, noise declared off", webgl_off)
|
||||
_the_noise_is_a_change_of_low_bits("WebGL element", webgl_on["direct"], webgl_off["direct"])
|
||||
|
||||
# the control of the other side: a 2D canvas is not noised by any reader, with the engine on or off
|
||||
assert cr.distinct_colours(flat_off["direct"]) > 100, (
|
||||
"the 2D scene holds %d colours: too flat to be a canvas the noise would touch" % cr.distinct_colours(flat_off["direct"]))
|
||||
cr.assert_agree("2D canvas, noise on", flat_on)
|
||||
cr.assert_agree("2D canvas, noise declared off", flat_off)
|
||||
assert flat_on["direct"] == flat_off["direct"], (
|
||||
"the 2D canvas reads differently with the canvas noise on and off (%d pixels): a 2D canvas reads as drawn, as on retail"
|
||||
% cr.differing_pixels(flat_on["direct"], flat_off["direct"]))
|
||||
|
||||
|
||||
@pytest.mark.timeout(300, method="thread")
|
||||
def test_an_offscreen_webgl_canvas_reads_as_its_element_does(firefox_binary):
|
||||
on = _read(firefox_binary, True, "theOffscreens()")
|
||||
off = _read(firefox_binary, False, "theOffscreens()")
|
||||
|
||||
def every(group):
|
||||
merged = {}
|
||||
for place in ("element", "main", "worker"):
|
||||
merged.update(cr.decode(group[place], place + "/"))
|
||||
return merged
|
||||
|
||||
webgl_on, webgl_off = every(on), every(off)
|
||||
cr.assert_agree("an element, an OffscreenCanvas and an OffscreenCanvas in a worker, noise on", webgl_on, "element/direct")
|
||||
cr.assert_agree("an element, an OffscreenCanvas and an OffscreenCanvas in a worker, noise declared off", webgl_off, "element/direct")
|
||||
_the_noise_is_a_change_of_low_bits("OffscreenCanvas", webgl_on["worker/direct"], webgl_off["worker/direct"])
|
||||
|
||||
|
||||
@pytest.mark.timeout(300, method="thread")
|
||||
def test_a_transferred_placeholder_reads_noised_like_its_worker(firefox_binary):
|
||||
on = _read(firefox_binary, True, "thePlaceholder()")
|
||||
off = _read(firefox_binary, False, "thePlaceholder()")
|
||||
|
||||
def every(group):
|
||||
merged = cr.decode(group["worker"], "worker/")
|
||||
merged.update(cr.decode(group["placeholder"], "placeholder/"))
|
||||
return merged
|
||||
|
||||
webgl_on, webgl_off = every(on), every(off)
|
||||
cr.assert_agree("the placeholder and its worker, noise on", webgl_on, "worker/direct")
|
||||
cr.assert_agree("the placeholder and its worker, noise declared off", webgl_off, "worker/direct")
|
||||
_the_noise_is_a_change_of_low_bits("the placeholder", webgl_on["placeholder/drawImage"], webgl_off["placeholder/drawImage"])
|
||||
@@ -15,6 +15,7 @@ import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
from _evidence_on_failure import FailureEvidence
|
||||
from _waits import wait_until
|
||||
from fakeweb import profile_p2, sites
|
||||
|
||||
@@ -117,39 +118,52 @@ def test_the_other_origin_of_the_fake_web_is_another_site_in_another_process(fir
|
||||
LOADERS = 3
|
||||
|
||||
|
||||
def test_the_page_that_leaves_with_beacons_reaches_networkidle_every_time_under_a_load_of_other_browsers(firefox_binary):
|
||||
def test_the_page_that_leaves_with_beacons_reaches_networkidle_every_time_under_a_load_of_other_browsers(firefox_binary, engine_reaches):
|
||||
"""MANDATORY CASE. `leaving_beacons_subframe` sends beacons from a frame of another site while it is sent to about:blank. With the
|
||||
context route holding them and other browsers loading pages in the background (the declared load: three loaders of ours, each a
|
||||
browser reloading an ad-heavy page every two seconds), a beacon's channel can be cancelled with its document after the route resumed
|
||||
it, and an engine that does not end that request leaves the page waiting for ever. Quiet, it passes; loaded, Playwright's own Firefox
|
||||
idles 30 rounds of 30 and an engine without the end of a cancelled resumed request idled 1 of 30. All ten rounds must idle."""
|
||||
idles 30 rounds of 30 and an engine without the end of a cancelled resumed request idled 1 of 30. All ten rounds must idle.
|
||||
|
||||
From firefox-68 (the parent no longer cuts a navigation that committed: the held cut of networkidle) they must. On an older engine the
|
||||
defect is the one this case caught (1 of 20 navigations did not idle under the load, on the published firefox-67; the candidate of the 68
|
||||
passes 4 of 4 on both systems): the run is made all the same and must complete its 20 navigations, and what idles is not asked, so the case
|
||||
neither skips (a required suite allows no skip) nor fails on an engine that does not carry the property."""
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
loader = pathlib.Path(__file__).resolve().parent / "fakeweb" / "loader.py"
|
||||
ready_dir = pathlib.Path(tempfile.mkdtemp(prefix="fakeweb-loaders-"))
|
||||
ready = [ready_dir / ("loader-%d.ready" % i) for i in range(LOADERS)]
|
||||
procs = [subprocess.Popen([sys.executable, str(loader), firefox_binary, str(mark)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
for mark in ready]
|
||||
origin, _other, stop = sites.start((0, 0))
|
||||
try:
|
||||
# the loaders are up and loading when each has finished its first page and said so (a file), not after a fixed pause
|
||||
assert wait_until(lambda: all(mark.exists() for mark in ready), 180, lambda: time.sleep(0.25)), "the loaders did not start loading: %s" % [m.name for m in ready if not m.exists()]
|
||||
cells = profile_p2.run_on_candidate(_stock_client(), firefox_binary, origin, ["leaving_beacons_subframe"], 10)
|
||||
finally:
|
||||
stop()
|
||||
for proc in procs:
|
||||
proc.terminate()
|
||||
for proc in procs:
|
||||
try:
|
||||
proc.wait(timeout=60)
|
||||
except Exception:
|
||||
proc.kill()
|
||||
bad = ["round %d%s: %s -- in flight: %s" % (c["round"], " (canary)" if c["canary"] else "", c["err"],
|
||||
[(r["type"], r["method"], r["frame"]) for r in c.get("in_flight", [])[:3]])
|
||||
for c in cells if not c["idle"]]
|
||||
assert not bad, "%d of %d navigations did not reach networkidle under load:%s" % (
|
||||
len(bad), len(cells), "".join("\n " + line for line in bad[:6]))
|
||||
with FailureEvidence("fakeweb-leaving-beacons-under-load") as evidence:
|
||||
loader = pathlib.Path(__file__).resolve().parent / "fakeweb" / "loader.py"
|
||||
ready_dir = pathlib.Path(tempfile.mkdtemp(prefix="fakeweb-loaders-"))
|
||||
ready = [ready_dir / ("loader-%d.ready" % i) for i in range(LOADERS)]
|
||||
procs = [subprocess.Popen([sys.executable, str(loader), firefox_binary, str(mark)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
for mark in ready]
|
||||
origin, _other, stop = sites.start((0, 0))
|
||||
evidence.watch_server(stop)
|
||||
try:
|
||||
# the loaders are up and loading when each has finished its first page and said so (a file), not after a fixed pause
|
||||
assert wait_until(lambda: all(mark.exists() for mark in ready), 180, lambda: time.sleep(0.25)), "the loaders did not start loading: %s" % [m.name for m in ready if not m.exists()]
|
||||
evidence.arm()
|
||||
cells = profile_p2.run_on_candidate(_stock_client(), firefox_binary, origin, ["leaving_beacons_subframe"], 10,
|
||||
client_log=evidence.client_log)
|
||||
evidence.note_cells(cells)
|
||||
finally:
|
||||
stop()
|
||||
for proc in procs:
|
||||
proc.terminate()
|
||||
for proc in procs:
|
||||
try:
|
||||
proc.wait(timeout=60)
|
||||
except Exception:
|
||||
proc.kill()
|
||||
if not engine_reaches("firefox-68"):
|
||||
assert len(cells) == 20, "the run made %d navigations, not 20" % len(cells)
|
||||
return
|
||||
bad = ["round %d%s: %s -- in flight: %s" % (c["round"], " (canary)" if c["canary"] else "", c["err"],
|
||||
[(r["type"], r["method"], r["frame"]) for r in c.get("in_flight", [])[:3]])
|
||||
for c in cells if not c["idle"]]
|
||||
assert not bad, "%d of %d navigations did not reach networkidle under load:%s" % (
|
||||
len(bad), len(cells), "".join("\n " + line for line in bad[:6]))
|
||||
@@ -254,9 +254,9 @@ def test_the_workflow_runs_stock_and_ours_and_never_reruns_or_forgives():
|
||||
assert "|| true" not in WORKFLOW and "|| echo" not in WORKFLOW
|
||||
assert "fetch | tail -1" in WORKFLOW # the published engine, as e2e.yml
|
||||
assert "gh run download" not in WORKFLOW # no engine of a named run: the candidate runs the entry itself
|
||||
# the lab database and the intermediates list are made by the repository before the first launch (the scripts launch the core as the tests do)
|
||||
# the lab database and the security state are made by the repository before the first launch (the scripts launch the core as the tests do)
|
||||
first_run = WORKFLOW.index(" - name: Profile P2")
|
||||
assert WORKFLOW.index("scripts/ci_lab_geoip.py build") < first_run and WORKFLOW.index("scripts/ci_lab_intermediates.py set") < WORKFLOW.index("fetch | tail -1")
|
||||
assert WORKFLOW.index("scripts/ci_lab_geoip.py build") < first_run and WORKFLOW.index("scripts/ci_lab_security_state.py set") < WORKFLOW.index("fetch | tail -1")
|
||||
|
||||
|
||||
def test_the_workflow_starts_on_the_fake_web_files_of_a_pull_request_and_of_main_and_by_hand():
|
||||
|
||||
@@ -313,3 +313,105 @@ def test_webgl_readpixels_no_masking_signature(page):
|
||||
f"WebGL readPixels shows {res['spikes']} high-frequency noise spikes "
|
||||
f"(pixelscan-maskable); the stealth noise must be a smooth gamma remap."
|
||||
)
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# The declared screen, and the inner size of the top level (characterisation of
|
||||
# the engine hooks fingerprint/screen-window/screen: nsScreen.cpp, nsPresContext.cpp)
|
||||
# ===========================================================================
|
||||
|
||||
#: A screen no runner has: 2731x1537, a 41 px taskbar, 30-bit colour, at scale 1.0.
|
||||
_DECLARED_SCREEN = {"screen.width": 2731, "screen.height": 1537, "screen.taskbar_px": 41,
|
||||
"screen.color_depth": 30, "screen.dpr": 1.0}
|
||||
|
||||
#: Another screen no runner has, for the control: the wrapper hands the declared screen to the browser by two roads (the prefs and
|
||||
#: the screen of the context that Juggler emulates), so a launch with the prefs at 0 still reads the pinned screen.
|
||||
_OTHER_SCREEN = {"screen.width": 2623, "screen.height": 1411, "screen.taskbar_px": 37,
|
||||
"screen.color_depth": 24, "screen.dpr": 1.0}
|
||||
|
||||
_READ_SCREEN = """() => ({width: screen.width, height: screen.height, availWidth: screen.availWidth,
|
||||
availHeight: screen.availHeight, pixelDepth: screen.pixelDepth,
|
||||
colorDepth: screen.colorDepth})"""
|
||||
|
||||
|
||||
def _read_screen(firefox_binary, pin=_DECLARED_SCREEN):
|
||||
with InvisiblePlaywright(seed=42, pin=pin, binary_path=firefox_binary, headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank", timeout=30_000)
|
||||
return page.evaluate(_READ_SCREEN)
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_a_declared_screen_that_no_runner_has_is_what_the_page_reads(firefox_binary):
|
||||
"""The page reads the screen the core declares (nsScreen::GetRect, GetAvailRect, PixelDepth), not the host's.
|
||||
|
||||
The available height is the declared height less the declared taskbar (2731x1537, taskbar 41, depth 30 -> availWidth
|
||||
2731, availHeight 1496). The control is a launch declared with ANOTHER screen (2623x1411, taskbar 37, depth 24: the wrapper
|
||||
hands the declared screen to the browser by two roads, so the absent declaration is not a control): the page reads that one, and
|
||||
none of the first declaration's numbers.
|
||||
"""
|
||||
from _popup_geometry import in_a_thread_of_its_own
|
||||
|
||||
# The module's `page` fixture keeps a sync client open in this thread: a second browser needs a thread of its own.
|
||||
declared = in_a_thread_of_its_own(lambda: _read_screen(firefox_binary))
|
||||
assert declared == {"width": 2731, "height": 1537, "availWidth": 2731, "availHeight": 1537 - 41,
|
||||
"pixelDepth": 30, "colorDepth": 30}, "the page reads %r under a declared 2731x1537 screen" % declared
|
||||
|
||||
host = in_a_thread_of_its_own(lambda: _read_screen(firefox_binary, _OTHER_SCREEN))
|
||||
assert host == {"width": 2623, "height": 1411, "availWidth": 2623, "availHeight": 1411 - 37,
|
||||
"pixelDepth": 24, "colorDepth": 24}, "the page reads %r under another declared screen" % host
|
||||
for key in ("width", "height", "availWidth", "availHeight", "pixelDepth"):
|
||||
assert host[key] != declared[key], (
|
||||
"under another declared screen screen.%s reads %r, the first declared value: the control reads the first declaration "
|
||||
"(%r)" % (key, host[key], host))
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_the_inner_size_of_the_top_is_synced_with_the_engine_active_and_not_without(firefox_binary):
|
||||
"""A popup's iframe reads the top level's inner size (nsPresContext::UpdateInnerSizeSpoofedForRFP).
|
||||
|
||||
With the engine active the top-level inner size is synced to every process of the browsing context, so an iframe of
|
||||
another site in a popup (200x150, in its own process) answers the outer size of the POPUP: the top's inner size plus the
|
||||
declared frame, 2 * border wide and popup UI + border high, and not the size of its own 200x150. The popup itself
|
||||
answers the same. The control is the same page in a launch declared with a SECOND frame that no runner has (border 6, popup
|
||||
UI 53): the iframe then answers the top's inner size plus THAT frame, and none of the first declaration's. The engine off is
|
||||
not the control: the declared frame is the one of a retail Windows window at scale 1.0, so a Windows runner's own popup
|
||||
reads it with the engine off too (measured: 516x480 for a 500x400 popup) and the test could not fail there.
|
||||
"""
|
||||
from _popup_geometry import (OTHER_BORDER, OTHER_FRAME, OTHER_POPUP_UI, frame_extra, frame_of_the_declaration,
|
||||
in_a_thread_of_its_own, read_popup)
|
||||
|
||||
frame = frame_of_the_declaration()
|
||||
extra = frame_extra(frame.border, frame.popup_ui)
|
||||
other_extra = frame_extra(OTHER_BORDER, OTHER_POPUP_UI)
|
||||
assert other_extra != extra
|
||||
|
||||
def synced_to(wanted):
|
||||
def synced(reading):
|
||||
top = reading["popup"]
|
||||
return (reading["frame"]["ow"], reading["frame"]["oh"]) == (top["iw"] + wanted[0], top["ih"] + wanted[1])
|
||||
return synced
|
||||
|
||||
# The module's `page` fixture keeps a sync client open in this thread: a second browser needs a thread of its own.
|
||||
on = in_a_thread_of_its_own(lambda: read_popup(firefox_binary, iframe=True, ready=synced_to(extra)))
|
||||
top, inner = on["popup"], on["frame"]
|
||||
assert (top["ow"], top["oh"]) == (top["iw"] + extra[0], top["ih"] + extra[1]), (
|
||||
"the popup reads outer %dx%d for inner %dx%d, the declared frame adds %r" % (top["ow"], top["oh"], top["iw"],
|
||||
top["ih"], extra))
|
||||
assert (inner["ow"], inner["oh"]) == (top["iw"] + extra[0], top["ih"] + extra[1]), (
|
||||
"the iframe of the popup reads outer %dx%d, the top level's inner %dx%d plus the declared frame %r is %dx%d (the "
|
||||
"iframe's own inner size is %dx%d)" % (inner["ow"], inner["oh"], top["iw"], top["ih"], extra,
|
||||
top["iw"] + extra[0], top["ih"] + extra[1], inner["iw"], inner["ih"]))
|
||||
assert (inner["iw"], inner["ih"]) != (top["iw"], top["ih"]), "the iframe has the size of the popup: the read proves nothing"
|
||||
|
||||
other = in_a_thread_of_its_own(lambda: read_popup(firefox_binary, extra_prefs=OTHER_FRAME, iframe=True, ready=synced_to(other_extra)))
|
||||
other_top, other_inner = other["popup"], other["frame"]
|
||||
assert (other_inner["ow"], other_inner["oh"]) == (other_top["iw"] + other_extra[0], other_top["ih"] + other_extra[1]), (
|
||||
"declared with another frame the iframe of a popup reads outer %dx%d, the top's inner %dx%d plus the second declared frame %r is %dx%d: %r"
|
||||
% (other_inner["ow"], other_inner["oh"], other_top["iw"], other_top["ih"], other_extra,
|
||||
other_top["iw"] + other_extra[0], other_top["ih"] + other_extra[1], other))
|
||||
assert (other_top["ow"], other_top["oh"]) == (other_top["iw"] + other_extra[0], other_top["ih"] + other_extra[1]), (
|
||||
"declared with another frame the popup reads outer %dx%d for inner %dx%d, the second declared frame adds %r"
|
||||
% (other_top["ow"], other_top["oh"], other_top["iw"], other_top["ih"], other_extra))
|
||||
assert (other_inner["ow"] - other_top["iw"], other_inner["oh"] - other_top["ih"]) != (inner["ow"] - top["iw"], inner["oh"] - top["ih"]), (
|
||||
"the iframe reads the same frame under two declarations: it does not follow the declaration: %r vs %r" % (other, on))
|
||||
@@ -10,21 +10,24 @@ site changes its process.
|
||||
navigation and `go_back()` restore the page with its frame of another site, and the frame answers `evaluate`.
|
||||
The outcome asserted is what stock Firefox does (see the docstrings).
|
||||
* Processes. A context whose page had frames of other sites leaves no content process behind once it is closed:
|
||||
the count of web content processes under the engine, read after each of several such contexts, stays within the
|
||||
pool of spare processes retail Firefox keeps (see the test).
|
||||
judged by identity (the processes that host the frames' sites, by name on Linux and by the engine's logged remote
|
||||
type on Windows), not by a count that also holds the pool of spare processes (see the test).
|
||||
|
||||
The first test proves the frame is in another process, so the file cannot turn into a same-process suite.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
import pytest
|
||||
|
||||
from _fission_frames import Sites, assert_other_process, launch, new_page, wait_for, wait_frame
|
||||
from _waits import spare_processes, watch
|
||||
from _processes import LOG_ENV, NAMED_BY_SITE, remote_types, site_processes_below
|
||||
from _waits import watch
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
@@ -138,98 +141,79 @@ def test_a_top_level_navigation_and_back_restore_the_page_with_its_frame_usable(
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _content_processes(engine_dir):
|
||||
"""The pids of the engine's web content processes (`-contentproc ... tab`) below this test."""
|
||||
import psutil
|
||||
|
||||
found = set()
|
||||
for child in psutil.Process(os.getpid()).children(recursive=True):
|
||||
try:
|
||||
if not os.path.normcase(child.exe()).startswith(os.path.normcase(engine_dir)):
|
||||
continue
|
||||
command = child.cmdline()
|
||||
except psutil.Error:
|
||||
continue
|
||||
if "-contentproc" in command and command[-1] == "tab":
|
||||
found.add(child.pid)
|
||||
return found
|
||||
|
||||
|
||||
def _settled(engine_dir, seconds=2.0, limit=25.0):
|
||||
"""The set of content processes once it has not changed for ``seconds``."""
|
||||
end = time.monotonic() + limit
|
||||
last, since = _content_processes(engine_dir), time.monotonic()
|
||||
while time.monotonic() < end:
|
||||
time.sleep(0.25)
|
||||
now = _content_processes(engine_dir)
|
||||
if now != last:
|
||||
last, since = now, time.monotonic()
|
||||
elif time.monotonic() - since >= seconds:
|
||||
break
|
||||
return last
|
||||
|
||||
|
||||
CONTEXTS = 5
|
||||
#: How long a count of processes may take to reach what it must be (a process starts or ends in well under a
|
||||
#: second; this is the only clock the verdict has).
|
||||
#: How long a process may take to appear or to end (one starts or ends in well under a second; this is the only clock
|
||||
#: the verdict has).
|
||||
DEADLINE = 25.0
|
||||
|
||||
|
||||
def test_a_closed_context_with_frames_of_other_sites_leaves_no_content_process(firefox_binary, sites):
|
||||
def _site(url):
|
||||
"""The site of a url: scheme and host, never the port."""
|
||||
parts = urlsplit(url)
|
||||
return "%s://%s" % (parts.scheme, parts.hostname)
|
||||
|
||||
|
||||
def test_a_closed_context_with_frames_of_other_sites_leaves_no_content_process(
|
||||
firefox_binary, sites, monkeypatch, tmp_path):
|
||||
"""Five contexts in a row, each with a page whose frames are on B and (nested) on C. The processes the frames
|
||||
took are gone once the context is closed.
|
||||
|
||||
What retail Firefox does, and so what is allowed: with Fission on it keeps a pool of preallocated content
|
||||
processes, `dom.ipc.processPrelaunch.fission.number` of them (3 on desktop, 1 on a machine of 4 GB or less),
|
||||
refilled one at a time after a page takes one (`_waits.spare_processes` has the source). So between two looks
|
||||
the number of content processes moves by up to that pool and no more: after the first context is closed
|
||||
(``counts[0]``) every later count is at most ``counts[0]`` plus the pool, and a frame process that is never
|
||||
released grows the count by at least one per context, so it passes the bound within the five (a pool that is
|
||||
emptier at the last look than at the first could hide it: the bound is as wide as the pool, no wider). While a context
|
||||
is open the count rises above ``counts[0]``: the frames' processes are on top of a refilled pool.
|
||||
The verdict is told by identity, not by a count: the number of content processes under the engine also holds the
|
||||
preallocated pool and whatever the browser starts for itself (the New Tab page's own Mozilla site), which move
|
||||
with the load of the machine and are not what the test is about. A process that hosts a site says so: on Linux
|
||||
its name is the site (`fission.processSiteNames`, test-only), on Windows the remote type the engine logs for
|
||||
every process it creates (`webIsolated=<site>^userContextId=N`, `_processes.py`). So:
|
||||
|
||||
Each count is a WAIT for that bound (up to 25 s), not a look after a fixed pause; the message gives the counts
|
||||
over time of every context."""
|
||||
import psutil
|
||||
* while a context is open the frames of B and C each have a content process of their own (the processes that host
|
||||
B and C exist: a lookup that finds nothing cannot pass);
|
||||
* once the context is closed no process that hosts B or C is left below this test (B and C are only ever framed,
|
||||
by a context that is closed, so nothing may host them).
|
||||
|
||||
On Linux a name keeps 15 characters, so `http://127.0.0.2` is told from nothing but the start `http://127.0.0.` (the
|
||||
site of A, which closes with the context as well): the lookup of C is then no narrower than that of A and B's is the
|
||||
exact one.
|
||||
|
||||
Each look is a WAIT for that condition (up to 25 s), not a look after a fixed pause; the message gives what was
|
||||
seen over time for every context."""
|
||||
sites.route("B", "/leak-b", "<!doctype html><title>b</title><iframe src='%s'></iframe>" % sites.url("C", "/h3"))
|
||||
sites.route("A", "/leak", "<!doctype html><title>leak</title><iframe id='b' src='%s'></iframe>"
|
||||
% sites.url("B", "/leak-b"))
|
||||
engine_dir = str(Path(firefox_binary).resolve().parent)
|
||||
spare = spare_processes(psutil.virtual_memory().total)
|
||||
framed = {"B": _site(sites.url("B")), "C": _site(sites.url("C"))}
|
||||
base = tmp_path / "process-types"
|
||||
if sys.platform == "win32":
|
||||
# Windows names no process: the engine's log tells the remote type of each one it creates
|
||||
monkeypatch.setenv("MOZ_LOG", LOG_ENV["MOZ_LOG"])
|
||||
monkeypatch.setenv("MOZ_LOG_FILE", str(base))
|
||||
|
||||
def number():
|
||||
return len(_content_processes(engine_dir))
|
||||
def hosting():
|
||||
"""`{name of the site: pids}` of the live processes below this test that host a framed site."""
|
||||
return {name: site_processes_below(os.getpid(), site, engine_dir, types=lambda: remote_types(base))
|
||||
for name, site in framed.items()}
|
||||
|
||||
def both_hosted(found):
|
||||
return all(found.values())
|
||||
|
||||
def none_hosted(found):
|
||||
return not any(found.values())
|
||||
|
||||
def pause():
|
||||
time.sleep(0.25)
|
||||
|
||||
with launch(firefox_binary) as browser:
|
||||
counts, during, trail = [], [], []
|
||||
with launch(firefox_binary, extra_prefs=NAMED_BY_SITE) as browser:
|
||||
trail = []
|
||||
for n in range(CONTEXTS):
|
||||
context, page = new_page(browser)
|
||||
page.goto(sites.url("A", "/leak"), wait_until="load")
|
||||
wait_frame(page, sites.url("C"), "/h3")
|
||||
if not counts:
|
||||
during.append(len(_settled(engine_dir)))
|
||||
trail.append("context %d open: %d" % (n, during[-1]))
|
||||
else:
|
||||
opened = watch(number, lambda count: count > counts[0], DEADLINE, pause)
|
||||
during.append(opened.history[-1][1])
|
||||
trail.append("context %d open, waiting for more than %d: %s" % (n, counts[0], opened.render()))
|
||||
assert opened.ok, (
|
||||
"the frames of other sites took no process of their own: %r while open, %r after; %s" % (
|
||||
during, counts, " | ".join(trail)))
|
||||
opened = watch(hosting, both_hosted, DEADLINE, pause)
|
||||
trail.append("context %d open: %s" % (n, opened.render()))
|
||||
assert opened.ok, (
|
||||
"the frames of B and C took no process of their own (a site with no process of its own shows an empty "
|
||||
"set): %s" % " | ".join(trail))
|
||||
context.close()
|
||||
if not counts:
|
||||
counts.append(len(_settled(engine_dir)))
|
||||
trail.append("context %d closed: %d (the reference)" % (n, counts[0]))
|
||||
else:
|
||||
closed = watch(number, lambda count: count <= counts[0] + spare, DEADLINE, pause)
|
||||
counts.append(closed.history[-1][1])
|
||||
trail.append("context %d closed, waiting for at most %d (%d + a pool of %d): %s" % (
|
||||
n, counts[0] + spare, counts[0], spare, closed.render()))
|
||||
assert closed.ok, (
|
||||
"web content processes after each closed context: %r (open: %r); more than the %d the first "
|
||||
"left plus the pool of %d the engine keeps: %s" % (counts, during, counts[0], spare,
|
||||
" | ".join(trail)))
|
||||
closed = watch(hosting, none_hosted, DEADLINE, pause)
|
||||
trail.append("context %d closed: %s" % (n, closed.render()))
|
||||
assert closed.ok, (
|
||||
"a process that hosts the site of a frame of the closed context is still there: %s"
|
||||
% " | ".join(trail))
|
||||
@@ -94,8 +94,7 @@ def test_the_crash_of_an_iframe_s_process_leaves_the_tab(firefox_binary, engine_
|
||||
port = server.server_address[1]
|
||||
marionette = None
|
||||
try:
|
||||
marionette_port = webfont_probe.marionette_port()
|
||||
prefs = dict(FISSION, **{"marionette.port": marionette_port})
|
||||
prefs = dict(FISSION, **{"marionette.port": 0})
|
||||
with InvisiblePlaywright(binary_path=firefox_binary, headless=True, humanize=False,
|
||||
extra_args=["-marionette"], extra_prefs=prefs) as browser:
|
||||
page = browser.new_context().new_page()
|
||||
@@ -107,7 +106,7 @@ def test_the_crash_of_an_iframe_s_process_leaves_the_tab(firefox_binary, engine_
|
||||
# the iframe's document is not read, nor its address: what the client can see of a frame in another
|
||||
# process is what the rest of Fission builds
|
||||
|
||||
marionette = webfont_probe._Marionette(marionette_port)
|
||||
marionette = webfont_probe._Marionette(webfont_probe.marionette_active_port())
|
||||
marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
|
||||
marionette.call("Marionette:SetContext", {"value": "chrome"})
|
||||
# the tabs of the engine whose document has a child, each [top pid, child pid]: a count of TABS read from the
|
||||
|
||||
@@ -27,13 +27,16 @@ ask for the processes of one site and never compare two counts. Counting was wro
|
||||
processes of its own: in every run, a second isolated process (remote type `webIsolated=https://mozgcp.net`) is
|
||||
born about a second after the process of the New Tab page, with any page, and under load it arrived between the
|
||||
two reads (red in 14 of 30 runs of the whole e2e suite, `[P] -> [P, P2]`). A cross-site frame gives a process
|
||||
for the frame's site; a same-site one leaves the page's site in its single process. Off Linux the two tests
|
||||
skip: no other system names the process.
|
||||
for the frame's site; a same-site one leaves the page's site in its single process. Windows names no process, so there
|
||||
the same two questions are answered by the engine's own log, which says the remote type of every process it creates
|
||||
(`webIsolated=http://a.test^userContextId=N` for the process of a site): the browser is started with `LOG_ENV` and a file
|
||||
base, and a process counts when it is alive in the tree and its logged type is that of the site (tests/_processes.py).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
@@ -42,7 +45,7 @@ from urllib.parse import parse_qs, urlsplit
|
||||
|
||||
import pytest
|
||||
|
||||
from _processes import NAMED_BY_SITE, site_processes_below
|
||||
from _processes import LOG_ENV, NAMED_BY_SITE, remote_types, site_processes_below
|
||||
from _servers import LocalServer
|
||||
|
||||
SITE_A = "http://a.test"
|
||||
@@ -135,13 +138,26 @@ def engine_dir(firefox_binary):
|
||||
return str(Path(firefox_binary).resolve().parent)
|
||||
|
||||
|
||||
def processes_of(site, engine_dir):
|
||||
"""The pids of the engine's processes below this test that host `site` (named by it, tests/_processes.py)."""
|
||||
return site_processes_below(os.getpid(), site, engine_dir)
|
||||
@pytest.fixture
|
||||
def engine_log(monkeypatch, tmp_path):
|
||||
"""Windows only: the engine logs the remote type of each process it creates, to files that start with the returned
|
||||
base (Linux names the process by its site instead, and the environment stays as it is there)."""
|
||||
base = tmp_path / "process-types"
|
||||
if sys.platform == "win32":
|
||||
monkeypatch.setenv("MOZ_LOG", LOG_ENV["MOZ_LOG"])
|
||||
monkeypatch.setenv("MOZ_LOG_FILE", str(base))
|
||||
return base
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def browser(firefox_binary):
|
||||
def processes_of(engine_dir, engine_log):
|
||||
"""`processes_of(site)`: the pids of the engine's processes below this test that host `site` (tests/_processes.py:
|
||||
by the name of the process on Linux, by the type the engine logged on Windows)."""
|
||||
return lambda site: site_processes_below(os.getpid(), site, engine_dir, types=lambda: remote_types(engine_log))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def browser(firefox_binary, engine_log):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=42, binary_path=firefox_binary, humanize=False, headless=True,
|
||||
@@ -195,7 +211,7 @@ def frame_with_origin(page, origin):
|
||||
# ── 1, 2: the bench itself ─────────────────────────────────────────────────────
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_cross_site_iframe_gets_its_own_process(page, cross_site_loop, engine_dir):
|
||||
def test_cross_site_iframe_gets_its_own_process(page, cross_site_loop, processes_of):
|
||||
"""Green today: it says the bench separates sites. A frame of b.test in a page of a.test has a process of its own.
|
||||
|
||||
The processes are asked for by the name of their site, never counted between two reads (tests/_processes.py): the
|
||||
@@ -204,20 +220,20 @@ def test_cross_site_iframe_gets_its_own_process(page, cross_site_loop, engine_di
|
||||
the navigation: a top-level navigation may land in another process of the same site (`mReplaceBrowsingContext`,
|
||||
dom/ipc/ProcessIsolation.cpp, see the control below)."""
|
||||
page.goto(cross_site_loop["plain"])
|
||||
here = processes_of(SITE_A, engine_dir)
|
||||
here = processes_of(SITE_A)
|
||||
assert len(here) == 1, "the page of a.test must have one process of its site: %s" % sorted(here)
|
||||
assert not processes_of(SITE_B, engine_dir), "a process for b.test before any page of it"
|
||||
assert not processes_of(SITE_B), "a process for b.test before any page of it"
|
||||
page.goto(cross_site_loop["top"], wait_until="load")
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/loaded" and r["host"] == "a.test" and
|
||||
r["query"]["path"] == ["/leaf"] for r in cross_site_loop["reports"]))
|
||||
framed = processes_of(SITE_B, engine_dir)
|
||||
framed = processes_of(SITE_B)
|
||||
assert len(framed) >= 1, "no process for the site of the frame (b.test)"
|
||||
tops = processes_of(SITE_A, engine_dir)
|
||||
tops = processes_of(SITE_A)
|
||||
assert len(tops) == 1, "the processes of a.test must still be one: %s" % sorted(tops)
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
def test_same_site_other_port_stays_in_process(page, cross_site_loop, engine_dir):
|
||||
def test_same_site_other_port_stays_in_process(page, cross_site_loop, processes_of):
|
||||
"""Green today, the control: a frame of the page's own site gets no process, and none for another site.
|
||||
|
||||
The processes of a.test are asked for by name before and after the frame is added: one pid, the same pid. Nothing
|
||||
@@ -233,15 +249,15 @@ def test_same_site_other_port_stays_in_process(page, cross_site_loop, engine_dir
|
||||
the same site (`dom.ipc.processCount.webIsolated` is 4). That is the top's process, not the frame's; a frame of
|
||||
the page's site stays in the page's process."""
|
||||
page.goto(cross_site_loop["plain"])
|
||||
before = processes_of(SITE_A, engine_dir)
|
||||
before = processes_of(SITE_A)
|
||||
assert len(before) == 1, "the page of a.test must have one process of its site: %s" % sorted(before)
|
||||
page.evaluate("(u) => { const f = document.createElement('iframe'); f.id = 's'; f.src = u;"
|
||||
" document.body.appendChild(f); }", cross_site_loop["leaf"])
|
||||
assert wait_for(page, lambda: any(r["path"] == "/report/loaded" and r["query"]["path"] == ["/leaf"]
|
||||
for r in cross_site_loop["reports"]))
|
||||
after = processes_of(SITE_A, engine_dir)
|
||||
after = processes_of(SITE_A)
|
||||
assert after == before, "a same-site frame changed the processes of a.test: %s -> %s" % (sorted(before), sorted(after))
|
||||
assert not processes_of(SITE_B, engine_dir), "a process for b.test, which no page here belongs to"
|
||||
assert not processes_of(SITE_B), "a process for b.test, which no page here belongs to"
|
||||
|
||||
|
||||
# ── 3 .. 10: what the product does not do yet ──────────────────────────────────
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
"""A page keeps the focus when another session takes the display, and loses it only to its own session.
|
||||
|
||||
What it fixes: with ``zoom.stealth.focus.ignore_os_deactivation`` (the core declares it true, one value for every session) the window does not give up its
|
||||
activation when the SYSTEM takes it: another application, or another session's window on the same display. A page reads ``document.hasFocus()`` and the
|
||||
``blur`` event; without the pref a second visible session made the first one read ``hasFocus()`` false (4 times in 4 on one display) while nothing in its own
|
||||
session had moved. When the session opens a window of its own the window it replaces is lowered with the blur any Firefox gives.
|
||||
|
||||
The hooks: ``AppWindow::WindowDeactivated`` (the early return) and ``AppWindow::WindowActivated`` (``StealthLowerActiveWindow``, which lowers the active window
|
||||
with its own action id before Mozilla's raise) in ``xpfe/appshell/AppWindow.cpp`` of the series, folder ``fingerprint/screen-window/focus``.
|
||||
|
||||
The steps: session A opens a page that records ``focus`` and ``blur``; session B, headed on the same display, opens a window and takes the focus. A's page
|
||||
still reads ``hasFocus()`` true and has recorded no ``blur``. Then A opens a second page of its own: the first page records its ``blur`` and reads
|
||||
``hasFocus()`` false, the new one reads it true.
|
||||
|
||||
The control, in the same test: ``extra_prefs={"zoom.stealth.focus.ignore_os_deactivation": False}``, the same steps up to B taking the display, and A's page
|
||||
reads ``hasFocus()`` false. It runs first, so a runner where the second session does not take the focus is red there and not a green that means nothing.
|
||||
|
||||
Both sessions are headed on one display, and the test owns it: on Linux a private Xvfb started for the test (the ``xvfb-run`` display that the four workers
|
||||
share is never used, so no neighbour's headed window moves the focus); on Windows the interactive desktop of the runner, which only this test touches because
|
||||
it is ``wall_clock`` (the e2e run gives such a test the machine alone, after the parallel tests).
|
||||
|
||||
What the verdict waits for is the operating system, not a pause: before anything is judged the test reads from the OS that the focus really is where the step
|
||||
says (the X input focus on Linux, ``GetForegroundWindow`` on Windows: first the first session's window, then the second session's window). "No blur" is judged
|
||||
after that and after a round trip to the first page's own process (two painted frames), which handles everything the parent sent it before: the deactivation
|
||||
that would cause a blur has been delivered by then, so a late one cannot give a false green.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from _os_focus import ForegroundWindow, XFocus, a_display_of_its_own
|
||||
from _window_sessions import in_a_thread_of_its_own, launch, wait_for_condition
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
PREF = "zoom.stealth.focus.ignore_os_deactivation"
|
||||
|
||||
RECORD = """() => {
|
||||
window.__events = [];
|
||||
for (const type of ['focus', 'blur']) window.addEventListener(type, () => window.__events.push(type));
|
||||
return document.hasFocus();
|
||||
}"""
|
||||
HAS_FOCUS = "() => document.hasFocus()"
|
||||
EVENTS = "() => window.__events"
|
||||
#: A round trip to the page's own process: it has handled what the parent sent it before this ran (the deactivation, if the parent had one to send).
|
||||
ROUND_TRIP = "() => new Promise(done => requestAnimationFrame(() => requestAnimationFrame(done)))"
|
||||
#: Names the page, so that on Windows its top-level window is found by its title.
|
||||
NAME = "(name) => { document.title = name; return document.title; }"
|
||||
FIRST_TITLE, SECOND_TITLE = "focus-first-session", "focus-second-session"
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def the_os_focus(monkeypatch):
|
||||
"""What tells where the OS has put the focus, on a display this test owns (see the module docstring)."""
|
||||
if sys.platform == "win32":
|
||||
yield ForegroundWindow()
|
||||
return
|
||||
with a_display_of_its_own(monkeypatch) as display:
|
||||
reader = XFocus(display)
|
||||
try:
|
||||
yield reader
|
||||
finally:
|
||||
reader.close()
|
||||
|
||||
|
||||
def takes_the_focus(b):
|
||||
"""Runs in the second session's own thread: opens a window, names it, and waits until its page has the focus."""
|
||||
taker = b.new_page()
|
||||
taker.goto("about:blank")
|
||||
taker.evaluate(NAME, SECOND_TITLE)
|
||||
wait_for_condition(taker, lambda: taker.evaluate(HAS_FOCUS), lambda focused: focused is True, "the second session's page never took the focus")
|
||||
|
||||
|
||||
def os_focus_is_on_the_first_window(first, os_focus):
|
||||
"""Waits until the OS says the first session's window holds the focus; gives what holds it."""
|
||||
if sys.platform == "win32":
|
||||
window = wait_for_condition(first, lambda: os_focus.window_titled(FIRST_TITLE), lambda hwnd: hwnd is not None,
|
||||
"no single visible top-level window is titled %r" % FIRST_TITLE).history[-1][1]
|
||||
wait_for_condition(first, lambda: os_focus.ask_for_the_foreground(window), lambda holder: holder == window,
|
||||
"the first session's window never became the foreground window")
|
||||
return window
|
||||
seen = wait_for_condition(first, os_focus.holder, os_focus.is_a_window, "no window of the display ever held the X input focus")
|
||||
return seen.history[-1][1]
|
||||
|
||||
|
||||
def os_focus_is_on_the_second_window(first, os_focus, before):
|
||||
"""Waits until the OS says a window other than the first one holds the focus (on Windows: the second session's window, by its title)."""
|
||||
if sys.platform == "win32":
|
||||
window = wait_for_condition(first, lambda: os_focus.window_titled(SECOND_TITLE), lambda hwnd: hwnd is not None,
|
||||
"no single visible top-level window is titled %r" % SECOND_TITLE).history[-1][1]
|
||||
assert window != before, "the second session's window is the first one's"
|
||||
wait_for_condition(first, lambda: os_focus.ask_for_the_foreground(window), lambda holder: holder == window,
|
||||
"the second session's window never became the foreground window")
|
||||
return
|
||||
wait_for_condition(first, os_focus.holder, lambda holder: os_focus.is_a_window(holder) and holder != before,
|
||||
"the X input focus never left the first session's window %r" % before)
|
||||
|
||||
|
||||
def another_session_takes_the_display(firefox_binary, os_focus, keeps, with_own_page=False):
|
||||
"""What A's page reads once B's window has the focus, and (``with_own_page``) once A has opened a page of its own."""
|
||||
extra = None if keeps else {PREF: False}
|
||||
with launch(firefox_binary, extra_prefs=extra) as a:
|
||||
first = a.new_page()
|
||||
first.goto("about:blank")
|
||||
first.evaluate(NAME, FIRST_TITLE)
|
||||
first.evaluate(RECORD)
|
||||
wait_for_condition(first, lambda: first.evaluate(HAS_FOCUS), lambda focused: focused is True, "the page never had the focus of its own window")
|
||||
before = os_focus_is_on_the_first_window(first, os_focus)
|
||||
with in_a_thread_of_its_own(firefox_binary) as b:
|
||||
b.run(takes_the_focus)
|
||||
os_focus_is_on_the_second_window(first, os_focus, before)
|
||||
if keeps:
|
||||
# the OS has moved the focus; one round trip to the page's process orders the read after the deactivation that would have followed
|
||||
first.evaluate(ROUND_TRIP)
|
||||
else:
|
||||
wait_for_condition(first, lambda: first.evaluate(HAS_FOCUS), lambda focused: focused is False,
|
||||
"the first page still has the focus although another session's window took it")
|
||||
seen = {"has_focus": first.evaluate(HAS_FOCUS), "events": first.evaluate(EVENTS)}
|
||||
if with_own_page:
|
||||
own = a.new_page()
|
||||
own.goto("about:blank")
|
||||
wait_for_condition(own, lambda: (own.evaluate(HAS_FOCUS), first.evaluate(EVENTS), first.evaluate(HAS_FOCUS)),
|
||||
lambda state: state[0] is True and state[1].count("blur") == 1 and state[2] is False,
|
||||
"a page of the session's own did not take the focus from the first with one blur")
|
||||
seen["after_own_page"] = (own.evaluate(HAS_FOCUS), first.evaluate(EVENTS), first.evaluate(HAS_FOCUS))
|
||||
return seen
|
||||
|
||||
|
||||
@pytest.mark.wall_clock
|
||||
def test_a_page_keeps_focus_when_another_session_takes_the_display(firefox_binary, monkeypatch):
|
||||
with the_os_focus(monkeypatch) as os_focus:
|
||||
control = another_session_takes_the_display(firefox_binary, os_focus, keeps=False)
|
||||
assert control["has_focus"] is False, "control: without the pref the first page still has the focus: %r" % control
|
||||
|
||||
kept = another_session_takes_the_display(firefox_binary, os_focus, keeps=True, with_own_page=True)
|
||||
assert kept["has_focus"] is True, "with the pref the first page lost the focus to another session: %r" % kept
|
||||
assert "blur" not in kept["events"], "with the pref the first page recorded a blur when another session took the display: %r" % kept
|
||||
assert kept["has_focus"] != control["has_focus"]
|
||||
own_focused, events, first_focused = kept["after_own_page"]
|
||||
assert own_focused is True and events.count("blur") == 1 and first_focused is False, "a page of the session's own did not replace the first one with one blur: %r" % kept
|
||||
@@ -1,345 +0,0 @@
|
||||
"""Fontconfig reads nothing of the host (e2e, Linux): no process of the browser opens
|
||||
the host's fontconfig configuration or its font files, and no content process looks at
|
||||
them at all (open, stat, access, readlink). The parent's own existence probes (lstat,
|
||||
stat, access, readlink) are not reads: see ``judge``.
|
||||
|
||||
The engine runs fontconfig on an empty configuration installed before the
|
||||
first ``FcInit()`` (``StealthFcEmptyConfig``, nsLookAndFeel and the platform
|
||||
font list); the fonts are the bundle's. The engine's own gtest only looks at
|
||||
the final state, so it would also pass if the host's configuration had been
|
||||
loaded first, by GTK, Pango or anything else, and replaced afterwards. What
|
||||
sees the order is the system calls themselves: the browser runs under
|
||||
``strace -f`` and a page with text is drawn, and one ``open`` of
|
||||
``/etc/fonts``, ``~/.config/fontconfig``, ``$FONTCONFIG_FILE`` or
|
||||
``/usr/share/fonts`` by any process, or one ``stat`` there by a content process, fails
|
||||
the test.
|
||||
|
||||
Why the parent's existence probes pass: the parent builds the permissions of the content
|
||||
sandbox (SandboxBrokerPolicyFactory::InitContentPolicy) and, for each path a content
|
||||
process may be given, asks whether it exists (``lstat``, ``stat``). It opens nothing and
|
||||
no byte of those files enters the process; a page cannot see the call. Fontconfig that
|
||||
read the host would ``open`` its configuration, and that is what fails.
|
||||
|
||||
strace runs through a stand-in tree: a temporary directory with a link to
|
||||
every file of the engine's directory, where the executable is a script that
|
||||
execs the real one under strace. The core reads the engine's identity from
|
||||
the directory of the path it is given, so the seal check passes as it does
|
||||
for the real tree. The script stays in the engine's place: same pid, same
|
||||
process group, the one the core's spawn gives the engine (``_stand_in``).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.e2e,
|
||||
pytest.mark.skipif(not sys.platform.startswith("linux"),
|
||||
reason="fontconfig is the Linux font system"),
|
||||
pytest.mark.skipif(shutil.which("strace") is None, reason="needs strace (apt install strace)"),
|
||||
]
|
||||
|
||||
_SYSCALLS = ("execve,clone,clone3,fork,vfork,open,openat,stat,lstat,"
|
||||
"newfstatat,statx,access,faccessat,faccessat2,readlink")
|
||||
|
||||
_PAGE = ("<!doctype html><meta charset=utf-8><body style='font-family:serif'>"
|
||||
"<h1>Fontconfig</h1><p style='font-family:sans-serif'>The quick brown "
|
||||
"fox jumps over the lazy dog.</p><code>monospace 0123456789</code>"
|
||||
"<p style='font-family:Arial'>Arial</p></body>")
|
||||
|
||||
|
||||
def _host_font_paths() -> list:
|
||||
"""Every place the host keeps fontconfig configuration or fonts."""
|
||||
home = os.path.expanduser("~")
|
||||
config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(home, ".config")
|
||||
paths = ["/etc/fonts", os.path.join(config_home, "fontconfig"),
|
||||
os.path.join(home, ".config", "fontconfig"),
|
||||
os.path.join(home, ".fonts.conf"), "/usr/share/fonts"]
|
||||
if os.environ.get("FONTCONFIG_FILE"):
|
||||
paths.append(os.environ["FONTCONFIG_FILE"])
|
||||
if os.environ.get("FONTCONFIG_PATH"):
|
||||
paths += os.environ["FONTCONFIG_PATH"].split(":")
|
||||
return sorted(set(p.rstrip("/") for p in paths if p))
|
||||
|
||||
|
||||
def _strace_options() -> str:
|
||||
"""strace's own flags: quiet, follow forks, and die with the traced process
|
||||
when this build knows --kill-on-exit."""
|
||||
help_text = subprocess.run([shutil.which("strace"), "-h"], capture_output=True,
|
||||
text=True).stdout
|
||||
return "-f -qq -s 4096" + (" --kill-on-exit" if "--kill-on-exit" in help_text else "")
|
||||
|
||||
|
||||
def _require_strace_can_trace(tmp: Path) -> None:
|
||||
"""strace needs ptrace: a container or yama can refuse it, and then the
|
||||
failure is the environment's, said as such, not the launch's."""
|
||||
probe = subprocess.run([shutil.which("strace"), "-o", str(tmp / "probe.log"), "true"],
|
||||
capture_output=True, text=True)
|
||||
if probe.returncode != 0:
|
||||
pytest.fail("strace cannot trace here: %s" % (probe.stderr.strip() or probe.returncode),
|
||||
pytrace=False)
|
||||
|
||||
|
||||
def _stand_in(binary: str, tree: Path, log: Path, pidfile: Path, syscalls: str = _SYSCALLS,
|
||||
timestamps: bool = False) -> str:
|
||||
"""A copy of the engine's directory made of links, whose executable runs
|
||||
the real one under strace, in the engine's place.
|
||||
|
||||
The script writes its pid and execs strace: the pid stays, and so does the
|
||||
process group its launcher gave it. The core spawns the engine as the
|
||||
leader of a process group of its own (``posix_spawn`` with ``setpgroup=0``,
|
||||
as Playwright's launcher does with ``detached: true``), so that group holds
|
||||
strace and everything it traces, and ``_kill_group`` kills the group of the
|
||||
pid (``os.getpgid``). The script used to exec ``setsid``: setsid(1) forks
|
||||
when its caller leads a process group, its parent exited 0 at once, and the
|
||||
core saw the engine exit during startup (candidate 44161687675).
|
||||
|
||||
``syscalls`` is what strace traces; ``timestamps`` adds ``-ttt`` (the epoch
|
||||
seconds after each pid), which ``_LINE`` does not read: a caller that asks
|
||||
for them strips them first (``test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e``)."""
|
||||
real = Path(os.path.realpath(binary))
|
||||
tree.mkdir()
|
||||
for entry in real.parent.iterdir():
|
||||
if entry.name != real.name:
|
||||
(tree / entry.name).symlink_to(entry)
|
||||
script = tree / real.name
|
||||
script.write_text(
|
||||
"#!/bin/sh\n"
|
||||
"echo $$ > %s\n"
|
||||
'exec %s %s -o %s -e trace=%s %s "$@"\n'
|
||||
% (pidfile, shutil.which("strace"), _strace_options() + (" -ttt" if timestamps else ""), log, syscalls, real))
|
||||
script.chmod(script.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
||||
return str(script)
|
||||
|
||||
|
||||
_LINE = re.compile(r"^(\d+)\s+(\w+)\((.*)$")
|
||||
# strace -f splits a call that another thread interrupts in two lines:
|
||||
# "PID clone3({...} <unfinished ...>" and "PID <... clone3 resumed>) = CHILD".
|
||||
_RESUMED = re.compile(r"^(\d+)\s+<\.\.\. (\w+) resumed>(.*)$")
|
||||
_RESULT = re.compile(r"=\s+(\d+)\s*$")
|
||||
|
||||
|
||||
def _roles(lines: list, real_binary: str):
|
||||
"""``(role, argv_of)`` for a strace log read as lines: ``role(pid)`` is ``"parent"``, ``"content"`` or ``"other"`` (walking up the
|
||||
clones to the process that executed the engine), ``argv_of`` maps a pid to the arguments of the last execve of the engine it made."""
|
||||
parent_of = {}
|
||||
argv_of = {}
|
||||
for line in lines:
|
||||
m = _LINE.match(line) or _RESUMED.match(line)
|
||||
if not m:
|
||||
continue
|
||||
pid, call, rest = int(m.group(1)), m.group(2), m.group(3)
|
||||
if call in ("clone", "clone3", "fork", "vfork"):
|
||||
r = _RESULT.search(rest)
|
||||
if r:
|
||||
parent_of[int(r.group(1))] = pid
|
||||
elif call == "execve" and real_binary in rest:
|
||||
# The arguments are on the first line even when the result comes
|
||||
# on a resumed one; the last execve of a process is what it runs.
|
||||
argv_of[pid] = rest
|
||||
|
||||
def role(pid: int) -> str:
|
||||
seen = set()
|
||||
while pid not in seen:
|
||||
seen.add(pid)
|
||||
argv = argv_of.get(pid)
|
||||
if argv is not None and real_binary in argv:
|
||||
return "content" if "-contentproc" in argv else "parent"
|
||||
if pid not in parent_of:
|
||||
break
|
||||
pid = parent_of[pid]
|
||||
return "other"
|
||||
|
||||
return role, argv_of
|
||||
|
||||
|
||||
def _host_lookups(log: Path, real_binary: str) -> dict:
|
||||
"""``{"parent"|"content"|"other": ["<syscall> <line>", ...]}`` for every
|
||||
system call of the browser that names a host font path."""
|
||||
lines = log.read_text(errors="replace").splitlines()
|
||||
role, _argv_of = _roles(lines, real_binary)
|
||||
|
||||
paths = _host_font_paths()
|
||||
found = defaultdict(list)
|
||||
for line in lines:
|
||||
m = _LINE.match(line)
|
||||
if not m or m.group(2) in ("execve", "clone", "clone3", "fork", "vfork"):
|
||||
continue
|
||||
quoted = re.findall(r'"([^"]*)"', m.group(3))
|
||||
if any(q == p or q.startswith(p + "/") for q in quoted for p in paths):
|
||||
found[role(int(m.group(1)))].append(line)
|
||||
return dict(found)
|
||||
|
||||
|
||||
# What a call does to a path. An existence probe is the question "is it there": no byte is read.
|
||||
_OPENS = ("open", "openat", "openat2", "creat")
|
||||
|
||||
|
||||
def _call_of(line: str) -> str:
|
||||
m = _LINE.match(line)
|
||||
return m.group(2) if m else ""
|
||||
|
||||
|
||||
def judge(found: dict) -> dict:
|
||||
"""The part of ``_host_lookups``' result that fails the test.
|
||||
|
||||
- any process that OPENS a host fontconfig or font path (an open that fails with ENOENT
|
||||
too: it is fontconfig trying to read its configuration);
|
||||
- a content process that does anything at all there (stat, access, readlink included):
|
||||
content has no reason to look, and it is the process a page runs in.
|
||||
|
||||
The parent's existence probes (stat, lstat, newfstatat, statx, access, faccessat, readlink)
|
||||
are ignored, for the reason in the module's docstring."""
|
||||
bad = {}
|
||||
for who, hits in found.items():
|
||||
kept = list(hits) if who == "content" else [h for h in hits if _call_of(h) in _OPENS]
|
||||
if kept:
|
||||
bad[who] = kept
|
||||
return bad
|
||||
|
||||
|
||||
def _group_of(pidfile: Path):
|
||||
"""The process group of the stand-in, read from its living pid (``os.getpgid``); None when it is gone or wrote no pid."""
|
||||
try:
|
||||
return os.getpgid(int(pidfile.read_text().strip()))
|
||||
except (OSError, ValueError):
|
||||
return None
|
||||
|
||||
|
||||
def _kill_group(pidfile: Path):
|
||||
"""Kill the stand-in's process group: strace, the browser and its children. Returns the group killed, or None.
|
||||
|
||||
Looking for the stand-in's path in the command lines found nothing (strace
|
||||
and its children carry the real binary's path), so the group is the handle:
|
||||
the group of the stand-in's pid, not the pid taken as a group id. Never the
|
||||
group of this test: a stand-in started inside it is killed alone."""
|
||||
pgid = _group_of(pidfile)
|
||||
if pgid is None:
|
||||
return None
|
||||
if pgid == os.getpgrp():
|
||||
try:
|
||||
os.kill(int(pidfile.read_text().strip()), signal.SIGKILL)
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
return None
|
||||
try:
|
||||
os.killpg(pgid, signal.SIGKILL)
|
||||
except OSError:
|
||||
pass
|
||||
return pgid
|
||||
|
||||
|
||||
def _detached(argv: list, **kwargs) -> subprocess.Popen:
|
||||
"""A process started as the core starts the engine: the leader of a process group of its own (``posix_spawn`` with
|
||||
``setpgroup=0`` in ``invisible_core.juggler.connection._spawn_posix``)."""
|
||||
return subprocess.Popen(argv, process_group=0, **kwargs)
|
||||
|
||||
|
||||
def _group_members(pgid: int) -> list:
|
||||
"""Pids still in the process group ``pgid``."""
|
||||
members = []
|
||||
for pid in os.listdir("/proc"):
|
||||
if not pid.isdigit():
|
||||
continue
|
||||
try:
|
||||
stat_line = Path("/proc/%s/stat" % pid).read_text()
|
||||
except OSError:
|
||||
continue
|
||||
fields = stat_line.rsplit(")", 1)[1].split()
|
||||
# fields: state ppid pgrp ...; a zombie is already dead.
|
||||
if fields[0] != "Z" and int(fields[2]) == pgid:
|
||||
members.append(int(pid))
|
||||
return members
|
||||
|
||||
|
||||
def _wait_for_exit(pgid: int, seconds: float = 30.0) -> list:
|
||||
end = time.monotonic() + seconds
|
||||
left = _group_members(pgid)
|
||||
while left and time.monotonic() < end:
|
||||
time.sleep(0.1)
|
||||
left = _group_members(pgid)
|
||||
return left
|
||||
|
||||
|
||||
def test_a_killed_stand_in_leaves_neither_strace_nor_the_browser(firefox_binary, tmp_path):
|
||||
"""The cleanup after a forced timeout kills everything: it launches the
|
||||
stand-in as the test does, kills it as the test's `finally` does, and
|
||||
looks for survivors."""
|
||||
_require_strace_can_trace(tmp_path)
|
||||
log = tmp_path / "strace.log"
|
||||
pidfile = tmp_path / "stand-in.pid"
|
||||
stand_in = _stand_in(firefox_binary, tmp_path / "engine", log, pidfile)
|
||||
profile = tmp_path / "profile"
|
||||
profile.mkdir()
|
||||
proc = _detached([stand_in, "-headless", "-no-remote", "-profile", str(profile), "about:blank"],
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
try:
|
||||
end = time.monotonic() + 30
|
||||
while time.monotonic() < end and "-contentproc" not in (
|
||||
log.read_text(errors="replace") if log.exists() else ""):
|
||||
time.sleep(0.2)
|
||||
pgid = _group_of(pidfile)
|
||||
assert pgid == proc.pid, "the stand-in does not lead the group its launcher gave it (group %s, pid %d)" % (pgid, proc.pid)
|
||||
assert len(_group_members(pgid)) >= 3, "strace and the browser did not come up"
|
||||
assert _kill_group(pidfile) == pgid
|
||||
proc.wait(timeout=30)
|
||||
left = _wait_for_exit(pgid)
|
||||
finally:
|
||||
_kill_group(pidfile)
|
||||
assert not left, "processes left after the kill: %s" % [
|
||||
Path("/proc/%d/cmdline" % p).read_bytes()[:120] for p in left
|
||||
if Path("/proc/%d" % p).exists()]
|
||||
|
||||
|
||||
def test_no_process_reads_the_host_fontconfig(firefox_binary, tmp_path, engine_at_least):
|
||||
engine_at_least("firefox-68")
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
_require_strace_can_trace(tmp_path)
|
||||
log = tmp_path / "strace.log"
|
||||
tree = tmp_path / "engine"
|
||||
pidfile = tmp_path / "stand-in.pid"
|
||||
stand_in = _stand_in(firefox_binary, tree, log, pidfile)
|
||||
real = os.path.realpath(firefox_binary)
|
||||
try:
|
||||
with InvisiblePlaywright(seed=4246, binary_path=stand_in,
|
||||
headless=True) as browser:
|
||||
page = browser.new_page()
|
||||
page.set_content(_PAGE)
|
||||
# Text was laid out with real fonts: the page measured something.
|
||||
assert page.evaluate(
|
||||
"() => document.querySelector('p').getBoundingClientRect().width") > 0
|
||||
page.screenshot()
|
||||
finally:
|
||||
_kill_group(pidfile)
|
||||
|
||||
text = log.read_text(errors="replace")
|
||||
assert "-contentproc" in text, (
|
||||
"strace saw no content process, so the test could not judge one")
|
||||
found = judge(_host_lookups(log, real))
|
||||
report = []
|
||||
for who, hits in sorted(found.items()):
|
||||
pids = sorted({int(h.split()[0]) for h in hits})
|
||||
names = sorted({q for h in hits for q in re.findall(r'"([^"]*)"', h)
|
||||
if any(q == p or q.startswith(p + "/")
|
||||
for p in _host_font_paths())})
|
||||
roots = {p: sum(1 for n in names if n == p or n.startswith(p + "/"))
|
||||
for p in _host_font_paths()}
|
||||
report.append("%s: %d calls by pids %s, %d paths (%s), first ones:"
|
||||
% (who, len(hits), pids, len(names),
|
||||
", ".join("%s %d" % kv for kv in roots.items() if kv[1])))
|
||||
report += [" " + n for n in names[:12]]
|
||||
report += [" " + h[:240] for h in hits[:4]]
|
||||
assert not found, (
|
||||
"the browser opened the host's fontconfig, or a content process looked at it (%s):\n%s"
|
||||
% (", ".join(_host_font_paths()), "\n".join(report)))
|
||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user