extensions: Port content_scripts API tests to desktop Android, part 1 [chromium/src : main]

0 views
Skip to first unread message

James Cook (Gerrit)

unread,
Sep 4, 2025, 7:38:44 PM (2 days ago) Sep 4
to Zhengzheng Liu, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Zhengzheng Liu

James Cook added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
James Cook . resolved

Zhengzheng, please take a look. The tryjobs are red due to a compile failure on tip-of-trunk, not this CL. The tests all pass locally and I'll run tryjobs before landing. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Zhengzheng Liu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I47750af4f49f6dd2db6849dcc249a51973a79327
Gerrit-Change-Number: 6917485
Gerrit-PatchSet: 2
Gerrit-Owner: James Cook <jame...@chromium.org>
Gerrit-Reviewer: James Cook <jame...@chromium.org>
Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
Gerrit-Attention: Zhengzheng Liu <zhz...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Sep 2025 23:38:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Zhengzheng Liu (Gerrit)

unread,
Sep 4, 2025, 8:32:25 PM (2 days ago) Sep 4
to James Cook, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from James Cook

Zhengzheng Liu added 3 comments

File chrome/browser/extensions/content_script_apitest.cc
Line 78, Patchset 2 (Latest):
Zhengzheng Liu . unresolved

Consider adding `static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));`??

Line 1188, Patchset 2 (Latest):#if BUILDFLAG(ENABLE_EXTENSIONS)
Zhengzheng Liu . unresolved

Is it possible to merge this `#if BUILDFLAG(ENABLE_EXTENSIONS)` block to the above one? Or they are separated intentionally due to different TODOs? I have no preference, just to clarify :)

Line 2219, Patchset 2 (Latest): ntp_test_utils::SetUserSelectedDefaultSearchProvider(
Zhengzheng Liu . unresolved

I think `ntp_test_utils` is not available on Android. Maybe consider guard this piece of code behind ENABLE_EXTENSIONS?

Open in Gerrit

Related details

Attention is currently required from:
  • James Cook
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I47750af4f49f6dd2db6849dcc249a51973a79327
    Gerrit-Change-Number: 6917485
    Gerrit-PatchSet: 2
    Gerrit-Owner: James Cook <jame...@chromium.org>
    Gerrit-Reviewer: James Cook <jame...@chromium.org>
    Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
    Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
    Gerrit-Attention: James Cook <jame...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 00:32:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    James Cook (Gerrit)

    unread,
    Sep 4, 2025, 8:47:31 PM (2 days ago) Sep 4
    to Zhengzheng Liu, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Zhengzheng Liu

    James Cook voted and added 4 comments

    Votes added by James Cook

    Commit-Queue+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    James Cook . resolved

    Zhengzheng, please take another look.

    File chrome/browser/extensions/content_script_apitest.cc
    Line 78, Patchset 2:
    Zhengzheng Liu . resolved

    Consider adding `static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));`??

    James Cook

    Done. Whoops!

    Line 1188, Patchset 2:#if BUILDFLAG(ENABLE_EXTENSIONS)
    Zhengzheng Liu . resolved

    Is it possible to merge this `#if BUILDFLAG(ENABLE_EXTENSIONS)` block to the above one? Or they are separated intentionally due to different TODOs? I have no preference, just to clarify :)

    James Cook

    I kept them separate intentionally, since they are different TODOs (and this one will be deleted in the next CL).

    Line 2219, Patchset 2: ntp_test_utils::SetUserSelectedDefaultSearchProvider(
    Zhengzheng Liu . resolved

    I think `ntp_test_utils` is not available on Android. Maybe consider guard this piece of code behind ENABLE_EXTENSIONS?

    James Cook

    I'd prefer to do this in the next CL, when I'm enabling tests that use this class. Is that OK? We may have to skip the entire class but I'm not sure yet.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Zhengzheng Liu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: I47750af4f49f6dd2db6849dcc249a51973a79327
    Gerrit-Change-Number: 6917485
    Gerrit-PatchSet: 3
    Gerrit-Owner: James Cook <jame...@chromium.org>
    Gerrit-Reviewer: James Cook <jame...@chromium.org>
    Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
    Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
    Gerrit-Attention: Zhengzheng Liu <zhz...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 00:47:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Zhengzheng Liu <zhz...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zhengzheng Liu (Gerrit)

    unread,
    Sep 4, 2025, 9:11:52 PM (2 days ago) Sep 4
    to James Cook, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from James Cook

    Zhengzheng Liu voted and added 1 comment

    Votes added by Zhengzheng Liu

    Code-Review+1

    1 comment

    File chrome/browser/extensions/content_script_apitest.cc
    Line 2219, Patchset 2: ntp_test_utils::SetUserSelectedDefaultSearchProvider(
    Zhengzheng Liu . resolved

    I think `ntp_test_utils` is not available on Android. Maybe consider guard this piece of code behind ENABLE_EXTENSIONS?

    James Cook

    I'd prefer to do this in the next CL, when I'm enabling tests that use this class. Is that OK? We may have to skip the entire class but I'm not sure yet.

    Zhengzheng Liu

    I am OK with it. Please go ahead as long as the CQ run passes. 😊

    Open in Gerrit

    Related details

    Attention is currently required from:
    • James Cook
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I47750af4f49f6dd2db6849dcc249a51973a79327
      Gerrit-Change-Number: 6917485
      Gerrit-PatchSet: 3
      Gerrit-Owner: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
      Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
      Gerrit-Attention: James Cook <jame...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 01:11:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Zhengzheng Liu <zhz...@chromium.org>
      Comment-In-Reply-To: James Cook <jame...@chromium.org>
      satisfied_requirement
      open
      diffy

      James Cook (Gerrit)

      unread,
      Sep 5, 2025, 5:09:46 PM (2 days ago) Sep 5
      to Zhengzheng Liu, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

      James Cook voted and added 1 comment

      Votes added by James Cook

      Commit-Queue+2

      1 comment

      Patchset-level comments
      James Cook . resolved

      Thanks for the review!

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I47750af4f49f6dd2db6849dcc249a51973a79327
      Gerrit-Change-Number: 6917485
      Gerrit-PatchSet: 3
      Gerrit-Owner: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
      Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 21:09:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Sep 5, 2025, 5:12:23 PM (2 days ago) Sep 5
      to James Cook, Zhengzheng Liu, Achuith Bhandarkar, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      extensions: Port content_scripts API tests to desktop Android, part 1

      Support for content scripts was added very early in the desktop
      Android extensions project, before we had ExtensionBrowserTest and
      ExtensionApiTest. Thus most tests were left unported.

      Port the first half of the API tests. (I stopped at half to keep
      the CL from getting too big.) There are still several tests that
      must be skipped due to chrome.tabs dependencies, but there are a
      large number of tests we can add now.
      Bug: 441557607
      Change-Id: I47750af4f49f6dd2db6849dcc249a51973a79327
      Reviewed-by: Zhengzheng Liu <zhz...@chromium.org>
      Commit-Queue: James Cook <jame...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1511871}
      Files:
      • M chrome/browser/extensions/content_script_apitest.cc
      • M chrome/test/BUILD.gn
      Change size: M
      Delta: 2 files changed, 97 insertions(+), 34 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Zhengzheng Liu
      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: I47750af4f49f6dd2db6849dcc249a51973a79327
      Gerrit-Change-Number: 6917485
      Gerrit-PatchSet: 4
      Gerrit-Owner: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: James Cook <jame...@chromium.org>
      Gerrit-Reviewer: Zhengzheng Liu <zhz...@chromium.org>
      Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages