[Extensions] Overload chrome.test.assertThrows to support w3c proposal [chromium/src : main]

0 views
Skip to first unread message

Justin Lulejian (Gerrit)

unread,
Jun 22, 2026, 12:11:49 PM (3 days ago) Jun 22
to Tim, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Tim

Justin Lulejian voted and added 1 comment

Votes added by Justin Lulejian

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Justin Lulejian . resolved

Hi Tim! Doing assertThrows() now 😄. We can consider the tests to have passed since they passed on previous patchsets and I made some minor comment changes only for this recent upload.

Open in Gerrit

Related details

Attention is currently required from:
  • Tim
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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
Gerrit-Change-Number: 7959318
Gerrit-PatchSet: 11
Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Tim <tjud...@chromium.org>
Gerrit-Attention: Tim <tjud...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Jun 2026 16:11:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Tim (Gerrit)

unread,
Jun 22, 2026, 7:52:12 PM (3 days ago) Jun 22
to Justin Lulejian, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin

Tim added 1 comment

Patchset-level comments
Tim . resolved

Hmmm, this way of using choices and repeating different arguments in different positions seems like quite a hack from its normal intended use. I get that you do the custom work to disambiguate which signature you think has been passed in the custom bindings, but it feels bad to me that the schema says `chrome.test.assertThrows(chrome.tabs.create, "foo", "foo", "foo")` would be a valid call.

I'm going to pass this one over to Devlin for now to get their take on the general approach and if they have any alternative ideas on how to do this best.

rdevlin.cronin@: If you think the overall approach here is fine, feel free to pass it back to me to take a closer look.

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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
Gerrit-Change-Number: 7959318
Gerrit-PatchSet: 11
Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
Gerrit-CC: Tim <tjud...@chromium.org>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Mon, 22 Jun 2026 23:51:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Justin Lulejian (Gerrit)

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

Justin Lulejian added 1 comment

Patchset-level comments
Tim . unresolved

Hmmm, this way of using choices and repeating different arguments in different positions seems like quite a hack from its normal intended use. I get that you do the custom work to disambiguate which signature you think has been passed in the custom bindings, but it feels bad to me that the schema says `chrome.test.assertThrows(chrome.tabs.create, "foo", "foo", "foo")` would be a valid call.

I'm going to pass this one over to Devlin for now to get their take on the general approach and if they have any alternative ideas on how to do this best.

rdevlin.cronin@: If you think the overall approach here is fine, feel free to pass it back to me to take a closer look.

Justin Lulejian

For extra context Devlin: the design said to move the old signature to assertThrowsSelf and then have the browser.test proposal's assertThrows signature be the default. But it seemed not too complex in practice to just support both so I tried this way.

