Compare commits

..
Author SHA1 Message Date
feder-cr 27f0501cea tests: the proof of the hidden-display pointer test is an outcome after a count of frames, not a clock window 2026-12-02 11:47:28 +01:00
feder-cr 585acedecc tests: a page on the hidden display sees no pointer or mouse event before the test's first input, and its first event is the one that input makes 2026-12-02 11:44:49 +01:00
feder-cr 05149cb8c8 Merge branch 'e72/r6-pwwidth' into e72/r6-wrapper 2026-12-02 08:49:39 +01:00
feder-cr 95bcd4d1c3 tests: the password-mask extraction test is listed among the tests that hash a file, and the page it hashes is a pinned fixture (-text) 2026-12-02 08:49:29 +01:00
feder-cr 4afd02e305 Merge branch 'e72/r6-b2' into e72/r6-wrapper 2026-12-02 08:48:00 +01:00
feder-cr 570d9997ad Merge branch 'e72/r6-twinctl' into e72/r6-wrapper
Unit rows re-summed: +9 cases of the popup move-to extraction test (first and later popup positions), 4586 + 9 = 4595 linux, 4598 + 9 = 4607 windows.
2026-12-02 08:48:00 +01:00
feder-cr 0eff758320 tests: each phase of the popup move/resize test expects what retail reads in the position the phase has in the browser's life (phase 1 the first popup, phase 3 a later one), from the popup-move-to capture of four launches
Retail Firefox 159.0 at a real 150% opens the first popup of a browser one device pixel narrower than every popup after it (inner 499, outer 514, against 500 and 515), and moveTo(99999, 0) stops at 766 for it and 765 for a later one. The old expected values of phase 1 came from rounds
that ran resizeBy(0, 0) in a LATER popup (500, then 501), while the test runs phase 1 as the FIRST popup the browser opens (nothing is opened before it: launch_case, new_page, goto, then the three phases in this order, each popup closed before the next).

The capture (RetailCaptures hunt/popup-move-to, run 46833539990, commit 8a78d95c461c84d9c11fcbd0596b120bbcb102f4; runs 46832090474 and 46821521582 read the same except the one value below) has per display case four launches: a the test's order, b phase 3 alone, c a throwaway
popup opened and closed first and then the three phases, d phase 2 alone, so every phase is read as the first popup of a browser and as a later one. scripts/extract_retail_popup_move_resize.py writes ci/retail-popup-move-resize.json from it (cases[case][phase][first|later],
the launches each reading came from, the sha256 of every raw.json checked against its meta.json, popups of one position that disagree fail the extraction) and cross-checks the window-geometry rounds against it. The test reads only: MOMENTS is phase 1 first, MOVE_TO is
phase 3 later; no assertion changed.

Old and new expected values: phase 1 at scale 1.5 was inner 500x400, outer 515x478 before and inner 501 after resizeBy(0, 0); it is now inner 499x400, outer 514x478 before and after. Scales 1, 1.25 and 2 and phase 3 (moved 13,13; moved_to 765,0; outer 515 at 1.5) are unchanged.

The "501 after resizeBy(0, 0)" case is not asserted any more because this test never opens a non-first popup with resizeBy. It is not lost: launch c (resizeBy(0, 0) in the second popup of its browser) reads 500 then 501 at 1.5 in runs 46832090474 and 46833539990, and the extraction
fails if the old rounds' readings are reproduced by no position (they are, by later, in all four cases).

Unit tests (red on the old script, green after): 26 -> 35 in test_the_retail_popup_moves_and_resizes_are_extracted_from_the_capture_not_typed.py; ci/required-suites.json wrapper.unit.all.linux 4564 -> 4573 and wrapper.unit.all.windows 4576 -> 4585.
2026-12-02 08:42:21 +01:00
feder-cr 6bb7df2ba3 tests: TEMP evidence, a listener made by another script world and the page's own throwing listener, and what window.onerror is told, run on retail and on ours, side by side
On candidate 46792115974 (linux.3, windows.3) the two listener cases of
test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py fail: the error of the
listener the client's evaluate registered never reaches window.onerror, the page's own does.
This test registers the same listener from the default sandbox of Marionette's ExecuteScript on
retail Firefox 159 (not wrappedJSObject.eval, which is the page's realm) and from the client's
evaluate on ours, fires it by a real click on the page's trigger, and saves per case (Error,
throw 5) whether window.onerror was called and what it was told, with the page's own listener as
control. It asserts nothing about ours.
It is the third file of the row wrapper.e2e.stock_twin.tooltip (min_tests 6) and a named exclusion
of the whole-suite rows (30).
2026-12-02 07:36:17 +01:00
feder-cr 71ddb27003 Merge branch 'e72/r6-b2' into e72/r6-wrapper 2026-12-02 07:26:52 +01:00
feder-cr 1509415d7a Merge branch 'e72/r6-pwwidth' into e72/r6-wrapper
Unit rows re-summed: 4558 + 6 (twin control) + 14 (popup move-to extraction) + 8 (password-mask extraction) = 4586 linux; 4570 + 28 = 4598 windows.
2026-12-02 07:26:51 +01:00
feder-cr 0072328944 Merge branch 'e72/r6-twinctl' into e72/r6-wrapper 2026-12-02 07:26:21 +01:00
feder-cr 197a3e4f49 tests: phase 3 of the popup move/resize test expects what retail reads in its own order (the third popup of one launch, moveBy(10, 10), moveTo(99999, 0)), extracted from the popup-move-to capture with every raw.json checked against its meta.json sha256, not from rounds that ran resizeBy(0, 0) first 2026-12-02 07:12:56 +01:00
feder-cr f0b83b089c tests: the retail window of a twin is sized by the content area of ours plus its frame read in device pixels, and only the inner equality is the hard control
The control was wrong against its source. size_by_content took the retail frame as outerWidth/outerHeight less innerWidth/innerHeight and demanded retail outer == asked. outerWidth and
outerHeight are whole CSS pixels (Firefox nsGlobalWindowOuter::GetOuterSize returns RoundedToInt(GetSize() / CSSToDevScale), nsGlobalWindowOuter.cpp:3573 in the engine tree), innerWidth and
innerHeight are fractional, so the frame read that way is off by up to half a CSS pixel, and a content area of an odd number of device pixels at a scale of 2 (558.5 CSS = 1117 device) has no
outer size that reads back as asked. Candidate 46792115974: linux dpr2.0 asked outer [800, 558.5], answers outer [800, 559] and inner [800, 558.5] = ours; windows dpr1.25 asked [1548.4, 829.2],
answers [1549, 830]; linux dpr1.25 and dpr1.5: the frame from the whole outer less the fractional inner made the retail inner 0.4 and 0.33 CSS smaller than ours (a real mismatch).

RetailSession.set_inner_size reads the window frame in device pixels in one chrome script (nsIBaseWindow.getSize less the content area times the scale) and sets the window to ours' inner
size plus that frame (CONTENT_JS). run_retail_twin keeps the inner equality as the hard control (BROKEN CONTROL when the inner sizes differ); the outer readback is no longer a condition.
Nothing about ours changes. Unit tests: the odd device height at dpr2.0 is not broken when inner is equal, an inner that differs is broken; red on 674ba823, green here.
Unit rows: +6 tests (4564 linux, 4576 windows).
2026-12-02 06:50:50 +01:00
feder-cr b165ac7e90 tests: TEMP evidence, the plant and the page's own read of the getters of the handle test run on retail and on ours, side by side
The control of test_a_client_call_on_a_handle_reads_none_of_the_getters_the_page_planted fails before
any client call on candidate 46792115974 (linux.3, windows.3): properties off the prototype chain
count 1, properties on it count 0. This test runs the same pages and the same plant and read on retail
Firefox 159 (Marionette) and on ours, and saves per property the count, where it is defined before
and after the plant, and a second read, in the evidence folder. It asserts nothing about ours.
It is the second file of the row wrapper.e2e.stock_twin.tooltip (min_tests 5) and a named exclusion of the
whole-suite rows (29).
2026-12-02 06:50:39 +01:00
feder-cr c1c0a84214 tests: a password field of 40 characters is as wide as on retail Windows (the engine masks with U+25CF, not '*'), the retail width extracted from the capture by a script
- test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py: the page of the retail capture, byte for byte (tests/data/password_mask_page.html), read in the product launch (seed 4, scale 1): the scrollWidth of a password field of 40 x "a" in Arial 16px must equal the retail value, on Linux and Windows. Red where the widget layer masks with '*' (249 px against 387 px).
- scripts/extract_retail_password_mask.py writes ci/retail-password-mask.json from the capture (result.json and meta.json, sha256 checked, page sha256 checked); nothing is typed.
- test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py: the extraction on a small sample, known-bad captures refused, the e2e test holds no number (8 unit cases).
- ci/required-suites.json: the e2e in wrapper.e2e.suite.linux.3 (394) and windows.3 (297); the unit file in wrapper.unit.all.linux (4566) and windows (4578).
2026-12-02 06:49:05 +01:00
feder-cr 674ba82359 tests: the login list not open before the click on #user ends, or before the press on #pass, is a broken control, not a finding about ours 2026-12-02 06:32:59 +01:00
feder-cr 7ee01460c3 tests: the login autocomplete case is launched with signon.rememberSignons true, as a default Firefox, since -marionette sets it false, and its failure message prints the pref 2026-12-02 06:32:13 +01:00
feder-cr 476da7c8d0 Merge commit 'eb052e74397795bf8588be1d6e72f8034fb87e06' into e72/r5-wrapper 2026-12-02 06:30:35 +01:00
feder-cr eb052e7439 tests: the fontconfig rules of the host enter through /etc/fonts/local.conf, since the core owns XDG_CONFIG_HOME
The test of the fontconfig rules (E1) injected each launch's rules through $XDG_CONFIG_HOME/fontconfig/fonts.conf and held the precondition that
XDG_CONFIG_HOME reached the engine (/proc/<pid>/environ). The core now points XDG_CONFIG_HOME and XDG_CONFIG_DIRS of the engine at empty folders of
its own, so that route no longer reaches the engine.

Now each launch writes its rules to /etc/fonts/local.conf with sudo (the e2e job runs on ubuntu-24.04 runners with passwordless sudo: e2e.yml
already uses it) and puts the original file back, or removes it if there was none, when the launch ends. The positive control stays: fc-match on
the host, in the environment of the test process, must obey each rule, or the launch fails. The engine-environment precondition is replaced by that
control. Every pixel assertion is unchanged: same launches, canvases, families, sizes and hashes compared with launch 1, plus the system-ui
assertion. Same three tests, same ids.

Why this is not a weakened test: the source of the test changed, not its bar. The test's route (the user's XDG config folder) is no longer a
route a host can use on the new engine, because the core owns that variable; the system-wide file is where a host can still put a rule, and the
test reads the same effect there. The check that the rule is in force in fontconfig itself is kept as the host control, and a rule fontconfig
does not apply still fails the launch.

The row note of ci/required-suites.json and the docstring of the host-files test say how it is now.
2026-12-02 03:25:15 +01:00
22 changed files with 3239 additions and 529 deletions

No files matched your search

+3
View File
@@ -34,3 +34,6 @@ tests/data/known_mozilla_defects/** -text
# The ready security state is hashed byte for byte against ci/security-state.pin.json.
ci/security-state/** -text
# The page of the password-mask e2e is the same bytes as the page of the retail capture (its sha256 is checked), so no checkout may change its line endings.
tests/data/password_mask_page.html -text
+6 -6
View File
@@ -14,19 +14,19 @@
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 7, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4: every step as stock, and every page left only once its noise is done), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 7 = 3 + 4 (the last two: a `load` that takes 20 s is a step that succeeds, and a `load` that never comes ends in an error that names the wait and the page). Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY).", "stock_firefox": true, "extra_steps": ["fakeweb_profiles"]},
{"id": "wrapper.e2e.stock_twin.dnd", "giro": "G2", "os": ["linux", "windows"], "min_tests": 8, "exact": true, "tests": ["tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py", "tests/test_a_press_outside_an_open_datalist_list_ends_as_on_stock_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one leg. The twin of the real drag from the top into a frame of another site (4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs. Second file: the twin of a press outside the open list of a datalist (4 scales): the list must be open in chrome on both before the press (else BROKEN CONTROL), and the events the page hears and the state of the list after must be the reference's (the leg took 2 minutes with one file).", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.select", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_select_dropdown_opens_at_its_element_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the select dropdown (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.tooltip", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_tooltip_opens_at_the_pointer_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the tooltip (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.tooltip", "giro": "G2", "os": ["linux", "windows"], "min_tests": 6, "exact": true, "tests": ["tests/test_a_tooltip_opens_at_the_pointer_e2e.py", "tests/test_temp_a_listener_of_a_sandbox_world_is_recorded_on_retail_and_on_ours_e2e.py", "tests/test_temp_the_planted_getters_are_recorded_on_retail_and_on_ours_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the tooltip (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs. Second file (TEMPORARY, remove with the control it explains): the plant and the page's own read of the getters planted by tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py, run on retail and on ours, dumped side by side to the evidence folder, no verdict about ours. Third file (TEMPORARY, same): what window.onerror is told when a listener registered from another script world (retail: the default sandbox of Marionette's ExecuteScript; ours: the client's evaluate) throws an Error and a non-error, against the page's own throwing listener as control, for the two listener cases of tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.intersection", "giro": "G2", "os": ["linux", "windows"], "min_tests": 8, "exact": true, "tests": ["tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of what the IntersectionObserver of a scrolled frame of another site reads (8 steps, 4 scales) and of when a lazy frame is requested (4 distances, 4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 9, "exact": true, "tests": ["tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py", "tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the engine runs it on its own empty configuration, and the rules of a user and the files of the host are what these tests try to make reach it. On Windows DirectWrite draws the text from the path of the font, with no rule of a user and no configuration or cache of fonts to read, so these tests have no Windows counterpart.", "note": "7 = (1-3) the fontconfig rules of a user do not reach the pixels of the text a page reads: seven launches of one seed, each with its own user fonts.conf ($XDG_CONFIG_HOME/fontconfig/fonts.conf, as a real user's rules enter; not FONTCONFIG_FILE, which the core strips): nothing; rgba=none with lcdfilter=lcdnone; rgba=bgr; embeddedbitmap=false; autohint=true; hintstyle=hintfull with antialias=false; a strong prepend rule on system-ui. fc-match, in the same environment, must show each rule in force (a launch that measures nothing is red). Three tests: every rule in force and its XDG_CONFIG_HOME in the engine's environment; the hashes of the pixels of getImageData (an opaque canvas and the default one, Arial, SimSun, MS Gothic at 9-16 px) equal to those of the launch with nothing; the computed family and the widths of system-ui equal. (4-7) no fontconfig file of the host is opened and the screenshot draws the bundle: the stand-in that runs the engine under strace stays in the engine's place (a fake engine with a child, no browser); the caches $HOME/.fontconfig and $XDG_CACHE_HOME/fontconfig hold a valid cache of the bundle that lacks msgothic5_32.ttc (fc-list proves it); under strace no process opens a path under /etc/fonts, a fonts.conf or a *.cache-* file; the screenshot of Japanese text in MS PGothic equals the content's own drawing. Needs strace, fc-cache, fc-list and fc-match on the runner: without them the tests are red, not skipped. Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-rules and fontconfig-host-files. Also in the row until the 72 is released: the old file of the warm-cache test (2 tests, same ids), rewritten to assert the 72's behaviour: the stand-in, and two launches with the same XDG_CACHE_HOME and HOME under strace write no fontconfig cache file (*.cache-*, .NEW, .TMP-*) and no process opens one. E1 and E2 replace it; its retirement entry goes to main after the release of the 72."},
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 9, "exact": true, "tests": ["tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py", "tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the engine runs it on its own empty configuration, and the rules of a user and the files of the host are what these tests try to make reach it. On Windows DirectWrite draws the text from the path of the font, with no rule of a user and no configuration or cache of fonts to read, so these tests have no Windows counterpart.", "note": "7 = (1-3) the fontconfig rules of a user do not reach the pixels of the text a page reads: seven launches of one seed, each with its own system-wide rule file (/etc/fonts/local.conf, written with sudo before the launch and put back after it; not the environment, which the core owns: it strips FONTCONFIG_*, and points XDG_CONFIG_HOME and XDG_CONFIG_DIRS at empty folders): nothing; rgba=none with lcdfilter=lcdnone; rgba=bgr; embeddedbitmap=false; autohint=true; hintstyle=hintfull with antialias=false; a strong prepend rule on system-ui. fc-match, in the same environment, must show each rule in force (a launch that measures nothing is red). Three tests: every rule in force in fc-match on the host; the hashes of the pixels of getImageData (an opaque canvas and the default one, Arial, SimSun, MS Gothic at 9-16 px) equal to those of the launch with nothing; the computed family and the widths of system-ui equal. (4-7) no fontconfig file of the host is opened and the screenshot draws the bundle: the stand-in that runs the engine under strace stays in the engine's place (a fake engine with a child, no browser); the caches $HOME/.fontconfig and $XDG_CACHE_HOME/fontconfig hold a valid cache of the bundle that lacks msgothic5_32.ttc (fc-list proves it); under strace no process opens a path under /etc/fonts, a fonts.conf or a *.cache-* file; the screenshot of Japanese text in MS PGothic equals the content's own drawing. Needs strace, fc-cache, fc-list, fc-match and sudo without a password on the runner: without them the tests are red, not skipped. Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-rules and fontconfig-host-files. Also in the row until the 72 is released: the old file of the warm-cache test (2 tests, same ids), rewritten to assert the 72's behaviour: the stand-in, and two launches with the same XDG_CACHE_HOME and HOME under strace write no fontconfig cache file (*.cache-*, .NEW, .TMP-*) and no process opens one. E1 and E2 replace it; its retirement entry goes to main after the release of the 72."},
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 4558, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.py", Line truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 4570, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.pLine truncated
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 4595, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.py", Line truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 4607, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_popup_under_the_declared_viewport_is_not_pinned.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_served_browser_keeps_the_udp_verdicts_of_its_proxies.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_an_expired_popupshown_wait_fails_the_e2e_test_that_launched_the_browser.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_fixture_a_test_pins_is_checked_out_byte_for_byte.pLine truncated
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode).", "core_dumps": "invpw-cores"},
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 447, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_throuLine truncated
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 463, "exact": true, "tests": ["tests/test_a_click_under_the_login_autocomplete_list_reaches_the_page_e2e.py", "tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_press_on_an_open_select_follows_windows_rollup_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_no_fontconfig_file_of_the_host_is_opened_and_the_screenshot_draws_the_bundle_linux_e2e.py", "tests/test_no_popup_is_left_when_a_page_closes_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of Line truncated
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 393, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py", "tests/test_webgpu_external_texture_e2e.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.3", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 565 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on linux (a skip is red in the verdict).", "run": "suite_run"},
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 396, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_page_sees_no_pointer_event_before_the_first_input_on_the_hidden_display_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py", "tests/test_webgpu_external_texture_e2e.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.3", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 565 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on linux (a skip is red in the verdict).", "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.1", "giro": "G2", "os": ["windows"], "min_tests": 332, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_detectors_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_ignore_https_errors_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_transport.py", "tests/test_keyboard_rhythm.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_workers_blocked.py", "tests/test_strict_and_force.py", "tests/test_the_engine_is_born_in_the_job_e2e.py", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_ua_widget_not_selectable.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 1 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 327, "exact": true, "tests": ["tests/test_a_click_under_the_login_autocomplete_list_reaches_the_page_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_press_on_an_open_select_follows_windows_rollup_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_declared_host_network_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_expose_binding_e2e.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_desktop.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_no_popup_is_left_when_a_page_closes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_oop_frame_geometry.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_e2e.py", "tests/test_screencast_stop_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the fLine truncated
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 296, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 299, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_page_sees_no_pointer_event_before_the_first_input_on_the_hidden_display_e2e.py", "tests/test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py", "tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 334, "exact": true, "tests": ["tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_popup_reads_the_retail_sizes_of_a_maximized_main_window_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_injected_node_surface.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_juggler_connection.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_oop_frame_element.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_scroll_into_view.py", "tests/test_shadow_trusted_input.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.control_a", "giro": "G2", "os": ["windows"], "min_tests": 20, "exact": true, "tests": ["tests/test_control_a_selects_all_in_a_field_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "The keyboard shortcut Control+A selects all in a field (5 ways to press it x an input and a textarea, in-process and served to the stock client), alone on its own Windows runner (windows-latest), as e2e.yml runs it on the published engine: the Windows keyboard of a real user is what it needs. The same file is in one of wrapper.e2e.suite.windows.1..4 and in wrapper.e2e.suite.linux.1.", "run": "suite_run"},
{"id": "wrapper.e2e.ab_oracle", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_oracle_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Same seed, same bytes: the engine of the published set (the last published engine, with its own core and wrapper) against the candidate (with core_ref and wrapper_ref), on one machine, after the control: the published engine against ITSELF (the A/A; a difference is a broken control, exit 2, and the A/B is not run). On a pull request (no candidate: INVPW_BINARY_PATH is the published engine, no INVISIBLE_SEAL_FILE) the A/A is the whole test, on the first two seeds of the candidate set (all five when the pull request changes a file of this oracle: the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py exports AB_ORACLE_PR_SEEDS), and saves both dumps and the diff under $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. scripts/ci_ab_oracle.py runs the host gate's dump (scripts/ci_host_gate.py dump: the persona seeds of ci/persona-seeds.json, each at its own DPR with nothing pinned, the whole page of scripts/host_gate; the `candidate` set of 5 seeds that reach every webgl renderer and every DPR, or with AB_ORACLE_SEED_SET=final and AB_ORACLE_SHARD=i/n the 20 seeds that reach every value of every dimension split over n jobs) twice, once with the published engine (fetched by the published set's own core under its own seal, which checks the archive's sha256, and dumped in that set's venv) and once with the candidate binary of the leg under its own seal, and compares every leaf of every visit: the only differences allowed are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys; anything else is red with the leaf, the two values and the seed; fewer leaves than the host gate's reference holds (16439 per visit; a DPR the reference does not record is held to the least of those it does) is red. The files (dump-<N>.json, dump-<N>-again.json for the tag of the published set, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) are the artifact ab-oracle-<os> of the leg. 1 = the one test; the comparator's own cases (51, the A/A's among them) are in tests/test_ab_oracle.py, the persona seeds' (15) in tests/test_persona_cover.py, in the rows of the whole unit suite. Needs the engine's binary (INVPW_BINARY_PATH) and, for the A/B, the candidate's seal (INVISIBLE_SEAL_FILE) and the network (the release assets of the published engine, and INVPW_PUBLISHED_PYTHON). Each engine runs with the core it was built for: a core that declares less than the published engine requires is no longer a red of this suite (it was: engine candidate 5, every A/B a broken control). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "timeout_minutes": 50, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"], "artifact": "ab-oracle"},
+43
View File
@@ -0,0 +1,43 @@
{
"about": "What retail Firefox on Windows reads on a password field in the page tests/data/password_mask_page.html (the width of 40 x 'a' in Arial 16px, which is 40 times the advance of the mask character), extracted by scripts/extract_retail_password_mask.py. Never edited by hand.",
"capture": {
"folder": "captures/firefox-159.0/windows-server-2025/password-mask/2026-12-02",
"retail_captures_commit": "e81da117a01c8d05b00beb62cd544dc057d40f85",
"run": "https://github.com/oss-invisible/core/actions/runs/46769343558",
"browser": {
"firefox_version": "159.0",
"build_id": "20261022150525",
"installer_sha256": "8776887b79925abbdd407fcdfe257d8382b54e24be52a6466426b95a804d6790",
"firefox_exe_sha256": "d8b5ed82fcd9c0f159dc86dc1c4526ceae981c4d9651f21908b6de90d0a56d85",
"xul_dll_sha256": "fec21f3e7c281c836ff4fb9658bf321857e101750bc4a6280d1b419996ce7e29"
},
"host": {
"runner_image": "windows-2025",
"os_version": "10.0.26100",
"os_ubr": "33828"
}
},
"files": [
{
"path": "result.json",
"sha256": "980ac7f4ee06ffeef80c3aa3ddb594216b30c4b221b43156b1fa39f92153571a"
},
{
"path": "meta.json",
"sha256": "3ecefececdca063d84b48f7bb8905039077356b5c6c46e59e2a7551e1bdaf2ad"
}
],
"page": {
"path": "tests/data/password_mask_page.html",
"sha256": "4b0c454f723392003e75325036effc576627a71f29c8d82cb01033a963e8de2a"
},
"n": 40,
"cases": {
"arial16": {
"password_scrollWidth": 387,
"mask": "U+25CF",
"devicePixelRatio": 1,
"platform": "Win32"
}
}
}
File diff suppressed because it is too large. Load diff
+134
View File
@@ -0,0 +1,134 @@
#!/usr/bin/env python3
"""Extracts, from the retail capture of the password-mask probe, the width retail Firefox on Windows gives a password field, into ci/retail-password-mask.json.
The e2e test ``tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py`` compares the width a page reads on a password field of our engine with the width RETAIL Firefox 159 on
Windows read in the same page. That number is typed nowhere: it is read here from the capture,
``captures/firefox-159.0/windows-server-2025/password-mask/<date>/result.json``: the page's whole reading (``fonts.arial16.password["40"].scrollWidth``, the ``scrollWidth`` of an
``<input type=password>`` of 40 x "a" in Arial 16px, the number a page reads) and ``meta.json`` (the sha256 of every file of the capture, of the page, of the binaries).
What is refused rather than filled in: a ``result.json`` whose sha256 is not the one ``meta.json`` lists; a page that is not the page of the capture (the sha256 of
``tests/data/password_mask_page.html`` must be ``meta.json``'s ``page.sha256``); a result with an ``error``, another ``n``, or no ``arial16`` reading; a reading that disagrees with itself (the width of
the password field in its own box and in the box of the 1, 10, 40 series; the verdict of the page, which must name U+25CF alone, the character Windows masks with).
The file records the capture's commit and run, the browser (version, build id, installer, ``firefox.exe`` and ``xul.dll`` sha256) and the sha256 of every file read. The wrapper's CI has no capture, so the
tests read the committed file and this module's functions are tested on a small sample (tests/test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py). One command regenerates it:
python scripts/extract_retail_password_mask.py --capture <RetailCaptures>/captures/firefox-159.0/windows-server-2025/password-mask/2026-12-02 --commit <RetailCaptures commit> --write
and the same without ``--write`` compares the committed file with what the capture gives (the check).
"""
from __future__ import annotations
import argparse
import hashlib
import json
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional
ROOT = Path(__file__).resolve().parent.parent
DATA_PATH = ROOT / "ci" / "retail-password-mask.json"
PAGE_PATH = ROOT / "tests" / "data" / "password_mask_page.html"
#: The characters of the field: ``N`` copies of "a", read in the font case ``arial16`` (``font-family:Arial;font-size:16px``).
N = 40
FONT_CASE = "arial16"
#: What Windows masks a password field with, and what the page's verdict must therefore name.
MASK = "U+25CF"
FORMAT = "password-mask/1"
class ExtractError(Exception):
"""What the capture does not give, or gives two ways: nothing is invented in its place."""
def sha256_of(path: Path) -> str:
return hashlib.sha256(path.read_bytes()).hexdigest()
def reading(result: Dict[str, Any], where: str) -> Dict[str, Any]:
"""The width of the password field in ``arial16``, after the checks of the reading against itself."""
if "error" in result:
raise ExtractError("%s: the page recorded an error: %s" % (where, str(result["error"])[:200]))
if result.get("format") != FORMAT or result.get("n") != N:
raise ExtractError("%s: format %r and n %r, not %r and %r" % (where, result.get("format"), result.get("n"), FORMAT, N))
try:
font = result["fonts"][FONT_CASE]
width = font["password"][str(N)]["scrollWidth"]
main = font["password"][str(N)]["scrollWidth_main"]
mask_width = font["refs"][MASK]["text_input"][str(N)]["scrollWidth"]
verdict = font["verdict"]["by_text_input_scrollWidth"]
platform, dpr = result["env"]["platform"], result["env"]["devicePixelRatio"]
except (KeyError, TypeError) as exc:
raise ExtractError("%s: the reading lacks %s: no retail value, none invented" % (where, exc))
if not isinstance(width, int) or width <= 0:
raise ExtractError("%s: the width %r is not a positive integer" % (where, width))
if main != width:
raise ExtractError("%s: the password field reads %r in its own box and %r in the series box" % (where, main, width))
if mask_width != width or verdict != [MASK]:
raise ExtractError("%s: the password field is %r wide, %s in a text input is %r and the page's verdict is %r: not the mask character of Windows" % (where, width, MASK, mask_width, verdict))
if platform != "Win32":
raise ExtractError("%s: navigator.platform is %r, not Win32: not a Windows capture" % (where, platform))
return {"password_scrollWidth": width, "mask": MASK, "devicePixelRatio": dpr, "platform": platform}
def build(capture: Path, commit: str, page: Path = PAGE_PATH) -> Dict[str, Any]:
result_path, meta_path = capture / "result.json", capture / "meta.json"
for path in (result_path, meta_path, page):
if not path.is_file():
raise ExtractError("missing %s" % path)
meta = json.loads(meta_path.read_text(encoding="utf-8"))
listed = meta.get("files", {}).get("result.json", {}).get("sha256")
if listed != sha256_of(result_path):
raise ExtractError("%s is %s and meta.json lists %r: not the file the capture recorded" % (result_path, sha256_of(result_path), listed))
page_sha = sha256_of(page)
if page_sha != meta.get("page", {}).get("sha256"):
raise ExtractError("%s is %s and the capture's page is %r: the test would not read the page retail read" % (page, page_sha, meta.get("page", {}).get("sha256")))
got = reading(json.loads(result_path.read_text(encoding="utf-8")), str(result_path))
binaries = meta.get("binaries", {})
return {
"about": "What retail Firefox on Windows reads on a password field in the page tests/data/password_mask_page.html (the width of 40 x 'a' in Arial 16px, which is 40 times the advance of the mask character), extracted by scripts/extract_retail_password_mask.py. Never edited by hand.",
"capture": {
"folder": "captures/firefox-159.0/windows-server-2025/password-mask/%s" % capture.name,
"retail_captures_commit": commit,
"run": "https://github.com/%s/actions/runs/%s" % (meta["source_run"]["repo"], meta["source_run"]["run_id"]),
"browser": {"firefox_version": meta["firefox_version"], "build_id": meta["build_id"], "installer_sha256": binaries.get("installer_sha256"),
"firefox_exe_sha256": binaries.get("firefox_exe_sha256"), "xul_dll_sha256": binaries.get("xul_dll_sha256")},
"host": {"runner_image": meta["host"]["runner_image"], "os_version": meta["host"]["os_version"], "os_ubr": meta["host"]["os_ubr"]},
},
"files": [{"path": "result.json", "sha256": sha256_of(result_path)}, {"path": "meta.json", "sha256": sha256_of(meta_path)}],
"page": {"path": "tests/data/password_mask_page.html", "sha256": page_sha},
"n": N,
"cases": {FONT_CASE: got},
}
def dumps(data: Dict[str, Any]) -> str:
return json.dumps(data, indent=2, sort_keys=False) + "\n"
def main(argv: Optional[List[str]] = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
parser.add_argument("--capture", required=True, type=Path, help="the folder of the capture in RetailCaptures (result.json and meta.json)")
parser.add_argument("--commit", required=True, help="the RetailCaptures commit the capture is in")
parser.add_argument("--write", action="store_true", help="write ci/retail-password-mask.json; without it the committed file is compared with the capture")
args = parser.parse_args(argv)
try:
text = dumps(build(args.capture.resolve(), args.commit))
except ExtractError as exc:
print("EXTRACTION FAILED: %s" % exc, file=sys.stderr)
return 2
if args.write:
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
print("wrote %s" % DATA_PATH)
return 0
if DATA_PATH.read_text(encoding="utf-8") != text:
print("%s is not what the capture gives" % DATA_PATH, file=sys.stderr)
return 1
print("%s is what the capture gives" % DATA_PATH)
return 0
if __name__ == "__main__":
sys.exit(main())
+219 -13
View File
@@ -1,19 +1,27 @@
#!/usr/bin/env python3
"""Extracts, from retail captures of the window geometry, what a popup of the maximized window reads after ``resizeBy(0, 0)``, ``moveBy(10, 10)`` and ``moveTo(99999, 0)``, into ci/retail-popup-move-resize.json.
"""Extracts, from the retail capture ``popup-move-to``, what a popup of the maximized window reads after ``resizeBy(0, 0)``, ``moveBy(10, 10)`` and ``moveTo(99999, 0)``, per display case, per phase of the wrapper test and
per POSITION in the browser's life, into ci/retail-popup-move-resize.json.
The e2e test ``tests/test_a_popup_moves_and_resizes_as_declared_e2e.py`` compares a popup of ours with what RETAIL Firefox 159 on Windows read. Its table was typed by hand, and the claim in its docstring that
``resizeBy(0, 0)`` changes nothing was wrong at a real 150% (retail reads an inner width of 501 after it, 500 before; the outer size is the same). The numbers are read from the captures, never typed:
The e2e test ``tests/test_a_popup_moves_and_resizes_as_declared_e2e.py`` compares a popup of ours with what RETAIL Firefox 159 on Windows read. An expected value comes from a capture of the SAME sequence,
position in the browser's life included: at a real 150% retail opens the FIRST popup of a browser one device pixel narrower (inner width 499, outer 514) than every popup after it (500, 515), ``resizeBy(0, 0)``
leaves the first at 499 and takes a later one to 501, and ``moveTo(99999, 0)`` stops at 766 for the first and 765 for a later one. The numbers are read from the capture, never typed:
* ``<round>/<dpr>/<panel>/<launch>/raw.json``, step ``popup_move_resize``: a popup opened with ``width=500,height=400`` from the maximized main window, read at four moments, ``initial`` (as opened),
``resized`` (after ``resizeBy(0, 0)``), ``moved`` (after ``moveBy(10, 10)``) and ``moved_to`` (after ``moveTo(99999, 0)``). The moments are keys of a sorted object, so the ORDER is not in the file; it is
read from the values and checked: the position is the opened one at ``initial`` and ``resized`` and moves at ``moved`` and ``moved_to``, which no other order gives.
* The rounds named on the command line (``--rounds``) must all have the step for the four display cases, in launches ``a`` and ``b``, and must all give the same readings, or the extraction fails: a value two
rounds or two launches disagree on is not a value.
* ``popup-move-to/<date>/<dpr>/<panel>/<launch>/raw.json`` (format ``retail-popup-move-to/1``), four launches per display case, each popup opened by a real click with ``width=500,height=400`` and closed before the next:
``a`` the test's order (phase 1 ``resizeBy(0, 0)``, phase 2 ``moveBy(10, 10)``, phase 3 ``moveBy(10, 10)`` then ``moveTo(99999, 0)``: phase 1 is the first popup of the browser), ``b`` phase 3 alone, ``c`` a throwaway
popup (no call) and then the three phases, ``d`` phase 2 alone. Every phase is thus read as the first popup of a browser (``first``: a, d, b) and as a later popup (``later``: c; a and c; a and c). Each step carries
its ordinal; the plan of every launch, the calls, the features, the close of every popup and the order of the moments are checked, and popups of the same phase and position must read the same, or the extraction fails.
* The sha256 of every raw.json is checked against the ``meta.json`` of its scale before it is read, and the run id, the browser (version, build id, installer sha256) and the sha256 of ``firefox.exe`` and
``xul.dll`` (``run-info.json``) are recorded.
* The window-geometry rounds named on the command line (``--rounds``; step ``popup_move_resize``: ``initial`` and ``resized`` as a later popup after many steps) are cross-checked: what they read after
``resizeBy(0, 0)`` must be what some position of the capture reads (at 1.5: 500 then 501, the ``later`` popup), or the extraction fails, an anomaly reported and not chosen. They must agree with each other
(all rounds, launches ``a`` and ``b``). The test does not read them.
The file records, for every raw.json read, its path and sha256, and the browser (version, build id, installer sha256). The wrapper's CI has no capture, so the tests read the committed file and this
module's functions are tested on a small sample (tests/test_the_retail_popup_moves_and_resizes_are_extracted_from_the_capture_not_typed.py). One command regenerates the file:
Each phase of the test asserts against the position it has in the test: phase 1 is the first popup of its browser (``first``), phases 2 and 3 are later ones.
python scripts/extract_retail_popup_move_resize.py --captures <RetailCaptures>/captures --rounds 2026-11-29-window-geometry-r8 2026-11-30-window-geometry-r9 2026-11-30-window-geometry-r11 2026-12-01-window-geometry-r12 --commit <RetailCaptures commit> --write
The wrapper's CI has no capture, so the tests read the committed file and this module's functions are tested on a small sample (tests/test_the_retail_popup_moves_and_resizes_are_extracted_from_the_capture_not_typed.py).
One command regenerates the file:
python scripts/extract_retail_popup_move_resize.py --captures <RetailCaptures>/captures --rounds 2026-11-29-window-geometry-r8 2026-11-30-window-geometry-r9 2026-11-30-window-geometry-r11 2026-12-01-window-geometry-r12 --commit <RetailCaptures commit> --move-to-capture <RetailCaptures>/captures/firefox-159.0/windows-server-2025/popup-move-to/2026-12-02 --move-to-run-id <id of the run> --move-to-commit <RetailCaptures commit> --write
and the same without ``--write`` compares the committed file with what the captures give (the check).
"""
@@ -23,7 +31,7 @@ import argparse
import json
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Tuple
sys.path.insert(0, str(Path(__file__).resolve().parent))
@@ -33,6 +41,33 @@ ROOT = Path(__file__).resolve().parent.parent
DATA_PATH = ROOT / "ci" / "retail-popup-move-resize.json"
MOMENTS = ("initial", "resized", "moved", "moved_to")
FEATURES = "width=500,height=400"
#: ``popup-move-to`` capture: the format of its raw.json and meta.json, the phase, and the order of phases of launch ``a`` (the test's order: phase 3 is the third popup).
MOVE_TO_FORMAT = "retail-popup-move-to/1"
MOVE_TO_META_FORMAT = "retail-popup-move-to-meta/1"
POSITION_FIRST = "first"
POSITION_LATER = "later"
MOVE_TO_PHASES = ["resize_by_zero", "move_by", "move_to_far_right"]
#: The launches of the capture and the popups each opens in order (``scripts/popup_move_to/run.py``, LAUNCHES): a is the test's order (phase 1 is the first popup of the browser); b phase 3 alone; c a throwaway
#: popup opened and closed first (no call), then the three phases; d phase 2 alone. Every phase is thus read as the first popup of a browser and as a later one.
MOVE_TO_LAUNCHES = {
"a": ["resize_by_zero", "move_by", "move_to_far_right"],
"b": ["move_to_far_right"],
"c": ["throwaway", "resize_by_zero", "move_by", "move_to_far_right"],
"d": ["move_by"],
}
MOVE_TO_MOMENTS = {
"throwaway": ("initial",),
"resize_by_zero": ("initial", "resized"),
"move_by": ("initial", "moved"),
"move_to_far_right": ("initial", "moved", "moved_to"),
}
MOVE_TO_CALLS = {
"throwaway": {},
"resize_by_zero": {"resized": "window.resizeBy(0, 0)"},
"move_by": {"moved": "window.moveBy(10, 10)"},
"move_to_far_right": {"moved": "window.moveBy(10, 10)", "moved_to": "window.moveTo(99999, 0)"},
}
MOVE_TO_BINARIES = ("firefox.exe", "xul.dll")
def moment_reading(moment: Dict[str, Any], where: str) -> Dict[str, Any]:
@@ -100,6 +135,166 @@ def build(captures: Path, rounds: List[str], commit: str) -> Dict[str, Any]:
}
def move_to_reading(moment: Dict[str, Any], where: str) -> Dict[str, Any]:
"""One moment of the ``popup-move-to`` format (short keys: ``iw``, ``ih``, ``ow``, ``oh``, ``sx``, ``sy``, ``availL``, ``availW``), in the shape of ``moment_reading``."""
try:
return {
"inner": [moment["iw"], moment["ih"]],
"outer": [moment["ow"], moment["oh"]],
"screen": [moment["sx"], moment["sy"]],
"avail": [moment["availL"], moment["availW"]],
}
except (KeyError, TypeError) as exc:
raise ExtractError("%s: the moment lacks %s" % (where, exc))
def position_of(ordinal: int) -> str:
"""``first``: the first popup the browser opens; ``later``: any popup after it (a throwaway popup counts)."""
return POSITION_FIRST if ordinal == 1 else POSITION_LATER
def read_launch(raw: Dict[str, Any], launch: str, where: str) -> List[Tuple[str, int, Dict[str, Dict[str, Any]]]]:
"""``[(phase, ordinal, readings)]`` of one launch of the ``popup-move-to`` capture, each phase checked against the plan of the launch, its calls and the order of its moments."""
if raw.get("format") != MOVE_TO_FORMAT:
raise ExtractError("%s has the format %r, not %r" % (where, raw.get("format"), MOVE_TO_FORMAT))
if raw.get("error") is not None:
raise ExtractError("%s ends with the error %r" % (where, raw.get("error")))
if raw.get("launch") != launch:
raise ExtractError("%s is launch %r, not %r" % (where, raw.get("launch"), launch))
if raw.get("phases_planned") != MOVE_TO_LAUNCHES[launch]:
raise ExtractError("%s ran the popups %r, not %r: the position of a phase in the browser's life is not the one this launch is for" % (
where, raw.get("phases_planned"), MOVE_TO_LAUNCHES[launch]))
found = []
for ordinal, phase in enumerate(MOVE_TO_LAUNCHES[launch], 1):
label = "%s step phase_%s" % (where, phase)
try:
step = raw["steps"]["phase_" + phase]
moments = step["moments"]
except (KeyError, TypeError):
raise ExtractError("%s is missing: no retail value, none invented" % label)
if step.get("ordinal") != ordinal:
raise ExtractError("%s is popup number %r of the browser, the plan says %r" % (label, step.get("ordinal"), ordinal))
if step.get("features") != FEATURES:
raise ExtractError("%s: the popup was opened with %r, not %r" % (label, step.get("features"), FEATURES))
if step.get("closed") is not True:
raise ExtractError("%s: the popup was not closed (%r), the next popup would not be the next one of a test that closes each" % (label, step.get("closed")))
if step.get("calls") != MOVE_TO_CALLS[phase]:
raise ExtractError("%s: the calls are %r, not %r" % (label, step.get("calls"), MOVE_TO_CALLS[phase]))
wanted = MOVE_TO_MOMENTS[phase]
missing = [m for m in wanted if m not in moments]
if missing:
raise ExtractError("%s lacks the moments %r: no retail value, none invented" % (label, missing))
readings = {m: move_to_reading(moments[m], "%s %s" % (label, m)) for m in wanted}
at = {m: readings[m]["screen"] for m in wanted}
if phase == "resize_by_zero":
in_order = at["resized"] == at["initial"]
elif phase == "move_by":
in_order = at["moved"] != at["initial"]
elif phase == "move_to_far_right":
in_order = at["moved"] != at["initial"] and at["moved_to"] != at["moved"]
else:
in_order = True
if not in_order:
raise ExtractError("%s: the positions %r do not follow the order %r" % (label, at, list(wanted)))
if phase != "throwaway":
found.append((phase, ordinal, readings))
return found
def build_move_to(capture: Path, run_id: str, commit: str) -> Dict[str, Any]:
"""The readings of every phase as the first popup of a browser and as a later popup: the four launches of the four display cases of one ``popup-move-to`` capture folder (the date folder), each
raw.json checked against the sha256 of its ``meta.json``. Popups of the same phase and the same position (``first``, ``later``) must read the same, or the extraction fails."""
run_info_path = capture / "run-info.json"
if not run_info_path.is_file():
raise ExtractError("missing %s" % run_info_path)
run_info = json.loads(run_info_path.read_text(encoding="utf-8"))
try:
binaries = {name: run_info["binaries"][name]["sha256"] for name in MOVE_TO_BINARIES}
except (KeyError, TypeError) as exc:
raise ExtractError("%s lacks the sha256 of %s" % (run_info_path, exc))
cases: Dict[str, Dict[str, Dict[str, Dict[str, Any]]]] = {}
sources: Dict[str, Dict[str, Dict[str, List[str]]]] = {}
files: List[Dict[str, str]] = []
browser: Optional[Dict[str, Any]] = None
for dpr_dir, panel, scale in DISPLAYS:
meta_path = capture / dpr_dir / "meta.json"
if not meta_path.is_file():
raise ExtractError("missing %s" % meta_path)
meta_file = json.loads(meta_path.read_text(encoding="utf-8"))
if meta_file.get("format") != MOVE_TO_META_FORMAT:
raise ExtractError("%s has the format %r, not %r" % (meta_path, meta_file.get("format"), MOVE_TO_META_FORMAT))
groups: Dict[Tuple[str, str], List[Tuple[str, int, Dict[str, Dict[str, Any]]]]] = {}
for launch in MOVE_TO_LAUNCHES:
path = capture / dpr_dir / panel / launch / "raw.json"
if not path.is_file():
raise ExtractError("missing %s" % path)
want = (meta_file.get("raw_sha256") or {}).get("%s/%s/raw.json" % (panel, launch))
have = sha256_of(path)
if want != have:
raise ExtractError("%s has the sha256 %s, its meta.json says %s: the file is not the one the capture wrote" % (path, have, want))
raw = json.loads(path.read_text(encoding="utf-8"))
if raw.get("dpr_asked") != scale:
raise ExtractError("%s asks scale %r, not %r" % (path, raw.get("dpr_asked"), scale))
found = {"firefox_version": raw["firefox_version"], "build_id": raw["build_id"], "installer_sha256": raw["installer_sha256"]}
if found != {k: meta_file.get(k) for k in found}:
raise ExtractError("%s is not the browser its meta.json names: %r" % (path, found))
if browser not in (None, found):
raise ExtractError("%s is not the same browser as the others: %r and %r" % (path, found, browser))
browser = found
for phase, ordinal, readings in read_launch(raw, launch, str(path)):
groups.setdefault((phase, position_of(ordinal)), []).append((launch, ordinal, readings))
files.append({"path": "%s/%s/%s/raw.json" % (dpr_dir, panel, launch), "sha256": have})
case: Dict[str, Dict[str, Dict[str, Any]]] = {}
origin: Dict[str, Dict[str, List[str]]] = {}
for phase in MOVE_TO_PHASES:
for position in (POSITION_FIRST, POSITION_LATER):
group = groups.get((phase, position))
if not group:
raise ExtractError("%s %s: no capture of %s as the %s popup of a browser: no retail value, none invented" % (dpr_dir, panel, phase, position))
first_launch, first_ordinal, first_readings = group[0]
for launch, ordinal, readings in group[1:]:
if readings != first_readings:
raise ExtractError("%s %s %s: the %s popup number %d of launch %s reads %r, popup number %d of launch %s read %r: popups of one position must agree" % (
dpr_dir, panel, phase, position, ordinal, launch, readings, first_ordinal, first_launch, first_readings))
case.setdefault(phase, {})[position] = first_readings
origin.setdefault(phase, {})[position] = ["%s#%d" % (launch, ordinal) for launch, ordinal, _ in group]
cases[case_id(panel, scale)] = case
sources[case_id(panel, scale)] = origin
named = (run_info.get("build") or {}).get("build_id")
if named != (browser or {}).get("build_id"):
raise ExtractError("%s names the build %r, the raw files %r" % (run_info_path, named, (browser or {}).get("build_id")))
return {
"about": "What retail Firefox reads in a popup of the maximized window, per display case, per phase of the wrapper test (resize_by_zero, move_by, move_to_far_right) and per position in the browser's life "
"(first: the first popup the browser opens; later: any popup after it), from the popup-move-to capture; a test phase asserts against the position it has in the test. Extracted by "
"scripts/extract_retail_popup_move_resize.py. Never edited by hand.",
"capture": {
"run_id": run_id,
"retail_captures_commit": commit,
"folder": capture.name,
"format": MOVE_TO_FORMAT,
"popup_features": FEATURES,
"launches": MOVE_TO_LAUNCHES,
"browser": browser,
"binaries_sha256": binaries,
},
"files": files,
"sources": sources,
"cases": cases,
}
def cross_check(rounds: Dict[str, Any], cases: Dict[str, Any]) -> Dict[str, List[str]]:
"""What the window-geometry rounds read for a popup after ``resizeBy(0, 0)`` (``initial``, ``resized``) must be what SOME position of the popup-move-to capture reads (the rounds ran it as a later popup,
after other popups): a value no position reproduces is an anomaly, reported, not chosen. Returns, per case, the positions that reproduce it."""
reproduced_by: Dict[str, List[str]] = {}
for case, moments in rounds["cases"].items():
reproduced_by[case] = [pos for pos, got in cases[case]["resize_by_zero"].items() if all(got[m] == moments[m] for m in ("initial", "resized"))]
if not reproduced_by[case]:
raise ExtractError("%s: the rounds read %r after resizeBy(0, 0), no position of the popup-move-to capture reads that (%r)" % (
case, {m: moments[m] for m in ("initial", "resized")}, cases[case]["resize_by_zero"]))
return reproduced_by
def dumps(data: Dict[str, Any]) -> str:
return json.dumps(data, indent=2) + "\n"
@@ -109,10 +304,21 @@ def main(argv: Optional[List[str]] = None) -> int:
parser.add_argument("--captures", required=True, type=Path, help="the captures folder of RetailCaptures")
parser.add_argument("--rounds", required=True, nargs="+")
parser.add_argument("--commit", required=True, help="the RetailCaptures commit the rounds are in")
parser.add_argument("--move-to-capture", required=True, type=Path, help="the date folder of the popup-move-to capture (with run-info.json and the dpr folders)")
parser.add_argument("--move-to-run-id", required=True, help="the id of the run that made the popup-move-to capture")
parser.add_argument("--move-to-commit", required=True, help="the RetailCaptures commit the popup-move-to capture is in")
parser.add_argument("--write", action="store_true", help="write ci/retail-popup-move-resize.json; without it the committed file is compared with the captures")
args = parser.parse_args(argv)
try:
text = dumps(build(args.captures, args.rounds, args.commit))
rounds = build(args.captures, args.rounds, args.commit)
data = build_move_to(args.move_to_capture, args.move_to_run_id, args.move_to_commit)
data["rounds_cross_check"] = {
"about": "The window-geometry rounds (a popup after resizeBy(0, 0) as a later popup of a long browser life) read what the positions listed in reproduced_by read in the popup-move-to capture; they are not read by the test.",
"capture": rounds["capture"],
"files": rounds["files"],
"reproduced_by": cross_check(rounds, data["cases"]),
}
text = dumps(data)
except ExtractError as exc:
print("EXTRACTION FAILED: %s" % exc, file=sys.stderr)
return 2
+47 -16
View File
@@ -182,6 +182,24 @@ return JSON.stringify({ok: true});
"""
#: Sizes the window so that its content area (``innerWidth`` x ``innerHeight`` of the chrome window, fractional CSS pixels) is the one asked, and reads the window's own frame in DEVICE pixels in the same
#: chrome read: frame = ``nsIBaseWindow.getSize`` (the whole window, device pixels) less the content area in device pixels (``inner * devicePixelRatio``, whole device pixels as the widget gives them).
#: The window is then set to the asked content area plus that frame, all in device pixels, so an odd number of device pixels (558.5 CSS = 1117 device at a scale of 2) is reachable, which no whole CSS
#: ``outerHeight`` is: ``outerWidth`` and ``outerHeight`` are whole CSS pixels (nsGlobalWindowOuter::GetOuterSize rounds, nsGlobalWindowOuter.cpp:3573), ``innerWidth`` and ``innerHeight`` are not.
CONTENT_JS = """
const [width, height] = arguments;
const win = Services.wm.getMostRecentWindow("navigator:browser");
const scale = win.devicePixelRatio;
const base = win.docShell.treeOwner.QueryInterface(Ci.nsIBaseWindow);
const w = {}, h = {};
base.getSize(w, h);
const frame = [w.value - Math.round(win.innerWidth * scale), h.value - Math.round(win.innerHeight * scale)];
const asked = [Math.round(width * scale) + frame[0], Math.round(height * scale) + frame[1]];
base.setSize(asked[0], asked[1], true);
return JSON.stringify({frame, asked, scale});
"""
class RetailSession:
"""Retail Firefox 159 with Marionette, headed, one profile; closed with its whole tree."""
@@ -237,6 +255,22 @@ class RetailSession:
time.sleep(0.1)
return out
def set_inner_size(self, inner: Tuple[float, float]) -> Dict[str, Any]:
"""Sets the window so that its content area is ``inner`` (CSS pixels of the chrome, fractions allowed) and reads back what the chrome window answers. The window is put at the origin of the screen.
The frame is read in device pixels through the chrome (``CONTENT_JS``) and the window is set to ``inner`` plus that frame in device pixels. The answer has ``outer`` and ``inner`` (CSS pixels, as
the window reads them: ``outer`` is whole), ``frame_device`` and ``asked_outer`` (device pixels, and the same in CSS pixels, the last fractional)."""
self.call("content", "WebDriver:SetWindowRect", {"x": 0, "y": 0})
asked = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": CONTENT_JS, "args": [inner[0], inner[1]]})["value"])
out: Dict[str, Any] = {}
for _ in range(int(DEADLINE_S * 10)):
out = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": SIZE_JS, "args": []})["value"])
if out["inner"] == [inner[0], inner[1]]:
break
time.sleep(0.1)
out.update({"frame_device": asked["frame"], "asked_outer_device": asked["asked"], "asked_outer": [asked["asked"][i] / asked["scale"] for i in range(2)]})
return out
def __exit__(self, *exc) -> None:
if self._marionette is not None:
self._marionette.close()
@@ -312,28 +346,25 @@ class RetailDriver(Driver):
time.sleep(ms / 1000.0)
def size_by_content(session: Any, ours_outer: Any, ours_inner: Any) -> Tuple[list, Dict[str, Any]]:
def size_by_content(session: Any, ours_inner: Any) -> Tuple[list, Dict[str, Any]]:
"""``(asked, got)``: the retail window sized so that its content area (``inner``) is the one of ours, whatever its frame is.
Ours declares a frame of its own (the one of a Windows window), and the retail window has the one of its system and display (none on Xvfb without a window manager, 8x4 CSS pixels at a scale of 2 on a
Windows runner), so the same OUTER size is not the same content area. The retail window is first asked the outer size of ours; its own frame is what that answer shows (outer less inner), and when
its inner size is not the one of ours it is asked ours' inner size plus that frame. ``asked`` is the last outer size asked, ``got`` what the window answers to it."""
asked = [ours_outer[0], ours_outer[1]]
got = session.set_window_size((asked[0], asked[1]))
outer, inner = got.get("outer"), got.get("inner")
if inner != list(ours_inner) and isinstance(outer, list) and isinstance(inner, list) and len(outer) == len(inner) == 2:
asked = [ours_inner[i] + (outer[i] - inner[i]) for i in range(2)]
got = session.set_window_size((asked[0], asked[1]))
return asked, got
Ours declares a frame of its own (the one of a Windows window), and the retail window has the one of its system and display (none on Xvfb without a window manager, 8x4 CSS pixels at a scale of 2 on
a Windows runner), so the same OUTER size is not the same content area. The frame is read in exact device pixels through the chrome (``RetailSession.set_inner_size``) and the window is asked
ours' inner size plus that frame. ``asked`` is the outer size asked (CSS pixels, fractional when the device pixels are odd at the scale), ``got`` what the window answers to it. The outer size the
window reads back is not compared with ``asked``: ``outerWidth`` and ``outerHeight`` are whole CSS pixels (nsGlobalWindowOuter::GetOuterSize rounds, nsGlobalWindowOuter.cpp:3573), ``innerWidth``
and ``innerHeight`` are fractional, so a content area of an odd number of device pixels at a scale of 2 has no outer size that reads back as asked."""
got = session.set_inner_size((ours_inner[0], ours_inner[1]))
return list(got["asked_outer"]), got
def run_retail_twin(case: str, firefox_binary: str, measure: Callable[[Driver], Dict[str, Any]]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""(retail's record, ours): the same ``measure(driver)`` on our engine and on the retail reference, one browser at a time. Needs MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 for ours.
Ours goes first, for its window: the retail window is given the SAME content area as ours (the maximized window of the case's declared screen, as ``launch_case`` makes it, read from the chrome
window's ``innerWidth`` and ``innerHeight``) by ``size_by_content``: ours' outer size first, and when the frames differ, ours' inner size plus the frame the retail window shows. The inner sizes both
chrome windows answer are compared before anything is measured, and the retail window must also have the outer size it was asked: when either differs the verdict is BROKEN CONTROL, not a finding
about ours. Both sizes are in each record (``scales.chrome_outer``, ``scales.chrome_inner``), with the last outer size the retail window was asked (``scales.window_asked_outer``)."""
window's ``innerWidth`` and ``innerHeight``) by ``size_by_content``: ours' inner size plus the frame the retail window shows, read in device pixels. The inner sizes both chrome windows answer are
compared before anything is measured: when they differ the verdict is BROKEN CONTROL, not a finding about ours. The outer size the retail window reads back is not a condition (it is whole CSS
pixels). Both sizes are in each record (``scales.chrome_outer``, ``scales.chrome_inner``), with the outer size the retail window was asked (``scales.window_asked_outer``)."""
executable = retail_executable()
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
page = browser.new_page() # first: the window the session below waits for
@@ -343,8 +374,8 @@ def run_retail_twin(case: str, firefox_binary: str, measure: Callable[[Driver],
finally:
chrome.close()
with RetailSession(executable, CASES[case][0]) as session:
asked, got = size_by_content(session, ours["scales"]["chrome_outer"], ours["scales"]["chrome_inner"])
if got.get("outer") != asked or got.get("inner") != ours["scales"]["chrome_inner"]:
asked, got = size_by_content(session, ours["scales"]["chrome_inner"])
if got.get("inner") != ours["scales"]["chrome_inner"]:
raise BrokenControl("BROKEN CONTROL, no finding about ours: the retail window was asked the outer size %r (the content area of ours %r plus its own frame; the outer size of ours is %r) and answers outer %r and inner %r; "
"ours has inner %r (case %s)"
% (asked, ours["scales"]["chrome_inner"], ours["scales"]["chrome_outer"], got.get("outer"), got.get("inner"), ours["scales"]["chrome_inner"], case))
+100
View File
@@ -0,0 +1,100 @@
<!doctype html>
<meta charset="utf-8">
<title>password mask character, read as widths</title>
<body style="margin:0;background:#fff">
<script>
"use strict";
// Which character does an <input type=password> mask with? A page cannot read it, but it can read widths: the
// scrollWidth of a password field holding N copies of "a" is N times the advance of the mask character in the field's
// font. The same box styles hold N copies of each candidate character in a text input (scrollWidth) and in an inline span
// (getBoundingClientRect). The mask character is the candidate whose width equals the password width.
// Two fonts: Arial 16px, and the default font of an input (only the size is set). Also recorded: measureText of each
// candidate in a canvas with the same font, devicePixelRatio, the computed font-family of the input, navigator.platform.
const N = 40;
const CANDS = [["U+25CF", "●"], ["U+2022", "•"], ["U+2731", "✱"], ["U+273A", "✺"], ["*", "*"]];
const FONTS = [["arial16", "font-family:Arial;font-size:16px"], ["default16", "font-size:16px"]];
const BOX = "box-sizing:content-box;margin:0;padding:0;border:0;width:20px;height:24px;outline:0;";
const SPAN = "display:inline-block;white-space:pre;margin:0;padding:0;border:0;";
function input(type, value, font) {
const el = document.createElement("input");
el.type = type;
el.value = value;
el.setAttribute("style", BOX + font);
document.body.appendChild(el);
return el;
}
function span(text, familyCss) {
const el = document.createElement("span");
el.textContent = text;
el.setAttribute("style", SPAN + familyCss);
document.body.appendChild(el);
return el;
}
function measureFont(fontCase, font) {
const out = {};
const pw = input("password", "a".repeat(N), font);
const cs = getComputedStyle(pw);
const family = cs.fontFamily;
out.input_font_family = family;
out.input_font_size = cs.fontSize;
out.input_font = cs.font;
const spanFont = "font-family:" + family + ";font-size:16px";
// password widths with 1, 10 and N characters: per-character advance = (w[N] - w[10]) / (N - 10)
out.password = {};
for (const n of [1, 10, N]) {
const e = input("password", "a".repeat(n), font);
out.password[n] = {scrollWidth: e.scrollWidth, clientWidth: e.clientWidth};
e.remove();
}
out.password[N].scrollWidth_main = pw.scrollWidth;
out.password.per_char = (out.password[N].scrollWidth - out.password[10].scrollWidth) / (N - 10);
out.refs = {};
for (const [name, ch] of CANDS) {
const r = {};
r.text_input = {};
for (const n of [1, 10, N]) {
const e = input("text", ch.repeat(n), font);
r.text_input[n] = {scrollWidth: e.scrollWidth};
e.remove();
}
r.text_input.per_char = (r.text_input[N].scrollWidth - r.text_input[10].scrollWidth) / (N - 10);
const sp = span(ch.repeat(N), spanFont);
r.span_width = sp.getBoundingClientRect().width;
r.span_width_1 = (() => { const s1 = span(ch, spanFont); const w = s1.getBoundingClientRect().width; s1.remove(); return w; })();
sp.remove();
const c = document.createElement("canvas").getContext("2d");
c.font = (fontCase === "arial16" ? "16px Arial" : "16px " + family);
r.canvas_measureText = c.measureText(ch).width;
r.canvas_font = c.font;
out.refs[name] = r;
}
const pwWidth = out.password[N].scrollWidth;
out.verdict = {
by_text_input_scrollWidth: CANDS.map(c => c[0]).filter(k => out.refs[k].text_input[N].scrollWidth === pwWidth),
by_span_width: CANDS.map(c => c[0]).filter(k => Math.abs(out.refs[k].span_width - pwWidth) < 1),
by_per_char: CANDS.map(c => c[0]).filter(k => out.refs[k].text_input.per_char === out.password.per_char),
};
pw.remove();
return out;
}
(async () => {
let result;
try {
result = {format: "password-mask/1", n: N,
env: {userAgent: navigator.userAgent, platform: navigator.platform, devicePixelRatio: window.devicePixelRatio,
width: screen.width, height: screen.height},
fonts: {}};
for (const [fontCase, font] of FONTS) result.fonts[fontCase] = measureFont(fontCase, font);
} catch (e) {
result = {format: "password-mask/1", error: String(e && e.stack || e)};
}
window.__result = result;
const label = location.search.slice(1) || "result";
try { await fetch("/result?" + label, {method: "POST", body: JSON.stringify(result)}); } catch (e) { /* recorded in window.__result */ }
document.title = "done";
})();
</script>
@@ -19,7 +19,7 @@ from typing import Any, Iterator, List, Tuple
import pytest
from _fission_frames import Sites
from _stock_twin import MARIONETTE_ARGS, Chrome
from _stock_twin import MARIONETTE_ARGS, BrokenControl, Chrome
from _window_origin import CASES, DEADLINE_S, launch_case, observe, wait_for
pytestmark = pytest.mark.e2e
@@ -48,12 +48,20 @@ window.__read = () => ({events: window.__events.slice(), active: document.active
window.__reset = () => { window.__events.length = 0; };
</script>"""
#: The prefs of the launch. ``-marionette`` applies Marionette's recommended preferences, which set ``signon.rememberSignons`` to false on the default branch, and a real user's Firefox has it true (the default):
#: the user branch, which wins over the default one, gets it back, so the login manager marks the field and the list opens.
EXTRA_PREFS = {"marionette.port": 0, "signon.rememberSignons": True}
#: The state of the autocomplete list, read in the chrome (``absent`` where the element is not there).
STATE_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
const popup = win.document.getElementById("PopupAutoComplete");
return JSON.stringify({autocomplete: popup && typeof popup.state === "string" ? popup.state : "absent"});
"""
#: The pref that lets the login manager mark a field as autocompletable (``LoginHelper.enabled``).
PREF_JS = """
return JSON.stringify({rememberSignons: Services.prefs.getBoolPref("signon.rememberSignons", null)});
"""
#: Closes the list, so the page closes clean.
HIDE_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
@@ -67,7 +75,7 @@ return JSON.stringify({});
def _session(firefox_binary: str, monkeypatch, case: str) -> Iterator[Tuple[Any, Any, Chrome, Sites]]:
"""Our browser on ``case`` with the login page served: ``(page, context, chrome, sites)``. The first page is kept open (the window the chrome session waits for)."""
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads
with Sites() as sites, launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
with Sites() as sites, launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs=EXTRA_PREFS) as browser:
sites.route("A", "/login", PAGE)
holder = browser.new_page()
chrome = Chrome(holder)
@@ -89,11 +97,16 @@ def test_a_click_on_the_password_field_under_the_login_list_reaches_the_page(fir
with _session(firefox_binary, monkeypatch, case) as (page, context, chrome, _sites):
page.mouse.click(*USER_CENTRE)
opened = wait_for(page, lambda: _list_state(chrome) == "open", DEADLINE_S)
assert opened, "a click on #user did not open the login autocomplete list (state %r): the case would pass for nothing" % _list_state(chrome)
if not opened:
raise BrokenControl("BROKEN CONTROL, no finding about ours: a click on #user did not open the login autocomplete list (state %r, signon.rememberSignons %r): the case would pass for nothing"
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
# The release of the first click is heard by the page after the click returned: wait for it, then start from an empty record.
assert wait_for(page, lambda: ["click", "user"] in page.evaluate("() => window.__read()")["events"], DEADLINE_S), "the page never heard the click on #user"
page.evaluate("() => window.__reset()")
pages_before = len(context.pages)
if _list_state(chrome) != "open":
raise BrokenControl("BROKEN CONTROL, no finding about ours: the login autocomplete list is not open right before the press on #pass (state %r, signon.rememberSignons %r)"
% (_list_state(chrome), chrome.script(PREF_JS)["rememberSignons"]))
page.mouse.click(*PASS_CENTRE)
@@ -263,8 +263,8 @@ def test_ours_gets_the_answer_of_its_session_in_a_retail_twin(world, monkeypatch
def __exit__(self, *exc):
return False
def set_window_size(self, outer):
return {"outer": [800, 600], "inner": [790, 500]}
def set_inner_size(self, inner):
return {"outer": [800, 600], "inner": [790, 500], "asked_outer": [800, 600]}
monkeypatch.setattr(_retail_reference, "retail_executable", lambda: "retail")
monkeypatch.setattr(_retail_reference, "RetailSession", FakeRetail)
@@ -0,0 +1,150 @@
"""With `headless=True` a page sees no pointer or mouse event until the test's own first input.
What it proves: the engine runs on the core's own hidden display (an Xvfb on Linux, a private desktop on Windows), and
the host pointer is not part of it. A page that listens from the first line of its `<head>` hears nothing at all with no
input: no `pointerover`, `pointerenter`, `mouseover` or `mouseenter` at the centre of the screen, no move, no wheel. The
first thing it hears is what the test's own `page.mouse.move` makes, at the point the test asked for, trusted.
Why it matters: an event the page hears before any input is an input nobody made. A real user's page gets its first
`mouseover` when the pointer enters it, at the place the pointer is, never at the centre of the screen on its birth. The
pointer of the host is the one thing the hidden display must not give the page: whatever the machine's cursor is doing
(the runner's, a person's at their desk) is not something a page may read.
Measured on the published engine (run 46840604601 of this repository): every page on Linux got a trusted
`pointerover`, `pointerenter`, `mouseover` and `mouseenter` at the centre of the screen with no input at all, 42 to 160 ms
after its birth, and Windows got none. The engine makes its window ignore the host pointer on that display, on both systems.
How the proof is made, with no clock. What must not happen is an event that arrives on its own, and "nothing arrived in
some time" would judge the machine. So the proof is an outcome: after `TURNS` frames of the page (a count of the page's own
`requestAnimationFrame` turns, never a time) the test makes ONE input, a `page.mouse.move` to a point that is not the centre
of the screen, and waits until the page has recorded it. The page must then have recorded, as its very first pointer or
mouse event, the one that move made: an over, an enter or a move at that point, trusted. A crossing made by the host pointer
is synthesized on layout and paint, within the first frames of a page, so it lands before the move and is the first event
the page recorded: the test is red on it, with the event in the message.
Two tests, one launch each, on Linux and on Windows:
* the first input, in three situations: the page the test serves on 127.0.0.1 (first document of its tab); a page that
stood on `about:blank` (the recorder is put there by the test); and a page that stood on `about:blank` for its frames with
no input and was then navigated to the served page. In each, the sentinel move is the first event recorded;
* the first input in full: on the served page, the move is the first event, and every event of it is trusted, at (x, y) in
client coordinates, and of a kind a move alone makes.
The listeners are on `window` in the capture phase (a `mouseenter` does not bubble) and on `document`. The humaniser is off:
the move is one move, not a stroke from somewhere else.
"""
from __future__ import annotations
import pytest
from _fission_frames import Sites
pytestmark = pytest.mark.e2e
#: Every pointer and mouse event a page can be given by a pointer that moves, presses or wheels.
TYPES = ["pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointerdown", "pointerup",
"mouseover", "mouseout", "mouseenter", "mouseleave", "mousemove", "mousedown", "mouseup", "click", "wheel",
"contextmenu"]
#: Frames of the page (its own `requestAnimationFrame` turns) before the sentinel move is made (see the docstring).
TURNS = 30
#: Where the moves go: inside the default viewport, and not at its centre. One per situation of the first test.
X, Y = 211, 137
POINTS = [(211, 137), (173, 251), (329, 97)]
FIRST_KINDS = ("pointerover", "pointerenter", "mouseover", "mouseenter", "pointermove", "mousemove")
#: The recorder: the page runs it from the first line of its `<head>`, and the test runs it on `about:blank`.
RECORDER = """
window.__ev = [];
window.__turns = 0;
(function () {
const types = %s;
for (const where of [window, document]) {
const name = where === window ? 'window' : 'document';
for (const t of types) {
where.addEventListener(t, e => {
window.__ev.push({t: t, via: name, trusted: e.isTrusted, x: e.clientX, y: e.clientY});
}, true);
}
}
const turn = () => { window.__turns++; requestAnimationFrame(turn); };
requestAnimationFrame(turn);
})();
""" % repr(TYPES)
PAGE = """<!doctype html><html><head><meta charset=utf-8><title>listening</title>
<script>%s</script>
<style>html,body{margin:0;height:100%%}</style></head><body></body></html>""" % RECORDER
def _frames(page):
"""Until the page has run `TURNS` frames of its own (a count of its turns, with a deadline)."""
page.wait_for_function("(turns) => window.__turns >= turns", arg=TURNS, timeout=30_000)
def _heard(page):
return page.evaluate("() => window.__ev")
def _launch(binary, seed):
from invisible_playwright import InvisiblePlaywright
return InvisiblePlaywright(seed=seed, binary_path=binary, headless=True, humanize=False)
def _the_move_is_the_first_event(page, point, where):
"""One move after the frames; it must be recorded, and be the first event the page recorded."""
_frames(page)
page.mouse.move(*point)
page.wait_for_function("([x, y]) => window.__ev.some(e => e.t === 'mousemove' && e.x === x && e.y === y)",
arg=list(point), timeout=30_000)
events = _heard(page)
first = events[0]
assert first["t"] in FIRST_KINDS and (first["x"], first["y"]) == point and first["trusted"], (
"%s: the first event the page recorded is %r, not an over, an enter or a move of the move at %r; all: %r" % (where, first, point, events))
def test_a_page_sees_no_pointer_or_mouse_event_before_the_first_input_on_the_hidden_display(firefox_binary):
with Sites() as sites:
sites.route("A", "/listening", PAGE)
with _launch(firefox_binary, 7201) as browser:
# a page served on 127.0.0.1, listened to from the first line of its head
page = browser.new_page()
page.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
_the_move_is_the_first_event(page, POINTS[0], "the served page")
# about:blank itself, with the recorder put there by the test
blank = browser.new_page()
blank.evaluate("() => { %s }" % RECORDER)
_the_move_is_the_first_event(blank, POINTS[1], "about:blank")
# about:blank first, its frames run with no input, then navigated: the pointer of this tab has not been moved by the
# test before its sentinel, so a crossing the page hears first can only be one nobody made
later = browser.new_page()
later.evaluate("() => { %s }" % RECORDER)
_frames(later)
later.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
_the_move_is_the_first_event(later, POINTS[2], "the page navigated to after about:blank")
def test_the_first_event_a_page_sees_is_the_one_the_first_mouse_move_makes(firefox_binary):
with Sites() as sites:
sites.route("A", "/listening", PAGE)
with _launch(firefox_binary, 7202) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/listening"), wait_until="load", timeout=30_000)
_frames(page)
page.mouse.move(X, Y)
page.wait_for_function("([x, y]) => window.__ev.some(e => e.t === 'mousemove' && e.x === x && e.y === y)",
arg=[X, Y], timeout=30_000)
events = _heard(page)
assert events, "the page heard nothing of the move"
first = events[0]
assert first["t"] in FIRST_KINDS and (first["x"], first["y"]) == (X, Y), (
"the first event of the page is %r, not an over, an enter or a move at the move's point %r; all: %r" % (first, (X, Y), events))
assert all(e["trusted"] for e in events), "an event of the move is not trusted: %r" % [e for e in events if not e["trusted"]]
assert all((e["x"], e["y"]) == (X, Y) for e in events), "an event of the move is not at %r: %r" % ((X, Y), events)
assert {e["t"] for e in events} <= set(FIRST_KINDS), (
"a move made an event a move does not make: %r" % sorted({e["t"] for e in events} - set(FIRST_KINDS)))
@@ -0,0 +1,91 @@
"""A password field of 40 characters is as wide as on retail Firefox on Windows: the engine masks it with U+25CF, on Linux and on Windows.
What it fixes: the character an ``<input type=password>`` is masked with. Windows retail masks with U+25CF (``widget/windows/nsLookAndFeel.cpp``), a GTK build with the ``invisible-char`` of a
GTK entry, which is ``*`` where the host's GTK picks it from its font list. A page cannot read the character, but it reads widths: the ``scrollWidth`` of a password field holding 40 x "a" is 40 times
the advance of the mask character in the field's font (Arial 16px: 387 px for U+25CF, 249 px for ``*``). The declared machine is a Windows one, so a page on it must read what a page reads on
retail Windows, whatever the host.
The page is the page of the retail capture, byte for byte (``tests/data/password_mask_page.html``, its sha256 is the capture's): it reads the width of the password field, and the widths of 40 x
each candidate mask character in the same box, in a text input (``scrollWidth``), an inline span and a canvas. The test reads the number the capture's analysis reads, ``fonts.arial16.password["40"].scrollWidth``
(a password field of 40 x "a", ``font-family:Arial;font-size:16px``, a box 20 px wide with no padding or border), and compares it with the retail value.
NO NUMBER OF RETAIL IS TYPED HERE. The retail width is read from ``ci/retail-password-mask.json``, which ``scripts/extract_retail_password_mask.py`` extracts from the retail capture (Firefox 159.0 on a
Windows Server 2025 runner, run 46769343558; the file carries the browser's version, build id and installer sha256 and the sha256 of every file read).
The launch is the product's, ``InvisiblePlaywright(seed=4, binary_path=..., headless=True)``: seed 4 declares a display of scale 1, the scale of the capture, and the test says so if it did not (a
reading at another scale is not the reading the capture holds). Linux and Windows run the same assertions.
Red on an engine whose GTK widget layer answers ``*`` (the width is 249, not 387); green where the widget layer gives U+25CF, as Windows does.
"""
from __future__ import annotations
import hashlib
import json
import threading
from http.server import BaseHTTPRequestHandler
from pathlib import Path
import pytest
from _servers import LocalServer
pytestmark = pytest.mark.e2e
ROOT = Path(__file__).resolve().parent.parent
PAGE = (ROOT / "tests" / "data" / "password_mask_page.html").read_bytes()
#: The retail reading: the file the extraction script writes from the capture; nothing below is typed.
RETAIL = json.loads((ROOT / "ci" / "retail-password-mask.json").read_text(encoding="utf-8"))
CASE = RETAIL["cases"]["arial16"]
#: The seed that declares a display of scale 1, the scale of the retail capture.
SEED = 4
DEADLINE_MS = 30_000
class _Page(BaseHTTPRequestHandler):
"""Serves the page of the capture; the page posts its result (the test reads ``window.__result``, so the body is only drained)."""
def log_message(self, *args):
pass
def do_GET(self):
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(PAGE)))
self.end_headers()
self.wfile.write(PAGE)
def do_POST(self):
self.rfile.read(int(self.headers.get("Content-Length") or 0))
self.send_response(200)
self.send_header("Content-Length", "0")
self.end_headers()
def test_a_password_field_of_40_characters_is_as_wide_as_on_retail_windows(firefox_binary):
from invisible_playwright import InvisiblePlaywright
served = hashlib.sha256(PAGE).hexdigest()
assert served == RETAIL["page"]["sha256"], "BROKEN CONTROL, no finding about ours: the page served is %s and the page of the capture is %s" % (served, RETAIL["page"]["sha256"])
with LocalServer(("127.0.0.1", 0), _Page) as server:
threading.Thread(target=server.serve_forever, daemon=True).start()
try:
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True) as browser:
page = browser.new_context().new_page()
page.goto("http://127.0.0.1:%d/index.html?dpr1" % server.server_address[1], timeout=DEADLINE_MS)
page.wait_for_function("window.__result !== undefined && document.title === 'done'", timeout=DEADLINE_MS)
result = page.evaluate("window.__result")
finally:
server.shutdown()
assert "error" not in result, "BROKEN CONTROL, no finding about ours: the page recorded an error: %s" % result.get("error")
env = result["env"]
assert env["devicePixelRatio"] == CASE["devicePixelRatio"], (
"BROKEN CONTROL, no finding about ours: the page ran at devicePixelRatio %r and the retail capture at %r (seed %d)" % (env["devicePixelRatio"], CASE["devicePixelRatio"], SEED))
font = result["fonts"]["arial16"]
width = font["password"][str(RETAIL["n"])]["scrollWidth"]
masks = font["verdict"]["by_text_input_scrollWidth"]
assert width == CASE["password_scrollWidth"], (
"a password field of %d x 'a' in Arial 16px is %r px wide (scrollWidth) on this engine, and %r px on retail Firefox %s on Windows: the mask character the page's widths name is %s here, %s on retail "
"(per-character advance %r px here; a text input of 40 x U+25CF reads %r px, 40 x '*' reads %r px). navigator.platform %r, devicePixelRatio %r, computed font-family %r"
% (RETAIL["n"], width, CASE["password_scrollWidth"], RETAIL["capture"]["browser"]["firefox_version"], masks, CASE["mask"], font["password"]["per_char"],
font["refs"]["U+25CF"]["text_input"][str(RETAIL["n"])]["scrollWidth"], font["refs"]["*"]["text_input"][str(RETAIL["n"])]["scrollWidth"],
env["platform"], env["devicePixelRatio"], font["input_font_family"]))
@@ -5,14 +5,14 @@ absolute result to the parent, which applies it to the real window. A popup whos
puts the popup where it likes, and its frame is the host's) must still answer these calls as the retail window does. Three things, per display case (the four of
the window tests), each in a popup of its own opened by a real click, ``window.open(url, '_blank', 'width=500,height=400')``:
1. ``resizeBy(0, 0)``: ``innerWidth``, ``innerHeight``, ``outerWidth`` and ``outerHeight`` are what RETAIL read after the same call (``MOMENTS``, below). At three of the four
display cases that is what they were before; at a real 150% retail reads an inner width of 501 after the call, 500 before, the outer size unchanged, and keeps 501
through the moves that follow (the device rounding of the real window, which the call sends back to it). If the parent converted the declared outer size into the real one with
the wrong frame, the real inner size would move by the difference of the two frames. The page is watched for 1.5 s after the call, so a change that arrives late is seen.
1. ``resizeBy(0, 0)``: ``innerWidth``, ``innerHeight``, ``outerWidth`` and ``outerHeight`` are what RETAIL read, before and after the same call, in the first popup of a browser (``MOMENTS``, below: this phase
runs first, in the first popup the browser opens). At a real 150% the first popup of a browser is a device pixel narrower than a later one (inner 499, outer 514, against 500 and 515), and the call leaves it at
499; a later popup is taken from 500 to 501 by the call (the device rounding of the real window, which the call sends back to it), a position this test never has. If the parent converted the declared outer
size into the real one with the wrong frame, the real inner size would move by the difference of the two frames. The page is watched for 1.5 s after the call, so a change that arrives late is seen.
2. ``moveBy(10, 10)``: ``screenX`` and ``screenY`` grow by exactly 10 CSS pixels, from the position the popup read before. If the parent took the real position of
the window as the base, the declared and the real positions would differ by what the host's window manager decided, and the popup would jump.
3. ``moveBy(10, 10)`` and then ``moveTo(99999, 0)``, the sequence the retail capture ran: ``screenX`` and ``screenY`` after each call are the numbers RETAIL read
(``MOMENTS``, below, with the capture and the derivation). The clamp is the page's (``nsGlobalWindowOuter::CheckSecurityLeftAndTop``: it keeps the window inside
3. ``moveBy(10, 10)`` and then ``moveTo(99999, 0)``, the sequence the retail capture ran: ``screenX`` and ``screenY`` after each call are the numbers RETAIL read in a later popup
(``MOVE_TO``, below, with the capture and the derivation: this phase runs third). The clamp is the page's (``nsGlobalWindowOuter::CheckSecurityLeftAndTop``: it keeps the window inside
the available rectangle of the screen the page reads, with the outer width in CSS pixels that Mozilla rounds by its edges), so the page can learn the real
frame of the window from where the popup stops if the clamp reads any of it from the host.
@@ -34,10 +34,15 @@ from _window_origin import CASES, DEADLINE_S, launch_case, observe, settled, wai
pytestmark = pytest.mark.e2e
#: What RETAIL read: the file ``scripts/extract_retail_popup_move_resize.py`` writes from the retail captures (the step ``popup_move_resize`` of rounds 8, 9, 11 and 12 of the window-geometry
#: capture, launches a and b, all equal; Firefox 159.0; the file carries the rounds, the RetailCaptures commit, the browser's build id and installer sha256 and the sha256 of each raw.json): a popup
#: opened with ``width=500,height=400``, then ``resizeBy(0, 0)``, ``moveBy(10, 10)``, ``moveTo(99999, 0)``. The numbers are the capture's, never typed or computed here.
MOMENTS = json.loads((Path(__file__).resolve().parent.parent / "ci" / "retail-popup-move-resize.json").read_text(encoding="utf-8"))["cases"]
#: What RETAIL read: the file ``scripts/extract_retail_popup_move_resize.py`` writes from the ``popup-move-to`` capture (retail Firefox 159.0 on Windows, four launches per display case: the test's order; phase 3 alone; a
#: throwaway popup first and then the three phases; phase 2 alone; the file carries the run id, the RetailCaptures commit, the browser's build id and installer sha256, the sha256 of ``firefox.exe`` and ``xul.dll`` and of
#: each raw.json, verified against the capture's meta.json). Each phase is read in the POSITION it has in this test: popups opened with ``width=500,height=400``, one per phase, closed before the next, in one browser, in the
#: order phase 1, 2, 3 and nothing opened before phase 1, so phase 1 is the FIRST popup of the browser (``first``) and phase 3 the third, a later one (``later``). The numbers are the capture's, never typed or computed here.
_RETAIL = json.loads((Path(__file__).resolve().parent.parent / "ci" / "retail-popup-move-resize.json").read_text(encoding="utf-8"))
#: Phase 1 (``initial``, ``resized``): the first popup of a browser.
MOMENTS = {case: phases["resize_by_zero"]["first"] for case, phases in _RETAIL["cases"].items()}
#: Phase 3 (``moved``, ``moved_to``): a later popup (the third).
MOVE_TO = {case: phases["move_to_far_right"]["later"] for case, phases in _RETAIL["cases"].items()}
#:
#: Why ``moveTo(99999, 0)`` stops at 1022 at scale 1.25: Mozilla's ``CheckSecurityLeftAndTop`` (dom/base/nsGlobalWindowOuter.cpp) clamps
#: ``x_css = availLeft + availWidth - W``, where ``W`` is the outer width ROUNDED BY ITS EDGES, ``CSSIntRect::Round(deviceRect / scale).width``
@@ -48,8 +53,8 @@ MOMENTS = json.loads((Path(__file__).resolve().parent.parent / "ci" / "retail-po
def _retail(case: str) -> Tuple[Tuple[int, int], Tuple[int, int], int]:
"""(moved (screenX, screenY), moved_to (screenX, screenY), outerWidth) of retail for the sequence of the capture."""
m = MOMENTS[case]
"""(moved (screenX, screenY), moved_to (screenX, screenY), outerWidth) of retail in phase 3, from the capture made in the test's own order."""
m = MOVE_TO[case]
return tuple(m["moved"]["screen"]), tuple(m["moved_to"]["screen"]), m["moved_to"]["outer"][0]
@@ -30,6 +30,7 @@ PINNED_BY_BYTES = {
"tests/gates/wire_method_debt.json": "tests/test_every_wire_method_is_served_or_refused.py",
"ci/py-lock/gate.in": "tests/test_the_gate_lock_follows_the_sources.py",
"ci/py-lock/gate.txt": "tests/test_the_gate_lock_follows_the_sources.py",
"tests/data/password_mask_page.html": "tests/test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py",
}
# Every test file that hashes a file it reads, and where its fixtures come from.
@@ -38,6 +39,7 @@ HASHING_TESTS = {
"test_known_mozilla_defects_in_crash_evidence.py": "sources.json beside the evidence",
"test_the_vendored_bundles_are_listed_with_their_hash.py": "the rows of tests/vendor/README.md",
"test_ci_published_set.py": "a wheel the test builds in tmp_path: no fixture of the repository",
"test_the_retail_password_mask_width_is_extracted_from_the_capture_not_typed.py": "tests/data/password_mask_page.html, the page of the retail capture (PINNED_BY_BYTES, `-text` in .gitattributes); the capture itself is built in tmp_path",
}
@@ -33,7 +33,8 @@ face of the text run, which does not list it: it draws another file's outlines (
fontconfig on its own empty configuration.
The environment reaches the browser as it does for a user: the test sets ``HOME`` and ``XDG_CACHE_HOME`` in its own environment (and ``XDG_CONFIG_HOME`` to a
folder with nothing in it), and the core composes the engine's environment from it. ``FONTCONFIG_FILE`` and ``FONTCONFIG_PATH`` of the runner are taken off.
folder with nothing in it; the core gives the engine empty configuration folders of its own, whatever the test sets), and the core composes the rest of the
engine's environment from it. ``FONTCONFIG_FILE`` and ``FONTCONFIG_PATH`` of the runner are taken off.
Evidence, whatever the verdict: when ``RUNNER_TEMP`` is set the test writes ``result.json`` (the poison, what fontconfig says of it, every open of a
forbidden path with the role of its process, every other forbidden look, the boxes of the screenshot) and the screenshot under
@@ -0,0 +1,302 @@
"""TEMPORARY EVIDENCE, no verdict about ours: what ``window.onerror`` is told when a listener made by a script world other than the page's throws, on RETAIL Firefox 159 and on ours, side by side.
Remove it when the two cases of ``test_a_page_function_called_by_the_client_sees_only_page_frames_e2e.py`` named below are settled.
THE RED TO EXPLAIN. On candidate 46792115974 (linux.3 and windows.3) ``test_an_error_thrown_by_a_listener_the_clients_evaluate_registered_names_no_location_of_the_clients_world`` and
``test_a_non_error_thrown_by_a_listener_the_clients_evaluate_registered_names_no_location_of_the_clients_world`` fail: the listener the client's evaluate registered throws (an Error, then ``throw 5``) when the
page fires it (the test clicks a trigger, the page's own listener of the trigger clicks the target), and the error never reaches ``window.onerror`` within 30 s; the control (the page's own
throwing listener) does reach it. By reading Mozilla's code a listener of a sandbox realm is reported to the console only (dom/script/ScriptSettings.cpp, ``AutoJSAPI::ReportException``: the error
global is the sandbox, ``WindowOrNull`` is null, no script-error event is dispatched). Before any test changes, the same steps run on retail and the record says what retail does.
WHAT IT RUNS. The page and the script of the original (``OE_PAGE``, ``OE_SCRIPT``, its handler, imported, not copied), two cases, each on a fresh load of the page:
* ``error``: the listener throws ``new Error('w')``; control: the page's own ``#go-c``;
* ``non_error``: the listener throws ``5``; control: the page's own ``#go-d``.
In each: the CONTROL first (a real click on ``#go-c`` / ``#go-d``, the page's own throwing listener; ``window.onerror``'s record is read, then reset), then the listener is registered from the other
world on ``#b`` and the trigger ``#go-b`` is clicked for real (the page's own function ``fire`` clicks ``#b``). Recorded: whether ``window.onerror`` was called within 30 s and what it was told
(message, filename, lineno, colno, stack), and, for the ``marked`` listener, how many times it ran.
THE LISTENER'S REALM. On RETAIL: the default sandbox of Marionette's ``WebDriver:ExecuteScript`` in the content process (a ``Cu.Sandbox`` over the page's window, Xray vision): the listener is a
function created by that script, so its realm is that sandbox. It is NOT ``window.wrappedJSObject.eval``, which would create the listener in the page's own realm; ``wrappedJSObject.eval`` is used only to READ
``window.__oe`` (and to reset it), never to register anything. On OURS: the original's own steps, ``page.evaluate`` of the client (the world the wrapper's evaluate runs in). Both browsers dump
probes of the world the script runs in (``realm``: ``typeof Components``, ``typeof window.wrappedJSObject``, ``String(globalThis)``) so the realm is on record, not assumed.
TWO LISTENERS. ``plain`` is the original's text (ours only: nothing in it says whether it ran); ``marked`` is the same listener with one ``setAttribute`` before the throw
(``data-ran`` on the document element, a DOM attribute both worlds share) so that "the listener ran and the error was not reported" is told from "the listener never ran". ``marked`` runs on both browsers.
No client call is made on the page beyond the above, and nothing about ours is asserted: the test fails only when retail cannot be driven (a BROKEN CONTROL, no finding about ours: an exception of
the driver, or the page's own throwing listener not heard on retail), after saving what it has.
WHERE THE RECORD IS. ``$RUNNER_TEMP/invpw-evidence/sandbox-listener-onerror/{ours,retail,side-by-side}.json`` and ``side-by-side.txt`` (the folder every e2e job uploads; off a runner, the temporary
folder), and the lines of ``side-by-side.txt`` are printed to the output of the test.
"""
from __future__ import annotations
import importlib
import json
import os
import tempfile
import threading
import time
from pathlib import Path
from types import SimpleNamespace
from typing import Any, Callable, Dict, List, Optional
import pytest
from _retail_reference import RetailDriver, RetailSession, retail_executable
from _servers import LocalServer
from _stock_twin import BrokenControl
from _waits import wait_until
from _watchdog_log import EVIDENCE_FOLDER
pytestmark = pytest.mark.e2e
#: The test whose two cases are explained, imported as a module (its test functions are not names of this one, so they are not collected twice).
ORIGINAL = importlib.import_module("test_a_page_function_called_by_the_client_sees_only_page_frames_e2e")
SUBFOLDER = "sandbox-listener-onerror"
DEADLINE = ORIGINAL.DEADLINE
#: (case id, what the listener throws as source text, the page's own throwing listener that is the control)
CASES = (("error", "new Error('w')", "go-c"), ("non_error", "5", "go-d"))
#: The listener registered on #b by the other world: ``plain`` is the original's text, ``marked`` adds the count of its runs in a DOM attribute before the throw.
PLAIN = "document.getElementById('b').addEventListener('click', () => { throw %s; });"
MARKED = ("document.getElementById('b').addEventListener('click', () => { const e = document.documentElement; "
"e.setAttribute('data-ran', String(Number(e.getAttribute('data-ran') || 0) + 1)); throw %s; });")
#: The world the script runs in, as probes.
REALM_PROBE = ("(() => { const out = {}; "
"try { out.typeof_Components = typeof Components; } catch (e) { out.typeof_Components = 'throws ' + e; } "
"try { out.typeof_wrappedJSObject = typeof window.wrappedJSObject; } catch (e) { out.typeof_wrappedJSObject = 'throws ' + e; } "
"try { out.globalThis = String(globalThis); } catch (e) { out.globalThis = 'throws ' + e; } "
"try { out.expando_visible_to_the_page_script = typeof window.__oe; } catch (e) { out.expando_visible_to_the_page_script = 'throws ' + e; } "
"return out; })()")
READ_MARK = "document.documentElement.getAttribute('data-ran')"
REALM_NAMES = {"ours": "the client's evaluate of the wrapper (page.evaluate), as the original test",
"retail": "the default sandbox of Marionette's WebDriver:ExecuteScript, content process, over the page's window (Xray); not wrappedJSObject.eval"}
@pytest.fixture
def site():
srv = LocalServer(("127.0.0.1", 0), ORIGINAL._Handler)
srv.requests = []
threading.Thread(target=srv.serve_forever, daemon=True).start()
try:
yield SimpleNamespace(url="http://127.0.0.1:%d/" % srv.server_address[1])
finally:
srv.shutdown()
srv.server_close()
class _Ops:
"""What one browser can do, so that one script of steps (``_steps``) runs on both."""
def load(self) -> None: raise NotImplementedError
def click(self, selector: str) -> None: raise NotImplementedError
def register(self, source: str) -> None: raise NotImplementedError
def read_oe(self) -> Optional[Dict[str, Any]]: raise NotImplementedError
def reset_oe(self) -> None: raise NotImplementedError
def read_mark(self) -> Optional[str]: raise NotImplementedError
def realm(self) -> Dict[str, Any]: raise NotImplementedError
def pump(self) -> None: raise NotImplementedError
def _listen(ops: _Ops, ready: Callable[[], Any]) -> Dict[str, Any]:
"""Waits up to DEADLINE for ``ready()``; says whether it came and after how long."""
began = time.monotonic()
ok = wait_until(ready, DEADLINE, ops.pump)
return {"heard": bool(ok), "after_s": round(time.monotonic() - began, 2)}
def _control_and_listener(ops: _Ops, throws: str, control_button: str, variant: str) -> Dict[str, Any]:
ops.load()
out: Dict[str, Any] = {"realm": ops.realm()}
ops.click("#" + control_button)
out["control"] = _listen(ops, ops.read_oe)
out["control"]["onerror"] = ops.read_oe()
ops.reset_oe()
ops.register((MARKED if variant == "marked" else PLAIN) % throws)
ops.click("#go-b")
if variant == "marked":
out["listener_ran"] = _listen(ops, ops.read_mark)
out["listener_ran"]["count"] = ops.read_mark()
out["listener"] = _listen(ops, ops.read_oe)
out["listener"]["onerror"] = ops.read_oe()
return out
def _steps(make_ops: Callable[[], _Ops], variants: List[str]) -> Dict[str, Any]:
record: Dict[str, Any] = {}
for case_id, throws, control_button in CASES:
record[case_id] = {}
for variant in variants:
record[case_id][variant] = _control_and_listener(make_ops(), throws, control_button, variant)
return record
class _OursOps(_Ops):
def __init__(self, browser, url: str) -> None:
self.browser, self.url, self.page, self.context = browser, url, None, None
def load(self) -> None:
self.close()
self.context = self.browser.new_context()
self.page = self.context.new_page()
self.page.goto(self.url + "oe", wait_until="load")
def click(self, selector: str) -> None:
self.page.click(selector)
def register(self, source: str) -> None:
self.page.evaluate("() => { %s }" % source)
def read_oe(self) -> Optional[Dict[str, Any]]:
return self.page.evaluate("() => window.__oe")
def reset_oe(self) -> None:
self.page.evaluate("() => { window.__oe = null; }")
def read_mark(self) -> Optional[str]:
return self.page.evaluate("() => %s" % READ_MARK)
def realm(self) -> Dict[str, Any]:
return self.page.evaluate("() => %s" % REALM_PROBE)
def pump(self) -> None:
self.page.wait_for_timeout(50)
def close(self) -> None:
if self.context is not None:
self.context.close()
self.context = None
class _RetailOps(_Ops):
def __init__(self, driver: RetailDriver, url: str) -> None:
self.driver, self.url = driver, url
def load(self) -> None:
self.driver.goto(self.url + "oe")
def click(self, selector: str) -> None:
x, y = self.driver.eval("(() => { const r = document.querySelector(%s).getBoundingClientRect(); return [r.left + r.width / 2, r.top + r.height / 2]; })()" % json.dumps(selector))
self.driver.click(x, y)
def register(self, source: str) -> None:
# a function created by THIS script: its realm is Marionette's sandbox
self.driver.eval("(() => { %s return 'registered'; })()" % source)
def _page_json(self, code: str) -> Any:
# wrappedJSObject.eval only READS the page's own record and resets it; it registers nothing
text = self.driver.eval("window.wrappedJSObject.eval(%s)" % json.dumps(code))
return json.loads(text) if text is not None else None
def read_oe(self) -> Optional[Dict[str, Any]]:
return self._page_json("JSON.stringify(window.__oe)")
def reset_oe(self) -> None:
self._page_json("(window.__oe = null, 'null')")
def read_mark(self) -> Optional[str]:
return self.driver.eval(READ_MARK)
def realm(self) -> Dict[str, Any]:
return self.driver.eval(REALM_PROBE)
def pump(self) -> None:
self.driver.wait_for_timeout(50)
def _on_ours(firefox_binary: str, url: str) -> Dict[str, Any]:
from invisible_playwright import InvisiblePlaywright
made: List[_OursOps] = []
def make() -> _Ops:
made.append(_OursOps(browser, url))
return made[-1]
with InvisiblePlaywright(seed=4275, binary_path=firefox_binary, headless=True) as browser:
try:
return _steps(make, ["plain", "marked"])
finally:
for ops in made:
ops.close()
def _on_retail(executable: str, url: str) -> Dict[str, Any]:
with RetailSession(executable, 1.0) as session:
driver = RetailDriver(session)
return _steps(lambda: _RetailOps(driver, url), ["marked"])
def _cell(entry: Dict[str, Any], key: str) -> str:
got = entry[key]
told = got["onerror"]
return "heard=%s after=%ss told=%s" % (got["heard"], got["after_s"], json.dumps(told, sort_keys=True) if told else None)
def _side_by_side(ours: Dict[str, Any], retail: Dict[str, Any]) -> List[Dict[str, Any]]:
rows = []
for case_id, _, _ in CASES:
for variant in ("plain", "marked"):
o = (ours.get(case_id) or {}).get(variant)
r = (retail.get(case_id) or {}).get(variant)
if o or r:
rows.append({"case": case_id, "variant": variant, "retail": r, "ours": o})
return rows
def _lines(rows: List[Dict[str, Any]]) -> str:
out = []
for row in rows:
out.append("%s / %s listener" % (row["case"], row["variant"]))
for who in ("retail", "ours"):
entry = row[who]
if not entry:
out.append(" %-6s no record" % who)
continue
out.append(" %-6s control (page's own): %s" % (who, _cell(entry, "control")))
if "listener_ran" in entry:
out.append(" %-6s listener ran: count=%s after=%ss" % (who, entry["listener_ran"]["count"], entry["listener_ran"]["after_s"]))
out.append(" %-6s listener of the other world: %s" % (who, _cell(entry, "listener")))
out.append(" %-6s realm probes: %s" % (who, json.dumps(entry["realm"], sort_keys=True)))
return "\n".join(out) + "\n"
def _folder() -> Path:
base = os.environ.get("RUNNER_TEMP") or tempfile.gettempdir()
folder = Path(base) / EVIDENCE_FOLDER / SUBFOLDER
folder.mkdir(parents=True, exist_ok=True)
return folder
def test_temp_a_listener_of_a_sandbox_world_is_recorded_on_retail_and_on_ours(firefox_binary, site):
records: Dict[str, Any] = {}
errors: Dict[str, str] = {}
for name, run in (("ours", lambda: _on_ours(firefox_binary, site.url)), ("retail", lambda: _on_retail(retail_executable(), site.url))):
try:
records[name] = run()
except BaseException as exc: # noqa: BLE001 - the other browser still runs, and what failed is recorded
records[name] = {}
errors[name] = "%s: %s" % (type(exc).__name__, exc)
rows = _side_by_side(records["ours"], records["retail"])
folder = _folder()
for name in ("ours", "retail"):
(folder / ("%s.json" % name)).write_text(
json.dumps({"listener_realm": REALM_NAMES[name], "errors": errors.get(name), "cases": records[name]}, indent=1, sort_keys=True) + "\n", encoding="utf-8")
(folder / "side-by-side.json").write_text(json.dumps({"listener_realm": REALM_NAMES, "errors": errors, "rows": rows}, indent=1, sort_keys=True) + "\n", encoding="utf-8")
text = _lines(rows)
(folder / "side-by-side.txt").write_text(text, encoding="utf-8")
print("\nlisteners of another world and window.onerror, retail and ours, saved in %s\n%s" % (folder, text))
if "retail" in errors:
raise BrokenControl("BROKEN CONTROL, no finding about ours: retail Firefox could not be driven through the steps (%s); what ours did is in %s" % (errors["retail"], folder))
unheard = [case for case, by_variant in records["retail"].items() for r in by_variant.values() if not r["control"]["heard"]]
if unheard:
raise BrokenControl("BROKEN CONTROL, no finding about ours: on retail the page's own throwing listener never reached window.onerror in the cases %s, so the click did not reach the page; the record is in %s" % (unheard, folder))
if "ours" in errors:
raise AssertionError("ours could not be driven through the steps (%s); the record of retail is in %s" % (errors["ours"], folder))
@@ -0,0 +1,233 @@
"""TEMPORARY EVIDENCE, no verdict about ours: the plant and the page's own read of ``test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e.py::
test_a_client_call_on_a_handle_reads_none_of_the_getters_the_page_planted``, on RETAIL Firefox 159 and on ours, side by side. Remove it when the control of that test is settled.
THE RED TO EXPLAIN. On candidate 46792115974 (linux.3 and windows.3) the cases quads, describe, scroll and click of that test fail at their CONTROL, before any client call: a property
the plant defines on the INSTANCE with ``Object.defineProperty`` counts 1 when the page reads it if it was not on the prototype chain (``getBoxQuads``, ``browsingContext``), and 0 when it
was (``isConnected``, ``nodeType``, ``ownerDocument``, ``innerWidth``, ``defaultView``, ``clientWidth``...). The case adopt passes. Before the control is touched, the same pages and the same plant
and read run on retail, and the record says what retail does.
WHAT IT RUNS. The five cases of the original test (``CASES``, its ``PLANT`` and its ``TARGETS_PAGE``, imported, not copied), each on a fresh page of a fresh context, on ours first (the launch of
the original: ``InvisiblePlaywright(seed=4274, headless=True)``) and on retail second (``_retail_reference.RetailSession``: the official build, Marionette alone, headed, one browser at a time).
For every planted property, in the frame the case plants it in, it records:
* ``before``: where the property is defined before the plant (the number of prototype hops from the target, ``0`` being the instance; the object that holds it; accessor or data);
* ``count``: what the ORIGINAL plant returns as its control (the page's own first read of the planted property);
* ``after_own``: ``Object.getOwnPropertyDescriptor(target, name)`` after the plant (own or not, accessor or data, configurable, and whether the getter is the planted one);
* ``second``: a second read by the page after the plant (the count that one read adds), and the type of the value it returns.
The page code is the same text on both browsers: on ours it is ``page.evaluate``; on retail it runs through ``window.wrappedJSObject.eval`` (Marionette's sandbox is not the page's world: a
property defined on its Xray would be one the page never sees). No client call is made and nothing about ours is asserted: the test fails only when a browser cannot be driven (a BROKEN
CONTROL, no finding about ours) after saving what it has.
WHERE THE RECORD IS. ``$RUNNER_TEMP/invpw-evidence/hasinstance-planted-getters/{ours,retail,side-by-side}.json`` and ``side-by-side.txt`` (the folder every e2e job uploads; off a runner, the
temporary folder), and the lines of ``side-by-side.txt`` are printed to the output of the test.
"""
from __future__ import annotations
import importlib
import json
import os
import tempfile
import threading
from http.server import BaseHTTPRequestHandler
from pathlib import Path
from types import SimpleNamespace
from typing import Any, Callable, Dict, List
import pytest
from _retail_reference import RetailDriver, RetailSession, retail_executable
from _servers import LocalServer
from _stock_twin import BrokenControl
from _waits import wait_until
from _watchdog_log import EVIDENCE_FOLDER
pytestmark = pytest.mark.e2e
#: The test whose control is explained, imported as a module (its test functions are not names of this one, so they are not collected twice).
ORIGINAL = importlib.import_module("test_a_pages_own_hasinstance_is_never_called_while_the_client_listens_to_console_e2e")
SUBFOLDER = "hasinstance-planted-getters"
DEADLINE = 30.0
#: The page-side helpers: the same resolution of a target as the original plant.
_RESOLVE = "const resolve = of => of === 'window' ? window : of === 'document' ? document : of === 'root' ? document.documentElement : document.querySelector(of);"
#: Before the plant: where each property is defined (hops from the target; 0 is the instance).
INSPECT_BEFORE = """(targets) => {
%s
const out = {};
for (const [of, names] of targets) {
const target = resolve(of);
for (const name of names) {
let owner = target, hops = 0, d = null;
while (owner && !(d = Object.getOwnPropertyDescriptor(owner, name))) { owner = Object.getPrototypeOf(owner); hops++; }
out[of + '.' + name] = d ? {hops, holder: Object.prototype.toString.call(owner), kind: ('get' in d) ? 'accessor' : 'data', configurable: d.configurable}
: {hops: null, holder: null, kind: 'absent', configurable: null};
}
}
return JSON.stringify(out);
}""" % _RESOLVE
#: The ORIGINAL plant, as it is, returning its control as text (the same wrapper on both browsers).
RUN_PLANT = "(targets) => JSON.stringify((%s)(targets))" % ORIGINAL.PLANT
#: After the plant: the descriptor on the target, and a second read by the page.
INSPECT_AFTER = """(targets) => {
%s
const out = {};
for (const [of, names] of targets) {
const target = resolve(of);
for (const name of names) {
const key = of + '.' + name;
const own = Object.getOwnPropertyDescriptor(target, name);
let second = null, type = null, error = null;
try {
const before = window.__reads[key];
const value = target[name];
second = window.__reads[key] - before;
type = value === null ? 'null' : typeof value;
window.__reads[key] = before;
} catch (e) { error = String(e && e.message || e); }
out[key] = {
after_own: own ? {own: true, kind: ('get' in own) ? 'accessor' : 'data', configurable: own.configurable,
planted_getter: typeof own.get === 'function' && Function.prototype.toString.call(own.get).includes('__reads')}
: {own: false, kind: null, configurable: null, planted_getter: false},
second, second_value_type: type, second_error: error,
};
}
}
return JSON.stringify(out);
}""" % _RESOLVE
class _Handler(BaseHTTPRequestHandler):
"""The targets page of the original test on every path (a query tells the cases apart)."""
def log_message(self, *a):
pass
def do_GET(self):
body = ORIGINAL.TARGETS_PAGE
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.send_header("Cache-Control", "no-store")
self.end_headers()
self.wfile.write(body)
@pytest.fixture
def site():
srv = LocalServer(("127.0.0.1", 0), _Handler)
threading.Thread(target=srv.serve_forever, daemon=True).start()
try:
yield SimpleNamespace(url="http://127.0.0.1:%d/" % srv.server_address[1])
finally:
srv.shutdown()
srv.server_close()
def _measure(case, evaluate: Callable[[str, str], Any]) -> Dict[str, Any]:
"""The record of one case: ``evaluate(frame_key, page_function_text, targets)`` runs the text with the targets in that frame and returns what it parsed."""
record: Dict[str, Any] = {"block": case.block, "frames": {}}
for frame_key, targets in case.plants:
before = evaluate(frame_key, INSPECT_BEFORE, targets)
control = evaluate(frame_key, RUN_PLANT, targets)
after = evaluate(frame_key, INSPECT_AFTER, targets)
rows = {}
for key in before:
rows[key] = {"before": before[key], "count": control.get(key), **after.get(key, {})}
record["frames"][frame_key] = rows
return record
def _on_ours(firefox_binary: str, url: str) -> Dict[str, Any]:
from invisible_playwright import InvisiblePlaywright
out: Dict[str, Any] = {}
with InvisiblePlaywright(seed=4274, binary_path=firefox_binary, headless=True) as browser:
for case in ORIGINAL.CASES:
page = browser.new_context().new_page()
page.goto(url + "?case=" + case.id, wait_until="load")
child = page.query_selector("#f").content_frame()
child.wait_for_selector("#inner")
where = {"main": page, "child": child}
def evaluate(frame_key, text, targets):
return json.loads(where[frame_key].evaluate(text, targets))
out[case.id] = _measure(case, evaluate)
page.close()
return out
def _on_retail(executable: str, url: str) -> Dict[str, Any]:
out: Dict[str, Any] = {}
with RetailSession(executable, 1.0) as session:
driver = RetailDriver(session)
for case in ORIGINAL.CASES:
driver.goto(url + "?case=" + case.id)
assert wait_until(lambda: driver.eval_in_frame("!!document.getElementById('inner')"), DEADLINE, lambda: driver.wait_for_timeout(50)), \
"the frame of the page has no #inner after %.0f s on retail" % DEADLINE
def evaluate(frame_key, text, targets):
expression = "window.wrappedJSObject.eval(%s)" % json.dumps("(%s)(%s)" % (text, json.dumps(targets)))
read = driver.eval if frame_key == "main" else driver.eval_in_frame
return json.loads(read(expression))
out[case.id] = _measure(case, evaluate)
return out
def _side_by_side(ours: Dict[str, Any], retail: Dict[str, Any]) -> List[Dict[str, Any]]:
rows = []
for case_id in [c.id for c in ORIGINAL.CASES]:
for frame_key, props in (ours.get(case_id) or retail.get(case_id) or {"frames": {}})["frames"].items():
for key in props:
rows.append({"case": case_id, "frame": frame_key, "property": key,
"retail": ((retail.get(case_id) or {}).get("frames", {}).get(frame_key, {}) or {}).get(key),
"ours": ((ours.get(case_id) or {}).get("frames", {}).get(frame_key, {}) or {}).get(key)})
return rows
def _line(row: Dict[str, Any]) -> str:
def cell(r):
if not r:
return "no record"
b, a = r["before"], r["after_own"]
return "count=%s second=%s before(hops=%s %s %s) after(own=%s %s planted_getter=%s)" % (
r["count"], r["second"], b["hops"], b["holder"], b["kind"], a["own"], a["kind"], a["planted_getter"])
return "%-8s %-5s %-34s\n retail: %s\n ours: %s" % (row["case"], row["frame"], row["property"], cell(row["retail"]), cell(row["ours"]))
def _folder() -> Path:
base = os.environ.get("RUNNER_TEMP") or tempfile.gettempdir()
folder = Path(base) / EVIDENCE_FOLDER / SUBFOLDER
folder.mkdir(parents=True, exist_ok=True)
return folder
def test_temp_the_planted_getters_are_recorded_on_retail_and_on_ours(firefox_binary, site):
records: Dict[str, Any] = {}
errors: Dict[str, str] = {}
for name, run in (("ours", lambda: _on_ours(firefox_binary, site.url)), ("retail", lambda: _on_retail(retail_executable(), site.url))):
try:
records[name] = run()
except BaseException as exc: # noqa: BLE001 - the other browser still runs, and what failed is recorded
records[name] = {}
errors[name] = "%s: %s" % (type(exc).__name__, exc)
rows = _side_by_side(records["ours"], records["retail"])
folder = _folder()
for name in ("ours", "retail"):
(folder / ("%s.json" % name)).write_text(json.dumps({"errors": errors.get(name), "cases": records[name]}, indent=1, sort_keys=True) + "\n", encoding="utf-8")
(folder / "side-by-side.json").write_text(json.dumps({"errors": errors, "rows": rows}, indent=1, sort_keys=True) + "\n", encoding="utf-8")
text = "\n".join(_line(row) for row in rows) + "\n"
(folder / "side-by-side.txt").write_text(text, encoding="utf-8")
print("\nplanted getters, retail and ours, saved in %s\n%s" % (folder, text))
if "retail" in errors:
raise BrokenControl("BROKEN CONTROL, no finding about ours: retail Firefox could not be driven through the plant (%s); what ours did is in %s" % (errors["retail"], folder))
if "ours" in errors:
raise AssertionError("ours could not be driven through the plant (%s); the record of retail is in %s" % (errors["ours"], folder))
+5 -1
View File
@@ -65,6 +65,10 @@ EXCLUDED = {
(_BOTH, "wrapper.e2e.stock_twin.dnd (second file): the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
"tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py":
(_BOTH, "wrapper.e2e.stock_twin.intersection: the same steps on a reference (Playwright's own Firefox, or retail Firefox 159 for the chrome popups) and on ours, which only the legs of that row install; the whole-suite rows have neither"),
"tests/test_temp_a_listener_of_a_sandbox_world_is_recorded_on_retail_and_on_ours_e2e.py":
(_BOTH, "wrapper.e2e.stock_twin.tooltip (third file, TEMPORARY): the same listener of another script world and the page's own, on retail Firefox 159 and on ours, which only the legs of that row install; the whole-suite rows have neither"),
"tests/test_temp_the_planted_getters_are_recorded_on_retail_and_on_ours_e2e.py":
(_BOTH, "wrapper.e2e.stock_twin.tooltip (second file, TEMPORARY): the same plant and read on retail Firefox 159 and on ours, which only the legs of that row install; the whole-suite rows have neither"),
"tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py":
(_BOTH, "wrapper.e2e.udp.exit: the lab's exit is an address held on lo as root (Linux only), run in the root step"),
"tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick":
@@ -105,7 +109,7 @@ EXCLUDED = {
(("windows",), "skips on Windows: the Linux text path"),
}
#: Changed by hand, together with the list above: an exclusion is a test the candidate does not run, and it may not be added in silence.
EXCLUDED_COUNT = 28
EXCLUDED_COUNT = 30
@functools.lru_cache(maxsize=None)
@@ -1,4 +1,4 @@
"""The fontconfig rules of the user do not change a pixel of the text a page reads (e2e, Linux, a gate test that asserts the principle: same seed, same bytes).
"""The fontconfig rules of the host do not change a pixel of the text a page reads (e2e, Linux, a gate test that asserts the principle: same seed, same bytes).
Why Linux only: fontconfig exists only there. On Windows DirectWrite draws the text, with no rule of a user in between, so this test has no
Windows form (the row of ``ci/required-suites.json`` says so: ``linux_only``).
@@ -8,10 +8,11 @@ The question. The engine draws a face with the parameters of its fontconfig patt
reads their effect (``getImageData`` of a canvas with text). A value a page reads must not depend on the machine. The engine runs fontconfig on its
own empty configuration: it reads no ``fonts.conf``, no rule, no cache folder and no GTK or Xft option, so every rule below must change nothing.
How a rule enters. As a real user's does: through the user's own configuration, ``$XDG_CONFIG_HOME/fontconfig/fonts.conf`` (the system
``fonts.conf`` includes it through ``conf.d/50-user.conf``), set in the environment of the test. Not through ``FONTCONFIG_FILE``: the core removes
``FONTCONFIG_*`` and ``FC_*`` from the environment of the engine, so a rule given that way would never arrive, and a test built on it would be green
for the wrong reason. ``XDG_CONFIG_HOME`` is not removed, and the test reads ``/proc/<pid>/environ`` of the engine's processes to show it did arrive.
How a rule enters. As the rule of a host does, system-wide: ``/etc/fonts/local.conf``, the file the system ``fonts.conf`` includes for the rules of the
administrator, written with ``sudo`` (the runner has it without a password) just before the launch and put back as it was (or removed, if there was
none) when the launch ends, whatever its outcome. Not through the environment: the core owns ``XDG_CONFIG_HOME`` and ``XDG_CONFIG_DIRS`` and points
both at empty folders of its own, and removes ``FONTCONFIG_*`` and ``FC_*``, so no variable the test sets can carry a rule to the engine, and a test
built on one would be green for the wrong reason. The files of the system are where a host can still put a rule, and where the engine must not read it.
What is drawn. One local page (http://127.0.0.1, a secure context, so ``crypto.subtle`` answers) draws ``fillText`` with the same seed in every launch:
@@ -26,9 +27,9 @@ What is drawn. One local page (http://127.0.0.1, a secure context, so ``crypto.s
Each row returns the sha256 of the ``getImageData`` bytes, the number of pixels with R != G or G != B (subpixel anti-aliasing: grayscale text has
none), the number of pixels that are not white (the text is there) and the width ``measureText`` gives.
Seven launches, one engine, one seed, each with its own user ``fonts.conf``:
Seven launches, one engine, one seed, each with its own ``/etc/fonts/local.conf``:
1. nothing: a ``fonts.conf`` with no rule (the rules of the machine, whatever they are);
1. nothing: a ``local.conf`` with no rule (the rules of the machine, whatever they are);
2. ``rgba=none`` and ``lcdfilter=lcdnone`` (the runner's own rules say rgba=rgb: this is the other side of it);
3. ``rgba=bgr``;
4. ``embeddedbitmap=false``;
@@ -38,15 +39,14 @@ Seven launches, one engine, one seed, each with its own user ``fonts.conf``:
mode="prepend_first" binding="strong">`` of a face every runner has (the engine builds exactly such a pattern for a generic family:
FC_FAMILY = "system-ui", FC_SCALABLE, FC_LANG, then ``FcConfigSubstitute`` and ``FcFontSort``).
Each is a separate configuration. Before each engine starts, ``fc-match`` runs in the same environment (the same ``XDG_CONFIG_HOME``) and says whether
the rule is in force; a launch whose rule is not in force measures nothing and the test says so, and fails: a launch that measures nothing is not a pass
(the raw lines are in ``result.json``). Why the system-ui rule did not take in the measurement of the old engine (run 45078210028): ``fc-match
Each is a separate configuration. The positive control: before each engine starts, ``fc-match`` runs on the HOST, in the environment of the test process
(less ``FONTCONFIG_*`` and ``FC_*``), and says whether the rule is in force; a launch whose rule is not in force measures nothing and the test says so,
and fails: a launch that measures nothing is not a pass (the raw lines are in ``result.json``). Why the system-ui rule did not take in the measurement of the old engine (run 45078210028): ``fc-match
system-ui`` PARSES its argument as a fontconfig name, in which ``-`` starts the size (``family-size``), so fontconfig matched the family ``system``
and the rule on ``system-ui`` never fired. The test asks ``fc-match`` for ``system\\-ui`` (the hyphen escaped), which is the family the engine builds.
The assertions:
* every launch has its rule in force in fontconfig itself and its ``XDG_CONFIG_HOME`` in the environment of an engine process, and every
row drew text (a blank canvas would equal any other);
* every launch has its rule in force in fontconfig itself (the host control above), and every row drew text (a blank canvas would equal any other);
* every launch gives the same pixel hashes as launch 1, row by row, for the opaque canvas and for the default one;
* with the rule on ``system-ui``, a page reads the same computed ``font-family`` and the same widths (canvas and layout, Latin and CJK) as in launch 1.
@@ -54,13 +54,15 @@ Red on the old engine (run 45078210028: ``rgba=none`` with ``lcdfilter=none`` ch
rows on both canvases): the rules reach the face through the host's configuration. Green on the engine that runs fontconfig on its own empty one.
Evidence, whatever the verdict: when ``RUNNER_TEMP`` is set the test writes ``result.json`` under ``$RUNNER_TEMP/invpw-evidence/fontconfig-rules/``: per
launch, the configuration, the hashes and subpixel counts by row, the reads of ``system-ui``, what ``fc-match`` says and the environment seen in the engine's
processes. A table is printed (launch by canvas: same or different from launch 1, subpixel pixels in total). A failure to write it never changes the outcome.
launch, the configuration, the hashes and subpixel counts by row, the reads of ``system-ui``, what ``fc-match`` says and the ``FONTCONFIG_*`` / ``FC_*``
variables seen in the engine's processes. A table is printed (launch by canvas: same or different from launch 1, subpixel pixels in total). A failure to
write it never changes the outcome.
Run: pytest tests/test_the_host_fontconfig_rules_do_not_reach_the_text_pixels_linux_e2e.py -m e2e -v -s
"""
from __future__ import annotations
import contextlib
import http.server
import json
import os
@@ -98,7 +100,10 @@ HOST_FACE_CANDIDATES = [
("/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf", "Liberation Serif"),
]
#: name of the launch -> the rules, ``(property, kind, value)``. The user's ``fonts.conf`` of a launch holds them and nothing else.
#: The system-wide file of the rules of a host; the system ``fonts.conf`` includes it.
LOCAL_CONF = Path("/etc/fonts/local.conf")
#: name of the launch -> the rules, ``(property, kind, value)``. The ``local.conf`` of a launch holds them and nothing else.
LAUNCHES = [
("1_nothing", []),
("2_rgba_none_lcdnone", [("rgba", "const", "none"), ("lcdfilter", "const", "lcdnone")]),
@@ -203,7 +208,7 @@ def _evidence_dir():
def _config_text(name: str, rules, host_family: str) -> str:
"""The user's ``fonts.conf`` of a launch: its rules and nothing else (the system ``fonts.conf`` includes it)."""
"""The ``/etc/fonts/local.conf`` of a launch: its rules and nothing else (the system ``fonts.conf`` includes it)."""
parts = ['<?xml version="1.0"?>', '<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">', "<fontconfig>"]
if name == SYSTEM_UI_LAUNCH:
# STRONG, and first: the face comes before ``system-ui`` and before every family the rules of the system add behind it.
@@ -221,11 +226,31 @@ def _config_text(name: str, rules, host_family: str) -> str:
return "\n".join(parts) + "\n"
def _fc_env(xdg_config_home: Path) -> dict:
"""The environment ``fc-match`` runs in: the test's own, with the user's configuration folder of THIS launch, and without the variables the core strips."""
env = {k: v for k, v in os.environ.items() if not k.startswith(("FONTCONFIG_", "FC_"))}
env["XDG_CONFIG_HOME"] = str(xdg_config_home)
return env
def _fc_env() -> dict:
"""The environment ``fc-match`` runs in: the test's own, without the variables the core strips."""
return {k: v for k, v in os.environ.items() if not k.startswith(("FONTCONFIG_", "FC_"))}
def _sudo(*argv: str, data: bytes | None = None) -> subprocess.CompletedProcess:
"""``sudo`` without a password prompt (``-n``): a runner without it fails here, loudly, and the test says so."""
return subprocess.run(["sudo", "-n", *argv], input=data, capture_output=True, timeout=60)
@contextlib.contextmanager
def _system_rule(text: str):
"""``/etc/fonts/local.conf`` holds ``text`` inside the block; on the way out, whatever happened, the file is what it was before (or is removed, if there
was none). A host that cannot be written to is a failure of the test, never a launch without its rule."""
original = LOCAL_CONF.read_bytes() if LOCAL_CONF.is_file() else None
try:
done = _sudo("tee", str(LOCAL_CONF), data=text.encode("utf-8"))
assert done.returncode == 0, "cannot write %s with sudo: %s" % (LOCAL_CONF, done.stderr.decode("utf-8", "replace").strip())
yield
finally:
if original is None:
done = _sudo("rm", "-f", str(LOCAL_CONF))
else:
done = _sudo("tee", str(LOCAL_CONF), data=original)
assert done.returncode == 0, "cannot put %s back with sudo: %s" % (LOCAL_CONF, done.stderr.decode("utf-8", "replace").strip())
def _fc_match(env: dict, pattern: str, fmt: str) -> str:
@@ -233,11 +258,11 @@ def _fc_match(env: dict, pattern: str, fmt: str) -> str:
return done.stdout.strip()
def _what_fontconfig_says(xdg_config_home: Path) -> dict:
"""What fontconfig itself says in the environment of this launch (the host tool, not the browser): the value of each property, the raw ``fc-match -v``
lines of them, and the family it answers to ``system-ui`` (the pattern the engine builds)."""
def _what_fontconfig_says() -> dict:
"""What fontconfig itself says on the host with the rule of this launch in place (the host tool, not the browser): the value of each property, the raw
``fc-match -v`` lines of them, and the family it answers to ``system-ui`` (the pattern the engine builds)."""
out = {}
env = _fc_env(xdg_config_home)
env = _fc_env()
try:
for key in PROPERTIES:
out[key] = _fc_match(env, "sans", "%%{%s}" % key)
@@ -252,7 +277,7 @@ def _what_fontconfig_says(xdg_config_home: Path) -> dict:
def _rule_in_force(name: str, said: dict, base_said: dict, host_family: str) -> dict:
"""The precondition of a launch, decided BEFORE its engine starts: does fontconfig, in the environment of this launch, apply the rule? A launch whose
"""The precondition of a launch, decided BEFORE its engine starts: does fontconfig on the host apply the rule? A launch whose
rule is not in force measures nothing (it would equal launch 1 whatever the engine does)."""
problems, notes = [], []
if "error" in said:
@@ -276,10 +301,9 @@ def _rule_in_force(name: str, said: dict, base_said: dict, host_family: str) ->
return {"ok": not problems, "problems": problems, "notes": notes}
def _engine_environ(binary: str, xdg_config_home: Path) -> dict:
"""``XDG_CONFIG_HOME`` and any ``FONTCONFIG_*`` in the environment of every process of the engine (``/proc/<pid>/environ``): the rule reaches the
engine only if the first is there with this launch's folder, and the core removes the second."""
seen = {"processes": 0, "with_the_config_home": 0, "fontconfig_variables": []}
def _engine_environ(binary: str) -> dict:
"""Evidence only: the processes of the engine seen in ``/proc`` and any ``FONTCONFIG_*`` / ``FC_*`` in their environment (the core removes them)."""
seen = {"processes": 0, "fontconfig_variables": []}
try:
real = os.path.realpath(binary)
for entry in os.scandir("/proc"):
@@ -293,22 +317,19 @@ def _engine_environ(binary: str, xdg_config_home: Path) -> dict:
except OSError:
continue
seen["processes"] += 1
if env.get(b"XDG_CONFIG_HOME", b"").decode("utf-8", "replace") == str(xdg_config_home):
seen["with_the_config_home"] += 1
seen["fontconfig_variables"] += sorted(k.decode("utf-8", "replace") for k in env if k.startswith((b"FONTCONFIG_", b"FC_")))
except Exception as exc:
seen["error"] = repr(exc)
return seen
def _launch(binary: str, xdg_config_home: Path, url: str) -> dict:
def _launch(binary: str, url: str) -> dict:
from invisible_playwright import InvisiblePlaywright
result = {"xdg_config_home": str(xdg_config_home)}
# The variable of THIS launch, in the environment of the process: the wrapper composes the engine's environment from it. A FONTCONFIG_FILE or
# FONTCONFIG_PATH of the runner is taken off: with one of them, the system ``fonts.conf`` would not be read and the user's file would not either.
result = {}
# A FONTCONFIG_FILE or FONTCONFIG_PATH of the runner is taken off: with one of them, the system ``fonts.conf`` would not be read, nor would the
# ``local.conf`` it includes.
with pytest.MonkeyPatch.context() as patch:
patch.setenv("XDG_CONFIG_HOME", str(xdg_config_home))
for variable in ("FONTCONFIG_FILE", "FONTCONFIG_PATH"):
patch.delenv(variable, raising=False)
with InvisiblePlaywright(seed=SEED, binary_path=binary, headless=True) as browser:
@@ -316,7 +337,7 @@ def _launch(binary: str, xdg_config_home: Path, url: str) -> dict:
page.goto(url, timeout=30_000)
result["rows"] = page.evaluate(ROWS_JS, [[[f, t] for f, t, _w in FONTS], SIZES])
result["system_ui"] = page.evaluate(SYSTEM_UI_JS)
result["engine_environ"] = _engine_environ(binary, xdg_config_home)
result["engine_environ"] = _engine_environ(binary)
return result
@@ -358,12 +379,13 @@ def _table(results: dict, base: str) -> str:
@pytest.fixture(scope="module")
def launches(firefox_binary, tmp_path_factory):
def launches(firefox_binary):
"""Every launch, once per module. -> {name: result}; the record is written before the assertions run."""
for tool in ("fc-match",):
for tool in ("fc-match", "sudo"):
if shutil.which(tool) is None:
pytest.fail("needs %s (apt install fontconfig): without it no rule can be shown to be in force" % tool, pytrace=False)
work = tmp_path_factory.mktemp("fcrules")
pytest.fail("needs %s (fontconfig, sudo): without it no rule can be put on the host and shown to be in force" % tool, pytrace=False)
if _sudo("true").returncode != 0:
pytest.fail("needs sudo without a password: a rule of the host is written to %s" % LOCAL_CONF, pytrace=False)
face, host_family = next(((p, f) for p, f in HOST_FACE_CANDIDATES if os.path.exists(p)), (None, None))
assert face, "no host face to put first for the system-ui launch: none of %r exists on this runner" % [p for p, _f in HOST_FACE_CANDIDATES]
@@ -373,15 +395,13 @@ def launches(firefox_binary, tmp_path_factory):
results, fc = {}, {}
try:
for name, rules in LAUNCHES:
xdg = work / name / "xdg-config"
(xdg / "fontconfig").mkdir(parents=True)
conf = xdg / "fontconfig" / "fonts.conf"
conf.write_text(_config_text(name, rules, host_family), encoding="utf-8")
# Before the engine starts: fontconfig in THIS environment. Its answer says whether the launch measures anything.
fc[name] = _what_fontconfig_says(xdg)
precondition = _rule_in_force(name, fc[name], fc.get(BASE_LAUNCH, fc[name]), host_family)
results[name] = _launch(firefox_binary, xdg, url)
results[name]["config"] = conf.read_text(encoding="utf-8")
config = _config_text(name, rules, host_family)
with _system_rule(config):
# Before the engine starts: fontconfig on the host with this rule in place. Its answer says whether the launch measures anything.
fc[name] = _what_fontconfig_says()
precondition = _rule_in_force(name, fc[name], fc.get(BASE_LAUNCH, fc[name]), host_family)
results[name] = _launch(firefox_binary, url)
results[name]["config"] = config
results[name]["fc_match"] = fc[name]
results[name]["precondition"] = precondition
finally:
@@ -398,30 +418,26 @@ def launches(firefox_binary, tmp_path_factory):
(where / "result.json").write_text(json.dumps(record, indent=1, sort_keys=True), encoding="utf-8")
if BASE_LAUNCH in results:
print(_table(results, BASE_LAUNCH))
print("XDG_CONFIG_HOME seen in the engine's processes:",
{n: (r.get("engine_environ") or {}).get("with_the_config_home") for n, r in results.items()})
print("FONTCONFIG_* / FC_* variables seen in the engine's processes:",
{n: (r.get("engine_environ") or {}).get("fontconfig_variables") for n, r in results.items()})
except Exception as exc: # a record never changes the outcome
print("the record could not be written:", repr(exc))
return results
def _every_launch_measures_something(launches):
"""The first assertion of every test: a launch whose rule fontconfig does not apply, or whose rule did not reach the engine, measures nothing,
and the comparison would say "equal"."""
"""The first assertion of every test: a launch whose rule fontconfig itself does not apply measures nothing, and the comparison would say "equal"."""
assert set(launches) == {n for n, _r in LAUNCHES}, "not every launch ran: %s" % sorted(launches)
for name, _rules in LAUNCHES:
pre = launches[name]["precondition"]
assert pre["ok"], "launch %s measures nothing: fontconfig does not apply its rule: %s (it said: %r)" % (
name, "; ".join(pre["problems"]), launches[name]["fc_match"])
seen = launches[name]["engine_environ"]
assert seen.get("processes"), "launch %s: no process of the engine was seen in /proc (%r): the environment it ran in is not known" % (name, seen)
assert seen["with_the_config_home"] > 0, (
"launch %s measures nothing: XDG_CONFIG_HOME of the launch did not reach the engine (%r), so its rule could not be read" % (name, seen))
@pytest.mark.timeout(900, method="thread")
def test_every_launch_has_its_rule_in_force_in_fontconfig_itself_and_in_the_engine_s_environment(launches):
"""Without this the equalities below would say nothing: a configuration fontconfig ignores is equal to any other."""
"""Without this the equalities below would say nothing: a configuration fontconfig ignores is equal to any other. The rule is in force when ``fc-match``
on the host obeys it (the engine's environment is not the route: the core gives the engine empty folders of its own)."""
_every_launch_measures_something(launches)
@@ -0,0 +1,120 @@
"""The retail width of a password field comes from the capture by a script, and the committed file is what that script writes: nothing is typed.
``tests/test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py`` compares the width a page reads on a password field of our engine with what RETAIL Firefox 159 on Windows read in the same page.
Its number is read from ``ci/retail-password-mask.json``, which ``scripts/extract_retail_password_mask.py`` writes from the capture. The wrapper's CI has no capture, so, with no browser and no capture:
1. the extraction is run on a small capture made here (the shape of a ``result.json`` and of ``meta.json``, with a known width): it gives that width, the mask, the sha256 of the files read and the browser;
2. known-bad captures are refused, never filled in: a ``result.json`` that is not the file ``meta.json`` lists, a page that is not the page of the capture, a result with an error, a result with no ``arial16``
reading, a password field whose own box and series box disagree, a verdict that does not name U+25CF alone, a capture that is not a Windows one;
3. the committed file has what the e2e test reads: the browser (version, build id, installer, ``firefox.exe`` and ``xul.dll`` sha256), the run, the page's sha256 (equal to the sha256 of the page of
the test), and the reading of ``arial16`` with its mask U+25CF; its width is a positive whole number of pixels;
4. the e2e test holds no retail number of its own: it reads the file, and types no width.
Known-bad: a typed width in the e2e test, a page that is not the capture's. Green: the state of the repository.
"""
from __future__ import annotations
import copy
import hashlib
import json
import re
import sys
from pathlib import Path
from typing import Any, Dict
import pytest
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT / "scripts"))
import extract_retail_password_mask as ex # noqa: E402
pytestmark = pytest.mark.unit
E2E = ROOT / "tests" / "test_a_password_field_is_as_wide_as_on_retail_windows_e2e.py"
PAGE = ROOT / "tests" / "data" / "password_mask_page.html"
def _result(width: int = 400) -> Dict[str, Any]:
"""A result.json of the page with a known width for 40 characters of the mask U+25CF."""
font = {"password": {"40": {"scrollWidth": width, "scrollWidth_main": width, "clientWidth": 20}, "per_char": width / 40},
"refs": {"U+25CF": {"text_input": {"40": {"scrollWidth": width}}}, "*": {"text_input": {"40": {"scrollWidth": width - 100}}}},
"verdict": {"by_text_input_scrollWidth": ["U+25CF"]}}
return {"format": "password-mask/1", "n": 40, "env": {"platform": "Win32", "devicePixelRatio": 1}, "fonts": {"arial16": font, "default16": copy.deepcopy(font)}}
def _capture(tmp_path: Path, result: Dict[str, Any] = None, *, listed_sha: str = None, page_sha: str = None) -> Path:
folder = tmp_path / "captures" / "firefox-159.0" / "windows-server-2025" / "password-mask" / "2026-12-02"
folder.mkdir(parents=True)
path = folder / "result.json"
path.write_text(json.dumps(result or _result()), encoding="utf-8")
meta = {"files": {"result.json": {"sha256": listed_sha or hashlib.sha256(path.read_bytes()).hexdigest()}}, "page": {"sha256": page_sha or ex.sha256_of(PAGE)},
"firefox_version": "159.0", "build_id": "20261022150525", "source_run": {"repo": "example/core", "run_id": 1},
"host": {"runner_image": "windows-2025", "os_version": "10.0.26100", "os_ubr": "1"},
"binaries": {"installer_sha256": "ab" * 32, "firefox_exe_sha256": "cd" * 32, "xul_dll_sha256": "ef" * 32}}
(folder / "meta.json").write_text(json.dumps(meta), encoding="utf-8")
return folder
def _refused(tmp_path: Path, fragment: str, **kw) -> None:
with pytest.raises(ex.ExtractError) as info:
ex.build(_capture(tmp_path, **kw), "abc123")
assert fragment in str(info.value), str(info.value)
def test_the_extraction_gives_the_width_of_the_capture_with_the_sha256_of_the_files_read(tmp_path):
data = ex.build(_capture(tmp_path, _result(400)), "abc123")
assert data["cases"]["arial16"] == {"password_scrollWidth": 400, "mask": "U+25CF", "devicePixelRatio": 1, "platform": "Win32"}
assert data["capture"]["retail_captures_commit"] == "abc123" and data["capture"]["browser"]["build_id"] == "20261022150525"
assert data["page"]["sha256"] == ex.sha256_of(PAGE) and [f["path"] for f in data["files"]] == ["result.json", "meta.json"]
def test_a_result_that_is_not_the_file_the_capture_listed_is_refused(tmp_path):
_refused(tmp_path, "not the file the capture recorded", listed_sha="0" * 64)
def test_a_page_that_is_not_the_page_of_the_capture_is_refused(tmp_path):
_refused(tmp_path, "the test would not read the page retail read", page_sha="0" * 64)
def test_a_result_with_an_error_or_without_the_reading_is_refused(tmp_path):
_refused(tmp_path, "recorded an error", result={"format": "password-mask/1", "error": "boom"})
no_font = _result()
del no_font["fonts"]["arial16"]
_refused(tmp_path / "b", "no retail value, none invented", result=no_font)
def test_a_password_field_whose_boxes_disagree_or_whose_verdict_is_not_the_windows_mask_is_refused(tmp_path):
disagree = _result()
disagree["fonts"]["arial16"]["password"]["40"]["scrollWidth_main"] = 1
_refused(tmp_path, "in its own box", result=disagree)
star = _result()
star["fonts"]["arial16"]["verdict"]["by_text_input_scrollWidth"] = ["*"]
_refused(tmp_path / "b", "not the mask character of Windows", result=star)
narrow = _result()
narrow["fonts"]["arial16"]["refs"]["U+25CF"]["text_input"]["40"]["scrollWidth"] = 300
_refused(tmp_path / "c", "not the mask character of Windows", result=narrow)
def test_a_capture_that_is_not_a_windows_one_is_refused(tmp_path):
linux = _result()
linux["env"]["platform"] = "Linux x86_64"
_refused(tmp_path, "not a Windows capture", result=linux)
def test_the_committed_file_has_what_the_e2e_test_reads():
data = json.loads((ROOT / "ci" / "retail-password-mask.json").read_text(encoding="utf-8"))
assert data["page"]["sha256"] == ex.sha256_of(PAGE), "the page of the test is not the page of the capture"
browser = data["capture"]["browser"]
assert browser["firefox_version"] == "159.0" and all(re.fullmatch(r"[0-9a-f]{64}", browser[k]) for k in ("installer_sha256", "firefox_exe_sha256", "xul_dll_sha256")), browser
assert re.fullmatch(r"[0-9a-f]{40}", data["capture"]["retail_captures_commit"]) and "/actions/runs/" in data["capture"]["run"]
case = data["cases"]["arial16"]
assert data["n"] == 40 and case["mask"] == "U+25CF" and case["platform"] == "Win32" and case["devicePixelRatio"] == 1, case
assert isinstance(case["password_scrollWidth"], int) and case["password_scrollWidth"] > 0, case
def test_the_e2e_test_holds_no_retail_number_of_its_own():
source = E2E.read_text(encoding="utf-8")
assert "retail-password-mask.json" in source, "the e2e test does not read ci/retail-password-mask.json"
typed = re.findall(r"==\s*\d{3}\b|=\s*\d{3}\s*$", source, re.M)
assert not typed, "a width is typed in the e2e test: %r" % typed
@@ -1,15 +1,19 @@
"""The retail numbers of the popup move/resize test come from the captures by a script, and the committed file is what that script writes: nothing is typed.
``tests/test_a_popup_moves_and_resizes_as_declared_e2e.py`` asserted that ``resizeBy(0, 0)`` changes nothing. At a real 150% retail Firefox 159 reads an inner width of 501 after it (500 before; the outer
size is 515x478 throughout), and keeps 501 through the moves that follow. Its expected values are now read from ``ci/retail-popup-move-resize.json``, which
``scripts/extract_retail_popup_move_resize.py`` writes from the ``popup_move_resize`` step of the retail captures. The wrapper's CI has no capture, so, with no browser and no capture:
Each phase of ``tests/test_a_popup_moves_and_resizes_as_declared_e2e.py`` asserts against a capture of its OWN position in the browser's life: at a real 150% retail Firefox 159 opens the FIRST popup of a
browser one device pixel narrower (inner width 499, outer 514, ``moveTo(99999, 0)`` stops at 766) than every popup after it (500, 515, 765), ``resizeBy(0, 0)`` leaves the first at 499 and takes a later one to
501. The expected values are read from ``ci/retail-popup-move-resize.json``, which ``scripts/extract_retail_popup_move_resize.py`` writes from the ``popup-move-to`` capture (four launches: the test's order; phase 3
alone; a throwaway popup first and then the three phases; phase 2 alone, so that every phase is read as the first popup of a browser and as a later one) and cross-checks against the older window-geometry rounds.
The wrapper's CI has no capture, so, with no browser and no capture:
1. the extraction is run on a small capture made here (several rounds, the two launches, the four display cases, known values): it gives those values and the sha256 of every file read;
1. the extraction of the rounds is run on a small capture made here (several rounds, the two launches, the four display cases, known values): it gives those values and the sha256 of every file read;
2. known-bad captures are refused, never filled in: two rounds that disagree, two launches that disagree, a moment that is missing, positions that do not follow the order of the moves, one round only,
a display case asked at another scale, another browser;
3. the committed file has what the e2e test reads: the four display cases with the four moments, the rounds, the RetailCaptures commit, the browser, the sha256 of every raw.json; and the value the
old test denied (scale 1.5, inner width 501 after ``resizeBy(0, 0)``) is the capture's;
4. the e2e test holds no retail number of its own: it reads the file and defines no table of positions.
3. the extraction of the ``popup-move-to`` capture is run on a small capture made here (four launches, four display cases, a synthetic browser whose first popup is narrower at 1.5): every phase is given as the first and
as a later popup, with the launches it came from; known-bad captures are refused (a hash that is not the meta.json's, a launch with no throwaway popup, a popup left open, two popups of one position that disagree...);
4. a reading of the old rounds that no position of the capture reproduces is an anomaly the extraction fails on; the 501 of the old rounds is reproduced by a later popup and by no first one;
5. the committed file has every case, phase and position, the run, the build, the binaries and the sha256 of every raw.json, and the values retail read (first popup 499 at 1.5, a later one 500 then 501);
6. the e2e test holds no retail number of its own, and each of its phases reads the position it has in the test (phase 1 the first popup, phase 3 a later one).
"""
from __future__ import annotations
@@ -86,28 +90,48 @@ def _committed() -> Dict[str, Any]:
return json.loads(ex.DATA_PATH.read_text(encoding="utf-8"))
def test_the_committed_file_has_every_case_and_moment_with_its_provenance():
CASES = ["1600x1200-dpr2.0", "1920x1080-dpr1.0", "1920x1080-dpr1.25", "1920x1080-dpr1.5"]
POSITIONS = ["first", "later"]
def test_the_committed_file_has_every_phase_in_both_positions_with_its_provenance():
data = _committed()
assert sorted(data["cases"]) == ["1600x1200-dpr2.0", "1920x1080-dpr1.0", "1920x1080-dpr1.25", "1920x1080-dpr1.5"]
for case, moments in data["cases"].items():
assert list(moments) == list(ex.MOMENTS), "%s: the moments are %r" % (case, list(moments))
for name, reading in moments.items():
assert sorted(reading) == ["avail", "inner", "outer", "screen"], "%s %s: %r" % (case, name, reading)
assert sorted(data["cases"]) == CASES
for case, phases in data["cases"].items():
assert list(phases) == ex.MOVE_TO_PHASES, "%s: the phases are %r" % (case, list(phases))
for phase, positions in phases.items():
assert list(positions) == POSITIONS, "%s %s: the positions are %r" % (case, phase, list(positions))
for position, moments in positions.items():
assert list(moments) == list(ex.MOVE_TO_MOMENTS[phase]), "%s %s %s: the moments are %r" % (case, phase, position, list(moments))
for name, reading in moments.items():
assert sorted(reading) == ["avail", "inner", "outer", "screen"], "%s %s %s %s: %r" % (case, phase, position, name, reading)
capture = data["capture"]
assert len(capture["rounds"]) >= 2 and capture["retail_captures_commit"] and capture["browser"]["firefox_version"] == "159.0" and capture["browser"]["build_id"]
assert re.fullmatch(r"[0-9a-f]{64}", capture["browser"]["installer_sha256"])
assert len(data["files"]) == len(capture["rounds"]) * 4 * 2 and all(re.fullmatch(r"[0-9a-f]{64}", f["sha256"]) for f in data["files"])
assert capture["run_id"].isdigit() and capture["retail_captures_commit"] and capture["launches"] == ex.MOVE_TO_LAUNCHES
assert capture["browser"]["firefox_version"] == "159.0" and capture["browser"]["build_id"] and re.fullmatch(r"[0-9a-f]{64}", capture["browser"]["installer_sha256"])
assert sorted(capture["binaries_sha256"]) == ["firefox.exe", "xul.dll"] and all(re.fullmatch(r"[0-9a-f]{64}", v) for v in capture["binaries_sha256"].values())
assert len(data["files"]) == 4 * len(ex.MOVE_TO_LAUNCHES) and all(re.fullmatch(r"[0-9a-f]{64}", f["sha256"]) for f in data["files"])
for case, phases in data["sources"].items():
for phase, positions in phases.items():
assert positions["first"] and positions["later"] and all(s.endswith("#1") for s in positions["first"]) and not any(s.endswith("#1") for s in positions["later"]), (case, phase, positions)
check = data["rounds_cross_check"]
assert len(check["capture"]["rounds"]) >= 2 and check["capture"]["retail_captures_commit"] and len(check["files"]) == len(check["capture"]["rounds"]) * 4 * 2
assert sorted(check["reproduced_by"]) == CASES and all(v for v in check["reproduced_by"].values()), check["reproduced_by"]
def test_retail_reads_an_inner_width_of_501_after_resizeby_zero_at_a_real_150_percent():
"""The assertion of the old test (resizeBy(0, 0) changes nothing) is false at scale 1.5 in the capture, and true at the other three."""
def test_the_first_popup_of_a_browser_at_scale_1_5_is_one_device_pixel_narrower_in_the_capture():
"""At a real 150% the first popup a browser opens reads an inner width of 499 and an outer width of 514, keeps 499 after resizeBy(0, 0), and moveTo(99999, 0) stops at 766; a later popup reads
500 and 515, 501 after resizeBy(0, 0), and stops at 765. At the other three scales the position changes nothing."""
cases = _committed()["cases"]
now = cases["1920x1080-dpr1.5"]
assert now["initial"]["inner"] == [500, 400] and now["resized"]["inner"] == [501, 400], now
assert now["resized"]["outer"] == now["initial"]["outer"] == [515, 478], now
assert now["moved"]["inner"] == now["moved_to"]["inner"] == [501, 400], now
first, later = now["resize_by_zero"]["first"], now["resize_by_zero"]["later"]
assert first["initial"]["inner"] == first["resized"]["inner"] == [499, 400] and first["initial"]["outer"] == first["resized"]["outer"] == [514, 478], first
assert later["initial"]["inner"] == [500, 400] and later["resized"]["inner"] == [501, 400] and later["initial"]["outer"] == later["resized"]["outer"] == [515, 478], later
assert now["move_to_far_right"]["first"]["moved_to"]["screen"] == [766, 0] and now["move_to_far_right"]["later"]["moved_to"]["screen"] == [765, 0], now["move_to_far_right"]
for case in ("1920x1080-dpr1.0", "1920x1080-dpr1.25", "1600x1200-dpr2.0"):
assert cases[case]["resized"]["inner"] == cases[case]["initial"]["inner"] and cases[case]["resized"]["outer"] == cases[case]["initial"]["outer"], cases[case]
for phase, positions in cases[case].items():
assert positions["first"] == positions["later"], (case, phase, positions)
resize = cases[case]["resize_by_zero"]["first"]
assert resize["resized"]["inner"] == resize["initial"]["inner"] and resize["resized"]["outer"] == resize["initial"]["outer"], (case, resize)
def test_the_move_resize_test_reads_the_file_and_types_no_retail_table():
@@ -115,3 +139,142 @@ def test_the_move_resize_test_reads_the_file_and_types_no_retail_table():
assert "retail-popup-move-resize.json" in source, "the test does not read ci/retail-popup-move-resize.json"
assert not re.search(r"^RETAIL\b", source, re.M), "a RETAIL table is typed in the move/resize test"
assert not re.search(r"\(\(\d+, \d+\), \(\d+, \d+\), \d+\)", source), "a tuple of retail positions is typed in the move/resize test"
def test_each_phase_of_the_move_resize_test_reads_the_position_it_has_in_the_browser():
"""The test opens its popups in the order phase 1, 2, 3 in one browser, each closed before the next, and nothing before phase 1: phase 1 is the FIRST popup, phase 3 the third (a later one)."""
source = E2E.read_text(encoding="utf-8")
assert re.search(r'MOMENTS = \{case: phases\["resize_by_zero"\]\["first"\] for case, phases in _RETAIL\["cases"\]\.items\(\)\}', source), "phase 1 does not read the first-popup capture"
assert re.search(r'MOVE_TO = \{case: phases\["move_to_far_right"\]\["later"\] for case, phases in _RETAIL\["cases"\]\.items\(\)\}', source), "phase 3 does not read the later-popup capture"
body = source[source.index("def test_a_popup_moves_and_resizes_as_declared"):]
order = [body.index(call) for call in ("_phase_resize_by_zero(", "_phase_move_by(", "_phase_move_to_the_far_right(")]
assert order == sorted(order) and body.count("_phase_") == 3 and body.index("new_page()") < order[0] and body.count("_open(") == 0, "the order or the number of popups of the test changed: re-read the positions"
# ---- the capture ``popup-move-to`` (format ``retail-popup-move-to/1``): four launches, every phase as the first popup of a browser and as a later popup ----
import hashlib # noqa: E402
from typing import Callable, Optional # noqa: E402
MOVE_TO_RUN = "4600000000001"
BINARIES = {"firefox.exe": "ab" * 32, "xul.dll": "ef" * 32}
def _values(scale: float, position: str) -> Dict[str, Any]:
"""What the synthetic browser reads: at 1.5 the first popup is a device pixel narrower (inner 499, outer 514, the clamp stops at 766) and a later one grows to 501 after resizeBy(0, 0)."""
narrow = scale == 1.5 and position == "first"
return {"iw": 499 if narrow else 500, "ow": 514 if narrow else 515, "resized_iw": 499 if narrow else (501 if scale == 1.5 else 500), "moved_to_x": 766 if narrow else 765}
def _mt_moment(v: Dict[str, Any], name: str, screen) -> Dict[str, Any]:
return {"availL": 0, "availW": 1280, "ih": 400, "iw": v["resized_iw"] if name == "resized" else v["iw"], "oh": 478, "ow": v["ow"], "settled": True, "sx": screen[0], "sy": screen[1]}
def _mt_step(phase: str, ordinal: int, scale: float, *, closed: bool = True, features: str = "width=500,height=400", skip: str = "", calls=None, moved=(13, 13), x_shift: int = 0) -> Dict[str, Any]:
v = _values(scale, "first" if ordinal == 1 else "later")
at = {"initial": (3, 3), "resized": (3, 3), "moved": moved, "moved_to": (v["moved_to_x"] + x_shift, 0)}
moments = {name: _mt_moment(v, name, at[name]) for name in ex.MOVE_TO_MOMENTS[phase] if name != skip}
return {"features": features, "calls": calls if calls is not None else dict(ex.MOVE_TO_CALLS[phase]), "closed": closed, "ordinal": ordinal, "moments": moments}
def _mt_raw(scale: float, launch: str, build_id: str = "1", fmt: str = "retail-popup-move-to/1", error=None, phases=None, steps: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
plan = ex.MOVE_TO_LAUNCHES[launch]
made = {"phase_" + phase: _mt_step(phase, ordinal, scale) for ordinal, phase in enumerate(plan, 1)}
made.update(steps or {})
return {"build_id": build_id, "dpr_asked": scale, "error": error, "firefox_version": "159.0", "format": fmt, "installer_sha256": "cd" * 32, "launch": launch,
"phases_planned": phases if phases is not None else list(plan), "steps": made}
def _mt_capture(tmp_path: Path, change: Optional[Callable[[str, str, Dict[str, Any]], None]] = None, meta_wrong: str = "", run_build: str = "1", binaries=None, scales=None, skip_file=None) -> Path:
"""``change(dpr folder, launch, raw)`` may edit a raw.json before it is written (its sha256 goes in the meta.json after the change)."""
folder = tmp_path / "popup-move-to" / "2026-01-03"
folder.mkdir(parents=True)
for dpr_dir, panel, scale in ex.DISPLAYS:
hashes = {}
for launch in ex.MOVE_TO_LAUNCHES:
raw = _mt_raw((scales or {}).get(dpr_dir, scale), launch)
if change:
change(dpr_dir, launch, raw)
if skip_file == (dpr_dir, launch):
continue
target = folder / dpr_dir / panel / launch
target.mkdir(parents=True)
body = json.dumps(raw).encode("utf-8")
(target / "raw.json").write_bytes(body)
hashes["%s/%s/raw.json" % (panel, launch)] = hashlib.sha256(body).hexdigest()
if meta_wrong == dpr_dir:
hashes["%s/a/raw.json" % panel] = "00" * 32
meta = {"format": "retail-popup-move-to-meta/1", "build_id": "1", "firefox_version": "159.0", "installer_sha256": "cd" * 32, "raw_sha256": hashes}
(folder / dpr_dir / "meta.json").write_text(json.dumps(meta), encoding="utf-8")
run_info = {"binaries": {name: {"bytes": 1, "sha256": sha} for name, sha in (binaries or BINARIES).items()}, "build": {"build_id": run_build}}
(folder / "run-info.json").write_text(json.dumps(run_info), encoding="utf-8")
return folder
def test_the_move_to_extraction_reads_every_phase_as_the_first_and_as_a_later_popup_and_records_the_run_the_build_and_the_binaries(tmp_path):
data = ex.build_move_to(_mt_capture(tmp_path), MOVE_TO_RUN, "abc123")
assert sorted(data["cases"]) == CASES
case = data["cases"]["1920x1080-dpr1.5"]
assert list(case) == ex.MOVE_TO_PHASES and all(list(p) == POSITIONS for p in case.values())
first, later = case["resize_by_zero"]["first"], case["resize_by_zero"]["later"]
assert first["initial"]["inner"] == first["resized"]["inner"] == [499, 400] and first["initial"]["outer"] == [514, 478], first
assert later["initial"]["inner"] == [500, 400] and later["resized"]["inner"] == [501, 400] and later["initial"]["outer"] == [515, 478], later
assert case["move_to_far_right"]["first"]["moved_to"]["screen"] == [766, 0] and case["move_to_far_right"]["later"]["moved_to"]["screen"] == [765, 0]
assert case["move_to_far_right"]["later"]["moved"]["screen"] == [13, 13] and case["move_by"]["first"]["moved"]["screen"] == [13, 13]
assert data["cases"]["1920x1080-dpr1.25"]["resize_by_zero"]["first"] == data["cases"]["1920x1080-dpr1.25"]["resize_by_zero"]["later"]
assert data["sources"]["1920x1080-dpr1.5"] == {
"resize_by_zero": {"first": ["a#1"], "later": ["c#2"]},
"move_by": {"first": ["d#1"], "later": ["a#2", "c#3"]},
"move_to_far_right": {"first": ["b#1"], "later": ["a#3", "c#4"]},
}
assert len(data["files"]) == 4 * 4 and all(re.fullmatch(r"[0-9a-f]{64}", f["sha256"]) for f in data["files"])
capture = data["capture"]
assert capture["run_id"] == MOVE_TO_RUN and capture["retail_captures_commit"] == "abc123" and capture["browser"]["build_id"] == "1" and capture["launches"] == ex.MOVE_TO_LAUNCHES
assert capture["binaries_sha256"] == BINARIES
def _edit(launch: str, edit: Callable[[Dict[str, Any]], None], dpr: str = "dpr1.5"):
return lambda d, l, raw: edit(raw) if (d, l) == (dpr, launch) else None
@pytest.mark.parametrize("what, kwargs, message", [
("a raw.json that is not what its meta.json hashed", {"meta_wrong": "dpr1.25"}, "its meta.json says"),
("a build the run-info does not name", {"run_build": "2"}, "names the build"),
("no sha256 of xul.dll", {"binaries": {"firefox.exe": "ab" * 32}}, "lacks the sha256"),
("a scale asked as another", {"scales": {"dpr1.25": 1.5}}, "asks scale"),
("a launch that is missing", {"skip_file": ("dpr2", "d")}, "missing"),
("another format", {"change": _edit("a", lambda r: r.update(format="retail-popup-move-resize/9"), "dpr1")}, "has the format"),
("a launch that is another launch", {"change": _edit("c", lambda r: r.update(launch="a"), "dpr1")}, "is launch"),
("a launch with no throwaway popup first", {"change": _edit("c", lambda r: r.update(phases_planned=["resize_by_zero", "move_by", "move_to_far_right"]), "dpr2")}, "not the one this launch is for"),
("a step that is another popup of the browser", {"change": _edit("c", lambda r: r["steps"]["phase_resize_by_zero"].update(ordinal=1))}, "is popup number"),
("a step that is missing", {"change": _edit("b", lambda r: r["steps"].pop("phase_move_to_far_right"))}, "is missing: no retail value"),
("a moment that is missing", {"change": _edit("a", lambda r: r["steps"]["phase_move_by"]["moments"].pop("moved"))}, "no retail value, none invented"),
("positions out of the order of the moves", {"change": _edit("d", lambda r: r["steps"]["phase_move_by"]["moments"]["moved"].update(sx=3, sy=3))}, "do not follow the order"),
("a resize that moved the window", {"change": _edit("a", lambda r: r["steps"]["phase_resize_by_zero"]["moments"]["resized"].update(sx=9))}, "do not follow the order"),
("other features", {"change": _edit("a", lambda r: r["steps"]["phase_move_by"].update(features="popup"), "dpr1")}, "was opened with"),
("other calls", {"change": _edit("a", lambda r: r["steps"]["phase_move_by"].update(calls={"moved": "window.moveBy(1, 1)"}), "dpr1")}, "the calls are"),
("a popup left open", {"change": _edit("c", lambda r: r["steps"]["phase_throwaway"].update(closed=False))}, "was not closed"),
("a run that ended with an error", {"change": _edit("a", lambda r: r.update(error="boom"), "dpr1")}, "ends with the error"),
("two later popups of one phase that disagree", {"change": _edit("c", lambda r: r["steps"]["phase_move_to_far_right"]["moments"]["moved_to"].update(sx=764))}, "popups of one position must agree"),
("two later popups of one phase that disagree in size", {"change": _edit("c", lambda r: r["steps"]["phase_move_by"]["moments"]["moved"].update(iw=499), "dpr2")}, "popups of one position must agree"),
])
def test_a_move_to_capture_that_does_not_give_a_value_is_refused_not_filled_in(tmp_path, what, kwargs, message):
folder = _mt_capture(tmp_path, **kwargs)
with pytest.raises(ex.ExtractError, match=message):
ex.build_move_to(folder, MOVE_TO_RUN, "abc123")
def _rounds_reading(resized_width: int) -> Dict[str, Any]:
return {"cases": {case: {"initial": {"inner": [500, 400], "outer": [515, 478], "screen": [3, 3], "avail": [0, 1280]},
"resized": {"inner": [resized_width, 400], "outer": [515, 478], "screen": [3, 3], "avail": [0, 1280]}} for case in ("1920x1080-dpr1.5",)}}
def test_the_501_of_the_old_rounds_is_reproduced_by_a_later_popup_and_by_no_first_popup(tmp_path):
cases = ex.build_move_to(_mt_capture(tmp_path), MOVE_TO_RUN, "abc123")["cases"]
assert ex.cross_check(_rounds_reading(501), cases) == {"1920x1080-dpr1.5": ["later"]}
def test_a_reading_of_the_old_rounds_that_no_position_of_the_capture_reproduces_is_an_anomaly_not_a_choice(tmp_path):
cases = ex.build_move_to(_mt_capture(tmp_path), MOVE_TO_RUN, "abc123")["cases"]
with pytest.raises(ex.ExtractError, match="no position of the popup-move-to capture reads that"):
ex.cross_check(_rounds_reading(502), cases)
@@ -13,11 +13,19 @@ of its own answers the sizes it is asked, and the chrome of ours is a fake with
Known-bad input: the old code (the retail window asked ours' outer size) with each of the two frames; green: the same window asked the content area plus its own frame. The control is as strict as it
was: a window that cannot get the content area of ours (a minimum size, the screen) is still BROKEN CONTROL, and so is one that does not take the size it was asked.
The frame is read in exact device pixels (candidate run 46792115974): ``outerWidth`` and ``outerHeight`` are whole CSS pixels (nsGlobalWindowOuter::GetOuterSize rounds,
nsGlobalWindowOuter.cpp:3573) and ``innerWidth`` and ``innerHeight`` are fractional, so the frame as outer less inner is wrong by up to half a CSS pixel, and a content area of an odd number of
device pixels at a scale of 2 (558.5 CSS = 1117 device) has no outer size that reads back as asked (Linux dpr2.0: asked outer [800, 558.5], answers outer [800, 559] and inner [800, 558.5] = ours).
``size_by_content`` now sets the retail window to ours' inner size plus its frame in device pixels (``RetailSession.set_inner_size``); the hard control is the equality of the inner sizes, and the outer
size the window reads back is not a condition. An inner size that differs is still BROKEN CONTROL (Linux dpr1.25 and dpr1.5: the frame from the whole outer less the fractional inner made the
retail inner 0.4 and 0.33 CSS pixels smaller than ours).
"""
from __future__ import annotations
import contextlib
import json
import math
import pytest
@@ -26,24 +34,33 @@ from _stock_twin import BrokenControl
pytestmark = pytest.mark.unit
#: The two cases of the red run, as ours answers them: outer and inner size of the maximized window, CSS pixels of the chrome, and the frame of the retail window of that system.
#: Cases: scale, outer and inner size of ours (CSS pixels of the chrome), the frame of the retail window in DEVICE pixels.
CASES = {
"linux 1920x1080-dpr1.0": ("1920x1080-dpr1.0", [1936, 1040], [1920, 1032], [0, 0]),
"windows 1600x1200-dpr2.0": ("1600x1200-dpr2.0", [813, 565], [800, 558.5], [8, 4]),
"equal frames": ("1920x1080-dpr1.0", [1936, 1040], [1920, 1032], [16, 8]),
"linux 1920x1080-dpr1.0": ("1920x1080-dpr1.0", 1.0, [1936, 1040], [1920, 1032], [0, 0]),
"windows 1600x1200-dpr2.0": ("1600x1200-dpr2.0", 2.0, [813, 565], [800, 558.5], [16, 8]),
"equal frames": ("1920x1080-dpr1.0", 1.0, [1936, 1040], [1920, 1032], [16, 8]),
"linux dpr2.0 odd device height": ("1600x1200-dpr2.0", 2.0, [800, 559], [800, 558.5], [0, 0]),
"windows dpr1.25 fractional inner": ("1920x1080-dpr1.25", 1.25, [1549, 830], [1548.8, 828.8], [16, 8]),
}
def _round(value):
return int(math.floor(value + 0.5))
class FakeRetailWindow:
"""What the retail window answers: it takes the outer size it is asked (down to ``minimum`` for its outer size) and its inner size is that less its own frame."""
"""What the retail window answers: its frame is in device pixels, it takes the outer size it is asked in device pixels (down to ``minimum`` device pixels), reads the outer size back in WHOLE CSS
pixels (as ``outerWidth`` does) and the inner size in CSS pixels as the device pixels over the scale (as ``innerWidth`` does)."""
def __init__(self, frame, minimum=(0, 0)):
self.frame, self.minimum, self.asked = frame, minimum, []
def __init__(self, scale, frame, minimum=(0, 0)):
self.scale, self.frame, self.minimum, self.asked = scale, frame, minimum, []
def set_window_size(self, outer):
self.asked.append([outer[0], outer[1]])
got = [max(outer[0], self.minimum[0]), max(outer[1], self.minimum[1])]
return {"outer": got, "inner": [got[0] - self.frame[0], got[1] - self.frame[1]]}
def set_inner_size(self, inner):
asked = [_round(inner[i] * self.scale) + self.frame[i] for i in range(2)]
self.asked.append(asked)
device = [max(asked[i], self.minimum[i]) for i in range(2)]
return {"outer": [_round(device[i] / self.scale) for i in range(2)], "inner": [(device[i] - self.frame[i]) / self.scale for i in range(2)],
"frame_device": self.frame, "asked_outer_device": asked, "asked_outer": [asked[i] / self.scale for i in range(2)]}
@pytest.fixture
@@ -92,42 +109,58 @@ def twin(monkeypatch):
@pytest.mark.parametrize("name", sorted(CASES))
def test_the_retail_window_gets_the_content_area_of_ours_whatever_its_frame(twin, name):
case, outer, inner, frame = CASES[name]
window = FakeRetailWindow(frame)
case, scale, outer, inner, frame = CASES[name]
window = FakeRetailWindow(scale, frame)
retail, ours = twin(case, outer, inner, window)
assert ours["scales"]["chrome_inner"] == inner
last = window.asked[-1]
assert [last[0] - frame[0], last[1] - frame[1]] == inner, (
"%s: the retail window was last asked the outer size %r, which with its frame %r is not the content area of ours %r (asks: %r)" % (name, last, frame, inner, window.asked))
assert retail["scales"]["window_asked_outer"] == last
assert [last[i] - frame[i] for i in range(2)] == [_round(inner[i] * scale) for i in range(2)], (
"%s: the retail window was last asked %r device pixels, which with its frame %r is not the content area of ours %r (asks: %r)" % (name, last, frame, inner, window.asked))
assert retail["scales"]["window_asked_outer"] == [last[0] / scale, last[1] / scale]
def test_equal_frames_ask_the_outer_size_of_ours_once(twin):
case, outer, inner, frame = CASES["equal frames"]
window = FakeRetailWindow(frame)
def test_equal_frames_ask_the_content_area_of_ours_once(twin):
case, scale, outer, inner, frame = CASES["equal frames"]
window = FakeRetailWindow(scale, frame)
twin(case, outer, inner, window)
assert len(window.asked) == 1
def test_an_odd_number_of_device_pixels_is_not_a_broken_control_for_the_outer_size_it_reads_back(twin):
"""Linux dpr2.0, candidate run 46792115974: ours has inner height 558.5 CSS = 1117 device pixels; the retail window answers outer 559 (whole CSS pixels) and inner 558.5 = ours. The outer
size it reads back differs from the one asked (558.5) and that is not a finding or a broken control: the inner sizes are equal."""
case, scale, outer, inner, frame = CASES["linux dpr2.0 odd device height"]
window = FakeRetailWindow(scale, frame)
answer = window.set_inner_size(inner)
window.asked.clear()
assert answer["outer"] == [800, 559] and answer["asked_outer"] == [800, 558.5] and answer["inner"] == inner
retail, _ = twin(case, outer, inner, window)
assert window.asked == [outer] and retail["scales"]["window_asked_outer"] == outer
assert retail["scales"]["window_asked_outer"] == [800, 558.5]
@pytest.mark.parametrize("name", ["linux 1920x1080-dpr1.0", "windows 1600x1200-dpr2.0"])
def test_a_window_that_cannot_get_the_content_area_of_ours_is_still_a_broken_control(twin, name):
"""The window has a minimum outer size above what the content area needs: its inner size stays above the one of ours after the second ask, as strict as before."""
case, outer, inner, frame = CASES[name]
window = FakeRetailWindow(frame, minimum=(outer[0] + 40, outer[1] + 40))
"""The window has a minimum size above what the content area needs: its inner size stays above the one of ours, as strict as before."""
case, scale, outer, inner, frame = CASES[name]
window = FakeRetailWindow(scale, frame, minimum=(_round(outer[0] * scale) + 40, _round(outer[1] * scale) + 40))
with pytest.raises(BrokenControl) as raised:
twin(case, outer, inner, window)
assert "BROKEN CONTROL" in str(raised.value) and "ours has inner %r" % (inner,) in str(raised.value)
def test_a_window_that_answers_another_outer_size_than_asked_is_still_a_broken_control(twin):
@pytest.mark.parametrize("name,delta", [("windows dpr1.25 fractional inner", [0.4, 0]), ("linux dpr2.0 odd device height", [0, 0.33]), ("linux 1920x1080-dpr1.0", [1, 0])])
def test_a_window_whose_inner_size_differs_from_ours_is_a_broken_control(twin, name, delta):
"""Linux dpr1.25 and dpr1.5 of the candidate run: the retail inner was 0.4 and 0.33 CSS pixels smaller than ours. The inner size is the hard control, whatever the outer size reads back."""
class Drifting(FakeRetailWindow):
def set_window_size(self, outer):
got = super().set_window_size(outer)
return {"outer": [got["outer"][0] + 1, got["outer"][1]], "inner": [got["inner"][0] + 1, got["inner"][1]]}
def set_inner_size(self, inner):
got = super().set_inner_size(inner)
got["inner"] = [got["inner"][i] - delta[i] for i in range(2)]
return got
case, outer, inner, frame = CASES["windows 1600x1200-dpr2.0"]
with pytest.raises(BrokenControl):
twin(case, outer, inner, Drifting(frame))
case, scale, outer, inner, frame = CASES[name]
with pytest.raises(BrokenControl) as raised:
twin(case, outer, inner, Drifting(scale, frame))
assert "ours has inner %r" % (inner,) in str(raised.value)
# ------------------------------------------------------------------------------------------------------------------ how the real session sets a size
@@ -160,3 +193,36 @@ def test_a_whole_size_goes_through_marionette_and_a_fraction_through_the_chrome_
context, command, params = [c for c in recorder.calls if c[1] == "WebDriver:ExecuteScript" and "setSize" in c[2]["script"]][0]
assert context == "chrome" and params["args"] == [808, 562.5]
assert "Math.round(height * scale)" in params["script"] and "nsIBaseWindow" in params["script"]
class ContentRecorder:
"""The Marionette calls of a ``RetailSession`` that is not started, for ``set_inner_size``: the chrome script that sizes the window (``getSize``) and the one that reads it back."""
def __init__(self, session, scale, frame):
self.calls, self.scale, self.frame = [], scale, frame
self.device = [0, 0]
session.call = self.call
def call(self, context, command, params):
self.calls.append((context, command, params))
if command == "WebDriver:ExecuteScript" and "getSize" in params["script"]:
want = [_round(params["args"][i] * self.scale) for i in range(2)]
self.device = [want[i] + self.frame[i] for i in range(2)]
return {"value": json.dumps({"frame": self.frame, "asked": self.device, "scale": self.scale})}
if command == "WebDriver:ExecuteScript":
return {"value": json.dumps({"outer": [_round(self.device[i] / self.scale) for i in range(2)], "inner": [(self.device[i] - self.frame[i]) / self.scale for i in range(2)]})}
return {"value": None}
def test_the_frame_is_read_and_the_size_set_in_device_pixels_in_one_chrome_script():
session = _retail_reference.RetailSession("retail", 2.0)
recorder = ContentRecorder(session, 2.0, [16, 8])
got = session.set_inner_size((800, 558.5))
scripts = [c for c in recorder.calls if c[1] == "WebDriver:ExecuteScript" and "getSize" in c[2]["script"]]
assert len(scripts) == 1
context, _, params = scripts[0]
script = params["script"]
assert context == "chrome" and params["args"] == [800, 558.5]
assert "nsIBaseWindow" in script and "getSize(" in script and "setSize(" in script and "innerHeight * scale" in script and "frame[1]" in script
assert got["inner"] == [800, 558.5] and got["outer"] == [808, 563]
assert got["frame_device"] == [16, 8] and got["asked_outer_device"] == [1616, 1125] and got["asked_outer"] == [808, 562.5]