惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
罗磊的独立博客
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
J
Java Code Geeks
L
LangChain Blog
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten browser tab selection assertions · openclaw...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -6,6 +6,7 @@ vi.hoisted(() => {

66

});

7788

import "./server-context.chrome-test-harness.js";

9+

import { CDP_JSON_NEW_TIMEOUT_MS } from "./cdp-timeouts.js";

910

import * as cdpHelpersModule from "./cdp.helpers.js";

1011

import * as cdpModule from "./cdp.js";

1112

import { InvalidBrowserNavigationUrlError } from "./navigation-guard.js";

@@ -36,13 +37,14 @@ function seedRunningProfileState(

36373738

async function expectOldManagedTabClose(fetchMock: ReturnType<typeof vi.fn>): Promise<void> {

3839

await vi.waitFor(() => {

39-

expect(fetchMock).toHaveBeenCalledWith(

40-

expect.stringContaining("/json/close/OLD1"),

41-

expect.any(Object),

42-

);

40+

expect(fetchCallUrls(fetchMock).some((url) => url.includes("/json/close/OLD1"))).toBe(true);

4341

});

4442

}

454344+

function fetchCallUrls(fetchMock: ReturnType<typeof vi.fn>): string[] {

45+

return fetchMock.mock.calls.map(([url]) => String(url));

46+

}

47+4648

function createOldTabCleanupFetchMock(

4749

existingTabs: ReturnType<typeof makeManagedTabsWithNew>,

4850

params?: { rejectNewTabClose?: boolean },

@@ -192,10 +194,7 @@ describe("browser server-context tab selection state", () => {

192194

const opened = await openManagedTabWithRunningProfile({ fetchMock });

193195

expect(opened.targetId).toBe("NEW");

194196

await expectOldManagedTabClose(fetchMock);

195-

expect(fetchMock).not.toHaveBeenCalledWith(

196-

expect.stringContaining("/json/close/NEW"),

197-

expect.anything(),

198-

);

197+

expect(fetchCallUrls(fetchMock).some((url) => url.includes("/json/close/NEW"))).toBe(false);

199198

});

200199201200

it("does not fail tab open when managed-tab cleanup list fails", async () => {

@@ -253,10 +252,7 @@ describe("browser server-context tab selection state", () => {

253252254253

const opened = await openclaw.openTab("http://127.0.0.1:3009");

255254

expect(opened.targetId).toBe("NEW");

256-

expect(fetchMock).not.toHaveBeenCalledWith(

257-

expect.stringContaining("/json/close/"),

258-

expect.anything(),

259-

);

255+

expect(fetchCallUrls(fetchMock).some((url) => url.includes("/json/close/"))).toBe(false);

260256

});

261257262258

it("does not block openTab on slow best-effort cleanup closes", async () => {

@@ -321,19 +317,18 @@ describe("browser server-context tab selection state", () => {

321317322318

const opened = await openclaw.openTab("https://example.com");

323319

expect(opened.targetId).toBe("NEW");

324-

expect(fetchJson).toHaveBeenNthCalledWith(

325-

1,

326-

expect.stringContaining("/json/new"),

327-

expect.any(Number),

320+

const jsonNewEndpoint = "http://127.0.0.1:18800/json/new?https%3A%2F%2Fexample.com";

321+

expect(fetchJson.mock.calls[0]).toEqual([

322+

jsonNewEndpoint,

323+

CDP_JSON_NEW_TIMEOUT_MS,

328324

{ method: "PUT" },

329325

undefined,

330-

);

331-

expect(fetchJson).toHaveBeenNthCalledWith(

332-

2,

333-

expect.stringContaining("/json/new"),

334-

expect.any(Number),

326+

]);

327+

expect(fetchJson.mock.calls[1]).toEqual([

328+

jsonNewEndpoint,

329+

CDP_JSON_NEW_TIMEOUT_MS,

335330

undefined,

336331

undefined,

337-

);

332+

]);

338333

});

339334

});