In some cases the provisionalDocumentLoader will not be there (i.e. when DocumentLoader::startLoadingMainResource: Returning empty document"), so the returned value of WKBundleFrameCopyProvisionalURL will not be valid.
Created attachment 440556 [details] Patch
Comment on attachment 440556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440556&action=review > LayoutTests/fast/harness/testrunner-fetch-empty-document.html:4 > + testRunner.dumpAsText(); Test is failing on Mac debug wk1 as well, this is worth checking. I also tried the test locally on mock-wk2-debug and it is passing without the patch.
(In reply to youenn fablet from comment #2) > Comment on attachment 440556 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=440556&action=review > > > LayoutTests/fast/harness/testrunner-fetch-empty-document.html:4 > > + testRunner.dumpAsText(); > > Test is failing on Mac debug wk1 as well, this is worth checking. > I also tried the test locally on mock-wk2-debug and it is passing without > the patch. This issue is only reproducible when the test is loaded from an http server AND the URL path is not 127.0.0.1/localhost. Unfortunately the test runner uses 127.0.0.1 so we cannot simply move this test to the http folder under LayoutTests.
Created attachment 440672 [details] Patch
Comment on attachment 440672 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440672&action=review > Tools/ChangeLog:9 > + (WTR::InjectedBundlePage::willSendRequestForFrame): Let's add a comment explaining the case for this check: Add mainFrameURL check in case of loading a non localhost URL with WebKitTestRunner.
Created attachment 440948 [details] Patch
Please put cq? if you want me to cq+ it
(In reply to youenn fablet from comment #7) > Please put cq? if you want me to cq+ it Added! Thank you for the head's up.
Committed r284039 (242869@main): <https://commits.webkit.org/242869@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440948 [details].
<rdar://problem/84167947>