Expand test coverage for StreamPacketSocket [chromium/src : main]

0 views
Skip to first unread message

Joe Downing (Gerrit)

unread,
Apr 21, 2026, 7:02:40 PM (2 days ago) Apr 21
to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Yuwei Huang

Joe Downing added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Joe Downing . resolved

PTAL!

Open in Gerrit

Related details

Attention is currently required from:
  • Yuwei Huang
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: Id9f796a7d6b9ebeac6e72a8dc41aec4e59a11e52
Gerrit-Change-Number: 7782873
Gerrit-PatchSet: 4
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Apr 2026 23:02:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Apr 21, 2026, 7:15:13 PM (2 days ago) Apr 21
to Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Joe Downing

Yuwei Huang voted and added 1 comment

Votes added by Yuwei Huang

Code-Review+1

1 comment

File remoting/protocol/stream_packet_socket_unittest.cc
Line 191, Patchset 4 (Latest): .WillOnce([&](net::IOBuffer* buf, int buf_len,
Yuwei Huang . unresolved

This lambda doesn't need to capture anything, so `[]` is preferred over `[&]`.

Open in Gerrit

Related details

Attention is currently required from:
  • Joe Downing
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: Id9f796a7d6b9ebeac6e72a8dc41aec4e59a11e52
    Gerrit-Change-Number: 7782873
    Gerrit-PatchSet: 4
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Joe Downing <joe...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Apr 2026 23:15:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Apr 21, 2026, 7:36:39 PM (2 days ago) Apr 21
    to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

    Joe Downing voted and added 2 comments

    Votes added by Joe Downing

    Commit-Queue+2

    2 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Joe Downing . resolved

    Thanks!

    File remoting/protocol/stream_packet_socket_unittest.cc
    Line 191, Patchset 4: .WillOnce([&](net::IOBuffer* buf, int buf_len,
    Yuwei Huang . resolved

    This lambda doesn't need to capture anything, so `[]` is preferred over `[&]`.

    Joe Downing

    Done

    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: Id9f796a7d6b9ebeac6e72a8dc41aec4e59a11e52
      Gerrit-Change-Number: 7782873
      Gerrit-PatchSet: 5
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Tue, 21 Apr 2026 23:36:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 21, 2026, 8:08:38 PM (2 days ago) Apr 21
      to Joe Downing, Yuwei Huang, chromium...@chromium.org, chromotin...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      4 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: remoting/protocol/stream_packet_socket_unittest.cc
      Insertions: 3, Deletions: 3.

      @@ -188,9 +188,9 @@

      // We expect Write to be called once.
      EXPECT_CALL(*mock_stream_socket_, Write(_, _, _, _))
      - .WillOnce([&](net::IOBuffer* buf, int buf_len,
      - net::CompletionOnceCallback callback,
      - const net::NetworkTrafficAnnotationTag&) {
      + .WillOnce([](net::IOBuffer* buf, int buf_len,
      + net::CompletionOnceCallback callback,
      + const net::NetworkTrafficAnnotationTag&) {
      return buf_len; // Return number of bytes written
      });

      ```

      Change information

      Commit message:
      Expand test coverage for StreamPacketSocket

      This CL expands the StreamPacketSocketTest suite to provide comprehensive
      coverage for the StreamPacketSocket class. The new tests verify:
      - Connection state checking (SendFailsWhenNotConnected).
      - Sending failures (SendToFailsWithAddressMismatch, SendLargePacketFails).
      - Sending successes via Write on the underlying socket (SendSuccess).
      - Proper closure behavior and cleanup (Close).
      - Setting socket options on both connected and unconnected sockets
      (SetOptionInitialized, SetOptionUninitialized).

      To facilitate testing without the network stack, this CL also introduces
      FakeStreamPacketProcessor and MockStreamSocket.
      Bug: None
      Change-Id: Id9f796a7d6b9ebeac6e72a8dc41aec4e59a11e52
      Reviewed-by: Yuwei Huang <yuw...@chromium.org>
      Commit-Queue: Joe Downing <joe...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1618559}
      Files:
      • M remoting/protocol/stream_packet_socket_unittest.cc
      Change size: M
      Delta: 1 file changed, 188 insertions(+), 3 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Yuwei Huang
      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: Id9f796a7d6b9ebeac6e72a8dc41aec4e59a11e52
      Gerrit-Change-Number: 7782873
      Gerrit-PatchSet: 6
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages