Add test for Network Efficiency Guardrails chunked responses [chromium/src : main]

0 views
Skip to first unread message

Luis Flores (Gerrit)

unread,
Jan 28, 2026, 1:21:42 PM (2 days ago) Jan 28
to Takashi Toyoshima, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org
Attention needed from Daniel Cheng and Takashi Toyoshima

Luis Flores added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Luis Flores . resolved

Adding test for chunked responses as discussed in previous CL 7173352. PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Takashi Toyoshima
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: Iad0b960bc07d167d860c9ad2c4abc8117e72431e
Gerrit-Change-Number: 7524412
Gerrit-PatchSet: 3
Gerrit-Owner: Luis Flores <luf...@microsoft.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Luis Flores <luf...@microsoft.com>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Wed, 28 Jan 2026 18:21:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Jan 29, 2026, 12:56:36 AM (yesterday) Jan 29
to Luis Flores, Takashi Toyoshima, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org
Attention needed from Luis Flores and Takashi Toyoshima

Daniel Cheng added 3 comments

Patchset-level comments
Daniel Cheng . unresolved

Do we have a way to verify that the resulting response is actually chunked, i.e. we don't accidentally flatten the shared buffer somewhere?

File third_party/blink/renderer/core/loader/frame_fetch_context_test.cc
Line 2123, Patchset 3 (Latest): CheckImageLoadViolation(1024 * 1024, true, /*enable_policy=*/true,
Daniel Cheng . unresolved

It would be helpful to have some explanatory comments here. I suppose it's self-documenting to people who are more familiar, but it's not self-documenting to me.

e.g.

  // expected violation because ...
File third_party/blink/renderer/platform/testing/url_test_helpers.h
Line 86, Patchset 3 (Latest):// Registers with a custom response.
Daniel Cheng . unresolved

Document the new parameter. What happens if chunk size is 0, for instance? Does that mean unchunked, i.e. the same as nullopt? Or is that not allowed?

Open in Gerrit

Related details

Attention is currently required from:
  • Luis Flores
  • Takashi Toyoshima
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: Iad0b960bc07d167d860c9ad2c4abc8117e72431e
    Gerrit-Change-Number: 7524412
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Luis Flores <luf...@microsoft.com>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 05:56:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Jan 29, 2026, 5:28:24 AM (yesterday) Jan 29
    to Luis Flores, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org
    Attention needed from Luis Flores

    Takashi Toyoshima added 2 comments

    Patchset-level comments
    Takashi Toyoshima . resolved

    Thank you for adding this.
    Overall, lgtm, but we may have some test variants (with comments)

    File third_party/blink/renderer/core/loader/frame_fetch_context_test.cc
    Line 2123, Patchset 3 (Latest): CheckImageLoadViolation(1024 * 1024, true, /*enable_policy=*/true,
    Daniel Cheng . unresolved

    It would be helpful to have some explanatory comments here. I suppose it's self-documenting to people who are more familiar, but it's not self-documenting to me.

    e.g.

      // expected violation because ...
    Takashi Toyoshima

    +1.

    Also good to keep 2 types of tests, one runs with data within a single chunk, and the other runs with multiple chunk data.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Luis Flores
    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: Iad0b960bc07d167d860c9ad2c4abc8117e72431e
    Gerrit-Change-Number: 7524412
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Luis Flores <luf...@microsoft.com>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 10:27:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Luis Flores (Gerrit)

    unread,
    Jan 29, 2026, 6:37:15 PM (yesterday) Jan 29
    to Takashi Toyoshima, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org
    Attention needed from Daniel Cheng and Takashi Toyoshima

    Luis Flores added 4 comments

    Patchset-level comments
    Daniel Cheng . unresolved

    Do we have a way to verify that the resulting response is actually chunked, i.e. we don't accidentally flatten the shared buffer somewhere?

    Luis Flores

    I have added a test checking actual call count to `DidReceiveData`.

    File-level comment, Patchset 4 (Latest):
    Luis Flores . resolved

    Addressed comments. PTAL

    File third_party/blink/renderer/core/loader/frame_fetch_context_test.cc
    Line 2123, Patchset 3: CheckImageLoadViolation(1024 * 1024, true, /*enable_policy=*/true,
    Daniel Cheng . unresolved

    It would be helpful to have some explanatory comments here. I suppose it's self-documenting to people who are more familiar, but it's not self-documenting to me.

    e.g.

      // expected violation because ...
    Takashi Toyoshima

    +1.

    Also good to keep 2 types of tests, one runs with data within a single chunk, and the other runs with multiple chunk data.

    Luis Flores

    Thanks, I've added comments for these chunking cases.

    toyoshim@ for data in a single chunk, existing cases in `FrameFetchContextNetworkGuardrailsTest.LargeImageResourceSizeLimit` already use a single chunk as default. Is this what you are referring to? or are you suggesting to have additional tests beyond those?

    File third_party/blink/renderer/platform/testing/url_test_helpers.h
    Line 86, Patchset 3:// Registers with a custom response.
    Daniel Cheng . unresolved

    Document the new parameter. What happens if chunk size is 0, for instance? Does that mean unchunked, i.e. the same as nullopt? Or is that not allowed?

    Luis Flores

    Thanks, I've added comments throughout the functions that add the parameter.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    • Takashi Toyoshima
    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: Iad0b960bc07d167d860c9ad2c4abc8117e72431e
    Gerrit-Change-Number: 7524412
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Luis Flores <luf...@microsoft.com>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 23:37:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Luis Flores (Gerrit)

    unread,
    Jan 29, 2026, 6:38:54 PM (yesterday) Jan 29
    to Takashi Toyoshima, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, blink-...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org
    Attention needed from Daniel Cheng and Takashi Toyoshima

    Luis Flores added 1 comment

    File third_party/blink/renderer/platform/testing/url_test_helpers.h
    Line 86, Patchset 3:// Registers with a custom response.
    Daniel Cheng . unresolved

    Document the new parameter. What happens if chunk size is 0, for instance? Does that mean unchunked, i.e. the same as nullopt? Or is that not allowed?

    Luis Flores

    Thanks, I've added comments throughout the functions that add the parameter.

    Luis Flores

    Also updated the parameter to simply take `size_t` in and use `0` as no chunking. Comments reflect the updated behavior.

    Gerrit-Comment-Date: Thu, 29 Jan 2026 23:38:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Luis Flores <luf...@microsoft.com>
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages