| Commit-Queue | +1 |
Hi Alex,
Could you please review this CL?
Thank you,
Mohamed
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks, looks good to me but let's also add an inspector-protocol test to verify the behavior e2e, i.e., by querying the web API within the iframe and then checking that it did not leak to the frames in the same target.
std::optional<String> in_frame_id = std::nullopt) override;NIT: It is generally discouraged to add default arguments to overridden virtual methods (as per the Google C++ Style Guide). Consider removing the default argument here and updating the older tests in `digital_credentials_handler_unittest.cc` to explicitly pass `std::nullopt` instead.
return root_node->child_at(index);NIT: `AppendChild` returns the newly created `TestRenderFrameHost*`, so you can simplify this method by using that return value directly:
```cpp
TestRenderFrameHost* child_rfh = static_cast<TestRenderFrameHost*>(
root_node->current_frame_host())->AppendChild(name);
return child_rfh->frame_tree_node();
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks, looks good to me but let's also add an inspector-protocol test to verify the behavior e2e, i.e., by querying the web API within the iframe and then checking that it did not leak to the frames in the same target.
Done
Thanks Alex
I hope this is what you had in mind wrt to the test!
std::optional<String> in_frame_id = std::nullopt) override;NIT: It is generally discouraged to add default arguments to overridden virtual methods (as per the Google C++ Style Guide). Consider removing the default argument here and updating the older tests in `digital_credentials_handler_unittest.cc` to explicitly pass `std::nullopt` instead.
Done
NIT: `AppendChild` returns the newly created `TestRenderFrameHost*`, so you can simplify this method by using that return value directly:
```cpp
TestRenderFrameHost* child_rfh = static_cast<TestRenderFrameHost*>(
root_node->current_frame_host())->AppendChild(name);
return child_rfh->frame_tree_node();
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
await dp.DigitalCredentials.setVirtualWalletBehavior({action: 'clear'});Since the mock was scoped to `iframe1Id` earlier, calling `clear` without a `frameId` here clears the main frame's virtual wallet, not the iframe's wallet.
Consider adding `frameId: iframe1Id` to ensure the iframe's state is properly cleaned up (even though it's the end of the test).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks a lot, Alex!
await dp.DigitalCredentials.setVirtualWalletBehavior({action: 'clear'});Since the mock was scoped to `iframe1Id` earlier, calling `clear` without a `frameId` here clears the main frame's virtual wallet, not the iframe's wallet.
Consider adding `frameId: iframe1Id` to ensure the iframe's state is properly cleaned up (even though it's the end of the test).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: third_party/blink/web_tests/http/tests/inspector-protocol/digital-credentials/digital-credentials-virtual_wallet-scoped-iframe.js
Insertions: 4, Deletions: 1.
@@ -90,7 +90,10 @@
data: {},
})`);
- await dp.DigitalCredentials.setVirtualWalletBehavior({action: 'clear'});
+ await dp.DigitalCredentials.setVirtualWalletBehavior({
+ action: 'clear',
+ frameId: iframe1Id,
+ });
testRunner.log('iframe1 result: ' + JSON.stringify(iframe1Result));
testRunner.log('iframe2 result: ' + JSON.stringify(iframe2Result));
```
[DC] Add frameId param to DigitalCredentials.setVirtualWalletBehavior
Currently, DigitalCredentials.setVirtualWalletBehavior only applies
virtual wallet behavior globally or at the top-level WebContents/main
frame level. In automated browser testing (via WebDriverBiDi, Puppeteer,
or DevTools clients), test scripts frequently need to test cross-origin
iframes or embedded contexts requesting digital credentials.
This CL adds an optional Page.FrameId frameId parameter to the command
definition in DigitalCredentials.pdl. When provided, the DevTools
handler resolves the token using FrameTreeNodeFromDevToolsFrameToken
within the current session's frame subtree and scopes the virtual wallet
behavior to the target frame tree node. If frameId is omitted, behavior
defaults to the main frame of the session.
BUG=470685266
TEST=DigitalCredentialsHandlerTest.*
AG=agy
CONV=2f51e7d6-fb1e-48e1-a310-2d19aaac61df
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |