Bug 217217 - WebDriver: several issues when switching to new browser context
Summary: WebDriver: several issues when switching to new browser context
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: gtk-webdriver
  Show dependency treegraph
 
Reported: 2020-10-02 04:37 PDT by Carlos Garcia Campos
Modified: 2020-10-02 23:27 PDT (History)
4 users (show)

See Also:


Attachments
Patch (20.91 KB, patch)
2020-10-02 04:56 PDT, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>