Bug 217217

Summary: WebDriver: several issues when switching to new browser context
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bburg, clopez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 166679    
Attachments:
Description Flags
Patch bburg: review+

Description Carlos Garcia Campos 2020-10-02 04:37:32 PDT
There are several issues to fix when switching to a browser context:

 1- The spec has changed and now we should always keep the current parent browsing context.
 2- The spec says we should focus the new frame after switching to a frame or parent frame, but we are just resolving the frame and updating the handle internally.
 3- We are keeping stale frame handles and ids in the automation session, they should be removed when frames are destroyed.
 4- We are clearing all frame references in the automation session when a navigation happens in any main frame. We should only clear the frames of the page that completed the navigation.

All theses cases are covered by new tests added to imported/w3c/webdriver/tests/switch_to_parent_frame/
Comment 1 Carlos Garcia Campos 2020-10-02 04:56:11 PDT
Created attachment 410315 [details]
Patch
Comment 2 BJ Burg 2020-10-02 10:03:35 PDT
Comment on attachment 410315 [details]
Patch

r=me, thanks!
Comment 3 Carlos Garcia Campos 2020-10-02 23:26:18 PDT
Committed r267918: <https://trac.webkit.org/changeset/267918>
Comment 4 Radar WebKit Bug Importer 2020-10-02 23:27:17 PDT
<rdar://problem/69908860>