aboutsummaryrefslogtreecommitdiff
path: root/test-suite/unit/background-policy.test.mjs
diff options
context:
space:
mode:
authorTianren Dong <tianrendong.dtr@gmail.com>2026-09-26 19:07:56 -0400
committerTianren Dong <tianrendong.dtr@gmail.com>2026-09-26 19:07:56 -0400
commit238f347a03b2cefb21198bb78a90699e931d8504 (patch)
tree4c7221441428a086e93f2767a9fb332ee97c9995 /test-suite/unit/background-policy.test.mjs
parentdf1472b8c777d40daa70da23115f4c8f5afb6623 (diff)
Report hidden-tab input, append targeted typing, smarter uploads, prune screenshots; release 0.15.54
- Check page visibility before trusted input: Chrome drops input to hidden pages (inactive tabs, covered/minimized windows, macOS window tabs behind full screen). Type/key/hover/scroll/tap/drag fail fast with the reason; click/fill use their DOM fallback immediately (or reject with domFallback:false). - Use an inactive tab instead of a new window for the automation target while the user's window is full screen. - chrome_type with uid/selector moves the caret to the end (moveToEndOfDocument) after its focus click. - chrome_upload_file: labels/wrappers resolve to their file input, same-origin iframe search, and intercepted file chooser for upload buttons (trusted click when visible, user-gesture click when hidden); reject multiple paths for single-file inputs; no duplicate change event. - Prune default-folder chrome_screenshot captures (7 days, newest 20 kept, retentionDays override). - input.debug without a target no longer calls tabs.get(-1). - New hidden-input unit suite.
Diffstat (limited to 'test-suite/unit/background-policy.test.mjs')
-rw-r--r--test-suite/unit/background-policy.test.mjs3
1 files changed, 2 insertions, 1 deletions
diff --git a/test-suite/unit/background-policy.test.mjs b/test-suite/unit/background-policy.test.mjs
index fe71634..2388d78 100644
--- a/test-suite/unit/background-policy.test.mjs
+++ b/test-suite/unit/background-policy.test.mjs
@@ -50,7 +50,7 @@ function piHarness({ session = "alpha", send } = {}) {
formatChromeInspect: JSON.stringify, summarizeActionResult: () => "", formatIncludedSnapshotText: (_r, text) => text,
describeTypeEvidence: () => [], formatCdpResult: (_method, value) => ({ content: [{ type: "text", text: JSON.stringify(value) }], details: { value } }),
workspaceCwd: () => ctx.cwd, ...path,
- mkdir: async () => {}, writeFile: async (...args) => writes.push(args),
+ mkdir: async () => {}, writeFile: async (...args) => writes.push(args), pruneScreenshotDir: async () => 0,
};
const registrations = indexSource.slice(indexSource.indexOf("function registerChromeTools(pi:"), indexSource.lastIndexOf("\n}"));
vm.runInNewContext(stripTypeScriptTypes([
@@ -292,6 +292,7 @@ function workerHarness({ withWindows = true } = {}) {
w, chrome, calls, tabs, focusedWindow: () => focusedWindow,
cdpResult: (method) => method === "Page.captureScreenshot" ? { data: "c2NyZWVuc2hvdA==" }
: method === "DOM.requestNode" ? { nodeId: 1 }
+ : method === "Runtime.callFunctionOn" ? { result: { type: "object", value: { tag: "INPUT", isFile: true } } }
: { result: { type: "boolean", value: true, objectId: "file-input" } },
};
return h;