Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4df7fa78e8e3db4c9b95b0c5eb363c4582fea512
      
https://github.com/WebKit/WebKit/commit/4df7fa78e8e3db4c9b95b0c5eb363c4582fea512
  Author: Qianlang Chen <[email protected]>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M LayoutTests/inspector/console/setConsoleClearAPIEnabled.html
    M LayoutTests/platform/mac-site-isolation/TestExpectations

  Log Message:
  -----------
  [Site Isolation] Web Inspector: Fix setConsoleClearAPIEnabled.html test under 
SI
rdar://171677841
https://bugs.webkit.org/show_bug.cgi?id=309129

Reviewed by BJ Burg.

With site isolation enabled, the inspector frontend should be using the
frame targets' console agent in place of the main page's. As the
`window.ConsoleAgent` helper getter returns the main page's agent, with
SI on, the setConsoleClearAPIEnabled.html layout test would still use
the API on the page's console while evaluating test scripts interacting
with the main frame's console agent.

Fix that by using the main frame's console instead when under SI.
The main frame is identified as the first and only frame target existing
in the webpage when the test starts. (I'd like to make this a helper
for layout tests that returns the main frame target, but there's
currently no reliable way to pinpoint the main frame target in general
until we support more domains to work with frame targets. For example,
we might be able to use `WI.networkManager.mainFrame.mainResource.target`,
once we support frame targets in Network.)

Verified the test's progression locally with the --site-isolation flag:
    run-webkit-tests --site-isolation <other-flags> 
.../setConsoleClearAPIEnabled.html

* LayoutTests/inspector/console/setConsoleClearAPIEnabled.html:
* LayoutTests/platform/mac-site-isolation/TestExpectations:

Canonical link: https://commits.webkit.org/308702@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to