blink: Add APIs to test WebMCP [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Oct 22, 2025, 11:11:26 PM (10 days ago) Oct 22
to Khushal Sagar, David Bokan, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from David Bokan

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/script_tools/model_context.h
Line 46, Patchset 1 (Latest): void set_tools_changed_callback(std::optional<base::RepeatingClosure> cb) {
AI Code Reviewer . unresolved

Function names should use `CamelCase()` starting with an uppercase letter. As this is a setter, it should be named `SetToolsChangedCallback`. (Blink Style Guide: Naming - Use 'CamelCase' for all function names; Precede setters with the word “Set”)

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention is currently required from:
  • David Bokan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
Gerrit-Change-Number: 7077518
Gerrit-PatchSet: 1
Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: David Bokan <bo...@chromium.org>
Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: David Bokan <bo...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Oct 2025 03:11:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Khushal Sagar (Gerrit)

unread,
Oct 22, 2025, 11:11:31 PM (10 days ago) Oct 22
to David Bokan, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from David Bokan

Khushal Sagar voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • David Bokan
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
    Gerrit-Change-Number: 7077518
    Gerrit-PatchSet: 1
    Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Reviewer: David Bokan <bo...@chromium.org>
    Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: David Bokan <bo...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Oct 2025 03:11:20 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Bokan (Gerrit)

    unread,
    Oct 23, 2025, 3:16:34 PM (10 days ago) Oct 23
    to Khushal Sagar, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Khushal Sagar

    David Bokan voted and added 4 comments

    Votes added by David Bokan

    Code-Review+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 1 (Latest):
    David Bokan . resolved

    lgtm % fixing failures

    Commit Message
    Line 9, Patchset 1 (Latest):Add hooks that can be used to test WebMCP tools. The APIs list and
    David Bokan . unresolved

    maybe mention that it's for live/extension testing since a reader would normally expect it's for e.g. web/WPT tests in which case the question would be why not user something like internals?

    File third_party/blink/renderer/core/script_tools/model_context.h
    Line 46, Patchset 1 (Latest): void set_tools_changed_callback(std::optional<base::RepeatingClosure> cb) {
    AI Code Reviewer . unresolved

    Function names should use `CamelCase()` starting with an uppercase letter. As this is a setter, it should be named `SetToolsChangedCallback`. (Blink Style Guide: Naming - Use 'CamelCase' for all function names; Precede setters with the word “Set”)

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

    This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    David Bokan

    +1 I think this is a difference between Blink and Chromium

    File third_party/blink/web_tests/fast/webmcp/execute_tool.html
    Line 31, Patchset 1 (Latest): testRunner.dumpAsText();
    David Bokan . unresolved

    Eh, maybe not worth rewriting but any reason not to use testharness.js? I thought test runner is effectively deprecated?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Khushal Sagar
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
      Gerrit-Change-Number: 7077518
      Gerrit-PatchSet: 1
      Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Reviewer: David Bokan <bo...@chromium.org>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Oct 2025 19:16:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Khushal Sagar (Gerrit)

      unread,
      Oct 24, 2025, 3:16:11 AM (9 days ago) Oct 24
      to David Bokan, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

      Khushal Sagar voted and added 3 comments

      Votes added by Khushal Sagar

      Auto-Submit+1
      Commit-Queue+2

      3 comments

      Commit Message
      Line 9, Patchset 1:Add hooks that can be used to test WebMCP tools. The APIs list and
      David Bokan . resolved

      maybe mention that it's for live/extension testing since a reader would normally expect it's for e.g. web/WPT tests in which case the question would be why not user something like internals?

      Khushal Sagar

      Done

      File third_party/blink/renderer/core/script_tools/model_context.h
      Line 46, Patchset 1: void set_tools_changed_callback(std::optional<base::RepeatingClosure> cb) {
      AI Code Reviewer . resolved

      Function names should use `CamelCase()` starting with an uppercase letter. As this is a setter, it should be named `SetToolsChangedCallback`. (Blink Style Guide: Naming - Use 'CamelCase' for all function names; Precede setters with the word “Set”)

      To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
      **Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason

      This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent).AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve.[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

      David Bokan

      +1 I think this is a difference between Blink and Chromium

      Khushal Sagar

      Done

      File third_party/blink/web_tests/fast/webmcp/execute_tool.html
      Line 31, Patchset 1: testRunner.dumpAsText();
      David Bokan . resolved

      Eh, maybe not worth rewriting but any reason not to use testharness.js? I thought test runner is effectively deprecated?

      Khushal Sagar

      I copied from an existing test. :)

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
        Gerrit-Change-Number: 7077518
        Gerrit-PatchSet: 3
        Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: David Bokan <bo...@chromium.org>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Comment-Date: Fri, 24 Oct 2025 07:15:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Comment-In-Reply-To: David Bokan <bo...@chromium.org>
        satisfied_requirement
        open
        diffy

        David Bokan (Gerrit)

        unread,
        Oct 24, 2025, 2:40:35 PM (9 days ago) Oct 24
        to Khushal Sagar, AyeAye, Chromium LUCI CQ, AI Code Reviewer, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Khushal Sagar

        David Bokan voted

        Code-Review+1
        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Khushal Sagar
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
        Gerrit-Change-Number: 7077518
        Gerrit-PatchSet: 4
        Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: David Bokan <bo...@chromium.org>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Oct 2025 18:40:27 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Oct 24, 2025, 4:40:22 PM (9 days ago) Oct 24
        to Khushal Sagar, David Bokan, AyeAye, AI Code Reviewer, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        blink: Add APIs to test WebMCP


        Add hooks that can be used to test WebMCP tools. The APIs list and
        execute registered tools and also register a callback to invoke when the
        set of tools changes.

        This allows testing tools from an extension by injecting script.
        Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
        Commit-Queue: David Bokan <bo...@chromium.org>
        Reviewed-by: David Bokan <bo...@chromium.org>
        Auto-Submit: Khushal Sagar <khusha...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1535280}
        Files:
        • M android_webview/test/data/web_tests/webexposed/global-interface-listing-expected.txt
        • M third_party/blink/renderer/bindings/generated_in_core.gni
        • M third_party/blink/renderer/bindings/idl_in_core.gni
        • M third_party/blink/renderer/core/script_tools/build.gni
        • M third_party/blink/renderer/core/script_tools/model_context.cc
        • M third_party/blink/renderer/core/script_tools/model_context.h
        • M third_party/blink/renderer/core/script_tools/model_context_supplement.cc
        • M third_party/blink/renderer/core/script_tools/model_context_supplement.h
        • M third_party/blink/renderer/core/script_tools/model_context_supplement.idl
        • A third_party/blink/renderer/core/script_tools/model_context_testing.cc
        • A third_party/blink/renderer/core/script_tools/model_context_testing.h
        • A third_party/blink/renderer/core/script_tools/model_context_testing.idl
        • M third_party/blink/renderer/platform/runtime_enabled_features.json5
        • A third_party/blink/web_tests/fast/webmcp/execute_tool-expected.txt
        • A third_party/blink/web_tests/fast/webmcp/execute_tool.html
        • A third_party/blink/web_tests/fast/webmcp/list_tools-expected.txt
        • A third_party/blink/web_tests/fast/webmcp/list_tools.html
        • A third_party/blink/web_tests/fast/webmcp/tools_changed-expected.txt
        • A third_party/blink/web_tests/fast/webmcp/tools_changed.html
        • M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
        Change size: L
        Delta: 20 files changed, 653 insertions(+), 1 deletion(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by David Bokan
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib4a3b5c30935797a8881cf76d9166aea586f2368
        Gerrit-Change-Number: 7077518
        Gerrit-PatchSet: 5
        Gerrit-Owner: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: David Bokan <bo...@chromium.org>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages