[webkit-reviews] review granted: [Bug 167050] ASSERTION FAILED: referrer == URL(URL(), referrer).strippedForUseAsReferrer() in WebCore::SecurityPolicy::generateReferrerHeader on https://trac.webkit.org/browser : [Attachment 377228] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 26 04:20:31 PDT 2019


youenn fablet <youennf at gmail.com> has granted Fujii Hironori
<Hironori.Fujii at sony.com>'s request for review:
Bug 167050: ASSERTION FAILED: referrer == URL(URL(),
referrer).strippedForUseAsReferrer() in
WebCore::SecurityPolicy::generateReferrerHeader on
https://trac.webkit.org/browser
https://bugs.webkit.org/show_bug.cgi?id=167050

Attachment 377228: Patch

https://bugs.webkit.org/attachment.cgi?id=377228&action=review




--- Comment #17 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 377228
  --> https://bugs.webkit.org/attachment.cgi?id=377228
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=377228&action=review

> LayoutTests/http/tests/navigation/page-cache-fragment-referrer.html:22
> +    shouldBeEqualToString('xhr.responseText',
'http://127.0.0.1:8000/navigation/page-cache-fragment-referrer.html');

Can we compute the expected value with document.location.href.
Something like shouldBeEqualToString('xhr.responseText' + window.location.hash,
window.location.href);

Also, I would use either async XHR or fetch.
jsTestIsAsync = true;
window.addEventListener('pageshow', async () => {
     const response = fetch('resources/referrer.php');
     shouldBeEqualToString('xhr.responseText' + window.location.hash,
window.location.href);
     finishJSTest();
});

It was not initially clear to me that we were doing the XHR before going to
success.html and after doing a back navigation.

We could register page show after back navigation, using some state kept
through local storage.
Or we could queue the load/back navigation after the first xhr/fetch test, do
the second xhr/fetch test and call finishJSTest (again using local storage).


More information about the webkit-reviews mailing list