There isn't much use of assertThrows currently so it wouldn't be too onerous to still do assertThrowsSelf. I could also try to just coerce the current usages to use the browser.test proposal's assertThrows signature so that we only have one definition. LMK which would be more preferred.

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 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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
    Gerrit-Change-Number: 7959318
    Gerrit-PatchSet: 11
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-CC: Tim <tjud...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Jun 2026 16:28:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Tim <tjud...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Lulejian (Gerrit)

    unread,
    Jun 24, 2026, 2:45:59 PM (yesterday) Jun 24
    to android-bu...@system.gserviceaccount.com, Devlin Cronin, Tim, Chromium LUCI CQ, chromium...@chromium.org, msrame...@chromium.org, antoniosarto...@chromium.org, rginda...@chromium.org, mkwst+w...@chromium.org, arthursonzog...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin

    Justin Lulejian voted and added 1 comment

    Votes added by Justin Lulejian

    Auto-Submit+1

    1 comment

    Patchset-level comments
    Tim . unresolved

    Hmmm, this way of using choices and repeating different arguments in different positions seems like quite a hack from its normal intended use. I get that you do the custom work to disambiguate which signature you think has been passed in the custom bindings, but it feels bad to me that the schema says `chrome.test.assertThrows(chrome.tabs.create, "foo", "foo", "foo")` would be a valid call.

    I'm going to pass this one over to Devlin for now to get their take on the general approach and if they have any alternative ideas on how to do this best.

    rdevlin.cronin@: If you think the overall approach here is fine, feel free to pass it back to me to take a closer look.

    Justin Lulejian

    For extra context Devlin: the design said to move the old signature to assertThrowsSelf and then have the browser.test proposal's assertThrows signature be the default. But it seemed not too complex in practice to just support both so I tried this way.

    There isn't much use of assertThrows currently so it wouldn't be too onerous to still do assertThrowsSelf. I could also try to just coerce the current usages to use the browser.test proposal's assertThrows signature so that we only have one definition. LMK which would be more preferred.

    Justin Lulejian

    I ended up attempting (in Patchset 12) to just only use the browser.test proposal's version (`browser.test.assertThrows(fn, expectedError, message)`) and updating existing tests to use it. Besides the large diff due to updating the tests, it ends up being a lot simpler.

    Devlin: lmk which path you'd prefer us to take and I'll update the commit message as well if necessary.

    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 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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
    Gerrit-Change-Number: 7959318
    Gerrit-PatchSet: 12
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-CC: Tim <tjud...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 18:45:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Tim <tjud...@chromium.org>
    Comment-In-Reply-To: Justin Lulejian <jlul...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Justin Lulejian (Gerrit)

    unread,
    Jun 24, 2026, 5:23:22 PM (yesterday) Jun 24
    to android-bu...@system.gserviceaccount.com, Devlin Cronin, Tim, Chromium LUCI CQ, chromium...@chromium.org, msrame...@chromium.org, antoniosarto...@chromium.org, rginda...@chromium.org, mkwst+w...@chromium.org, arthursonzog...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Devlin Cronin

    Justin Lulejian voted and added 1 comment

    Votes added by Justin Lulejian

    Auto-Submit+1

    1 comment

    Patchset-level comments
    Tim . unresolved

    Hmmm, this way of using choices and repeating different arguments in different positions seems like quite a hack from its normal intended use. I get that you do the custom work to disambiguate which signature you think has been passed in the custom bindings, but it feels bad to me that the schema says `chrome.test.assertThrows(chrome.tabs.create, "foo", "foo", "foo")` would be a valid call.

    I'm going to pass this one over to Devlin for now to get their take on the general approach and if they have any alternative ideas on how to do this best.

    rdevlin.cronin@: If you think the overall approach here is fine, feel free to pass it back to me to take a closer look.

    Justin Lulejian

    For extra context Devlin: the design said to move the old signature to assertThrowsSelf and then have the browser.test proposal's assertThrows signature be the default. But it seemed not too complex in practice to just support both so I tried this way.

    There isn't much use of assertThrows currently so it wouldn't be too onerous to still do assertThrowsSelf. I could also try to just coerce the current usages to use the browser.test proposal's assertThrows signature so that we only have one definition. LMK which would be more preferred.

    Justin Lulejian

    I ended up attempting (in Patchset 12) to just only use the browser.test proposal's version (`browser.test.assertThrows(fn, expectedError, message)`) and updating existing tests to use it. Besides the large diff due to updating the tests, it ends up being a lot simpler.

    Devlin: lmk which path you'd prefer us to take and I'll update the commit message as well if necessary.

    Justin Lulejian

    (actually the latest patchset, 12 was failing with a couple of tests I missed).

    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 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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
    Gerrit-Change-Number: 7959318
    Gerrit-PatchSet: 13
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-CC: Tim <tjud...@chromium.org>
    Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 21:23:10 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Devlin Cronin (Gerrit)

    unread,
    6:25 PM (3 hours ago) 6:25 PM
    to Justin Lulejian, Tim, android-bu...@system.gserviceaccount.com, Devlin Cronin, Chromium LUCI CQ, chromium...@chromium.org, msrame...@chromium.org, antoniosarto...@chromium.org, rginda...@chromium.org, mkwst+w...@chromium.org, arthursonzog...@chromium.org, dullweb...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Justin Lulejian and Tim

    Devlin Cronin added 3 comments

    Patchset-level comments
    Tim . unresolved

    Hmmm, this way of using choices and repeating different arguments in different positions seems like quite a hack from its normal intended use. I get that you do the custom work to disambiguate which signature you think has been passed in the custom bindings, but it feels bad to me that the schema says `chrome.test.assertThrows(chrome.tabs.create, "foo", "foo", "foo")` would be a valid call.

    I'm going to pass this one over to Devlin for now to get their take on the general approach and if they have any alternative ideas on how to do this best.

    rdevlin.cronin@: If you think the overall approach here is fine, feel free to pass it back to me to take a closer look.

    Justin Lulejian

    For extra context Devlin: the design said to move the old signature to assertThrowsSelf and then have the browser.test proposal's assertThrows signature be the default. But it seemed not too complex in practice to just support both so I tried this way.

    There isn't much use of assertThrows currently so it wouldn't be too onerous to still do assertThrowsSelf. I could also try to just coerce the current usages to use the browser.test proposal's assertThrows signature so that we only have one definition. LMK which would be more preferred.

    Justin Lulejian

    I ended up attempting (in Patchset 12) to just only use the browser.test proposal's version (`browser.test.assertThrows(fn, expectedError, message)`) and updating existing tests to use it. Besides the large diff due to updating the tests, it ends up being a lot simpler.

    Devlin: lmk which path you'd prefer us to take and I'll update the commit message as well if necessary.

    Justin Lulejian

    (actually the latest patchset, 12 was failing with a couple of tests I missed).

    Devlin Cronin

    Thanks for the details!

    Given there aren't *too* many callsites here to update, I'd prefer we just update them all to use the new version (as appears to have been done here).

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

    Thanks, Justin!

    Just replying here and passing it back to Tim for the full review.

    File chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
    Line 427, Patchset 13 (Latest): {'origins': []}, {'cookies': true}),
    Devlin Cronin . unresolved

    for many of these, IMO, it's slightly cleaner to use bind() rather than wrapping in a function call:

    ```
    chrome.browsingData.remove.bind(null, {'origins': []}, {'cookies': true})
    ```

    (I think it's more obvious what function is expected to throw and it cleans up the stack trace a little, since there isn't an anonymous wrapper function in the trace)

    But I don't feel super strongly. Feel free to use your best judgment.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Justin Lulejian
    • Tim
    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: I91c7ec0a0f6d8e596db3ead4156c98cf7e0c8783
    Gerrit-Change-Number: 7959318
    Gerrit-PatchSet: 13
    Gerrit-Owner: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
    Gerrit-Reviewer: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Reviewer: Tim <tjud...@chromium.org>
    Gerrit-Attention: Tim <tjud...@chromium.org>
    Gerrit-Attention: Justin Lulejian <jlul...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 22:25:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages