Skip to content

Add an optional topLevelOrigin parameter to the permissions.setPermission command#468

Merged
miketaylr merged 4 commits intow3c:mainfrom
jalonthomas:addEmbeddingOrigin
Sep 26, 2025
Merged

Add an optional topLevelOrigin parameter to the permissions.setPermission command#468
miketaylr merged 4 commits intow3c:mainfrom
jalonthomas:addEmbeddingOrigin

Conversation

@jalonthomas
Copy link
Copy Markdown
Contributor

@jalonthomas jalonthomas commented Aug 14, 2025

Updates the permissions.setPermission command and the permission key generation algorithm. The command now accepts an optional topLevelOrigin parameter to support permissions that require double-keying, such as the Storage Access API. The permission key generation algorithm has been updated to accept origin and top-level origin as direct inputs, instead of an Environment Settings Objects (ESO). This allows WebDriver to properly set a permission, since it doesn't necessarily have an ESO to pass.

closes #450

The following tasks have been completed:

  • Modified Web platform tests (link)

Implementation commitment:

  • WebKit (link to issue)
  • Blink (link to issue)
  • Gecko (link to issue)

Preview | Diff

@jalonthomas jalonthomas changed the title Add an optional embeddingOrigin to the permissions.setPermission command Add an optional topLevelOrigin to the permissions.setPermission command Aug 14, 2025
@jalonthomas jalonthomas changed the title Add an optional topLevelOrigin to the permissions.setPermission command Add an optional topLevelOrigin parameter to the permissions.setPermission command Aug 14, 2025
Copy link
Copy Markdown
Contributor

@cfredric cfredric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks pretty good now, thanks!

<li>Let |origin| be the value of the `origin` field of |command parameters|.
</li>
<li>Let |embedding origin| be the value of the `embeddingOrigin` field of
<li>Let |top level origin| be the value of the `topLevelOrigin` field of
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me that there's a type mismatch here - top level origin is defined to be a text value here, but later on we use it as if it were an [=origin=] (without parsing it or anything). This is an existing problem with how the spec handles the origin variable, too. Technically, the spec probably ought to run a URL parser on the text to produce a URL and then access the URL's origin. Maybe there's a shorthand for doing all of that?

Co-authored-by: Chris Fredrickson <cfredric@users.noreply.github.com>
@jalonthomas jalonthomas marked this pull request as ready for review August 15, 2025 13:55
@miketaylr
Copy link
Copy Markdown
Member

Hey thanks! A few questions/comments while I try to page this all back into my head.

Dumb question: why not just add an additional optional top-level origin argument into "set a permission" and plumb that in?

The permission key generation algorithm has been updated to accept origin and top-level origin as direct inputs, instead of an Environment Settings Objects (ESO). This allows WebDriver to properly set a permission, since it doesn't necessarily have an ESO to pass.

I don't follow here - in https://pr-preview.s3.amazonaws.com/w3c/permissions/468/4f2ccb0...jalonthomas:4841693.html#automation you're calling the permission key generation algorithm with a current settings object. So why do we need to modify the permission key generation algorithm? When does WebDriver have a CSO (which is a type of ESO) but not an ESO?

@jalonthomas
Copy link
Copy Markdown
Contributor Author

I don't follow here - in https://pr-preview.s3.amazonaws.com/w3c/permissions/468/4f2ccb0...jalonthomas:4841693.html#automation you're calling the permission key generation algorithm with a current settings object. So why do we need to modify the permission key generation algorithm? When does WebDriver have a CSO (which is a type of ESO) but not an ESO?

My understanding is that WebDriver doesn’t have an ESO at all. By modifying the permission key generation algorithm to take an origin and a top-level origin directly, it's now possible for WebDriver to call the algorithm and set permissions without needing an ESO..

Dumb question: why not just add an additional optional top-level origin argument into "set a permission" and plumb that in?

This is definitely a possibility, but the optional origin before functionally was the key. So rather than pass both origins, I think it makes sense to consolidate under a single permission key input, and have the callers generate that key themselves.

@miketaylr
Copy link
Copy Markdown
Member

Thanks - I'm still trying to wrap my head around how WebDriver-bidi implements all of this, there's quite a bit of indirection.

https://github.com/GoogleChromeLabs/chromium-bidi/blob/0a6af6579fd89754d8e7e397dfb44d905e40e1df/src/bidiMapper/modules/permissions/PermissionsProcessor.ts#L25

etc

My understanding is that WebDriver doesn’t have an ESO at all. By modifying the permission key generation algorithm to take an origin and a top-level origin directly, it's now possible for WebDriver to call the algorithm and set permissions without needing an ESO..

How do steps 4 or 6 work in your changes with WebDriver(-bidi) if ESOs don't exist?

Screenshot 2025-09-01 at 3 26 47 PM

Dumb question: why not just add an additional optional top-level origin argument into "set a permission" and plumb that in?

This is definitely a possibility, but the optional origin before functionally was the key. So rather than pass both origins, I think it makes sense to consolidate under a single permission key input, and have the callers generate that key themselves.

One upside is that you don't have to touch any of the algorithms outside of the Automated testing section, I think.

@jalonthomas
Copy link
Copy Markdown
Contributor Author

How do steps 4 or 6 work in your changes with WebDriver(-bidi) if ESOs don't exist?

Those steps happen on the browser side, so it should have access to all ESOs. WebDriver only sends the command to the browser.

@jalonthomas
Copy link
Copy Markdown
Contributor Author

Thanks - I'm still trying to wrap my head around how WebDriver-bidi implements all of this, there's quite a bit of indirection.

Right so the only change that we're realistically making is adding an optional topLevelOrigin to SetPermissionParameters here. That's the input to the link that you sent. We'll then parse that value as well and send it using Broser.setPermission.

@miketaylr
Copy link
Copy Markdown
Member

My feeling here is that we should just add the argument to the setPermission command and not do any additional refactoring (the fact that WebDriver/BiDi does or does not have an ESO at various parts of the algorithm it consumes feels like an implementation detail for WebDriver to worry about). But, maybe I wrong and happy to convinced otherwise. Curious if @marcoscaceres has any thoughts here.

@marcoscaceres
Copy link
Copy Markdown
Member

Yeah, I'm reaching the same conclusion as @miketaylr. The fact that we can set permissions at all via Web Driver implies that there is an ESO in Web Driver.

In all cases, we should be passing both the origin and top level origin regardless... if we can pass the origin already.

@cfredric
Copy link
Copy Markdown
Contributor

If I may chime in - the issue that Jalon's trying to fix is that step 2 of set a permission grabs all of the ESOs that are same-origin with target origin.

The usage of same-origin was fine up until #390, when it became possible for permission "scopes" to deviate from an origin, via the concept of permission key. But importantly, #390 didn't update the Set Permission command to use a permission key instead of an origin. (I haven't dug through the whole PR, but I suspect this was an unintentional omission.)

This means it's no longer possible for WebDriver to precisely override the permissions states for permissions whose key type is not the default, i.e. aren't origins. For example, WebDriver cannot request that the storage-access permission state should be overridden for siteA iframes that are embedded in siteB (but not for any other iframes).

Jalon's PR is meant to fix this by allowing WebDriver remote end to receive two origins, compute a permission key from them, and then use that key to choose which ESOs get the new permission state.

This is why the PR modifies the key generation algorithm: so that the WebDriver remote end can construct a permission key from the command's pair of origins and then use the key to affect specific ESOs.


