[Extensions] Add tests for call order of manifest handlers [chromium/src : main]

0 views
Skip to first unread message

Anton Bershanskyi (Gerrit)

unread,
May 28, 2026, 10:42:07 AM (4 days ago) May 28
to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin

Anton Bershanskyi added 2 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Anton Bershanskyi . resolved

Hi Devlin,
this CL adds a few tests validating the call order of `extensions::ParseAppURLs()` and `AppLaunchInfo::Parse()`. I would like to land it before landing CL 7863620 to ensure that CL 7863620 has no behavioral changes.
Also, I would like to delete `AppLaunchInfo::OverrideLaunchURL()` which is not used any more. If you prefer, we can remove `AppLaunchInfo::OverrideLaunchURL()` in a separate CL 7879908 or together within this CL.

File chrome/common/extensions/manifest_handlers/app_launch_info.cc
Line 238, Patchset 2 (Parent):void AppLaunchInfo::OverrideLaunchURL(Extension* extension,
Anton Bershanskyi . resolved

This CL is a super-set of CL 7879908. Devlin, if you are fine with removing `AppLaunchInfo::OverrideLaunchURL()` in this CL together with adding these tests, I can close CL 7879908 in favor of this CL.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: I09984ac13aba67b6598b744c10951297321040e1
Gerrit-Change-Number: 7882139
Gerrit-PatchSet: 4
Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Thu, 28 May 2026 14:41:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
May 28, 2026, 2:35:02 PM (4 days ago) May 28
to Anton Bershanskyi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Anton Bershanskyi

Devlin Cronin voted and added 2 comments

Votes added by Devlin Cronin

Code-Review+1

2 comments

Patchset-level comments
Devlin Cronin . resolved

Thanks, Anton! LGTM, and I'm fine removing the unused method in this CL.

File chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
Line 34, Patchset 4 (Latest): URLPattern pattern(Extension::kValidWebExtentSchemes);
EXPECT_TRUE(pattern.SetScheme("*"));
pattern.SetHost("www.google.com");
pattern.SetPath("/*");
Devlin Cronin . unresolved

nit: since this is a test, maybe just inline the construction:

```
URLPattern pattern(kValidWebExtentSchemes, "*://www.google.com/*")
```

Ditto below

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bershanskyi
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: I09984ac13aba67b6598b744c10951297321040e1
Gerrit-Change-Number: 7882139
Gerrit-PatchSet: 4
Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Comment-Date: Thu, 28 May 2026 18:34:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Anton Bershanskyi (Gerrit)

unread,
May 28, 2026, 8:23:01 PM (4 days ago) May 28
to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin

Anton Bershanskyi added 1 comment

File chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
Line 34, Patchset 4: URLPattern pattern(Extension::kValidWebExtentSchemes);

EXPECT_TRUE(pattern.SetScheme("*"));
pattern.SetHost("www.google.com");
pattern.SetPath("/*");
Devlin Cronin . unresolved

nit: since this is a test, maybe just inline the construction:

```
URLPattern pattern(kValidWebExtentSchemes, "*://www.google.com/*")
```

Ditto below

Anton Bershanskyi

I updated two `URLPattern`s to use inline constructor, but the third one does not serialize to anything meaningful (it becomes `":/*"`). Please let me know if there is a better way to write it.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: I09984ac13aba67b6598b744c10951297321040e1
Gerrit-Change-Number: 7882139
Gerrit-PatchSet: 5
Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Fri, 29 May 2026 00:22:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
May 29, 2026, 4:14:10 PM (3 days ago) May 29
to Anton Bershanskyi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Anton Bershanskyi

Devlin Cronin added 1 comment

File chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
Line 34, Patchset 4: URLPattern pattern(Extension::kValidWebExtentSchemes);
EXPECT_TRUE(pattern.SetScheme("*"));
pattern.SetHost("www.google.com");
pattern.SetPath("/*");
Devlin Cronin . unresolved

nit: since this is a test, maybe just inline the construction:

```
URLPattern pattern(kValidWebExtentSchemes, "*://www.google.com/*")
```

Ditto below

Anton Bershanskyi

I updated two `URLPattern`s to use inline constructor, but the third one does not serialize to anything meaningful (it becomes `":/*"`). Please let me know if there is a better way to write it.

Devlin Cronin

Hmm... How were you trying to serialize it?

Right now, it's missing a SetScheme() call, which isn't really valid in practice (production callsites pretty much all parse URLPatterns directly), and I'd expect this to be `URLPattern(kValidWebExtentSchemes, "*://gmail.com/*")`. Does that not work, or does that not work with the scheme set for some reason?

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bershanskyi
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: I09984ac13aba67b6598b744c10951297321040e1
Gerrit-Change-Number: 7882139
Gerrit-PatchSet: 5
Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Attention: Anton Bershanskyi <bersh...@gmail.com>
Gerrit-Comment-Date: Fri, 29 May 2026 20:13:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Devlin Cronin <rdevlin...@chromium.org>
Comment-In-Reply-To: Anton Bershanskyi <bersh...@gmail.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anton Bershanskyi (Gerrit)

unread,
May 30, 2026, 12:29:51 PM (2 days ago) May 30
to Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin

Anton Bershanskyi added 1 comment

File chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc
Line 34, Patchset 4: URLPattern pattern(Extension::kValidWebExtentSchemes);
EXPECT_TRUE(pattern.SetScheme("*"));
pattern.SetHost("www.google.com");
pattern.SetPath("/*");
Devlin Cronin . resolved

nit: since this is a test, maybe just inline the construction:

```
URLPattern pattern(kValidWebExtentSchemes, "*://www.google.com/*")
```

Ditto below

Anton Bershanskyi

I updated two `URLPattern`s to use inline constructor, but the third one does not serialize to anything meaningful (it becomes `":/*"`). Please let me know if there is a better way to write it.

Devlin Cronin

Hmm... How were you trying to serialize it?

Right now, it's missing a SetScheme() call, which isn't really valid in practice (production callsites pretty much all parse URLPatterns directly), and I'd expect this to be `URLPattern(kValidWebExtentSchemes, "*://gmail.com/*")`. Does that not work, or does that not work with the scheme set for some reason?

Anton Bershanskyi

I checked again and `URLPattern(Extension::kValidWebExtentSchemes, "https://www.gmail.com/*")` worked.

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
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: I09984ac13aba67b6598b744c10951297321040e1
    Gerrit-Change-Number: 7882139
    Gerrit-PatchSet: 9
    Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Comment-Date: Sat, 30 May 2026 16:29:24 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Devlin Cronin (Gerrit)

    unread,
    1:55 PM (3 hours ago) 1:55 PM
    to Anton Bershanskyi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Anton Bershanskyi

    Devlin Cronin voted and added 1 comment

    Votes added by Devlin Cronin

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Devlin Cronin . resolved

    s lgtm; thanks, Anton!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anton Bershanskyi
    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: I09984ac13aba67b6598b744c10951297321040e1
    Gerrit-Change-Number: 7882139
    Gerrit-PatchSet: 12
    Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Attention: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Comment-Date: Mon, 01 Jun 2026 17:55:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Anton Bershanskyi (Gerrit)

    unread,
    2:25 PM (2 hours ago) 2:25 PM
    to Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Justin Lulejian

    Anton Bershanskyi added 1 comment

    Patchset-level comments
    Anton Bershanskyi . resolved

    Hi Justin, would you be interested in reviewing these new tests? This CL should not have any behavioral changes. Thanks in advance.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Justin Lulejian
    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: I09984ac13aba67b6598b744c10951297321040e1
    Gerrit-Change-Number: 7882139
    Gerrit-PatchSet: 12
    Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Comment-Date: Mon, 01 Jun 2026 18:25:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Lulejian (Gerrit)

    unread,
    3:04 PM (2 hours ago) 3:04 PM
    to Anton Bershanskyi, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Anton Bershanskyi

    Justin Lulejian voted and added 7 comments

    Votes added by Justin Lulejian

    Code-Review+1

    7 comments

    Patchset-level comments
    Justin Lulejian . resolved

    lgtm, thanks Anton! Just a few minor comments.

    Commit Message
    Line 11, Patchset 12 (Latest):handler refactoring.
    Justin Lulejian . unresolved

    Probably want to mention the removal of `OverrideLaunchURL` as well since it expands what this commit is doing.

    File chrome/common/extensions/manifest_handlers/app_launch_info.cc
    Line 175, Patchset 12 (Latest): // If launch_web_url_ is not empty, then it was set in kLaunchWebURL path
    Justin Lulejian . unresolved
    ```suggestion
    // If launch_web_url_ is not empty, then it was set in `kLaunchWebURL` path
    ```
    Line 178, Patchset 12 (Latest): // Ensure consistency of extension->web_extent().is_empty() with actual
    Justin Lulejian . unresolved
    ```suggestion
    // Ensure consistency of `extension->web_extent().is_empty()` with actual
    ```
    Line 178, Patchset 12 (Latest): // Ensure consistency of extension->web_extent().is_empty() with actual
    // Extension origins.
    Justin Lulejian . unresolved
    ```suggestion
    // Ensure consistency of `extension->web_extent().is_empty()` with actual
    // `Extension` origins.
    ```
    Line 180, Patchset 12 (Latest): DCHECK(URLOverrides::GetChromeURLOverrides(extension).empty());
    Justin Lulejian . unresolved

    Consider adding a comment here mentioning the dependency on ChromeURLOverridesHandler running before this handler, similar to the explanation in the new test AppURLsAndAppLaunchWebURL.

    File extensions/common/extension.cc
    Line 604, Patchset 12 (Latest): // extent_ should be immutable after manifest parsing finishes.
    Justin Lulejian . unresolved
    ```suggestion
    // `extent_` should be immutable after manifest parsing finishes.
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anton Bershanskyi
    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: I09984ac13aba67b6598b744c10951297321040e1
      Gerrit-Change-Number: 7882139
      Gerrit-PatchSet: 12
      Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
      Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
      Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
      Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
      Gerrit-Attention: Anton Bershanskyi <bersh...@gmail.com>
      Gerrit-Comment-Date: Mon, 01 Jun 2026 19:04:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Anton Bershanskyi (Gerrit)

      unread,
      3:43 PM (1 hour ago) 3:43 PM
      to Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Justin Lulejian

      Anton Bershanskyi added 7 comments

      Patchset-level comments
      File-level comment, Patchset 13 (Latest):
      Anton Bershanskyi . resolved

      Hi Justin, thanks for review. I incorporated changes, please take another look and feel free to mark discussions "resolved" if changes are OK.

      Commit Message
      Line 11, Patchset 12:handler refactoring.
      Justin Lulejian . unresolved

      Probably want to mention the removal of `OverrideLaunchURL` as well since it expands what this commit is doing.

      Anton Bershanskyi

      Added
      > Remove unused private method `AppLaunchInfo::OverrideLaunchURL()`.

      File chrome/common/extensions/manifest_handlers/app_launch_info.cc
      Line 175, Patchset 12: // If launch_web_url_ is not empty, then it was set in kLaunchWebURL path
      Justin Lulejian . resolved
      ```suggestion
      // If launch_web_url_ is not empty, then it was set in `kLaunchWebURL` path
      ```
      Anton Bershanskyi

      Fix applied.

      Line 178, Patchset 12: // Ensure consistency of extension->web_extent().is_empty() with actual
      Justin Lulejian . resolved
      ```suggestion
      // Ensure consistency of `extension->web_extent().is_empty()` with actual
      ```
      Anton Bershanskyi

      Fix applied.

      Line 178, Patchset 12: // Ensure consistency of extension->web_extent().is_empty() with actual
      // Extension origins.
      Justin Lulejian . resolved
      ```suggestion
      // Ensure consistency of `extension->web_extent().is_empty()` with actual
      // `Extension` origins.
      ```
      Anton Bershanskyi

      Done

      Line 180, Patchset 12: DCHECK(URLOverrides::GetChromeURLOverrides(extension).empty());
      Justin Lulejian . unresolved

      Consider adding a comment here mentioning the dependency on ChromeURLOverridesHandler running before this handler, similar to the explanation in the new test AppURLsAndAppLaunchWebURL.

      Anton Bershanskyi

      Follow-up CL 7863620 will make this dependency explicit and add comments where appropriate.

      File extensions/common/extension.cc
      Line 604, Patchset 12: // extent_ should be immutable after manifest parsing finishes.
      Justin Lulejian . resolved
      ```suggestion
      // `extent_` should be immutable after manifest parsing finishes.
      ```
      Anton Bershanskyi

      Fix applied.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Justin Lulejian
      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: I09984ac13aba67b6598b744c10951297321040e1
        Gerrit-Change-Number: 7882139
        Gerrit-PatchSet: 13
        Gerrit-Owner: Anton Bershanskyi <bersh...@gmail.com>
        Gerrit-Reviewer: Anton Bershanskyi <bersh...@gmail.com>
        Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
        Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
        Gerrit-Comment-Date: Mon, 01 Jun 2026 19:43:11 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Justin Lulejian <jlul...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages