Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runner/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
# Automation cohorts opt into on-demand layout explicitly.
"launch_profile_args": {
"all_resources": ("--resource",),
"browser_automation": ("--enable-automation",),
},
},
"lightpanda": {
Expand Down
19 changes: 17 additions & 2 deletions tasks/L1/raw_cdp/v2_diag_layoutmetrics_viewport.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{
"artifact_profile": "l1_standard",
"chrome_gate": "off",
"description": "[diagnostic lane] This method is on the real framework main path (on_framework_main_path); routed to the diagnostic lane per bench policy. Page.getLayoutMetrics viewport consistency: cssLayoutViewport.clientWidth, cssContentSize.width and the (deprecated) layoutViewport.clientWidth must all agree (780 under the pinned Chrome headless viewport).",
"description": "Sets an explicit 780\u00d7600 CSS viewport with DPR 1, then checks layout/content/visual viewport widths. This removes platform-dependent headless window defaults from the contract.",
"driver": {
"kind": "raw_cdp",
"steps": [
{
"method": "Emulation.setDeviceMetricsOverride",
"params": {
"width": 780,
"height": 600,
"deviceScaleFactor": 1,
"mobile": false
}
},
{
"method": "Page.getLayoutMetrics",
"save_result_as": "lm"
Expand Down Expand Up @@ -34,6 +43,12 @@
"kind": "saved_path_equals",
"name": "lm",
"path": "layoutViewport.clientWidth"
},
{
"expected": 780,
"kind": "saved_path_equals",
"name": "lm",
"path": "cssVisualViewport.clientWidth"
}
],
"kind": "inline_assertions"
Expand All @@ -50,7 +65,7 @@
"version.v0_2"
],
"task_id": "v2_diag_layoutmetrics_viewport",
"task_version": 1,
"task_version": 2,
"timeouts": {
"hard_kill_ms": 30000,
"task_ms": 15000
Expand Down
17 changes: 15 additions & 2 deletions test/test_unit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def test_moli_all_resources_profile_enables_full_resource_fetch():
]


def test_browser_automation_profile_is_chrome_only():
def test_chrome_browser_automation_profile_is_opt_in():
automation = runner_run.chrome_launch_command(
pathlib.Path("/tmp/chrome"),
9336,
Expand All @@ -459,7 +459,20 @@ def test_browser_automation_profile_is_chrome_only():
assert "--enable-automation" in automation
assert "--enable-automation" not in default
assert automation[-1] == "about:blank"
assert runner_run.engine_serve_args("moli", "browser_automation") == ()


@pytest.mark.parametrize("engine", ["moli", "lightpanda", "obscura"])
def test_browser_automation_profile_only_enables_supported_serve_engines(engine):
binary = pathlib.Path("/tmp") / engine
default = runner_run.serve_engine_launch_command(engine, binary, 9333)
automation = runner_run.serve_engine_launch_command(
engine, binary, 9333, "browser_automation"
)
assert "--enable-automation" not in default
if engine == "moli":
assert automation == [*default, "--enable-automation"]
else:
assert automation == default


def test_serve_command_keeps_engine_specific_flags_isolated():
Expand Down
Loading