Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebKit.WebsitePoliciesAutoplayQuirks API test times out with async po…
…licy delegates https://bugs.webkit.org/show_bug.cgi?id=183702 Reviewed by Alex Christensen. Source/WebCore: The issue is that the test calls loadHTMLString then loadRequest right after, without waiting for the first load to complete first. loadHTMLString is special as it relies on substitute data and which schedules a timer to commit the data. When doing the navigation policy check for the following loadRequest(), the substitute data timer would fire and commit its data and load. This would in turn cancel the pending navigation policy check for the loadRequest(). With sync policy delegates, this is not an issue because we take care of stopping all loaders when receiving the policy decision, which happens synchronously. However, when the policy decision happens asynchronously, the pending substitute data load does not get cancelled in time and it gets committed. To address the issue, this patch updates loadWithDocumentLoader() to cancel any provisional load when there is an asynchronous navigation policy decision pending. Change covered by new API test. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm: (-[AsyncAutoplayPoliciesDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): (-[AsyncAutoplayPoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]): (-[AsyncAutoplayPoliciesDelegate _webView:handleAutoplayEvent:withFlags:]): (TEST): Canonical link: https://commits.webkit.org/199356@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing with 128 additions and 0 deletions.