aboutsummaryrefslogtreecommitdiff
path: root/test-suite/unit/background-policy.test.mjs
diff options
context:
space:
mode:
authorTianren Dong <tianrendong.dtr@gmail.com>2026-09-26 16:38:22 -0400
committerGitHub <noreply@github.com>2026-09-26 16:38:22 -0400
commitdf1472b8c777d40daa70da23115f4c8f5afb6623 (patch)
treeb1f6ddcf387edb51213a6f9f1beb011fbe5c0bd3 /test-suite/unit/background-policy.test.mjs
parent4811ee616d2bbd5ead669a7e2f33a0bb14bd43ef (diff)
parentc49dc15fa5c33d5b1d210b0185677ce29640e2d5 (diff)
Merge pull request #20 from tianrendong/feat/absorb-fork-features
Absorb fork fixes and features; release 0.15.53
Diffstat (limited to 'test-suite/unit/background-policy.test.mjs')
-rw-r--r--test-suite/unit/background-policy.test.mjs4
1 files changed, 3 insertions, 1 deletions
diff --git a/test-suite/unit/background-policy.test.mjs b/test-suite/unit/background-policy.test.mjs
index e78fa49..fe71634 100644
--- a/test-suite/unit/background-policy.test.mjs
+++ b/test-suite/unit/background-policy.test.mjs
@@ -24,7 +24,7 @@ function piHarness({ session = "alpha", send } = {}) {
let authorized = true;
const ctx = { key: `session:${session}`, title: `Pi Session: ${session}`, cwd: "/fixture", ui: { notify: (...args) => notices.push(args) } };
const bridge = {
- connected: true, status: () => ({}),
+ connected: true, status: () => ({}), connectionStatus: async () => ({ connected: true }),
async send(action, params, timeout, signal) {
calls.push({ action, params: clone(params), timeout, signal });
if (signal?.aborted) throw new Error("Chrome command aborted");
@@ -48,6 +48,7 @@ function piHarness({ session = "alpha", send } = {}) {
tabActionValues: [], snapshotModeValues: [], waitForValues: [], imageFormatValues: [],
safeJson: JSON.stringify, truncateText: (s) => s, formatChromeSnapshot: JSON.stringify,
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),
};
@@ -107,6 +108,7 @@ test("every registered page tool, tab.new, and chrome_launch(url) use the centra
["chrome_get_network_request", { requestId: "1" }, "page.network.get"], ["chrome_screenshot", {}, "page.screenshot"],
["chrome_hover", {}, "page.hover"], ["chrome_drag", {}, "page.drag"], ["chrome_tap", {}, "page.tap"],
["chrome_scroll", {}, "page.scroll"], ["chrome_upload_file", { paths: ["fixture.txt"] }, "page.upload"],
+ ["chrome_cdp", { method: "Runtime.evaluate", params: { expression: "1" } }, "cdp.call"],
];
for (const [name, params, action] of cases) {
await h.tool(name, { ...params, background: false, foreground: true });