e2e: the consumers of the window origin (early readings of a frame, popup moveBy/resizeBy/moveTo, drag into a frame, IntersectionObserver and lazy loading in a frame, input at four scales, select dropdown anchor), in the rows of the maximized-window test

This commit is contained in:
feder-cr committed 2026-11-28 01:26:31 +01:00
1 parent 9ba446ed3c
commit eb2629fea1
8 files changed
+951 -2

No files matched your search

+2 -2
View File
@@ -19,11 +19,11 @@
{"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": 449, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_throuLine truncated
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 414, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 564 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapLine truncated
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 317, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_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": 345, "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_drag_from_the_top_into_a_frame_of_another_site_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_select_dropdown_opens_at_its_element_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_intersection_and_lazy_loading_in_a_frame_of_another_site_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_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": 333, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_detectors_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_ignore_https_errors_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_transport.py", "tests/test_keyboard_rhythm.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_workers_blocked.py", "tests/test_strict_and_force.py", "tests/test_the_engine_is_born_in_the_job_e2e.py", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_ua_widget_not_selectable.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 1 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 286, "exact": true, "tests": ["tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_declared_host_network_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_expose_binding_e2e.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_desktop.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_oop_frame_geometry.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_e2e.py", "tests/test_screencast_stop_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 276, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 278, "exact": true, "tests": ["tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_oop_frame_element.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_scroll_into_view.py", "tests/test_shadow_trusted_input.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 306, "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_from_the_top_into_a_frame_of_another_site_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_select_dropdown_opens_at_its_element_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_intersection_and_lazy_loading_in_a_frame_of_another_site_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_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.control_a", "giro": "G2", "os": ["windows"], "min_tests": 20, "exact": true, "tests": ["tests/test_control_a_selects_all_in_a_field_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "The keyboard shortcut Control+A selects all in a field (5 ways to press it x an input and a textarea, in-process and served to the stock client), alone on its own Windows runner (windows-latest), as e2e.yml runs it on the published engine: the Windows keyboard of a real user is what it needs. The same file is in one of wrapper.e2e.suite.windows.1..4 and in wrapper.e2e.suite.linux.1.", "run": "suite_run"},
{"id": "wrapper.e2e.ab_oracle", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_oracle_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Same seed, same bytes: the engine published as firefox-68 against the candidate, on one machine, with the same core and wrapper, after the control: the published engine against ITSELF (the A/A; a difference is a broken control, exit 2, and the A/B is not run). On a pull request (no candidate: INVPW_BINARY_PATH is the published engine, no INVISIBLE_SEAL_FILE) the A/A is the whole test, on the first two seeds of the candidate set (all five when the pull request changes a file of this oracle: the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py exports AB_ORACLE_PR_SEEDS), and saves both dumps and the diff under $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. scripts/ci_ab_oracle.py runs the host gate's dump (scripts/ci_host_gate.py dump: the persona seeds of ci/persona-seeds.json, each at its own DPR with nothing pinned, the whole page of scripts/host_gate; the `candidate` set of 5 seeds that reach every webgl renderer and every DPR, or with AB_ORACLE_SEED_SET=final and AB_ORACLE_SHARD=i/n the 20 seeds that reach every value of every dimension split over n jobs) twice, once with the firefox-68 binary (the release's seal.json, then the core's own download.ensure_binary under that seal: the archive's sha256 is checked against the seal) and once with the candidate binary of the leg under its own seal, and compares every leaf of every visit: the only differences allowed are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys; anything else is red with the leaf, the two values and the seed; fewer leaves than the host gate's reference holds (16439 per visit; a DPR the reference does not record is held to the least of those it does) is red. The files (dump-68.json, dump-68-again.json, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) are the artifact ab-oracle-<os> of the leg. 1 = the one test; the comparator's own cases (51, the A/A's among them) are in tests/test_ab_oracle.py, the persona seeds' (15) in tests/test_persona_cover.py, in the rows of the whole unit suite. Needs the engine's binary (INVPW_BINARY_PATH) and, for the A/B, the candidate's seal (INVISIBLE_SEAL_FILE) and the network (the release assets of firefox-68). The engine of the candidate must accept the core of the leg and the 68 engine must accept it too: a core that declares something the published engine refuses is a red of this suite, not of the engine.", "timeout_minutes": 50, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"], "artifact": "ab-oracle"},
{"id": "wrapper.e2e.ab_network", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_network_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Network A/B oracle: the P4 journey, HTTPS h1/h2 (ClientHello, h2 frames, header order), HTTP/3 (transport parameters, H3 SETTINGS), WebRTC through the coherent SOCKS5 lab gateway, DNS through the fake DoH, and an idle launch; transcripts compared leaf by leaf, direct connections red on either side. A/A first (the published engine twice: a difference is a broken control; ci/ab-network-volatile.json holds the leaves the A/A proved volatile, and may only shrink), then the published engine against the candidate. Without a candidate (a PR's e2e) the A/A alone, on the first seed (all five when the pull request changes a file of this oracle: AB_NETWORK_PR_SEEDS), in jobs of its own in e2e.yml on Linux and on Windows (the shared e2e jobs leave this file out).", "timeout_minutes": 75, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]},
+70
View File
@@ -0,0 +1,70 @@
"""What the window-origin e2e files share: the four display cases, a browser pinned to one of them, and waits on a reading of a page.
The four cases are the ones of the window tests against retail (``test_the_maximized_window_frames_and_popups_read_retail_e2e.py``): scale 1.0, 1.25 and 1.5
on a 1920x1080 panel (device pixels) and 2.0 on a 1600x1200 one. The engine declares the window, so the page reads the same on Linux and on Windows.
Waits are CONDITIONS with a deadline (``_waits``), never a pause; ``observe`` is the one bounded look at a value that must NOT change, and it says so.
"""
from __future__ import annotations
import time
from typing import Any, Callable, Dict, List, Tuple
from _waits import wait_until
#: The deadline of a wait for something that must happen, in seconds.
DEADLINE_S = 30
#: Floats of a page (``mozInnerScreenY`` 72.667 is 72.6666...).
FLOAT = 0.001
#: case id -> (display scale, panel in device pixels).
CASES: Dict[str, Tuple[float, Tuple[int, int]]] = {
"1920x1080-dpr1.0": (1.0, (1920, 1080)),
"1920x1080-dpr1.25": (1.25, (1920, 1080)),
"1920x1080-dpr1.5": (1.5, (1920, 1080)),
"1600x1200-dpr2.0": (2.0, (1600, 1200)),
}
def launch_case(firefox_binary: str, case: str, **extra: Any):
"""The product on one case: seed 42, the panel and the scale pinned, headless, no humanizing. ``extra`` is for the keywords a test needs on top
(``extra_args``, ``extra_prefs``)."""
from invisible_playwright import InvisiblePlaywright
dpr, panel = CASES[case]
pin = {"screen.width": panel[0], "screen.height": panel[1], "screen.dpr": dpr}
return InvisiblePlaywright(seed=42, pin=pin, binary_path=firefox_binary, headless=True, humanize=False, **extra)
def settled(page, read: Callable[[], Any], seconds: float = DEADLINE_S) -> Any:
"""``read()`` once two looks in a row, 100 ms apart, give the same value (or the last one at the deadline: a window that never settles is red where
the caller's assertion names what was read)."""
seen: Dict[str, Any] = {"now": None, "before": None}
def look() -> bool:
seen["before"], seen["now"] = seen["now"], read()
return seen["now"] == seen["before"]
wait_until(look, seconds, lambda: page.wait_for_timeout(100))
return seen["now"]
def wait_for(page, condition: Callable[[], Any], seconds: float = DEADLINE_S) -> bool:
"""Until ``condition()`` is true, reading the client's events between two looks; False at the deadline."""
return wait_until(condition, seconds, lambda: page.wait_for_timeout(100))
def observe(page, read: Callable[[], Any], seconds: float) -> List[Any]:
"""The distinct values ``read()`` gives over ``seconds``, in the order they were seen (the first look is always taken).
The ONE bounded look of these files: for a value that must stay as it is (a window after ``resizeBy(0, 0)``, a frame that must not have loaded yet).
A change that comes later than ``seconds`` is not seen; a change inside it always is, so the check can be late to catch a bug and never red for nothing."""
values: List[Any] = []
end = time.monotonic() + seconds
while True:
value = read()
if not values or values[-1] != value:
values.append(value)
if time.monotonic() >= end:
return values
page.wait_for_timeout(100)
@@ -0,0 +1,111 @@
"""A real drag from the top document into a frame of another site drops on the element under the cursor, and ``dragend`` says where the drag ended.
The drag-and-drop points cross the process boundary as whole numbers: the parent sends the drop point to the frame's process, and the end point of the drag
to the source's. If either one is off by the offset between the window's real chrome and its declared chrome, the frame's element under the cursor is not the
element that gets the drop, and ``dragend`` carries a point that is not the last one the drag reported. Both are values a page reads. The expected values
do not depend on the window: they are the page's own geometry.
What it does, per display case (the four of the window tests), with the client's own mouse (``page.mouse.move``, ``down``, ``move`` in steps, ``up``): a page of
the top site holds a draggable box at its top left and, lower right, a frame of another site, 400x300 at (200, 100). The frame holds two boxes, 120x120, at (40, 60)
(``target``) and (220, 60) (``other``). The mouse goes down on the box, moves in twelve steps to the centre of ``target`` (300, 220 in the top document) and goes up.
* the frame hears ONE ``drop``; the element it is dispatched at is ``target``, and it is the element ``document.elementFromPoint`` finds at the ``clientX/Y`` the
event carries (the element under the cursor, read by the frame itself); and the point it carries is the centre of ``target`` within one CSS pixel (the point is
in device pixels, which at a fractional scale are not whole CSS pixels);
* the top document hears ``dragend``; its ``clientX/Y`` equal EXACTLY the ``clientX/Y`` of the last ``drag`` event the same document heard. A drag whose end
point is moved by the offset reads a ``dragend`` that is not where the drag was last seen. The test is red if they differ by one.
Both are checked with the numbers the page read printed in the message.
The engine that answers these values is not released yet: with the real chrome offset in the points the drop target or ``dragend`` is off, so this test is RED on
the engine of the pin where they differ, on purpose. It enters the suite with the engine release.
"""
from __future__ import annotations
from typing import Any, Dict, List
import pytest
from _fission_frames import Sites, wait_frame
from _window_origin import CASES, DEADLINE_S, launch_case, wait_for
pytestmark = pytest.mark.e2e
#: The box that is dragged: 80x50 at (20, 20) of the top document; the mouse goes down at its centre.
SOURCE = (60, 45)
#: The frame: 400x300 at (200, 100). The centre of ``target`` in the frame is (100, 120), so (300, 220) in the top document.
FRAME_AT = (200, 100)
TARGET_IN_FRAME = (100, 120)
STEPS = 12
TOP = """<!doctype html><meta charset=utf-8><title>drag</title>
<style>html,body{margin:0;padding:0;height:100%%}
#src{position:absolute;left:20px;top:20px;width:80px;height:50px;background:#9bd}
#f{position:absolute;left:200px;top:100px;width:400px;height:300px;border:0}</style>
<body><div id=src draggable=true>drag</div><iframe id=f src="%s"></iframe><script>
window.__drag = {starts: 0, drags: [], end: null};
const point = e => ({cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY});
document.getElementById('src').addEventListener('dragstart', e => {
window.__drag.starts++;
e.dataTransfer.setData('text/plain', 'x');
e.dataTransfer.effectAllowed = 'copy';
});
document.addEventListener('drag', e => { window.__drag.drags.push(point(e)); }, true);
document.addEventListener('dragend', e => { window.__drag.end = point(e); }, true);
</script>"""
FRAME = """<!doctype html><meta charset=utf-8><title>drop</title>
<style>html,body{margin:0;padding:0;height:100%}
.box{position:absolute;top:60px;width:120px;height:120px}
#target{left:40px;background:#bd9}#other{left:220px;background:#db9}</style>
<body><div id=target class=box>target</div><div id=other class=box>other</div><script>
window.__drop = {drops: [], overs: 0};
document.addEventListener('dragover', e => { e.preventDefault(); window.__drop.overs++; }, true);
document.addEventListener('drop', e => {
e.preventDefault();
const under = document.elementFromPoint(e.clientX, e.clientY);
window.__drop.drops.push({at: e.target.id, under: under && under.id, cx: e.clientX, cy: e.clientY});
}, true);
</script>"""
def _drag(page) -> None:
page.mouse.move(*SOURCE)
page.mouse.down()
page.mouse.move(FRAME_AT[0] + TARGET_IN_FRAME[0], FRAME_AT[1] + TARGET_IN_FRAME[1], steps=STEPS)
page.mouse.up()
@pytest.mark.parametrize("case", sorted(CASES))
def test_a_drag_from_the_top_into_a_frame_of_another_site(firefox_binary, case):
with Sites() as sites:
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/drop"))
sites.route("B", "/drop", FRAME)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
frame = wait_frame(page, sites.origin["B"], "/drop", seconds=DEADLINE_S)
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
origin = page.evaluate("() => { const r = document.getElementById('f').getBoundingClientRect(); return [r.left, r.top]; }")
assert tuple(origin) == FRAME_AT, "%s: the frame is at %r in the top document, the test placed it at %r" % (case, origin, FRAME_AT)
_drag(page)
wait_for(page, lambda: page.evaluate("() => window.__drag.end") is not None and len(frame.evaluate("() => window.__drop.drops")) >= 1)
drag: Dict[str, Any] = page.evaluate("() => window.__drag")
drops: List[Dict[str, Any]] = frame.evaluate("() => window.__drop.drops")
overs = frame.evaluate("() => window.__drop.overs")
assert drag["starts"] == 1, "%s: the drag started %r times (dragstart), once is a drag (%r)" % (case, drag["starts"], drag)
assert len(drops) == 1, "%s: the frame heard %d drops (%d dragovers), one is a drop (%r)" % (case, len(drops), overs, drops)
drop = drops[0]
assert drop["under"] == drop["at"] == "target", (
"%s: the drop was dispatched at %r, the element under the cursor (elementFromPoint of the event's clientX/Y) is %r, and the cursor is over 'target' "
"(the drop carries client point (%r, %r), the centre of target is %r)" % (case, drop["at"], drop["under"], drop["cx"], drop["cy"], TARGET_IN_FRAME))
assert abs(drop["cx"] - TARGET_IN_FRAME[0]) <= 1 and abs(drop["cy"] - TARGET_IN_FRAME[1]) <= 1, (
"%s: the drop carries client point (%r, %r) in the frame, the cursor was released over %r" % (case, drop["cx"], drop["cy"], TARGET_IN_FRAME))
assert drag["drags"], "%s: the source heard no drag event before dragend (%r)" % (case, drag)
last, end = drag["drags"][-1], drag["end"]
assert (end["cx"], end["cy"]) == (last["cx"], last["cy"]), (
"%s: dragend carries client point (%r, %r), the last drag event carried (%r, %r), they must be equal exactly (%d drag events; dragend %r; last %r)"
% (case, end["cx"], end["cy"], last["cx"], last["cy"], len(drag["drags"]), end, last))
@@ -0,0 +1,128 @@
"""A frame reads its ``mozInnerScreen`` only as (0, 0), as the client origin of the window, or as its settled value, from the first line of its script to ``load``.
Retail Firefox 159.0 on Windows, round 7 of the window-geometry capture (RetailCaptures ``captures/WINDOW_GEOMETRY_FRAME_EARLY.csv``, steps ``iframes_max``
and ``iframes_transformed``, columns ``moment``, ``mozInnerScreenX/Y``, ``settled_mozInnerScreenX/Y``, ``client_origin_css_x/y``): in a maximized window every
reading of a frame, at parse, ``DOMContentLoaded``, the first two animation frames and ``load``, is one of
three values and no other:
* (0, 0): the frame has no place yet (a frame of another process before the parent has sent the first matrix, and any frame before its first layout);
* the window's client origin, ``client_origin_css_x/y``: (0, 0) in every row of the maximized window (the popup of the same round has (12, 4) at scale 1.0,
and is not read here);
* the value the frame settles at.
A reading that is none of them is a value the page can tell from retail: a frame of another process that, before its first matrix, reads the real offset of the
browser chrome in the host's window, or the real window origin, instead of what the declaration gives. Those values are what the host's window has, and they
are not the declared ones.
What it does, per display case (the four of the window tests): a page of the top site loads a frame of the same site and a frame of another site, and the same two
inside a container under ``transform: scale(1.5)`` and ``rotate(10deg)`` (``transform-origin: 0 0``), the six kinds of round 7. The frame's page has an inline
script FIRST in ``<head>``: it records ``mozInnerScreenX/Y`` at parse, at ``DOMContentLoaded``, in the first two ``requestAnimationFrame`` callbacks it asked for at
parse, and at ``load``. Each kind loads three times (a new frame each time: the reading at parse is a race the first load can win by luck). The settled value is the
frame's reading once two looks 100 ms apart are equal, after ``load``. The assertion names the case, the kind, the moment and the three values it allowed.
The engine that answers these values is not released yet: on the engine of the pin this test is RED where the frame reads the real offsets, on purpose. It enters
the suite with the engine release.
"""
from __future__ import annotations
from typing import Any, Dict, List, Tuple
import pytest
from _fission_frames import Sites, wait_frame
from _window_origin import CASES, DEADLINE_S, FLOAT, launch_case, settled, wait_for
pytestmark = pytest.mark.e2e
#: The window's client origin in CSS pixels: ``client_origin_css_x/y`` of every ``iframes_max`` and ``iframes_transformed`` row of round 7 (maximized: the client
#: area starts at the window's origin).
CLIENT_ORIGIN: Tuple[float, float] = (0.0, 0.0)
#: The moments of the capture, and the frames each load must have recorded before it is read.
MOMENTS = ("parse", "dcl", "raf1", "raf2", "load")
#: Loads of each kind.
LOADS = 3
TOP = """<!doctype html><meta charset=utf-8><title>early</title>
<style>html,body{margin:0;padding:0;height:100%}</style><body></body>"""
# The page of every frame. The script is the first thing in <head>, as in the capture.
EARLY = """<!doctype html><html><head><script>
window.__early = [];
function rec(moment) { window.__early.push({m: moment, x: mozInnerScreenX, y: mozInnerScreenY}); }
rec('parse');
document.addEventListener('DOMContentLoaded', function () { rec('dcl'); });
requestAnimationFrame(function () { rec('raf1'); requestAnimationFrame(function () { rec('raf2'); }); });
window.addEventListener('load', function () { rec('load'); });
</script><meta charset=utf-8><style>html,body{margin:0;padding:0;height:100%}</style></head><body></body></html>"""
#: A frame in the page, 300x120 at (10, 60) (same site) or (10, 200) (another site), or in a container at (10, 200) under a transform.
ADD = """([src, top, transform]) => {
const f = document.createElement('iframe');
f.src = src;
f.style.cssText = 'display:block;width:300px;height:120px;border:0;margin:0;padding:0';
const box = document.createElement('div');
box.className = 'early-box';
if (transform) {
box.style.cssText = 'position:fixed;left:10px;top:200px;width:300px;height:120px;margin:0;padding:0;transform-origin:0 0;transform:' + transform;
} else {
box.style.cssText = 'position:absolute;left:10px;top:' + top + 'px;width:300px;height:120px;margin:0;padding:0';
}
box.appendChild(f);
document.body.appendChild(box);
}"""
REMOVE = "() => { document.querySelectorAll('.early-box').forEach(b => b.remove()); }"
#: kind -> (site of the frame, top in the page, transform)
KINDS: Dict[str, Tuple[str, int, str]] = {
"same": ("A", 60, ""),
"cross": ("B", 200, ""),
"same_scale": ("A", 200, "scale(1.5)"),
"cross_scale": ("B", 200, "scale(1.5)"),
"same_rotate": ("A", 200, "rotate(10deg)"),
"cross_rotate": ("B", 200, "rotate(10deg)"),
}
def _near(reading: Tuple[float, float], other: Tuple[float, float]) -> bool:
return abs(reading[0] - other[0]) <= FLOAT and abs(reading[1] - other[1]) <= FLOAT
def _recorded(frame) -> List[Dict[str, Any]]:
try:
return frame.evaluate("() => window.__early || []")
except Exception: # the frame is between two documents: not recorded yet
return []
@pytest.mark.parametrize("case", sorted(CASES))
def test_a_frame_reads_only_declared_origins_while_it_loads(firefox_binary, case):
problems: List[str] = []
with Sites() as sites:
sites.route("A", "/page", TOP)
sites.route("A", "/early", EARLY)
sites.route("B", "/early", EARLY)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
for kind, (site, top, transform) in KINDS.items():
for load in range(LOADS):
path = "/early?%s&load=%d" % (kind, load)
page.evaluate(ADD, [sites.url(site, path), top, transform])
try:
frame = wait_frame(page, sites.origin[site], path, seconds=DEADLINE_S)
wait_for(page, lambda: {r["m"] for r in _recorded(frame)} >= set(MOMENTS))
records = {r["m"]: r for r in _recorded(frame)}
missing = [m for m in MOMENTS if m not in records]
if missing:
problems.append("%s, %s, load %d: the frame never recorded %s (recorded %r)" % (case, kind, load, missing, _recorded(frame)))
continue
final = settled(page, lambda: tuple(frame.evaluate("() => [mozInnerScreenX, mozInnerScreenY]")))
allowed = [(0.0, 0.0), CLIENT_ORIGIN, final]
for moment in MOMENTS:
reading = (records[moment]["x"], records[moment]["y"])
if not any(_near(reading, a) for a in allowed):
problems.append(
"%s, %s frame, load %d, at %s: mozInnerScreen reads (%r, %r); allowed (0, 0), the client origin %r, or the settled value %r"
% (case, kind, load, moment, reading[0], reading[1], CLIENT_ORIGIN, final))
finally:
page.evaluate(REMOVE)
assert not problems, "a frame read a value that is not declared while it loaded (%d):\n %s" % (len(problems), "\n ".join(problems))
@@ -0,0 +1,124 @@
"""A popup of the maximized window moves, resizes and clamps in the DECLARED window, not in the host's.
The page's ``moveBy``, ``moveTo``, ``resizeBy`` and ``resizeTo`` read the declared position and size of the window, add what the page asked, and send the
absolute result to the parent, which applies it to the real window. A popup whose declared position or frame is not its real one (on Linux the window manager
puts the popup where it likes, and its frame is the host's) must still answer these calls as the retail window does. Three things, per display case (the four of
the window tests), each in a popup of its own opened by a real click, ``window.open(url, '_blank', 'width=500,height=400')``:
1. ``resizeBy(0, 0)``: ``innerWidth``, ``innerHeight``, ``outerWidth`` and ``outerHeight`` stay what they were. A call that adds nothing must change nothing; if the
parent converted the declared outer size into the real one with the wrong frame, the real inner size would move by the difference of the two frames (retail
measures nothing here: the call is a no-op in its window). The page is watched for 1.5 s after the call, so a change that arrives late is seen.
2. ``moveBy(10, 10)``: ``screenX`` and ``screenY`` grow by exactly 10 CSS pixels, from the position the popup read before. If the parent took the real position of
the window as the base, the declared and the real positions would differ by what the host's window manager decided, and the popup would jump.
3. ``moveTo(99999, 0)``: ``screenX`` is ``screen.availLeft + screen.availWidth - outerWidth``, the three read by the page. The clamp is the page's
(``nsGlobalWindowOuter::CheckSecurityLeftAndTop``: it keeps the window inside the available rectangle of the screen the page reads, with the outer size the page
reads), so the page can learn the real outer width of the window from where the popup stops if the clamp reads any of them from the host.
Why a page reads it: a script that moves a window by ten and sees it move by another number, or that throws a window to the far right and reads where it stops,
is reading the host's window manager and its frame.
The engine that answers these values is not released yet: on the engine of the pin the clamp and the moves are the host's where the declared and the real window
differ, so this test is RED there, on purpose. It enters the suite with the engine release.
"""
from __future__ import annotations
from typing import Any, Dict, Tuple
import pytest
from _fission_frames import Sites
from _window_origin import CASES, DEADLINE_S, launch_case, observe, settled, wait_for
pytestmark = pytest.mark.e2e
#: The button that opens the popup: ``position:fixed`` at (20, 20), 160x40 CSS pixels; its centre is the point of the real click.
OPEN = (100, 40)
FEATURES = "width=500,height=400"
#: How long the window is watched after a call that must change nothing, in seconds.
WATCH_S = 1.5
TOP = """<!doctype html><meta charset=utf-8><title>popup</title>
<style>html,body{margin:0;padding:0;height:100%}
#open{position:fixed;left:20px;top:20px;width:160px;height:40px;margin:0}</style>
<body><button id=open>popup</button><script>
document.getElementById('open').addEventListener('click', () => { window.open(window.__popupUrl, '_blank', window.__popupFeatures); });
</script>"""
POPUP = "<!doctype html><meta charset=utf-8><title>popup</title><body style=margin:0>x"
READ = """() => ({iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight, sx: screenX, sy: screenY,
availL: screen.availLeft, availW: screen.availWidth})"""
SIZE = "() => [innerWidth, innerHeight, outerWidth, outerHeight]"
POSITION = "() => [screenX, screenY]"
def _open(page, sites) -> Any:
"""``window.open`` from a real click on the page's button; the popup, loaded."""
page.evaluate("([url, features]) => { window.__popupUrl = url; window.__popupFeatures = features; }", [sites.url("A", "/popup"), FEATURES])
with page.expect_popup(timeout=30000) as opened:
page.mouse.click(*OPEN) # the client's own click: a trusted event, so window.open is allowed
popup = opened.value
popup.wait_for_load_state("load", timeout=30000)
return popup
def _settled_popup(popup) -> Dict[str, Any]:
"""The popup once it is the size it was asked and two looks in a row agree."""
return settled(popup, lambda: popup.evaluate(READ))
def _phase_resize_by_zero(page, sites, case: str) -> None:
popup = _open(page, sites)
try:
before = _settled_popup(popup)
assert (before["iw"], before["ih"]) == (500, 400), "%s: the popup is %rx%r inside before the call, it was asked 500x400 (%r)" % (
case, before["iw"], before["ih"], before)
popup.evaluate("() => { window.resizeBy(0, 0); }")
after = observe(popup, lambda: tuple(popup.evaluate(SIZE)), WATCH_S)
was = (before["iw"], before["ih"], before["ow"], before["oh"])
assert after == [was], (
"%s: resizeBy(0, 0) changed the window: (innerWidth, innerHeight, outerWidth, outerHeight) was %r and the page then read %r" % (case, was, after))
finally:
popup.close()
def _phase_move_by(page, sites, case: str) -> None:
popup = _open(page, sites)
try:
before = _settled_popup(popup)
popup.evaluate("() => { window.moveBy(10, 10); }")
expected: Tuple[int, int] = (before["sx"] + 10, before["sy"] + 10)
wait_for(popup, lambda: tuple(popup.evaluate(POSITION)) == expected, DEADLINE_S)
after = settled(popup, lambda: tuple(popup.evaluate(POSITION)))
assert tuple(after) == expected, (
"%s: moveBy(10, 10) from (screenX, screenY) = (%r, %r) leaves it at %r, it must be exactly %r" % (case, before["sx"], before["sy"], tuple(after), expected))
finally:
popup.close()
def _phase_move_to_the_far_right(page, sites, case: str) -> None:
popup = _open(page, sites)
try:
before = _settled_popup(popup)
popup.evaluate("() => { window.moveTo(99999, 0); }")
# the clamp's own inputs, read by the page after the call: the declared avail rectangle and the declared outer width
wait_for(popup, lambda: popup.evaluate("() => screenX") == popup.evaluate("() => screen.availLeft + screen.availWidth - outerWidth"), DEADLINE_S)
after = settled(popup, lambda: popup.evaluate(READ))
expected = after["availL"] + after["availW"] - after["ow"]
assert after["sx"] == expected, (
"%s: after moveTo(99999, 0) screenX is %r; the declared avail right (availLeft %r + availWidth %r) less outerWidth %r is %r (popup was %r before the call)"
% (case, after["sx"], after["availL"], after["availW"], after["ow"], expected, before))
finally:
popup.close()
@pytest.mark.parametrize("case", sorted(CASES))
def test_a_popup_moves_and_resizes_as_declared(firefox_binary, case):
with Sites() as sites:
sites.route("A", "/page", TOP)
sites.route("A", "/popup", POPUP)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
_phase_resize_by_zero(page, sites, case)
_phase_move_by(page, sites, case)
_phase_move_to_the_far_right(page, sites, case)
@@ -0,0 +1,176 @@
"""The dropdown of a ``<select>`` opens on the real screen at the element the page showed, in the top document and in a frame of another site.
THIS IS A PRODUCT MEASUREMENT, NOT A PAGE-VISIBLE ONE. A page cannot read where a dropdown opens. But the engine declares to the content process the window origin and the
chrome offset the page reads (not the host's), and the chrome actors of the browser that anchor a popup on screen (the select dropdown, the autocomplete list, the pickers,
the form validation bubble) compute their anchor in the content process with ``windowUtils.getElementBoundingScreenRect``: the declared window origin plus the box of the
element. The parent then opens the popup at those numbers, on the REAL screen. Unless the parent maps the declared point back to the real one, the dropdown opens away
from its element by the difference between the declared window and the real one, and a person who uses the browser sees it (and, in a frame of another process, by the
declared chrome offset too: the matrix of that process).
What it does, per display case (the four of the window tests): the browser is launched with Marionette (``-marionette -remote-allow-system-access``, the route of
``test_software_compositing_is_declared_e2e.py``), so the test can read the chrome of the browser. A page of the top site has a ``<select>`` (160x28 at (30, 20)) and a frame
of another site, 420x200 at (30, 120), with the same ``<select>`` at (40, 20) of its document. For each of the two selects:
* the client's own click (``locator.click``, the mouse the client sends) opens the dropdown, and the test waits for the menulist popup of ``ContentSelectDropdown`` to be ``open``;
* from chrome, two rectangles are read, in the CSS pixels of the chrome: the popup's real screen rectangle (``popup.getOuterScreenRect()``, the bounds of the popup's
own widget) and the select's REAL screen rectangle, computed in the parent from the real geometry of the browser: the content-area rectangle of the ``<browser>`` plus
the select's rectangle in the page (the page's own ``getBoundingClientRect``, plus the frame's box for the second one), converted with the chrome window's
``windowUtils.toScreenRectInCSSUnits`` (the widget of the window as it really is);
* the popup is anchored below the element: its left is the element's left and its top is the element's bottom, each within ONE device pixel (``1 / devicePixelRatio`` CSS
pixels of the chrome window), and the frame's popup is anchored as the top one is (offset to the element within one device pixel of the top's offset), so a CSS margin of the
popup, if the build has one, is not mistaken for a displacement.
RED WITHOUT THE MAP OF THE POPUPS (design §3). Once the content process is told the declared window origin and the declared chrome offset, ``getElementBoundingScreenRect``
answers declared screen coordinates, and ``SelectParent`` opens the popup at them. The real window is not at the declared place (on Windows the real chrome has other
heights; on Linux the window manager's frame and the host's chrome are not retail's), so the popup lands at the real screen rectangle shifted by (declared - real) and its left
or top is more than a device pixel from the element's. With the map, ``p_real = p_decl - (W_decl - W_real) - d`` in the parent, the two rectangles agree. This test is what shows
the shift in the top document (the window origin) and in the frame (the window origin and the matrix).
The autocomplete popup is not measured: it needs a form-history entry written to the profile from chrome and a typed field, and nothing in this suite says that the engine
keeps form history on; a test that skips there is red in the verdict.
The engine that answers these values is not released yet: this test is red on an engine that declares the window origin without the map, on purpose. It enters the suite with it.
"""
from __future__ import annotations
import json
import time
from typing import Any, Dict, Tuple
import pytest
from _fission_frames import Sites, wait_frame
from _window_origin import CASES, DEADLINE_S, launch_case, wait_for
pytestmark = pytest.mark.e2e
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
TOP = """<!doctype html><meta charset=utf-8><title>select</title>
<style>html,body{margin:0;padding:0}
select{position:absolute;box-sizing:border-box;width:160px;height:28px;margin:0}
#s{left:30px;top:20px}#f{position:absolute;left:30px;top:120px;width:420px;height:200px;border:0}</style>
<body><select id=s><option>one</option><option>two</option><option>three</option></select><iframe id=f src="%s"></iframe>"""
FRAME = """<!doctype html><meta charset=utf-8><title>select in a frame</title>
<style>html,body{margin:0;padding:0}select{position:absolute;box-sizing:border-box;width:160px;height:28px;margin:0;left:40px;top:20px}</style>
<body><select id=s><option>one</option><option>two</option><option>three</option></select>"""
#: The select's rectangle in the page's own viewport, CSS pixels.
SELECT_BOX = "() => { const r = document.getElementById('s').getBoundingClientRect(); return {x: r.left, y: r.top, w: r.width, h: r.height}; }"
FRAME_BOX = "() => { const r = document.getElementById('f').getBoundingClientRect(); return {x: r.left, y: r.top}; }"
# The reads of the browser chrome, in the script of Marionette (chrome scope).
POPUP_STATE_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
return JSON.stringify({state: popup ? popup.state : "no popup"});
"""
MEASURE_JS = """
const [rect] = arguments;
const win = Services.wm.getMostRecentWindow("navigator:browser");
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
const browser = win.gBrowser.selectedBrowser;
const b = browser.getBoundingClientRect();
const el = win.windowUtils.toScreenRectInCSSUnits(b.left + rect.x, b.top + rect.y, rect.w, rect.h);
const p = popup.getOuterScreenRect();
const plain = r => ({left: r.left, top: r.top, right: r.right, bottom: r.bottom});
return JSON.stringify({state: popup.state, element: plain(el), popup: plain(p), dpr: win.devicePixelRatio});
"""
CLOSE_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
const popup = win.document.querySelector("#ContentSelectDropdown > menupopup");
popup.hidePopup();
return JSON.stringify({state: popup.state});
"""
def _marionette():
import webfont_probe
m = webfont_probe._Marionette(webfont_probe.marionette_active_port())
m.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
m.call("Marionette:SetContext", {"value": "chrome"})
return m
def _script(marionette, script: str, args=()) -> Dict[str, Any]:
return json.loads(marionette.call("WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
def _wait_state(page, marionette, state: str) -> Dict[str, Any]:
"""The popup's state once it is ``state`` (open or closed), polled; the last reading at the deadline."""
seen: Dict[str, Any] = {}
def look() -> bool:
seen.update(_script(marionette, POPUP_STATE_JS))
return seen["state"] == state
wait_for(page, look, DEADLINE_S)
return seen
def _measure(page, marionette, rect: Dict[str, float]) -> Dict[str, Any]:
"""Opens nothing: reads the open popup and the select's real screen rectangle, both in CSS pixels of the chrome."""
read = _script(marionette, MEASURE_JS, [rect])
# the popup's widget may still be sizing itself: read until two looks agree
end = time.monotonic() + DEADLINE_S
while True:
page.wait_for_timeout(100)
again = _script(marionette, MEASURE_JS, [rect])
if again == read or time.monotonic() >= end:
return again
read = again
def _anchor_offset(read: Dict[str, Any]) -> Tuple[float, float]:
"""(popup left - element left, popup top - element bottom), CSS pixels of the chrome."""
return (read["popup"]["left"] - read["element"]["left"], read["popup"]["top"] - read["element"]["bottom"])
@pytest.mark.parametrize("case", sorted(CASES))
def test_a_select_dropdown_opens_at_its_element(firefox_binary, monkeypatch, case):
monkeypatch.setenv("MOZ_REMOTE_ALLOW_SYSTEM_ACCESS", "1") # the chrome-scope reads below
marionette = None
reads: Dict[str, Dict[str, Any]] = {}
with Sites() as sites:
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/select"))
sites.route("B", "/select", FRAME)
try:
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
frame = wait_frame(page, sites.origin["B"], "/select", seconds=DEADLINE_S)
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
marionette = _marionette()
top_rect = page.evaluate(SELECT_BOX)
frame_origin = page.evaluate(FRAME_BOX)
in_frame = frame.evaluate(SELECT_BOX)
frame_rect = {"x": frame_origin["x"] + in_frame["x"], "y": frame_origin["y"] + in_frame["y"], "w": in_frame["w"], "h": in_frame["h"]}
for name, document, rect in (("top", page, top_rect), ("frame", frame, frame_rect)):
document.locator("#s").click()
opened = _wait_state(page, marionette, "open")
assert opened["state"] == "open", "%s, %s document: the dropdown did not open after a click on the select (popup state %r)" % (case, name, opened)
reads[name] = _measure(page, marionette, rect)
_script(marionette, CLOSE_JS)
closed = _wait_state(page, marionette, "closed")
assert closed["state"] == "closed", "%s, %s document: the dropdown did not close (popup state %r)" % (case, name, closed)
finally:
if marionette is not None:
marionette.close()
for name, read in reads.items():
tolerance = 1.0 / read["dpr"] + 0.01
left, top = _anchor_offset(read)
assert abs(left) <= tolerance and abs(top) <= tolerance, (
"%s, %s document: the dropdown opened at (left %r, top %r) on the real screen and the select's real rectangle is %r: left is off by %r and top (against the "
"element's bottom) by %r CSS pixels of the chrome, one device pixel is %r (the popup is %r)"
% (case, name, read["popup"]["left"], read["popup"]["top"], read["element"], left, top, tolerance, read["popup"]))
top_offset, frame_offset = _anchor_offset(reads["top"]), _anchor_offset(reads["frame"])
tolerance = 1.0 / reads["top"]["dpr"] + 0.01
assert abs(frame_offset[0] - top_offset[0]) <= tolerance and abs(frame_offset[1] - top_offset[1]) <= tolerance, (
"%s: the dropdown of the select in the frame is anchored %r from its element, the one of the top document %r: a frame of another process is shifted from the top by %r"
% (case, frame_offset, top_offset, (frame_offset[0] - top_offset[0], frame_offset[1] - top_offset[1])))
@@ -0,0 +1,152 @@
"""Click, hover, drag and wheel reach the element under the cursor, in the top document and in a frame of another site, at every display scale.
The parent turns a point of the window into a point of the content with the matrix it keeps of each content process (``mChildToParentConversionMatrix``), and the
mouse, the wheel and the drag go through it. The matrix the parent SENDS to the child is a different one (it carries the window origin the page reads), and a change
there must not move the input: the point the parent hit-tests, the element the event is dispatched at and the ``clientX/Y`` it carries must stay the cursor's.
Playwright's own input (``page.mouse``) is what a client sends, so this is what a script sees break.
What it does, per display case (the four of the window tests), once for the top document and once for a frame of another site, 500x240 at (20, 200) of the same
page, both holding the same four boxes (CSS pixels of the document): a button ``click`` (60x40 at (20, 20)), a box ``hover`` (60x40 at (100, 20)), a box ``drag``
(140x90 at (180, 20)) and a scroller ``scroll`` (140x100 at (20, 80), 600 high inside). The mouse is the client's (``page.mouse``), the point is the box's own
centre plus the document's origin in the page:
* click: ``mouse.click`` at the centre of ``click``: the document hears trusted ``mousedown``, ``mouseup`` and ``click`` AT ``click``, with ``clientX/Y`` at the point
within one CSS pixel (the point is a device pixel, which at a fractional scale is not a whole CSS pixel);
* hover: ``mouse.move`` to the centre of ``hover``: ``mouseover`` is dispatched at ``hover``, with the point, and the element matches ``:hover``;
* drag: ``mousedown`` at the centre of ``drag``, six moves to a point 30 right and 20 below, ``mouseup``: ``mousedown`` and ``mouseup`` AT ``drag`` with the two points,
the ``mousemove`` events with the left button held and the last at the end point;
* wheel: ``mouse.wheel(0, 120)`` over the centre of ``scroll``: the document hears a trusted ``wheel`` at ``scroll``, with the point, and ``scroll.scrollTop`` grows.
The existing suites that read input in a frame of another site and are in the candidate's rows already: ``test_nested_frame_actions.py`` (a click, and a pointer at a large
offset, with the scales 1, 1.25, 1.5 and 2, in one-, two- and three-process pages, and the wheel at scales 1 and 1.25 under a zoom),
``test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py`` (one click), ``test_fission_frames_tree_input_and_pixels_e2e.py`` (clicks under a transform, after a
scroll, typing), ``test_a_drag_keeps_its_buttons_pressed_e2e.py`` and ``test_drag_motion.py`` (a drag in the top document), ``test_input_is_born_before_the_page_sees_it_e2e.py``
(keys and moves). None puts the four kinds of input in both documents at the four scales: this file does, and only this.
The engine that answers these values is not released yet: it must pass on the engine of the pin, where the matrix is the real one; it is red if the matrix the
parent sends moves the input.
"""
from __future__ import annotations
from typing import Any, Dict, List, Tuple
import pytest
from _fission_frames import Sites, wait_frame
from _window_origin import CASES, DEADLINE_S, launch_case, wait_for
pytestmark = pytest.mark.e2e
#: The boxes' centres in the document, CSS pixels.
CLICK, HOVER, DRAG, SCROLL = (50, 40), (130, 40), (250, 65), (90, 130)
DRAG_TO = (280, 85)
#: The frame's place in the top document.
FRAME_AT = (20, 200)
#: One CSS pixel: the point of an event is a device pixel, rounded to CSS.
POINT_TOLERANCE = 1.0
BODY = """<style>html,body{margin:0;padding:0}.b{position:absolute;box-sizing:border-box;margin:0;padding:0}
#click{left:20px;top:20px;width:60px;height:40px}#hover{left:100px;top:20px;width:60px;height:40px;background:#eee}
#drag{left:180px;top:20px;width:140px;height:90px;background:#9bd}
#scroll{left:20px;top:80px;width:140px;height:100px;overflow:auto;background:#bd9}#scroll div{height:600px}</style>
<button id=click class=b>click</button><div id=hover class=b>hover</div><div id=drag class=b>drag</div><div id=scroll class=b><div></div></div>
<script>
window.__ev = [];
const idOf = e => { const n = e.target.closest ? e.target.closest('[id]') : null; return n ? n.id : null; };
for (const t of ['click', 'mouseover', 'mousedown', 'mousemove', 'mouseup', 'wheel'])
document.addEventListener(t, e => { window.__ev.push({t: t, id: idOf(e), cx: e.clientX, cy: e.clientY, trusted: e.isTrusted, buttons: e.buttons}); }, true);
</script>"""
TOP = ("<!doctype html><meta charset=utf-8><title>input</title><style>#f{position:absolute;left:20px;top:200px;width:500px;height:240px;border:0}</style>"
+ BODY + '<iframe id=f src="%s"></iframe>')
FRAME = "<!doctype html><meta charset=utf-8><title>input frame</title>" + BODY
def _events(doc) -> List[Dict[str, Any]]:
return doc.evaluate("() => window.__ev")
def _where(case: str, doc_name: str, what: str, events: List[Dict[str, Any]]) -> str:
return "%s, %s document, %s: events heard %r" % (case, doc_name, what, events)
def _near(event: Dict[str, Any], point: Tuple[float, float]) -> bool:
return abs(event["cx"] - point[0]) <= POINT_TOLERANCE and abs(event["cy"] - point[1]) <= POINT_TOLERANCE
def _of(events: List[Dict[str, Any]], kind: str, box: str) -> List[Dict[str, Any]]:
return [e for e in events if e["t"] == kind and e["id"] == box]
def _fresh(doc) -> None:
doc.evaluate("() => { window.__ev.length = 0; }")
def _check_click(page, doc, origin, case, name) -> None:
_fresh(doc)
page.mouse.click(origin[0] + CLICK[0], origin[1] + CLICK[1])
wait_for(page, lambda: _of(_events(doc), "click", "click"))
events = _events(doc)
where = _where(case, name, "click at %r" % (CLICK,), events)
for kind in ("mousedown", "mouseup", "click"):
heard = _of(events, kind, "click")
assert heard, "%s; no trusted %s at 'click'" % (where, kind)
assert heard[-1]["trusted"] and _near(heard[-1], CLICK), "%s; %s is not the trusted event at the point" % (where, kind)
def _check_hover(page, doc, origin, case, name) -> None:
_fresh(doc)
page.mouse.move(origin[0] + HOVER[0], origin[1] + HOVER[1])
wait_for(page, lambda: _of(_events(doc), "mouseover", "hover"))
where = _where(case, name, "hover at %r" % (HOVER,), _events(doc))
over = _of(_events(doc), "mouseover", "hover")
assert over and over[-1]["trusted"], "%s; no trusted mouseover at 'hover'" % where
assert wait_for(page, lambda: doc.evaluate("() => document.getElementById('hover').matches(':hover')")), "%s; 'hover' does not match :hover" % where
moves = [e for e in _events(doc) if e["t"] == "mousemove"]
assert moves and _near(moves[-1], HOVER), "%s; the last mousemove is not at the point" % where
def _check_drag(page, doc, origin, case, name) -> None:
_fresh(doc)
page.mouse.move(origin[0] + DRAG[0], origin[1] + DRAG[1])
page.mouse.down()
page.mouse.move(origin[0] + DRAG_TO[0], origin[1] + DRAG_TO[1], steps=6)
page.mouse.up()
wait_for(page, lambda: _of(_events(doc), "mouseup", "drag"))
events = _events(doc)
where = _where(case, name, "drag from %r to %r" % (DRAG, DRAG_TO), events)
down, up = _of(events, "mousedown", "drag"), _of(events, "mouseup", "drag")
assert down and _near(down[-1], DRAG), "%s; mousedown at 'drag' is not at the start point" % where
assert up and _near(up[-1], DRAG_TO), "%s; mouseup at 'drag' is not at the end point" % where
held = [e for e in events if e["t"] == "mousemove" and e["buttons"] == 1]
assert held and _near(held[-1], DRAG_TO), "%s; the last mousemove with the left button held is not at the end point" % where
def _check_wheel(page, doc, origin, case, name) -> None:
_fresh(doc)
page.mouse.move(origin[0] + SCROLL[0], origin[1] + SCROLL[1])
page.mouse.wheel(0, 120)
wait_for(page, lambda: doc.evaluate("() => document.getElementById('scroll').scrollTop") > 0 and _of(_events(doc), "wheel", "scroll"))
events = _events(doc)
where = _where(case, name, "wheel over %r" % (SCROLL,), events)
wheel = _of(events, "wheel", "scroll")
assert wheel and wheel[-1]["trusted"] and _near(wheel[-1], SCROLL), "%s; no trusted wheel at 'scroll' at the point" % where
assert doc.evaluate("() => document.getElementById('scroll').scrollTop") > 0, "%s; the scroller did not scroll" % where
@pytest.mark.parametrize("case", sorted(CASES))
def test_input_reaches_the_top_and_a_frame_of_another_site(firefox_binary, case):
with Sites() as sites:
sites.route("A", "/page", lambda handler: TOP % sites.url("B", "/input"))
sites.route("B", "/input", FRAME)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
frame = wait_frame(page, sites.origin["B"], "/input", seconds=DEADLINE_S)
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
box = page.evaluate("() => { const r = document.getElementById('f').getBoundingClientRect(); return [r.left, r.top]; }")
assert tuple(box) == FRAME_AT, "%s: the frame is at %r in the top document, the test placed it at %r" % (case, box, FRAME_AT)
for name, doc, origin in (("top", page, (0, 0)), ("frame", frame, FRAME_AT)):
_check_click(page, doc, origin, case, name)
_check_hover(page, doc, origin, case, name)
_check_drag(page, doc, origin, case, name)
_check_wheel(page, doc, origin, case, name)
@@ -0,0 +1,188 @@
"""What a frame of another site sees of the top viewport while the top scrolls: ``IntersectionObserver`` and lazy loading follow the page's own geometry.
A frame of another site runs in another process. It does not know where it is in the window: the parent tells it, as a matrix and as the part of the top viewport
that shows the frame (the remote document's visible rect). ``IntersectionObserver`` of a document in that frame, and the ``loading=lazy`` frames inside it,
read that rect. If the matrix the parent sends is moved from the real chrome offset to the declared one and the rect is not moved with it, the frame sees the
viewport shifted: its observer reports a ratio that is not the visible part of the frame, and a lazy frame loads too early or too late. Both are readable by any
page, and both have a right answer that does not depend on the window: what the top page itself reads of its own frame box.
HOW STOCK FIREFOX IS COMPARED. The wrapper's e2e jobs do not install Playwright's own Firefox: only the rows with ``stock_firefox`` in ``ci/required-suites.json``
(``wrapper.e2e.fakeweb`` and the host oracle) do, and they compare through ``scripts/``, not through a test of ``tests/``. So these tests do NOT run stock; they
compare with the value stock Firefox gives by its algorithm, computed from geometry the page reads (a ratio is the visible height over the frame height;
``rootBounds`` is null for a frame of another site, ``DOMIntersectionObserver.cpp``, ``isSimilarOrigin``; a nested lazy frame in a frame of another site loads when
its box meets the remote visible rect, which is not widened by the lazy margin, ``ComputeTheIntersection`` step 5, while a lazy frame of the top document
loads 600 CSS pixels before the viewport, ``dom.lazy-loading.margin.*``). A stock leg needs a row with ``stock_firefox`` and its legs in the gate.
1. The intersection of a frame, per display case (the four of the window tests). The top page is tall and holds a frame of another site, 300x300, at document y 1000.
The frame's page has a box ``#t`` of 300x300. Its script makes a NEW ``IntersectionObserver`` (threshold [0]) at every look, whose first callback always comes,
and reports ``isIntersecting``, ``intersectionRatio``, ``rootBounds``, ``boundingClientRect`` and ``intersectionRect``. The top scrolls (``scrollTo``) so that the frame's top
sits at a chosen place in the viewport: 100 (all visible), -50, -150, -250 (the top part clipped), -320 (all above, none visible), the viewport height less 60 (the bottom part
clipped), the viewport height plus 20 (all below), and 100 again. At each step the page's own ``getBoundingClientRect`` of the frame and ``clientHeight`` give the
expected visible height; the reading is waited for until it equals that, within one CSS pixel (scroll and box are snapped to device pixels), and the last one is
asserted: ``isIntersecting`` is whether any height is visible, the ratio is the visible height over 300, ``rootBounds`` is null, the box is 300x300, and the
intersection rect starts at the clipped height and is as high as the visible part. A frame that thinks the viewport starts a few pixels higher or lower reads another ratio.
2. Lazy frames, per display case. (a) A ``loading=lazy`` frame of another site in the top document, at document y 4000: it is not requested while its top is 640 CSS
pixels below the viewport, and is requested when it is 560 below. (b) A ``loading=lazy`` frame of a third site INSIDE a frame of another site, at y 200 of that frame,
which is itself at document y 4000: it is not requested while its top is 24 CSS pixels below the viewport's bottom edge, and is requested when it is 24 above it.
The "not requested" side is watched for 1.5 s, the requested side is waited for; the server's own record of requests says what was asked.
The engine that answers these values is not released yet: with a matrix moved and a rect not moved, the ratios and the lazy loads are off, so this test is RED there,
on purpose. It enters the suite with the engine release.
"""
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple
import pytest
from _fission_frames import Sites, wait_frame
from _window_origin import CASES, DEADLINE_S, launch_case, observe, wait_for
pytestmark = pytest.mark.e2e
FRAME_SIZE = 300
#: The frame's top in the top document, in CSS pixels.
IO_TOP = 1000
LAZY_TOP = 4000
#: One CSS pixel in the visible height: scroll and boxes are snapped to device pixels.
TOLERANCE_PX = 1.0
WATCH_S = 1.5
TOP_IO = """<!doctype html><meta charset=utf-8><title>io</title>
<style>html,body{margin:0;padding:0}body{height:4000px}
#f{position:absolute;left:20px;top:%dpx;width:300px;height:300px;border:0}</style>
<body><iframe id=f src="%%s"></iframe>""" % IO_TOP
FRAME_IO = """<!doctype html><meta charset=utf-8><title>io</title>
<style>html,body{margin:0;padding:0}#t{width:300px;height:300px;background:#9bd}</style><body><div id=t></div>"""
#: A new observer at every look: its first callback is always queued, whatever the thresholds, and carries the state now.
LOOK = """() => new Promise(resolve => {
const io = new IntersectionObserver(entries => {
const e = entries[entries.length - 1];
io.disconnect();
const box = r => r && {x: r.x, y: r.y, w: r.width, h: r.height};
resolve({isIntersecting: e.isIntersecting, ratio: e.intersectionRatio, rootBounds: box(e.rootBounds),
box: box(e.boundingClientRect), inter: box(e.intersectionRect)});
}, {threshold: [0]});
io.observe(document.getElementById('t'));
})"""
TOP_BOX = """() => { const r = document.getElementById('f').getBoundingClientRect(); return {top: r.top, vh: document.documentElement.clientHeight}; }"""
def _top_lazy(height: int, loading: str, src: str) -> str:
"""The top page of the lazy cases: a tall page with ONE frame of another site at document y ``LAZY_TOP``, ``height`` high; ``loading`` is the attribute's value."""
return ("<!doctype html><meta charset=utf-8><title>lazy</title>"
"<style>html,body{margin:0;padding:0}body{height:9000px}"
"iframe{position:absolute;left:20px;top:%dpx;width:300px;height:%dpx;border:0}</style>"
'<body><iframe id=f loading=%s src="%s"></iframe>' % (LAZY_TOP, height, loading, src))
FRAME_LAZY_HOST = """<!doctype html><meta charset=utf-8><title>host</title>
<style>html,body{margin:0;padding:0}iframe{position:absolute;left:0;top:200px;width:100px;height:50px;border:0}</style>
<body><iframe loading=lazy src="%s"></iframe>"""
LEAF = "<!doctype html><meta charset=utf-8><title>leaf</title><body>leaf"
def _expected(step_top: float, vh: float) -> Dict[str, float]:
"""What the observer of a 300x300 frame reports when the frame's top is ``step_top`` below the top of a viewport ``vh`` high, from geometry alone."""
shown_top = max(step_top, 0.0)
shown_bottom = min(step_top + FRAME_SIZE, vh)
visible = max(0.0, shown_bottom - shown_top)
return {"visible": visible, "ratio": visible / FRAME_SIZE, "inter_y": shown_top - step_top}
def _matches(reading: Dict[str, Any], expected: Dict[str, float]) -> bool:
ratio_tolerance = TOLERANCE_PX / FRAME_SIZE + 0.001
if abs(reading["ratio"] - expected["ratio"]) > ratio_tolerance:
return False
if reading["isIntersecting"] != (expected["visible"] > 0):
return False
return expected["visible"] == 0 or (reading["inter"] is not None and abs(reading["inter"]["h"] - expected["visible"]) <= TOLERANCE_PX
and abs(reading["inter"]["y"] - expected["inter_y"]) <= TOLERANCE_PX)
def _steps(vh: float) -> List[Tuple[str, float]]:
return [("all visible", 100), ("top 50 clipped", -50), ("top 150 clipped", -150), ("top 250 clipped", -250), ("all above", -320),
("bottom 240 clipped", vh - 60), ("all below", vh + 20), ("all visible again", 100)]
@pytest.mark.parametrize("case", sorted(CASES))
def test_the_intersection_of_a_frame_of_another_site_follows_the_scroll_of_the_top(firefox_binary, case):
with Sites() as sites:
sites.route("A", "/page", lambda handler: TOP_IO % sites.url("B", "/io"))
sites.route("B", "/io", FRAME_IO)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
page.goto(sites.url("A", "/page"), wait_until="load", timeout=30000)
frame = wait_frame(page, sites.origin["B"], "/io", seconds=DEADLINE_S)
wait_for(page, lambda: frame.evaluate("() => document.readyState") == "complete")
vh = page.evaluate(TOP_BOX)["vh"]
for name, step_top in _steps(vh):
page.evaluate("(y) => window.scrollTo(0, y)", IO_TOP - step_top)
seen: Dict[str, Optional[Dict[str, Any]]] = {"reading": None, "box": None}
def right() -> bool:
box = page.evaluate(TOP_BOX)
seen["box"] = box
seen["reading"] = frame.evaluate(LOOK)
return _matches(seen["reading"], _expected(box["top"], box["vh"]))
wait_for(page, right)
reading, box = seen["reading"], seen["box"]
expected = _expected(box["top"], box["vh"])
where = "%s, step %r (the frame's top is %.2f in a viewport %r high): the frame read %r, from geometry the page expects %r" % (
case, name, box["top"], box["vh"], reading, expected)
assert _matches(reading, expected), where
assert reading["rootBounds"] is None, "%s; rootBounds of a frame of another site is null in stock Firefox" % where
assert (reading["box"]["w"], reading["box"]["h"]) == (FRAME_SIZE, FRAME_SIZE), "%s; the box of the target is 300x300 in the frame's own space" % where
def _scroll_so_that_the_frame_top_is(page, frame_top: float, to: float) -> None:
"""Scrolls the top so that an element at document y ``frame_top`` has its top ``to`` CSS pixels below the top of the viewport."""
page.evaluate("(y) => window.scrollTo(0, y)", frame_top - to)
@pytest.mark.parametrize("case", sorted(CASES))
def test_a_lazy_frame_loads_when_it_meets_the_viewport_it_is_told_about(firefox_binary, case):
with Sites() as sites:
sites.route("A", "/lazy-top", lambda handler: _top_lazy(100, "lazy", sites.url("B", "/leaf-top")))
sites.route("A", "/lazy-nested", lambda handler: _top_lazy(FRAME_SIZE, "eager", sites.url("B", "/host")))
sites.route("B", "/leaf-top", LEAF)
sites.route("B", "/host", lambda handler: FRAME_LAZY_HOST % sites.url("C", "/leaf-nested"))
sites.route("C", "/leaf-nested", LEAF)
with launch_case(firefox_binary, case) as browser:
page = browser.new_page()
# (a) a lazy frame of another site in the top document: 600 CSS pixels before the viewport (dom.lazy-loading.margin.*)
page.goto(sites.url("A", "/lazy-top"), wait_until="load", timeout=30000)
vh = page.evaluate(TOP_BOX)["vh"]
def requested_top() -> int:
return len(sites.seen("B", "/leaf-top"))
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh + 640)
assert observe(page, requested_top, WATCH_S) == [0], (
"%s: a lazy frame of another site whose top is 640 CSS pixels below the viewport (the margin is 600) was requested" % case)
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh + 560)
assert wait_for(page, lambda: requested_top() >= 1), (
"%s: a lazy frame of another site whose top is 560 CSS pixels below the viewport (the margin is 600) was not requested in %d s" % (case, DEADLINE_S))
# (b) a lazy frame inside a frame of another site: its box meets the remote visible rect, no margin
page.goto(sites.url("A", "/lazy-nested"), wait_until="load", timeout=30000)
wait_frame(page, sites.origin["B"], "/host", seconds=DEADLINE_S)
vh = page.evaluate(TOP_BOX)["vh"]
def requested_nested() -> int:
return len(sites.seen("C", "/leaf-nested"))
# the lazy frame is at y 200 of its host: its top is 24 below the bottom edge of the viewport when the host's top is vh - 176
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh - 200 + 24)
assert observe(page, requested_nested, WATCH_S) == [0], (
"%s: a lazy frame inside a frame of another site whose top is 24 CSS pixels below the bottom edge of the top viewport was requested" % case)
_scroll_so_that_the_frame_top_is(page, LAZY_TOP, vh - 200 - 24)
assert wait_for(page, lambda: requested_nested() >= 1), (
"%s: a lazy frame inside a frame of another site whose top is 24 CSS pixels above the bottom edge of the top viewport was not requested in %d s"
% (case, DEADLINE_S))