[PEPC] Close PEPC prompt on tab switch
As per the DD the PEPC prompt should be closed when tab switching. This CL introduces a new TabSwitchingBehavior that closes the request as "Ignored" but also calls the "Cancelled" callback. This is needed to allow PEPC requests to notify the renderer of the prompt being closed in order to raise the "dismiss" event. Additionally during this CL a flaw was identified in PermissionElementBrowserTest which allowed all tests to falsely pass. |waitForResolveEvent| would immediately return true which made it appear that all conditions are met. This CL fixes that by using console logs to determine which events have been raised so far, and checking that they are the expected ones. Fixed: 339792166 Change-Id: I3671f0b425c54ed889fa24484ed0e09d1ecb6884 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526465 Commit-Queue: Andy Paicu <andypaicu@chromium.org> Reviewed-by:Thomas Nguyen <tungnh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1300313}
Showing
- chrome/browser/permissions/permission_element_browsertest.cc 83 additions, 36 deletionschrome/browser/permissions/permission_element_browsertest.cc
- chrome/browser/ui/views/permissions/embedded_permission_prompt.cc 1 addition, 1 deletion...rowser/ui/views/permissions/embedded_permission_prompt.cc
- chrome/test/data/permissions/permission_element.html 20 additions, 31 deletionschrome/test/data/permissions/permission_element.html
- components/permissions/permission_request_manager.cc 10 additions, 1 deletioncomponents/permissions/permission_request_manager.cc
Loading
Please register or sign in to comment