mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
fix(vom): add fixtures, remove fixed canvas numbers under budget, improve efficiency
This commit is contained in:
@@ -77,4 +77,14 @@ describe("RefStore", () => {
|
||||
expect(s.resolveEntry("e1")?.capabilities).toEqual(["screenshot"]);
|
||||
expect(s.resolveEntry("e2")?.capabilities).toEqual(["screenshot"]);
|
||||
});
|
||||
|
||||
it("copies caller-owned capability arrays", () => {
|
||||
const s = new RefStore();
|
||||
const capabilities: Array<"interact" | "screenshot"> = ["screenshot"];
|
||||
s.set("e1", 42, { tabId: 7, capabilities });
|
||||
|
||||
capabilities.push("interact");
|
||||
|
||||
expect(s.resolveEntry("e1")?.capabilities).toEqual(["screenshot"]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ function capabilitiesFor(
|
||||
capabilities: RefCapability[] | undefined,
|
||||
): RefCapability[] {
|
||||
if (kind === "surface") return ["screenshot"];
|
||||
return capabilities ?? ["interact", "screenshot"];
|
||||
return capabilities ? [...capabilities] : ["interact", "screenshot"];
|
||||
}
|
||||
|
||||
export class RefStore {
|
||||
|
||||
Reference in New Issue
Block a user