(Side note -- I don't really understand step 4.1 of set a permission in the current spec. Is it possible this step should have been changed when the permission store concept was introduced?)

@miketaylr
Copy link
Copy Markdown
Member

I met with @cfredric and @jalonthomas to discuss the PR again. My initial preference would be to keep changes local for the WebDriver BiDi changes, and saw the other changes as ~refactoring. But also, this change looks good and will make it possible to test the "storage access" permission, which is currently untestable via WebDriver bidi.

@miketaylr miketaylr merged commit a867a0e into w3c:main Sep 26, 2025
2 checks passed
github-actions bot added a commit that referenced this pull request Sep 26, 2025
…mission` command (#468)

SHA: a867a0e
Reason: push, by miketaylr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
annevk pushed a commit to privacycg/storage-access that referenced this pull request Oct 18, 2025
philwo pushed a commit to philwo/chromium that referenced this pull request Oct 30, 2025
The specification says to use the current settings object's origin and
top-level origin, as of w3c/permissions#468 (the
parameter was renamed in w3c/permissions#469).

Note that this change should be a no-op for all permission types
*except* for `storage-access`, since `storage-access` is the only
permission type whose "permission key" is not the context's top-level
origin. This is why only the storage-access-api WPTs are affected.

(This CL fixes a bug where PermissionOverrides used the wrong origin for
non-storage-access permissions. This bug was hidden by
https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
until now, since chromedriver did not supply the embeddedOrigin until
this CL.)

Skipping flake verification since this looks like an existing bug (maybe
https://crbug.com/40096995).

Bug: 384959114
Validate-Test-Flakiness: skip
Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1538255}
T3-M4 pushed a commit to bayandin/chromedriver that referenced this pull request Oct 31, 2025
The specification says to use the current settings object's origin and
top-level origin, as of w3c/permissions#468 (the
parameter was renamed in w3c/permissions#469).

Note that this change should be a no-op for all permission types
*except* for `storage-access`, since `storage-access` is the only
permission type whose "permission key" is not the context's top-level
origin. This is why only the storage-access-api WPTs are affected.

(This CL fixes a bug where PermissionOverrides used the wrong origin for
non-storage-access permissions. This bug was hidden by
https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
until now, since chromedriver did not supply the embeddedOrigin until
this CL.)

Skipping flake verification since this looks like an existing bug (maybe
https://crbug.com/40096995).

Bug: 384959114
Validate-Test-Flakiness: skip
Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1538255}
philwo pushed a commit to philwo/chromium that referenced this pull request Oct 31, 2025
…ame's URL"

This reverts commit 694c3f3.

Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881)

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114, 414530752
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 384959114
Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1538397}
T3-M4 pushed a commit to bayandin/chromedriver that referenced this pull request Oct 31, 2025
…ame's URL"

This reverts commit 6d49173.

Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881)

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114, 414530752
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 384959114
Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1538397}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 3, 2025
…ame's URL"

This is a reland of commit 694c3f3

This version is a bit more careful with TestExpectations, and doesn't
remove entries that might still timeout on slower bots (e.g.
msan/asan/etc).

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114
Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1539450}
T3-M4 pushed a commit to bayandin/chromedriver that referenced this pull request Nov 4, 2025
…ame's URL"

This is a reland of commit 6d49173

This version is a bit more careful with TestExpectations, and doesn't
remove entries that might still timeout on slower bots (e.g.
msan/asan/etc).

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114
Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1539450}
jmajnert pushed a commit to jmajnert/chromium that referenced this pull request Nov 6, 2025
The specification says to use the current settings object's origin and
top-level origin, as of w3c/permissions#468 (the
parameter was renamed in w3c/permissions#469).

Note that this change should be a no-op for all permission types
*except* for `storage-access`, since `storage-access` is the only
permission type whose "permission key" is not the context's top-level
origin. This is why only the storage-access-api WPTs are affected.

(This CL fixes a bug where PermissionOverrides used the wrong origin for
non-storage-access permissions. This bug was hidden by
https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
until now, since chromedriver did not supply the embeddedOrigin until
this CL.)

Skipping flake verification since this looks like an existing bug (maybe
https://crbug.com/40096995).

Bug: 384959114
Validate-Test-Flakiness: skip
Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1538255}
jmajnert pushed a commit to jmajnert/chromium that referenced this pull request Nov 6, 2025
…ame's URL"

This reverts commit 694c3f3.

Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881)

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114, 414530752
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 384959114
Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1538397}
jmajnert pushed a commit to jmajnert/chromium that referenced this pull request Nov 6, 2025
…ame's URL"

This is a reland of commit 694c3f3

This version is a bit more careful with TestExpectations, and doesn't
remove entries that might still timeout on slower bots (e.g.
msan/asan/etc).

Original change's description:
> Update chromedriver's SetPermission command to use current frame's URL
>
> The specification says to use the current settings object's origin and
> top-level origin, as of w3c/permissions#468 (the
> parameter was renamed in w3c/permissions#469).
>
> Note that this change should be a no-op for all permission types
> *except* for `storage-access`, since `storage-access` is the only
> permission type whose "permission key" is not the context's top-level
> origin. This is why only the storage-access-api WPTs are affected.
>
> (This CL fixes a bug where PermissionOverrides used the wrong origin for
> non-storage-access permissions. This bug was hidden by
> https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437
> until now, since chromedriver did not supply the embeddedOrigin until
> this CL.)
>
> Skipping flake verification since this looks like an existing bug (maybe
> https://crbug.com/40096995).
>
> Bug: 384959114
> Validate-Test-Flakiness: skip
> Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216
> Reviewed-by: Alex N. Jose <alexnj@chromium.org>
> Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
> Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1538255}

Bug: 384959114
Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801
Reviewed-by: Alex N. Jose <alexnj@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1539450}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an optional topLevelOrigin argument to permissions.setPermission WebDriver BiDi command

4 participants