haikuwebkit/LayoutTests/fast/history/page-cache-active-fetch-req...

14 lines
361 B
Plaintext
Raw Permalink Normal View History

FetchRequest should not prevent entering the back/forward cache https://bugs.webkit.org/show_bug.cgi?id=203091 <rdar://problem/56525333> Reviewed by Youenn Fablet. Source/WebCore: FetchRequest used to prevent the page from entering the back/forward cache while it had a blob load in progress. We no longer prevent suspension in such case. Instead, if the document is suspended when the blob load finishes, we post a task to the Window event loop to do the work and resolve / reject the promise. The Window event loop makes sure not to delays tasks that are associated with a document that is suspended. Tests: fast/history/page-cache-active-fetch-request-blobReadAsBlob.html fast/history/page-cache-active-fetch-request-blobReadAsReadableStream.html fast/history/page-cache-active-fetch-request-blobReadAsText.html * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::runNetworkTaskWhenPossible): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): (WebCore::FetchBodyOwner::postSuspendableNetworkTask): Deleted. * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchRequest.cpp: * Modules/fetch/FetchRequest.h: * dom/AbstractEventLoop.h: LayoutTests: Add layout test coverage. * TestExpectations: * fast/history/page-cache-active-fetch-request-blobReadAsBlob-expected.txt: Added. * fast/history/page-cache-active-fetch-request-blobReadAsBlob.html: Added. * fast/history/page-cache-active-fetch-request-blobReadAsReadableStream-expected.txt: Added. * fast/history/page-cache-active-fetch-request-blobReadAsReadableStream.html: Added. * fast/history/page-cache-active-fetch-request-blobReadAsText-expected.txt: Added. * fast/history/page-cache-active-fetch-request-blobReadAsText.html: Added. Canonical link: https://commits.webkit.org/216731@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-23 20:38:22 +00:00
Tests that a page with an active fetch request is able to enter the back/forward cache.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
pageshow - not from cache
pagehide - entering cache
pageshow - from cache
PASS Page did enter and was restored from the back/forward cache
PASS successfullyParsed is true
TEST COMPLETE