

























@@ -9,8 +9,8 @@ import "./server-context.chrome-test-harness.js";
99import * as cdpHelpersModule from "./cdp.helpers.js";
1010import * as cdpModule from "./cdp.js";
1111import { InvalidBrowserNavigationUrlError } from "./navigation-guard.js";
12-import { createBrowserRouteContext } from "./server-context.js";
1312import {
13+createTestBrowserRouteContext,
1414makeManagedTabsWithNew,
1515makeState,
1616originalFetch,
@@ -85,7 +85,7 @@ async function openManagedTabWithRunningProfile(params: {
8585global.fetch = withBrowserFetchPreconnect(params.fetchMock);
8686const state = makeState("openclaw");
8787seedRunningProfileState(state);
88-const ctx = createBrowserRouteContext({ getState: () => state });
88+const ctx = createTestBrowserRouteContext({ getState: () => state });
8989const openclaw = ctx.forProfile("openclaw");
9090return await openclaw.openTab(params.url ?? "http://127.0.0.1:3009");
9191}
@@ -117,7 +117,7 @@ describe("browser server-context tab selection state", () => {
117117118118global.fetch = withBrowserFetchPreconnect(fetchMock);
119119const state = makeState("openclaw");
120-const ctx = createBrowserRouteContext({ getState: () => state });
120+const ctx = createTestBrowserRouteContext({ getState: () => state });
121121const openclaw = ctx.forProfile("openclaw");
122122123123const opened = await openclaw.openTab("http://127.0.0.1:8080");
@@ -162,7 +162,7 @@ describe("browser server-context tab selection state", () => {
162162global.fetch = withBrowserFetchPreconnect(fetchMock);
163163const state = makeState("openclaw");
164164state.resolved.ssrfPolicy = {};
165-const ctx = createBrowserRouteContext({ getState: () => state });
165+const ctx = createTestBrowserRouteContext({ getState: () => state });
166166const openclaw = ctx.forProfile("openclaw");
167167168168const selected = await openclaw.ensureTabAvailable();
@@ -228,7 +228,7 @@ describe("browser server-context tab selection state", () => {
228228global.fetch = withBrowserFetchPreconnect(fetchMock);
229229const state = makeState("openclaw");
230230seedRunningProfileState(state);
231-const ctx = createBrowserRouteContext({ getState: () => state });
231+const ctx = createTestBrowserRouteContext({ getState: () => state });
232232const openclaw = ctx.forProfile("openclaw");
233233234234const opened = await openclaw.openTab("http://127.0.0.1:3009");
@@ -248,7 +248,7 @@ describe("browser server-context tab selection state", () => {
248248global.fetch = withBrowserFetchPreconnect(fetchMock);
249249const state = makeState("openclaw");
250250state.resolved.attachOnly = true;
251-const ctx = createBrowserRouteContext({ getState: () => state });
251+const ctx = createTestBrowserRouteContext({ getState: () => state });
252252const openclaw = ctx.forProfile("openclaw");
253253254254const opened = await openclaw.openTab("http://127.0.0.1:3009");
@@ -289,7 +289,7 @@ describe("browser server-context tab selection state", () => {
289289290290global.fetch = withBrowserFetchPreconnect(fetchMock);
291291const state = makeState("openclaw");
292-const ctx = createBrowserRouteContext({ getState: () => state });
292+const ctx = createTestBrowserRouteContext({ getState: () => state });
293293const openclaw = ctx.forProfile("openclaw");
294294295295await expect(openclaw.openTab("file:///etc/passwd")).rejects.toBeInstanceOf(
@@ -311,7 +311,7 @@ describe("browser server-context tab selection state", () => {
311311312312const state = makeState("openclaw");
313313state.resolved.ssrfPolicy = {};
314-const ctx = createBrowserRouteContext({ getState: () => state });
314+const ctx = createTestBrowserRouteContext({ getState: () => state });
315315const openclaw = ctx.forProfile("openclaw");
316316317317const opened = await openclaw.openTab("https://example.com");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。