aboutsummaryrefslogtreecommitdiff
path: root/test-suite/unit/automation-target.test.mjs
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-11-14 09:15:15 +0000
committerIgor Soarez <igor@soarez.org>2026-11-14 09:15:34 +0000
commita76fbc3b9b82038ab44c04d6379cc2d45e5cecd8 (patch)
tree7cf7425cfbca05a99b42198f78ff3fcf1a6eb5d8 /test-suite/unit/automation-target.test.mjs
parente18559a1240219b977ffc7da2076c09cd96d1dad (diff)
tabs: one window for every agent; inactive tabs take input; background off by default
Measured in Brave on 2026-11-14: an inactive tab takes trusted CDP clicks, key presses, text and mouse moves, and Page.captureScreenshot renders it live. Only mouseWheel hangs, waiting for a frame. The upstream guard that refused input to every hidden page was wrong for inactive tabs, and it is what made a window per session look necessary. - New sessions' tabs open inactive in the user's last focused window, in the session's tab group; a window is created only when none is open. - New groups start collapsed, unless their tab is the one showing, and expand when a tab in them is brought forward. Existing groups keep the user's setting. - Input is refused up front only in a minimized window (untested there). - chrome_scroll scrolls hidden pages by script instead of the wheel. - Focus emulation on attach, so blur-sensitive menus stay open. - Background mode is off by default. Calls still default to background; background:false or chrome_tab activate brings a tab forward. - Agent guidance, tool descriptions and docs say so.
Diffstat (limited to 'test-suite/unit/automation-target.test.mjs')
-rw-r--r--test-suite/unit/automation-target.test.mjs4
1 files changed, 4 insertions, 0 deletions
diff --git a/test-suite/unit/automation-target.test.mjs b/test-suite/unit/automation-target.test.mjs
index 73fbc77..1ac3fd6 100644
--- a/test-suite/unit/automation-target.test.mjs
+++ b/test-suite/unit/automation-target.test.mjs
@@ -9,6 +9,10 @@
// Like csp-eval.test.mjs we load the *real* worker into a vm sandbox with a stateful chrome.*
// mock, then exercise the real helpers and the real dispatch() paths. Chrome state (tabs/windows/
// storage.session) can be shared across two sandbox loads to simulate a service-worker restart.
+//
+// Its chrome.windows mock has no getLastFocused, so the worker takes the path for a browser with no
+// window to share and gives each target a window of its own. Placement in the user's window is
+// covered by user-window.test.mjs.
import vm from "node:vm";
import fs from "node:fs";