[wpt-sync] Sync PR 59599 - WebMCP: 2/N Permissions policy and cross-origin iframe tool support
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox152 fixed)
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 59599 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/59599
Details from upstream follow.
Dominic Farolino <dom@chromium.org> wrote:
WebMCP: 2/N Permissions policy and cross-origin iframe tool support
This CL implements ModelContext's
getTools()method, and integrates it
with the permission policy work from https://crrev.com/c/7764073. The
list of tools that thegetTools()Promise resolves to is dictated by
theexposedToorigins array for each tool in the tree. See 1 for
more information. This involves a new IPC on LocalFrameHost:
GetScriptTools()which returns an appropriately filtered list of tools
suitable for the caller.Additionally, this CL adds a TON of tests. This CL does not include
tests for the declarative API, those will come in a follow-up CL, to
avoid bloating this one too much.Follow-up CLs will:
- Remove
ModelContextTesting::listTools()and update each test to
usegetTools()instead.- Implement cross-origin iframe tool execution.
- This will involve exposing
WindowProxyandoriginon the
RegisteredTooldictionary, which this CL avoids for now.R=mfoltz
Bug: 506393880,489045948
Change-Id: I8af48097f48aa38e3d1b885e4c6910157c82d854
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7800264
Commit-Queue: Dominic Farolino \<dom@chromium.org>
Reviewed-by: Mark Foltz \<mfoltz@chromium.org>
Reviewed-by: Alex Moshchuk \<alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1624230}
| Assignee | ||
Comment 1•13 days ago
|
||
PR 59599 applied with additional changes from upstream: cc0733058f91a94a68bb439e259baea1615c2e76
| Assignee | ||
Comment 2•13 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/#/jobs?repo=try&revision=73600569eb7ff0da0dbae0a85f5087eaf207d774
| Assignee | ||
Comment 3•12 days ago
|
||
CI Results
Ran 8 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 19 tests and 1 subtests
Status Summary
Firefox
OK : 9[GitHub] 17[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 6
FAIL : 20[GitHub] 27[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
TIMEOUT: 3[Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug] 4[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt, GitHub]
Chrome
OK : 7
PASS : 2
FAIL : 7
TIMEOUT: 8
NOTRUN : 9
Safari
OK : 9
FAIL : 20
TIMEOUT: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /webmcp/declarative/toolchange-on-control-add-remove.https.html [wpt.fyi]
- Test that toolchange event fires when controls are added or removed:
FAIL(Chrome:FAIL, Safari:FAIL)
- Test that toolchange event fires when controls are added or removed:
- /webmcp/declarative/toolchange-on-name-change.https.html [wpt.fyi]
- Test that toolchange event fires on various mutations of form controls:
FAIL(Chrome:FAIL, Safari:FAIL)
- Test that toolchange event fires on various mutations of form controls:
- /webmcp/imperative/detached-frame-getTools.https.html [wpt.fyi]
- getTools() throws
InvalidStateErrorin detached frame:FAIL(Chrome:FAIL, Safari:FAIL)
- getTools() throws
- /webmcp/imperative/detached-frame-registerTool.https.html [wpt.fyi]
- Regardless of whether Navigator's modelContext object has been allocatedits getter always returns null after the document has been detached:
FAIL(Chrome:PASS, Safari:FAIL) - registerTool() throws
InvalidStateErrorin detached frame:FAIL(Chrome:PASS, Safari:FAIL)
- Regardless of whether Navigator's modelContext object has been allocatedits getter always returns null after the document has been detached:
- /webmcp/imperative/duplicate_tool_registration.https.window.html [wpt.fyi]
- duplicate tool registration is invalid.:
FAIL
- duplicate tool registration is invalid.:
- /webmcp/imperative/exposedTo-cross-origin-child.https.html [wpt.fyi]:
TIMEOUT(Chrome:TIMEOUT, Safari:TIMEOUT)- Parent exposes tool to cross-origin child:
FAIL(Chrome:TIMEOUT, Safari:FAIL) - Cross-origin child exposes tool to parent:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Parent exposes tool to origin that is neither its own nor its iframe's:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Iframe exposes tool to origin that is neither its own nor its parent's:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Cross-origin iframe without permissions policy does not receive toolchange event even if exposed to it:
TIMEOUT(Chrome:NOTRUN, Safari:TIMEOUT)
- Parent exposes tool to cross-origin child:
- /webmcp/imperative/exposedTo-defaults-cross-origin.https.html [wpt.fyi]
- Parent tool with no exposedTo array is not visible to cross-origin iframe:
FAIL(Chrome:TIMEOUT, Safari:FAIL) - Parent tool with empty exposedTo array is not visible to cross-origin iframe:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Cross-origin iframe tool with default exposure is not visible to parent:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Cross-origin iframe tool with empty exposedTo array is not visible to parent:
FAIL(Chrome:NOTRUN, Safari:FAIL)
- Parent tool with no exposedTo array is not visible to cross-origin iframe:
- /webmcp/imperative/exposedTo-defaults-same-origin.https.html [wpt.fyi]
- Parent tool with missing
exposedToarray is visible to same-origin iframe:FAIL(Chrome:FAIL, Safari:FAIL) - Parent tool with empty
exposedToarray is visible to same-origin iframe:FAIL(Chrome:TIMEOUT, Safari:FAIL) - Same-origin iframe tool with default exposure is visible to parent:
FAIL(Chrome:NOTRUN, Safari:FAIL) - Same-origin iframe tool with empty exposedTo array is visible to parent:
FAIL(Chrome:NOTRUN, Safari:FAIL)
- Parent tool with missing
- /webmcp/imperative/exposedTo-invalid-origins.https.html [wpt.fyi]
- registerTool() throws SecurityError for invalid or non-HTTPS origins in exposedTo:
FAIL(Chrome:FAIL, Safari:FAIL)
- registerTool() throws SecurityError for invalid or non-HTTPS origins in exposedTo:
- /webmcp/imperative/exposedTo-multiple-children.https.html [wpt.fyi]:
TIMEOUT(Chrome:TIMEOUT, Safari:TIMEOUT)- Multi-origin setup with mixed exposure lists:
TIMEOUT(Chrome:TIMEOUT, Safari:TIMEOUT)
- Multi-origin setup with mixed exposure lists:
- /webmcp/imperative/exposedTo-window-open.https.html [wpt.fyi]
- Tools are scoped to a frame tree, and are not exposed across opener boundaries.:
FAIL(Chrome:FAIL, Safari:FAIL)
- Tools are scoped to a frame tree, and are not exposed across opener boundaries.:
- /webmcp/imperative/model_context.https.window.html [wpt.fyi]
- navigator.modelContext instanceof ModelContext:
FAIL
- navigator.modelContext instanceof ModelContext:
- /webmcp/imperative/permissions-policy.https.html [wpt.fyi]
- registerTool() throws in iframe, after navigation to an origin not covered by permissions policy:
FAIL(Chrome:FAIL, Safari:FAIL)
- registerTool() throws in iframe, after navigation to an origin not covered by permissions policy:
- /webmcp/imperative/register_tool_no_schema.https.window.html [wpt.fyi]
- register tool with only required params:
FAIL
- register tool with only required params:
- /webmcp/imperative/register_tool_with_empty_annotation.https.window.html [wpt.fyi]
- register tool with empty annotations:
FAIL
- register tool with empty annotations:
- /webmcp/imperative/register_tool_with_schema.https.window.html [wpt.fyi]
- register and unregister script tool:
FAIL - registerTool succeeds when inputSchema.toJSON() returns 'undefined':
FAIL
- register and unregister script tool:
- /webmcp/imperative/same-origin-iframe-registerTool-regression.https.html [wpt.fyi]
- registerTool() does not throw in connected same-origin iframe navigated away of about:blank:
FAIL
- registerTool() does not throw in connected same-origin iframe navigated away of about:blank:
Comment 5•9 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c79c5ec4b117
https://hg.mozilla.org/mozilla-central/rev/ff7d12a5ffd8
Description
•