[webkit-changes] [WebKit/WebKit] 51105b: Reset main frame opener between tests in a way tha...
Alex Christensen
noreply at github.com
Thu Oct 24 22:32:52 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 51105b97099cb96676981910dc9fd04e3f76cdb8
https://github.com/WebKit/WebKit/commit/51105b97099cb96676981910dc9fd04e3f76cdb8
Author: Alex Christensen <achristensen at apple.com>
Date: 2024-10-24 (Thu, 24 Oct 2024)
Changed paths:
M Source/WebCore/page/Frame.cpp
M Source/WebKit/UIProcess/API/C/WKPage.cpp
M Source/WebKit/UIProcess/API/C/WKPage.h
M Source/WebKit/UIProcess/API/C/WKPagePrivate.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxyTesting.cpp
M Source/WebKit/UIProcess/WebPageProxyTesting.h
M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/WebPageTesting.cpp
M Source/WebKit/WebProcess/WebPage/WebPageTesting.h
M Source/WebKit/WebProcess/WebPage/WebPageTesting.messages.in
M Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
M Tools/WebKitTestRunner/TestController.cpp
Log Message:
-----------
Reset main frame opener between tests in a way that works with site isolation
https://bugs.webkit.org/show_bug.cgi?id=281694
rdar://138143721
Reviewed by Charlie Wolfe.
Some tests, such as fast/dom/Window/window-focus-self.html, leave behind a
main frame that has an opener (itself). Between tests, we need to reset this
state so that future tests that may check for an opener find no opener.
WKBundleFrameClearOpener only cleared the opener in one process and left state
inconsistent between web processes and with the UI process. This fixes that
and makes a path for replacing the rest of InjectedBundlePage::prepare.
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::takeWindowProxyAndOpenerFrom):
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageResetStateBetweenTests):
(WKPageClearWheelEventTestMonitor):
(WKPageDumpPrivateClickMeasurement):
(WKPageClearPrivateClickMeasurement):
(WKPageSetPrivateClickMeasurementOverrideTimerForTesting):
(WKPageMarkAttributedPrivateClickMeasurementsAsExpiredForTesting):
(WKPageSetPrivateClickMeasurementEphemeralMeasurementForTesting):
(WKPageSimulatePrivateClickMeasurementSessionRestart):
(WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting):
(WKPageSetPrivateClickMeasurementTokenSignatureURLForTesting):
(WKPageSetPrivateClickMeasurementAttributionReportURLsForTesting):
(WKPageMarkPrivateClickMeasurementsAsExpiredForTesting):
(WKPageSetPCMFraudPreventionValuesForTesting):
(WKPageSetPrivateClickMeasurementAppBundleIDForTesting):
(WKPageDispatchActivityStateUpdateForTesting):
(WKPageIsEditingCommandEnabledForTesting):
(WKPageSetPermissionLevelForTesting):
(WKPageSetTopContentInsetForTesting):
(WKPageResetProcessState): Deleted.
* Source/WebKit/UIProcess/API/C/WKPage.h:
* Source/WebKit/UIProcess/API/C/WKPagePrivate.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setStatisticsCrossSiteLoadWithLinkDecorationForTesting:withToHost:withWasFiltered:withCompletionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _setDefersLoadingForTesting:]):
(-[WKWebView _setIndexOfGetDisplayMediaDeviceSelectedForTesting:]):
(-[WKWebView _setSystemCanPromptForGetDisplayMediaForTesting:]):
(-[WKWebView _setPrivateClickMeasurementOverrideTimerForTesting:completionHandler:]):
(-[WKWebView _setPrivateClickMeasurementAttributionReportURLsForTesting:destinationURL:completionHandler:]):
(-[WKWebView _setPrivateClickMeasurementAttributionTokenPublicKeyURLForTesting:completionHandler:]):
(-[WKWebView _setPrivateClickMeasurementAttributionTokenSignatureURLForTesting:completionHandler:]):
(-[WKWebView _setPrivateClickMeasurementAppBundleIDForTesting:completionHandler:]):
(-[WKWebView _dumpPrivateClickMeasurement:]):
(-[WKWebView _isLayerTreeFrozenForTesting:]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::m_pageForTesting):
(WebKit::WebPageProxy::pageForTesting const):
(WebKit::WebPageProxy::protectedPageForTesting const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyTesting.cpp:
(WebKit::WebPageProxyTesting::resetStateBetweenTests):
* Source/WebKit/UIProcess/WebPageProxyTesting.h:
(WebKit::WebPageProxyTesting::create):
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameClearOpener): Deleted.
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::loadDidCommitInAnotherProcess):
* Source/WebKit/WebProcess/WebPage/WebPageTesting.cpp:
(WebKit::WebPageTesting::resetStateBetweenTests):
* Source/WebKit/WebProcess/WebPage/WebPageTesting.h:
* Source/WebKit/WebProcess/WebPage/WebPageTesting.messages.in:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::prepare):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
Canonical link: https://commits.webkit.org/285688@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list