Add Browser.addMockCamera DevTools command [chromium/src : main]

0 views
Skip to first unread message

Minju Kim (Gerrit)

unread,
Aug 10, 2026, 8:18:08 PM (9 days ago) Aug 10
to android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
Attention needed from Minju Kim

Message from Minju Kim

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Minju Kim
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
Gerrit-Change-Number: 8213640
Gerrit-PatchSet: 1
Gerrit-Owner: Minju Kim <mk...@igalia.com>
Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
Gerrit-Attention: Minju Kim <mk...@igalia.com>
Gerrit-Comment-Date: Tue, 11 Aug 2026 00:17:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Rudenko (Gerrit)

unread,
Aug 11, 2026, 1:23:58 AM (8 days ago) Aug 11
to Minju Kim, Ilya Nikolaevskiy, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
Attention needed from Ilya Nikolaevskiy and Minju Kim

Alex Rudenko added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Alex Rudenko . resolved

Thanks for the CL. Is there a design doc for the CDP changes or the overall feature?

Open in Gerrit

Related details

Attention is currently required from:
  • Ilya Nikolaevskiy
  • Minju Kim
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
Gerrit-Change-Number: 8213640
Gerrit-PatchSet: 5
Gerrit-Owner: Minju Kim <mk...@igalia.com>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
Gerrit-Attention: Ilya Nikolaevskiy <il...@chromium.org>
Gerrit-Comment-Date: Tue, 11 Aug 2026 05:23:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Rudenko (Gerrit)

unread,
Aug 11, 2026, 1:24:20 AM (8 days ago) Aug 11
to Minju Kim, Ilya Nikolaevskiy, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
Attention needed from Ilya Nikolaevskiy and Minju Kim

Alex Rudenko added 1 comment

Patchset-level comments
Alex Rudenko . unresolved

Thanks for the CL. Is there a design doc for the CDP changes or the overall feature?

Alex Rudenko

(unresolved)

Open in Gerrit

Related details

Attention is currently required from:
  • Ilya Nikolaevskiy
  • Minju Kim
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 5
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Aug 2026 05:24:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ilya Nikolaevskiy (Gerrit)

    unread,
    Aug 11, 2026, 4:18:19 AM (8 days ago) Aug 11
    to Minju Kim, Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Minju Kim

    Ilya Nikolaevskiy added 1 comment

    File content/browser/devtools/protocol/browser_handler.cc
    Line 708, Patchset 5 (Latest): base::StrCat({"Browser.addMockCamera requires --",
    Ilya Nikolaevskiy . unresolved

    It doesn't seem to be the requirement of the tool. True, in tests we might want to disable real cameras. But that's a separate matter, not related to the tool itself.

    Is there any reason I'm missing here?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Minju Kim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 5
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Minju Kim <mk...@igalia.com>
    Gerrit-Comment-Date: Tue, 11 Aug 2026 08:17:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Minju Kim (Gerrit)

    unread,
    Aug 12, 2026, 1:55:41 AM (7 days ago) Aug 12
    to Ilya Nikolaevskiy, Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Alex Rudenko and Ilya Nikolaevskiy

    Minju Kim voted and added 3 comments

    Votes added by Minju Kim

    Commit-Queue+1

    3 comments

    Patchset-level comments
    Alex Rudenko . unresolved

    Thanks for the CL. Is there a design doc for the CDP changes or the overall feature?

    Alex Rudenko

    (unresolved)

    Minju Kim

    There is no standalone design doc yet. I added an update to
    crbug.com/489736656 describing the current architecture and planned CL split.

    Would that be sufficient as the design context for this CL? I plan to prepare a
    short design note before adding remove/reset/get commands and WebDriver session
    lifecycle support. Please let me know if you would prefer the design note
    before this CL lands.

    File-level comment, Patchset 7 (Latest):
    Minju Kim . resolved

    Thanks for the review.

    File content/browser/devtools/protocol/browser_handler.cc
    Line 708, Patchset 5: base::StrCat({"Browser.addMockCamera requires --",
    Ilya Nikolaevskiy . resolved

    It doesn't seem to be the requirement of the tool. True, in tests we might want to disable real cameras. But that's a separate matter, not related to the tool itself.

    Is there any reason I'm missing here?

    Minju Kim

    You're right. I removed the switch requirement from Browser.addMockCamera. PTAL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Rudenko
    • Ilya Nikolaevskiy
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 7
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Attention: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Comment-Date: Wed, 12 Aug 2026 05:55:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
    Comment-In-Reply-To: Ilya Nikolaevskiy <il...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Rudenko (Gerrit)

    unread,
    Aug 12, 2026, 3:33:47 AM (7 days ago) Aug 12
    to Minju Kim, Ilya Nikolaevskiy, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Ilya Nikolaevskiy and Minju Kim

    Alex Rudenko added 7 comments

    Commit Message
    Line 24, Patchset 7 (Latest):This is a follow-up to https://crrev.com/c/7991297, which added the
    Alex Rudenko . unresolved

    Is this change motivated by any WebDriver spec? Could you link it in in the CL description plese?

    File content/browser/devtools/protocol/browser_handler.cc
    Line 130, Patchset 7 (Latest): mock_capture_device_controller_.reset();
    Alex Rudenko . unresolved

    could we add a test verifying that the mock is cleaned up fully if the CDP session disconnects?

    Line 703, Patchset 7 (Latest):Response BrowserHandler::AddMockCamera(const std::string& device_id) {
    Alex Rudenko . unresolved

    Let's make sure this is only available to browser targets (agent host type == browser). This currently seems to affect global state and we do not want to expose it to DevTools frontend or other page-scoped clients.

    File content/browser/devtools/protocol/browser_mock_camera_browsertest.cc
    Line 21, Patchset 7 (Latest):class MockCameraDevToolsProtocolTest : public DevToolsProtocolTest {
    Alex Rudenko . unresolved

    does it need to be a browser test? could we convert it to an inspector-protocol test https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/http/tests/inspector-protocol/browser/?

    Line 140, Patchset 7 (Latest):// TODO(crbug.com/40781953): This test is flakey on macOS.
    Alex Rudenko . unresolved

    why is it flaky on MacOS?

    File third_party/blink/public/devtools_protocol/domains/Browser.pdl
    Line 228, Patchset 7 (Latest): # Adds a mock camera for test automation.
    Alex Rudenko . unresolved

    Does this command require any command args to work? Let's document them.

    Line 229, Patchset 7 (Latest): experimental command addMockCamera
    Alex Rudenko . unresolved

    is the command scoped per page/frame or is it global? Can we make it frame-specific and more to the Page domain?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ilya Nikolaevskiy
    • Minju Kim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 7
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Comment-Date: Wed, 12 Aug 2026 07:33:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ilya Nikolaevskiy (Gerrit)

    unread,
    Aug 12, 2026, 4:47:36 AM (7 days ago) Aug 12
    to Minju Kim, Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Minju Kim

    Ilya Nikolaevskiy voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Minju Kim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 7
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Minju Kim <mk...@igalia.com>
    Gerrit-Comment-Date: Wed, 12 Aug 2026 08:47:18 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ilya Nikolaevskiy (Gerrit)

    unread,
    8:07 AM (2 hours ago) 8:07 AM
    to Minju Kim, Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Minju Kim

    Ilya Nikolaevskiy voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Minju Kim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 16
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Minju Kim <mk...@igalia.com>
    Gerrit-Comment-Date: Wed, 19 Aug 2026 12:07:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Minju Kim (Gerrit)

    unread,
    9:05 AM (1 hour ago) 9:05 AM
    to Ilya Nikolaevskiy, Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org
    Attention needed from Alex Rudenko

    Minju Kim added 8 comments

    Patchset-level comments
    File-level comment, Patchset 16 (Latest):
    Minju Kim . resolved

    Thanks so much for review. Please take another look!

    Commit Message
    Line 24, Patchset 7:This is a follow-up to https://crrev.com/c/7991297, which added the
    Alex Rudenko . resolved

    Is this change motivated by any WebDriver spec? Could you link it in in the CL description plese?

    Minju Kim

    Done

    File content/browser/devtools/protocol/browser_handler.cc
    Line 130, Patchset 7: mock_capture_device_controller_.reset();
    Alex Rudenko . resolved

    could we add a test verifying that the mock is cleaned up fully if the CDP session disconnects?

    Minju Kim

    Done. I have added [add-mock-camera-device-list.js](https://chromium-review.googlesource.com/c/chromium/src/+/8213640/14/third_party/blink/web_tests/http/tests/inspector-protocol/browser/add-mock-camera-device-list.js), which creates a mock camera through a browser-target CDP session, disconnects that session, and waits until the camera is removed from enumerateDevices()

    Line 703, Patchset 7:Response BrowserHandler::AddMockCamera(const std::string& device_id) {
    Alex Rudenko . resolved

    Let's make sure this is only available to browser targets (agent host type == browser). This currently seems to affect global state and we do not want to expose it to DevTools frontend or other page-scoped clients.

    Minju Kim

    Done

    File content/browser/devtools/protocol/browser_mock_camera_browsertest.cc
    Line 21, Patchset 7:class MockCameraDevToolsProtocolTest : public DevToolsProtocolTest {
    Alex Rudenko . resolved

    does it need to be a browser test? could we convert it to an inspector-protocol test https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/http/tests/inspector-protocol/browser/?

    Minju Kim

    Done

    Line 140, Patchset 7:// TODO(crbug.com/40781953): This test is flakey on macOS.
    Alex Rudenko . unresolved

    why is it flaky on MacOS?

    Minju Kim

    The open test [add-mock-camera-open.js](https://chromium-review.googlesource.com/c/chromium/src/+/8213640/14/third_party/blink/web_tests/http/tests/inspector-protocol/browser/add-mock-camera-open.js) exposes a macOS-specific buffer-handle mismatch. The capture client requests a GpuMemoryBuffer, while the shared-memory virtual device provides an UnsafeShmemRegion, causing BroadcastingReceiver::CloneBufferHandle() to crash. I couldn’t confirm that the existing flake issue covers this exact failure, so I’ll track it separately. Please check [here](https://chromium-review.googlesource.com/c/chromium/src/+/8213640/15/third_party/blink/web_tests/TestExpectations)

    File third_party/blink/public/devtools_protocol/domains/Browser.pdl
    Line 228, Patchset 7: # Adds a mock camera for test automation.
    Alex Rudenko . resolved

    Does this command require any command args to work? Let's document them.

    Minju Kim

    Done.

    Line 229, Patchset 7: experimental command addMockCamera
    Alex Rudenko . resolved

    is the command scoped per page/frame or is it global? Can we make it frame-specific and more to the Page domain?

    Minju Kim

    It’s shared across pages in the browser rather than tied to a specific page or frame. Since the video-capture service currently uses a single virtual-device registry, I kept it in the Browser domain. The device is cleaned up when the DevTools session that created it disconnects.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Rudenko
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I243fdf8d2c78b2332350ff4547bcff3bdb3c5713
    Gerrit-Change-Number: 8213640
    Gerrit-PatchSet: 16
    Gerrit-Owner: Minju Kim <mk...@igalia.com>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Ilya Nikolaevskiy <il...@chromium.org>
    Gerrit-Reviewer: Minju Kim <mk...@igalia.com>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Comment-Date: Wed, 19 Aug 2026 13:05:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages