Calling -[WKWebView _closeAllMediaPresentations] crashes
<rdar://78538835>
Created attachment 429814 [details] Patch
Comment on attachment 429814 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429814&action=review > Source/WebKit/ChangeLog:11 > + (-[WKWebView _closeAllMediaPresentations]): Can we write an API test for this?
Comment on attachment 429814 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429814&action=review >> Source/WebKit/ChangeLog:11 >> + (-[WKWebView _closeAllMediaPresentations]): > > Can we write an API test for this? Yes. Let me add a test.
Created attachment 429819 [details] Add an API test
Created attachment 429831 [details] Fix a mistake in the API test
Comment on attachment 429831 [details] Fix a mistake in the API test View in context: https://bugs.webkit.org/attachment.cgi?id=429831&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm:111 > + } while (true); I think it would be better to loop a fixed number of times so if the test fails rather than timings out if it doesn't exit from PiP for some reason.
Comment on attachment 429831 [details] Fix a mistake in the API test View in context: https://bugs.webkit.org/attachment.cgi?id=429831&action=review >> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm:111 >> + } while (true); > > I think it would be better to loop a fixed number of times so if the test fails rather than timings out if it doesn't exit from PiP for some reason. Agree. Actually this pattern is used multiple times in this file. Filed bug 226340 to fix all of them.
Created attachment 429888 [details] Patch for landing
Committed r278169 (238213@main): <https://commits.webkit.org/238213@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 429888 [details].