Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11db0d50b5 |
No files matched your search
@@ -14,7 +14,7 @@
|
||||
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 4 = 3 + 1. Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY)."},
|
||||
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 2, "exact": true, "tests": ["tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the parent of the engine shows <GRE>/fonts to it (FcConfigAppFontAddDir) to rebuild a font from a path and a face index. On Windows DirectWrite opens the file from its path, with no folder to scan and no cache to read, so this test has no Windows counterpart.", "note": "2 = (1) the stand-in that runs the engine under strace stays in the engine's place, as the core launches it (the leader of a process group of its own): a fake engine with a child, no browser; the process the launcher holds lives as long as the fake engine, and the group killed holds strace and the child (the stand-in that exec'd setsid forked and exited 0 at once: candidate 44161687675); (2) the warm launch of the parent reads the bundle from fontconfig's cache and does not scan it again (from firefox-66, engine_at_least). Two launches under strace with the same XDG_CACHE_HOME of the test, the first cold and the second warm: the cold parent opens every font file of <GRE>/fonts (the folder as the disk lists it) before any page and fontconfig writes its cache; the warm parent does not open every one of them, and it opens a *.cache-* file of fontconfig (a few files are opened to be used, so the verdict asks about the whole folder, as a scan does). Scan and drawing are told apart by position: only what the parent opens before the first page counts (the opens that draw are written as after_startup). Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-cache: the interval and the number of opens of the bundle, the names of the files of the bundle each launch opened before the first page, the size of the cache file, the VmRSS of the parent after about:blank and after a page with every family, and a third launch with gfx.bundled-fonts.activate=0 (the behaviour before), which is evidence only. Needs strace on the runner: without it both are red, not skipped. No threshold."},
|
||||
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2183, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtabLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2184, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/tLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2178, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtabLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2179, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/tLine 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)."}
|
||||
]
|
||||
@@ -56,12 +56,6 @@ the same rule.
|
||||
|
||||
python ci_host_gate.py dump <firefox> --leg linux-x86_64 --out dumps/
|
||||
python ci_host_gate.py compare dumps/ (reference: host_gate/reference/firefox-159)
|
||||
python ci_host_gate.py compare dumps/ --junit gate-junit/host-gate.xml
|
||||
|
||||
--junit writes the verdict as a junit (xunit2) file, one testcase per invariant
|
||||
(name `invariant:<name>`) and one per other check (`check:<name>`), classname
|
||||
`scripts.ci_host_gate`: a failed check is a <failure>, a check with nothing to look at
|
||||
(no dumps) is a <skipped/>, never a pass. The exit status is the gate's own.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -72,7 +66,6 @@ import gzip
|
||||
import json
|
||||
import sys
|
||||
import threading
|
||||
import xml.etree.ElementTree as ET
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
from pathlib import Path
|
||||
from typing import Callable, NamedTuple
|
||||
@@ -585,61 +578,6 @@ def compare(dumps: Path, reference: Path, exceptions: dict, notes: list | None =
|
||||
return failures
|
||||
|
||||
|
||||
# -
|
||||
# The junit: the verdict of compare() as one testcase per invariant and per
|
||||
# other check, so a judge can ask "did this invariant pass" by name.
|
||||
|
||||
#: The classname is the script's path as a dotted module (the hook tests judge turns it back into
|
||||
#: scripts/ci_host_gate.py, the file a hook names).
|
||||
JUNIT_CLASSNAME = "scripts.ci_host_gate"
|
||||
|
||||
#: The checks of compare() other than the invariants, with the prefix of the
|
||||
#: failure lines each one owns.
|
||||
CHECKS = (
|
||||
("dumps_complete", ("no dumps", "no retail reference")),
|
||||
("host_independence", ("host ",)),
|
||||
("retail_equality", ("retail ",)),
|
||||
("exceptions_current", ("known defect",)),
|
||||
)
|
||||
|
||||
|
||||
def junit_cases(failures: list, dumps_seen: int) -> list:
|
||||
"""The verdict as [(name, status, lines)], status being passed, failed or
|
||||
skipped. Nothing to look at (no dump) skips an invariant; a failure line
|
||||
is owned by the invariant or check it names."""
|
||||
cases = []
|
||||
for inv in INVARIANTS:
|
||||
lines = [f for f in failures if f.startswith("invariant %s " % inv.name)]
|
||||
cases.append(("invariant:" + inv.name, "failed" if lines else ("passed" if dumps_seen else "skipped"), lines))
|
||||
no_dumps = any(f.startswith("no dumps") for f in failures)
|
||||
no_reference = any(f.startswith("no retail reference") for f in failures)
|
||||
for name, prefixes in CHECKS:
|
||||
lines = [f for f in failures if f.startswith(prefixes) or (name == "dumps_complete" and ": no dump for seeds" in f)]
|
||||
skipped = no_dumps or (no_reference and name != "dumps_complete")
|
||||
cases.append(("check:" + name, "failed" if lines else ("skipped" if skipped else "passed"), lines))
|
||||
return cases
|
||||
|
||||
|
||||
def write_junit(path: Path, cases: list, suite: str = "host-gate") -> None:
|
||||
"""cases: [(name, status, lines)] as a junit (xunit2) file at path."""
|
||||
root = ET.Element("testsuites")
|
||||
counts = {"failed": 0, "skipped": 0}
|
||||
for _, status, _lines in cases:
|
||||
if status in counts:
|
||||
counts[status] += 1
|
||||
ts = ET.SubElement(root, "testsuite", name=suite, tests=str(len(cases)), failures=str(counts["failed"]),
|
||||
errors="0", skipped=str(counts["skipped"]), time="0")
|
||||
for name, status, lines in cases:
|
||||
tc = ET.SubElement(ts, "testcase", classname=JUNIT_CLASSNAME, name=name, time="0")
|
||||
if status == "failed":
|
||||
f = ET.SubElement(tc, "failure", message=lines[0][:300] if lines else "failed")
|
||||
f.text = "\n".join(lines[:50])
|
||||
elif status == "skipped":
|
||||
ET.SubElement(tc, "skipped", message="nothing to check: the gate had no dumps or no reference")
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
ET.ElementTree(root).write(path, encoding="utf-8", xml_declaration=True)
|
||||
|
||||
|
||||
def main(argv=None) -> int:
|
||||
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||
sub = ap.add_subparsers(dest="cmd", required=True)
|
||||
@@ -651,7 +589,6 @@ def main(argv=None) -> int:
|
||||
c = sub.add_parser("compare")
|
||||
c.add_argument("dumps", type=Path)
|
||||
c.add_argument("--reference", type=Path, default=REFERENCE)
|
||||
c.add_argument("--junit", type=Path, help="also write the verdict as a junit (xunit2) file")
|
||||
args = ap.parse_args(argv)
|
||||
if args.cmd == "dump":
|
||||
return dump(args.firefox, args.leg, args.out, args.reference)
|
||||
@@ -661,8 +598,6 @@ def main(argv=None) -> int:
|
||||
print("NOTE " + n)
|
||||
for f in failures:
|
||||
print("FAIL " + f)
|
||||
if args.junit:
|
||||
write_junit(args.junit, junit_cases(failures, len(list(args.dumps.glob("*.json")))))
|
||||
print("HOST GATE %s: %d failures" % ("OK" if not failures else "FAILED", len(failures)))
|
||||
return 1 if failures else 0
|
||||
|
||||
|
||||
@@ -461,70 +461,3 @@ def test_a_known_defect_of_linux_covers_every_linux_leg_of_the_gate():
|
||||
for e in scoped:
|
||||
if any(leg.startswith("linux-") for leg in e["legs"]):
|
||||
assert sorted(leg for leg in e["legs"] if leg.startswith("linux-")) == linux, e
|
||||
|
||||
|
||||
# The junit of the compare step: one testcase per invariant, by the name the hook tests spell.
|
||||
|
||||
def junit_of(tmp_path, items, retail=None, legs=None, make_dumps=True):
|
||||
import xml.etree.ElementTree as ET
|
||||
if make_dumps:
|
||||
dumps, ref = write(tmp_path, items, retail or {}, legs)
|
||||
else:
|
||||
dumps, ref = tmp_path / "dumps", tmp_path / "ref"
|
||||
dumps.mkdir(parents=True)
|
||||
ref.mkdir(parents=True)
|
||||
out = tmp_path / "gate-junit" / "host-gate.xml"
|
||||
from unittest import mock
|
||||
with mock.patch.object(gate, "load_exceptions", lambda: {}): # the repository's own list is not the subject here
|
||||
rc = gate.main(["compare", str(dumps), "--reference", str(ref), "--junit", str(out)])
|
||||
cases = {}
|
||||
for tc in ET.parse(out).getroot().iter("testcase"):
|
||||
assert tc.get("classname") == "scripts.ci_host_gate" # the judge reads it as scripts/ci_host_gate.py
|
||||
kids = [k.tag for k in tc]
|
||||
cases[tc.get("name")] = "failed" if "failure" in kids else "skipped" if "skipped" in kids else "passed"
|
||||
return rc, cases
|
||||
|
||||
|
||||
def test_the_junit_has_one_testcase_per_invariant_with_the_name_the_hooks_spell(tmp_path):
|
||||
rc, cases = junit_of(tmp_path, lambda leg, seed: {})
|
||||
assert rc == 0
|
||||
assert {"invariant:" + inv.name for inv in gate.INVARIANTS} <= set(cases)
|
||||
assert "invariant:fullscreen_is_the_screen" in cases
|
||||
assert set(cases.values()) == {"passed"}
|
||||
assert gate.JUNIT_CLASSNAME.replace(".", "/") + ".py" == "scripts/ci_host_gate.py"
|
||||
|
||||
|
||||
def test_the_junit_fails_the_invariant_that_broke_and_only_it_and_its_check(tmp_path):
|
||||
items = lambda leg, seed: retail_states(fullscreen=XVFB_FULLSCREEN) if leg.startswith("linux") else {}
|
||||
rc, cases = junit_of(tmp_path, items)
|
||||
assert rc == 1
|
||||
failed = {n for n, s in cases.items() if s == "failed"}
|
||||
assert {"invariant:fullscreen_is_the_screen", "invariant:fullscreen_declared"} <= failed
|
||||
assert cases["invariant:measured"] == "passed" and cases["invariant:back_to_normal"] == "passed"
|
||||
|
||||
|
||||
def test_the_junit_fails_a_host_difference_and_a_retail_difference(tmp_path):
|
||||
rc, cases = junit_of(tmp_path, lambda leg, seed: {"surface.x": leg}, {"surface.x": "win-x86_64"})
|
||||
assert rc == 1 and cases["check:host_independence"] == "failed"
|
||||
rc, cases = junit_of(tmp_path / "r", lambda leg, seed: {"surface.y": 1}, {"surface.y": 2})
|
||||
assert rc == 1 and cases["check:retail_equality"] == "failed" and cases["check:host_independence"] == "passed"
|
||||
|
||||
|
||||
def test_the_junit_skips_what_it_could_not_look_at_never_passes_it(tmp_path):
|
||||
rc, cases = junit_of(tmp_path, None, make_dumps=False)
|
||||
assert rc == 1
|
||||
assert cases["check:dumps_complete"] == "failed"
|
||||
assert all(s == "skipped" for n, s in cases.items() if n != "check:dumps_complete")
|
||||
assert "invariant:fullscreen_is_the_screen" in cases
|
||||
|
||||
|
||||
def test_the_junit_is_xunit2_with_the_counts_of_its_cases(tmp_path):
|
||||
import xml.etree.ElementTree as ET
|
||||
items = lambda leg, seed: retail_states(fullscreen=BUG_FULLSCREEN)
|
||||
junit_of(tmp_path, items)
|
||||
root = ET.parse(tmp_path / "gate-junit" / "host-gate.xml").getroot()
|
||||
suite = root.find("testsuite")
|
||||
cases = list(suite.iter("testcase"))
|
||||
assert root.tag == "testsuites" and int(suite.get("tests")) == len(cases)
|
||||
assert int(suite.get("failures")) == len([c for c in cases if c.find("failure") is not None]) == 3
|
||||
assert all(c.find("failure").text for c in cases if c.find("failure") is not None)
|
||||
@@ -0,0 +1,361 @@
|
||||
"""A WebGL context tells the page what the session DECLARES, never what the host's GL says.
|
||||
|
||||
Characterises, on the published engine (firefox-68), the hooks of the series folder
|
||||
``fingerprint/webgl/parameters`` in ``dom/canvas`` (``StealthWebGLParams.cpp`` and the hooks in
|
||||
``ClientWebGLContext.cpp``, ``WebGLContextValidate.cpp``): the numeric ``getParameter`` answers
|
||||
(``zoom.stealth.webgl.int_params`` / ``int2_params`` / ``float_params``), the renderer and the
|
||||
vendor strings (``zoom.stealth.webgl.renderer`` / ``vendor``), ``getShaderPrecisionFormat``
|
||||
(``zoom.stealth.webgl.shader_precisions``), the extension list the page reads
|
||||
(``zoom.stealth.webgl.extensions`` / ``zoom.stealth.webgl2.extensions``) and the stencil masks a
|
||||
fresh context starts with. A page reads every one of them with a handful of lines, and they are
|
||||
the biggest part of a WebGL fingerprint, so a value that came from the host's GPU or driver (a
|
||||
Mesa llvmpipe on a Linux runner, a WARP adapter on a Windows one) is a value that tells the
|
||||
machine apart from the Windows the session claims to be.
|
||||
|
||||
Each test declares a value no runner has (a ``MAX_TEXTURE_SIZE`` of 12345, a precision of
|
||||
7:11:13, a Radeon HD 5850, an extension list in a deliberately wrong order) and reads it back
|
||||
where a page reads it. The negative control is in the same test: the same page, the same
|
||||
engine, with the declaration of that value empty, reads the host's own answer, and the test
|
||||
asserts the two DIFFER, so it fails if the declaration is not what the page reads.
|
||||
|
||||
The renderer and the vendor have no empty control: an engine that is on refuses to start
|
||||
without them (the declaration gate), and an engine that is off draws on the host's GL, which a
|
||||
runner without a GPU may not give at all. The control there is the session's own persona (the
|
||||
product default), which the page must NOT read once the declaration says otherwise.
|
||||
|
||||
The stencil masks have no pref at all: the engine starts them at all ones, as ANGLE does, where
|
||||
the driver's own start is the stencil bits (Mesa: 255). The control is the same read after the
|
||||
page writes 255 itself, which proves the read is live and that 255 is what the masks were
|
||||
before the engine.
|
||||
|
||||
The test reads the engine through ``extra_prefs`` (applied last by the core), RFP stays off.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SEED = 4246
|
||||
|
||||
#: gl.INVALID_ENUM
|
||||
INVALID_ENUM = 1280
|
||||
|
||||
# -- numeric parameters ----------------------------------------------------------------------
|
||||
|
||||
#: A value no runner has for each (the host's are 16384 / 2048 / 32767 on a GL or ANGLE).
|
||||
DECLARED_INT = "3379|12345,34024|23456,34076|9001,32883|4321,35071|777"
|
||||
DECLARED_INT2 = "3386|12345:23456"
|
||||
DECLARED_FLOAT = "33901|1:7777,33902|3:5"
|
||||
EMPTY_NUMERIC = {
|
||||
"zoom.stealth.webgl.int_params": "",
|
||||
"zoom.stealth.webgl.int2_params": "",
|
||||
"zoom.stealth.webgl.float_params": "",
|
||||
}
|
||||
DECLARED_NUMERIC = {
|
||||
"zoom.stealth.webgl.int_params": DECLARED_INT,
|
||||
"zoom.stealth.webgl.int2_params": DECLARED_INT2,
|
||||
"zoom.stealth.webgl.float_params": DECLARED_FLOAT,
|
||||
}
|
||||
|
||||
NUMERIC_JS = """() => {
|
||||
const NAMES = {
|
||||
MAX_TEXTURE_SIZE: 0x0D33, MAX_RENDERBUFFER_SIZE: 0x84E8, MAX_CUBE_MAP_TEXTURE_SIZE: 0x851C,
|
||||
MAX_VIEWPORT_DIMS: 0x0D3A, ALIASED_POINT_SIZE_RANGE: 0x846D, ALIASED_LINE_WIDTH_RANGE: 0x846E,
|
||||
MAX_3D_TEXTURE_SIZE: 0x8073, MAX_ARRAY_TEXTURE_LAYERS: 0x88FF,
|
||||
};
|
||||
const out = {};
|
||||
for (const kind of ["webgl", "webgl2"]) {
|
||||
const gl = document.createElement("canvas").getContext(kind);
|
||||
if (!gl) { out[kind] = null; continue; }
|
||||
gl.getError();
|
||||
const r = {};
|
||||
for (const [name, pname] of Object.entries(NAMES)) {
|
||||
const v = gl.getParameter(pname);
|
||||
const error = gl.getError();
|
||||
const view = v !== null && ArrayBuffer.isView(v);
|
||||
r[name] = {value: view ? Array.from(v) : v,
|
||||
type: v === null ? "null" : (view ? v.constructor.name : typeof v), error};
|
||||
}
|
||||
out[kind] = r;
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
# -- renderer and vendor ---------------------------------------------------------------------
|
||||
|
||||
#: A device no runner has. ``SanitizeRenderer`` keeps the device of this Direct3D string as it
|
||||
#: is (a "Radeon HD 5850" is its own bucket) and rewrites what comes after the suffix, so the
|
||||
#: page reads this prefix whether the string is sanitized or not.
|
||||
RENDERER = "ANGLE (AMD, Radeon HD 5850 Direct3D11 vs_5_0 ps_5_0, D3D11)"
|
||||
RENDERER_READ_PREFIX = "ANGLE (AMD, Radeon HD 5850 Direct3D11 vs_5_0 ps_5_0"
|
||||
VENDOR = "Google Inc. (AMD)"
|
||||
|
||||
RENDERER_JS = """() => {
|
||||
const out = {};
|
||||
for (const kind of ["webgl", "webgl2"]) {
|
||||
const gl = document.createElement("canvas").getContext(kind);
|
||||
if (!gl) { out[kind] = null; continue; }
|
||||
gl.getError();
|
||||
// UNMASKED_RENDERER_WEBGL before the extension is enabled: Mozilla's own error.
|
||||
const before = gl.getParameter(0x9246);
|
||||
const before_error = gl.getError();
|
||||
const ext = gl.getExtension("WEBGL_debug_renderer_info");
|
||||
out[kind] = {
|
||||
renderer: gl.getParameter(gl.RENDERER),
|
||||
vendor: gl.getParameter(gl.VENDOR),
|
||||
unmasked_before_extension: before,
|
||||
unmasked_before_extension_error: before_error,
|
||||
has_extension: !!ext,
|
||||
unmasked_renderer: ext ? gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) : null,
|
||||
unmasked_vendor: ext ? gl.getParameter(ext.UNMASKED_VENDOR_WEBGL) : null,
|
||||
error: gl.getError(),
|
||||
};
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
# -- shader precision ------------------------------------------------------------------------
|
||||
|
||||
#: VERTEX_SHADER*LOW_FLOAT -> 7:11:13 and FRAGMENT_SHADER*HIGH_INT -> 3:5:2. No GPU has either.
|
||||
DECLARED_PRECISION = "35633*36336|7:11:13,35632*36341|3:5:2"
|
||||
|
||||
PRECISION_JS = """() => {
|
||||
const out = {};
|
||||
for (const kind of ["webgl", "webgl2"]) {
|
||||
const gl = document.createElement("canvas").getContext(kind);
|
||||
if (!gl) { out[kind] = null; continue; }
|
||||
gl.getError();
|
||||
const read = (shader, precision) => {
|
||||
const f = gl.getShaderPrecisionFormat(shader, precision);
|
||||
const error = gl.getError();
|
||||
return {format: f === null ? null : [f.rangeMin, f.rangeMax, f.precision], error};
|
||||
};
|
||||
out[kind] = {
|
||||
vertex_low_float: read(gl.VERTEX_SHADER, gl.LOW_FLOAT),
|
||||
fragment_high_int: read(gl.FRAGMENT_SHADER, gl.HIGH_INT),
|
||||
vertex_high_float: read(gl.VERTEX_SHADER, gl.HIGH_FLOAT),
|
||||
bad_precision_type: read(gl.VERTEX_SHADER, 0x1234),
|
||||
bad_shader_type: read(gl.TEXTURE_2D, gl.LOW_FLOAT),
|
||||
};
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
# -- extension list --------------------------------------------------------------------------
|
||||
|
||||
#: ``WebGLExtensionID`` of ``dom/canvas/WebGLTypes.h``, in declaration order (``MOZ_debug`` is
|
||||
#: never listed to a page): the one order a page ever reads, the retail one.
|
||||
ENUM_ORDER = [
|
||||
"ANGLE_instanced_arrays", "EXT_blend_minmax", "EXT_clip_control", "EXT_color_buffer_float",
|
||||
"EXT_color_buffer_half_float", "EXT_depth_clamp", "EXT_disjoint_timer_query", "EXT_float_blend",
|
||||
"EXT_frag_depth", "EXT_polygon_offset_clamp", "EXT_shader_texture_lod", "EXT_sRGB",
|
||||
"EXT_texture_compression_bptc", "EXT_texture_compression_rgtc",
|
||||
"EXT_texture_filter_anisotropic", "EXT_texture_mirror_clamp_to_edge", "EXT_texture_norm16",
|
||||
"OES_draw_buffers_indexed", "OES_element_index_uint", "OES_fbo_render_mipmap",
|
||||
"OES_standard_derivatives", "OES_texture_float", "OES_texture_float_linear",
|
||||
"OES_texture_half_float", "OES_texture_half_float_linear", "OES_vertex_array_object",
|
||||
"OVR_multiview2", "WEBGL_color_buffer_float", "WEBGL_compressed_texture_astc",
|
||||
"WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_etc1",
|
||||
"WEBGL_compressed_texture_pvrtc", "WEBGL_compressed_texture_s3tc",
|
||||
"WEBGL_compressed_texture_s3tc_srgb", "WEBGL_debug_renderer_info", "WEBGL_debug_shaders",
|
||||
"WEBGL_depth_texture", "WEBGL_draw_buffers", "WEBGL_explicit_present", "WEBGL_lose_context",
|
||||
"WEBGL_provoking_vertex",
|
||||
]
|
||||
|
||||
#: Declared in an order that is NOT the enum's: the page must read them in the enum's.
|
||||
DECLARED_EXTENSIONS_1 = ["WEBGL_lose_context", "OES_texture_float", "EXT_blend_minmax",
|
||||
"OES_vertex_array_object", "ANGLE_instanced_arrays"]
|
||||
DECLARED_EXTENSIONS_2 = ["WEBGL_lose_context", "EXT_texture_filter_anisotropic",
|
||||
"EXT_color_buffer_float", "OES_texture_float_linear"]
|
||||
|
||||
EXTENSIONS_JS = """() => {
|
||||
const out = {};
|
||||
for (const kind of ["webgl", "webgl2"]) {
|
||||
const gl = document.createElement("canvas").getContext(kind);
|
||||
if (!gl) { out[kind] = null; continue; }
|
||||
out[kind] = {list: gl.getSupportedExtensions(),
|
||||
depth_texture: gl.getExtension("WEBGL_depth_texture") === null ? null : "object"};
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
# -- stencil masks ---------------------------------------------------------------------------
|
||||
|
||||
STENCIL_JS = """() => {
|
||||
const PNAMES = {STENCIL_VALUE_MASK: 0x0B93, STENCIL_WRITEMASK: 0x0B98,
|
||||
STENCIL_BACK_VALUE_MASK: 0x8CA4, STENCIL_BACK_WRITEMASK: 0x8CA5};
|
||||
const read = gl => {
|
||||
const r = {};
|
||||
for (const [name, pname] of Object.entries(PNAMES)) r[name] = gl.getParameter(pname);
|
||||
return r;
|
||||
};
|
||||
const out = {};
|
||||
for (const kind of ["webgl", "webgl2"]) {
|
||||
for (const stencil of [false, true]) {
|
||||
const key = kind + (stencil ? "+stencil" : "");
|
||||
const gl = document.createElement("canvas").getContext(kind, {stencil});
|
||||
if (!gl) { out[key] = null; continue; }
|
||||
const fresh = read(gl);
|
||||
// The control: the page writes 255 itself and reads it back.
|
||||
gl.stencilMask(255);
|
||||
gl.stencilMaskSeparate(gl.BACK, 255);
|
||||
gl.stencilFunc(gl.ALWAYS, 0, 255);
|
||||
gl.stencilFuncSeparate(gl.BACK, gl.ALWAYS, 0, 255);
|
||||
out[key] = {fresh, written: read(gl)};
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
def _read(firefox_binary, prefs, js):
|
||||
"""One short-lived product session with ``prefs`` overlaid, and what the page answers to ``js``."""
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True,
|
||||
extra_prefs=dict(prefs)) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank")
|
||||
return page.evaluate(js)
|
||||
|
||||
|
||||
def _contexts(got, label):
|
||||
for kind in ("webgl", "webgl2"):
|
||||
assert got[kind] is not None, "%s: no %s context at all" % (label, kind)
|
||||
|
||||
|
||||
def test_declared_numeric_parameters_replace_the_hosts_and_webgl2_only_names_stay_null_on_webgl1(
|
||||
firefox_binary):
|
||||
declared = _read(firefox_binary, DECLARED_NUMERIC, NUMERIC_JS)
|
||||
control = _read(firefox_binary, EMPTY_NUMERIC, NUMERIC_JS)
|
||||
_contexts(declared, "declared")
|
||||
_contexts(control, "control")
|
||||
|
||||
want = {
|
||||
"MAX_TEXTURE_SIZE": (12345, "number"),
|
||||
"MAX_RENDERBUFFER_SIZE": (23456, "number"),
|
||||
"MAX_CUBE_MAP_TEXTURE_SIZE": (9001, "number"),
|
||||
"MAX_VIEWPORT_DIMS": ([12345, 23456], "Int32Array"),
|
||||
"ALIASED_POINT_SIZE_RANGE": ([1, 7777], "Float32Array"),
|
||||
"ALIASED_LINE_WIDTH_RANGE": ([3, 5], "Float32Array"),
|
||||
}
|
||||
want_webgl2_only = {"MAX_3D_TEXTURE_SIZE": 4321, "MAX_ARRAY_TEXTURE_LAYERS": 777}
|
||||
|
||||
for kind in ("webgl", "webgl2"):
|
||||
for name, (value, type_) in want.items():
|
||||
got = declared[kind][name]
|
||||
assert got == {"value": value, "type": type_, "error": 0}, (kind, name, got)
|
||||
# The control: the same page with the declaration empty reads the host's answer.
|
||||
assert control[kind][name]["value"] != value, (
|
||||
"%s %s: the host's own answer is the declared one, so this test cannot tell "
|
||||
"the declaration from the host: %r" % (kind, name, control[kind][name]))
|
||||
assert control[kind][name]["error"] == 0, (kind, name, control[kind][name])
|
||||
|
||||
# WebGL 2 only: the declared number is read on a WebGL 2 context ...
|
||||
for name, value in want_webgl2_only.items():
|
||||
got = declared["webgl2"][name]
|
||||
assert got == {"value": value, "type": "number", "error": 0}, (name, got)
|
||||
assert control["webgl2"][name]["value"] != value, (name, control["webgl2"][name])
|
||||
# ... and on a WebGL 1 context the name does not exist: null and INVALID_ENUM, declared
|
||||
# or not (the declaration cannot make a name appear that the context does not have).
|
||||
for label, run in (("declared", declared), ("control", control)):
|
||||
got = run["webgl"][name]
|
||||
assert got == {"value": None, "type": "null", "error": INVALID_ENUM}, (
|
||||
label, name, got)
|
||||
|
||||
|
||||
def test_declared_renderer_and_vendor_are_read_in_every_form(firefox_binary):
|
||||
declared = _read(firefox_binary, {"zoom.stealth.webgl.renderer": RENDERER,
|
||||
"zoom.stealth.webgl.vendor": VENDOR}, RENDERER_JS)
|
||||
# The control: the session's own persona, the product default (the declaration gate refuses
|
||||
# an empty pair on a running engine).
|
||||
control = _read(firefox_binary, {}, RENDERER_JS)
|
||||
_contexts(declared, "declared")
|
||||
_contexts(control, "control")
|
||||
|
||||
for kind in ("webgl", "webgl2"):
|
||||
got = declared[kind]
|
||||
# Every form of the renderer: the masked constant, and the unmasked one through the
|
||||
# extension the page enables.
|
||||
assert got["renderer"].startswith(RENDERER_READ_PREFIX), (kind, got)
|
||||
assert got["has_extension"], (kind, got)
|
||||
assert got["unmasked_renderer"].startswith(RENDERER_READ_PREFIX), (kind, got)
|
||||
assert got["unmasked_vendor"] == VENDOR, (kind, got)
|
||||
# The masked vendor is Firefox's own constant, whatever is declared.
|
||||
assert got["vendor"] == "Mozilla", (kind, got)
|
||||
# Without the extension the unmasked constants are not a thing: Mozilla's error.
|
||||
assert got["unmasked_before_extension"] is None, (kind, got)
|
||||
assert got["unmasked_before_extension_error"] == INVALID_ENUM, (kind, got)
|
||||
assert got["error"] == 0, (kind, got)
|
||||
|
||||
base = control[kind]
|
||||
assert base["has_extension"], (kind, base)
|
||||
assert not base["renderer"].startswith(RENDERER_READ_PREFIX), (kind, base)
|
||||
assert not base["unmasked_renderer"].startswith(RENDERER_READ_PREFIX), (kind, base)
|
||||
assert base["unmasked_vendor"] != VENDOR, (kind, base)
|
||||
assert base["vendor"] == "Mozilla", (kind, base)
|
||||
assert base["unmasked_before_extension"] is None, (kind, base)
|
||||
assert base["unmasked_before_extension_error"] == INVALID_ENUM, (kind, base)
|
||||
|
||||
|
||||
def test_declared_shader_precision_replaces_the_hosts_and_a_bad_pair_still_errors(
|
||||
firefox_binary):
|
||||
declared = _read(firefox_binary,
|
||||
{"zoom.stealth.webgl.shader_precisions": DECLARED_PRECISION}, PRECISION_JS)
|
||||
control = _read(firefox_binary, {"zoom.stealth.webgl.shader_precisions": ""}, PRECISION_JS)
|
||||
_contexts(declared, "declared")
|
||||
_contexts(control, "control")
|
||||
|
||||
for kind in ("webgl", "webgl2"):
|
||||
got, base = declared[kind], control[kind]
|
||||
assert got["vertex_low_float"] == {"format": [7, 11, 13], "error": 0}, (kind, got)
|
||||
assert got["fragment_high_int"] == {"format": [3, 5, 2], "error": 0}, (kind, got)
|
||||
# The control: with the declaration empty the page reads the host's formats.
|
||||
assert base["vertex_low_float"]["format"] not in (None, [7, 11, 13]), (kind, base)
|
||||
assert base["fragment_high_int"]["format"] not in (None, [3, 5, 2]), (kind, base)
|
||||
assert base["vertex_low_float"]["error"] == 0, (kind, base)
|
||||
# A pair nothing declares is the host's, untouched by the declarations next to it.
|
||||
assert got["vertex_high_float"] == base["vertex_high_float"], (kind, got, base)
|
||||
assert got["vertex_high_float"]["format"] is not None, (kind, got)
|
||||
# A bad pair is Mozilla's error with or without a declaration in the pref.
|
||||
for name in ("bad_precision_type", "bad_shader_type"):
|
||||
for label, run in (("declared", got), ("control", base)):
|
||||
assert run[name] == {"format": None, "error": INVALID_ENUM}, (kind, label, name, run)
|
||||
|
||||
|
||||
def test_the_declared_extension_list_is_read_in_firefoxs_order(firefox_binary):
|
||||
declared = _read(firefox_binary, {
|
||||
"zoom.stealth.webgl.extensions": ",".join(DECLARED_EXTENSIONS_1),
|
||||
"zoom.stealth.webgl2.extensions": ",".join(DECLARED_EXTENSIONS_2),
|
||||
}, EXTENSIONS_JS)
|
||||
control = _read(firefox_binary, {"zoom.stealth.webgl.extensions": "",
|
||||
"zoom.stealth.webgl2.extensions": ""}, EXTENSIONS_JS)
|
||||
_contexts(declared, "declared")
|
||||
_contexts(control, "control")
|
||||
|
||||
for kind, names in (("webgl", DECLARED_EXTENSIONS_1), ("webgl2", DECLARED_EXTENSIONS_2)):
|
||||
assert names != sorted(names, key=ENUM_ORDER.index), "the declared order must be wrong"
|
||||
want = [e for e in ENUM_ORDER if e in names]
|
||||
assert declared[kind]["list"] == want, (kind, declared[kind]["list"])
|
||||
# The control: with the declaration empty the page reads the host's own list.
|
||||
assert control[kind]["list"] != want, (kind, control[kind]["list"])
|
||||
assert control[kind]["list"], (kind, "the host list is empty")
|
||||
# Only what is declared is served: the host has WEBGL_depth_texture, the declaration lacks it.
|
||||
assert declared["webgl"]["depth_texture"] is None, declared["webgl"]
|
||||
|
||||
|
||||
def test_the_stencil_masks_start_at_all_ones(firefox_binary):
|
||||
got = _read(firefox_binary, {}, STENCIL_JS)
|
||||
all_ones = 4294967295
|
||||
names = ("STENCIL_VALUE_MASK", "STENCIL_WRITEMASK",
|
||||
"STENCIL_BACK_VALUE_MASK", "STENCIL_BACK_WRITEMASK")
|
||||
for key in ("webgl", "webgl+stencil", "webgl2", "webgl2+stencil"):
|
||||
run = got[key]
|
||||
assert run is not None, "%s: no context at all" % key
|
||||
# A fresh context, on any OS: all ones, as ANGLE starts them.
|
||||
assert run["fresh"] == {n: all_ones for n in names}, (key, run["fresh"])
|
||||
# The control: what the masks were before the engine on a driver GL is the stencil
|
||||
# bits (255 on Mesa), and a page that writes 255 reads 255 back, so the read is live and
|
||||
# all ones is not a constant of the page's reading.
|
||||
assert run["written"] == {n: 255 for n in names}, (key, run["written"])
|
||||
@@ -0,0 +1,106 @@
|
||||
"""``getTranslatedShaderSource`` answers in the DECLARED shader language, not the host's.
|
||||
|
||||
Characterises, on the published engine (firefox-68), the hooks of the series folder
|
||||
``fingerprint/webgl/shader-language`` in ``dom/canvas`` (``StealthWebGLShaderLanguage.cpp``;
|
||||
hooks in ``WebGLShader.cpp``, ``WebGLShaderValidator.cpp``, ``WebGLContext.cpp``): with
|
||||
``zoom.stealth.webgl.shader_output_language`` set to ``essl`` the page that asks
|
||||
``WEBGL_debug_shaders`` for the translated source of a shader reads ANGLE's translation to ESSL,
|
||||
the language a Windows Firefox (ANGLE, a GLES context) always answers in; the driver keeps
|
||||
receiving its own.
|
||||
|
||||
Why a page reads it: the session declares a Windows ANGLE renderer, and on a host whose GL
|
||||
context is not GLES (Linux through GLX) the same translator emits desktop GLSL, so the page
|
||||
would read ``#version 450`` from a browser whose RENDERER says ANGLE: a contradiction inside
|
||||
one page, with no need to know the OS.
|
||||
|
||||
The negative control is in the same test: the same engine, the same shaders, with the
|
||||
declaration empty. It is adapted to the OS, as the engine is. On Linux the host's language is
|
||||
desktop GLSL, so the declared and the undeclared sources DIFFER (the WebGL 2 shaders lose their
|
||||
``#version 300 es`` line). On Windows the context already goes through ANGLE and is already
|
||||
ESSL, so the two are EQUAL (and the declared one is the Windows one). On both, the driver still
|
||||
compiles and links the shader: the page sees one language, the pixels do not move.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.e2e
|
||||
|
||||
SEED = 4246
|
||||
|
||||
TRANSLATE_JS = """() => {
|
||||
const VS1 = 'attribute vec2 p; void main(){ gl_Position = vec4(p, 0.0, 1.0); }';
|
||||
const FS1 = 'precision mediump float; void main(){ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }';
|
||||
const VS2 = '#version 300 es\\nin vec2 p;\\nvoid main(){ gl_Position = vec4(p, 0.0, 1.0); }';
|
||||
const FS2 = '#version 300 es\\nprecision mediump float;\\nout vec4 o;\\n'
|
||||
+ 'void main(){ o = vec4(1.0, 0.0, 0.0, 1.0); }';
|
||||
const out = {};
|
||||
for (const [kind, vs, fs] of [["webgl", VS1, FS1], ["webgl2", VS2, FS2]]) {
|
||||
const gl = document.createElement("canvas").getContext(kind);
|
||||
if (!gl) { out[kind] = null; continue; }
|
||||
const dbg = gl.getExtension("WEBGL_debug_shaders");
|
||||
const v = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(v, vs); gl.compileShader(v);
|
||||
const f = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(f, fs); gl.compileShader(f);
|
||||
const prog = gl.createProgram(); gl.attachShader(prog, v); gl.attachShader(prog, f);
|
||||
gl.linkProgram(prog);
|
||||
out[kind] = {
|
||||
has_extension: !!dbg,
|
||||
vertex: dbg ? dbg.getTranslatedShaderSource(v) : null,
|
||||
fragment: dbg ? dbg.getTranslatedShaderSource(f) : null,
|
||||
compiled: gl.getShaderParameter(v, gl.COMPILE_STATUS) && gl.getShaderParameter(f, gl.COMPILE_STATUS),
|
||||
linked: gl.getProgramParameter(prog, gl.LINK_STATUS),
|
||||
};
|
||||
}
|
||||
return out;
|
||||
}"""
|
||||
|
||||
|
||||
def _read(firefox_binary, language):
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
|
||||
with InvisiblePlaywright(
|
||||
seed=SEED, binary_path=firefox_binary, headless=True,
|
||||
extra_prefs={"zoom.stealth.webgl.shader_output_language": language}) as browser:
|
||||
page = browser.new_page()
|
||||
page.goto("about:blank")
|
||||
return page.evaluate(TRANSLATE_JS)
|
||||
|
||||
|
||||
def test_get_translated_shader_source_is_in_the_declared_language_and_the_driver_still_compiles(
|
||||
firefox_binary):
|
||||
declared = _read(firefox_binary, "essl")
|
||||
control = _read(firefox_binary, "")
|
||||
|
||||
for kind in ("webgl", "webgl2"):
|
||||
for label, run in (("declared", declared), ("control", control)):
|
||||
got = run[kind]
|
||||
assert got is not None, "%s: no %s context at all" % (label, kind)
|
||||
assert got["has_extension"], (label, kind)
|
||||
# The driver is not touched by what the page is shown: it compiles and links.
|
||||
assert got["compiled"] is True and got["linked"] is True, (label, kind, got)
|
||||
assert got["vertex"] and got["fragment"], (label, kind, got)
|
||||
|
||||
# Declared: ESSL, on every OS. A WebGL 1 shader has no #version line in ESSL 1.00 and a
|
||||
# WebGL 2 one keeps its "#version 300 es".
|
||||
assert "#version" not in declared["webgl"]["vertex"], declared["webgl"]
|
||||
assert "#version" not in declared["webgl"]["fragment"], declared["webgl"]
|
||||
assert declared["webgl2"]["vertex"].lstrip().startswith("#version 300 es"), declared["webgl2"]
|
||||
assert declared["webgl2"]["fragment"].lstrip().startswith("#version 300 es"), declared["webgl2"]
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
# The host's context is desktop GL: without the declaration the page reads desktop GLSL.
|
||||
# The declaration is what makes the two differ (as a pair of stages: a one-line vertex
|
||||
# shader may translate to the same text in both languages).
|
||||
for kind in ("webgl", "webgl2"):
|
||||
assert (control[kind]["vertex"], control[kind]["fragment"]) != (
|
||||
declared[kind]["vertex"], declared[kind]["fragment"]), (kind, control[kind])
|
||||
assert not control["webgl2"]["vertex"].lstrip().startswith("#version 300 es"), control["webgl2"]
|
||||
assert not control["webgl2"]["fragment"].lstrip().startswith("#version 300 es"), control["webgl2"]
|
||||
else:
|
||||
# Windows (ANGLE, a GLES context): the host's language is already ESSL, nothing to
|
||||
# translate twice, and the declaration changes nothing.
|
||||
for kind in ("webgl", "webgl2"):
|
||||
for stage in ("vertex", "fragment"):
|
||||
assert control[kind][stage] == declared[kind][stage], (kind, stage, control[kind])
|
||||
Reference in new issue
Block a user