[iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2018 18:10:05 +0000 (18:10 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2018 18:10:05 +0000 (18:10 +0000)
commit848db6375e625b5944bc5469917e56845b64f399
tree5ed583bfa8fe35381bd390e1cd65faf80e9ae9e9
parent22262291a0a2e3c262f45e2858d1775553cd71dd
[iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=181499
<rdar://problem/36443428>

Reviewed by Youenn Fablet.

Source/WebCore:

After resolving a registration promise, we send an IPC back to the StorageProcess
for synchronization purposes, to make sure the registration does not get updated
before the promise's JS code has been executed. However, resolving a promise
schedules a microtask to run the JS and we would therefore send the IPC back too
early, thus causing flakiness. We now only send the IPC back back only after that
microtask has run and the JS has been executed.

* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::callFunction):
(WebCore::DeferredPromise::whenSettled):
* bindings/js/JSDOMPromiseDeferred.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):

LayoutTests:

Unskip test that should no longer be flaky.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMPromise.cpp
Source/WebCore/bindings/js/JSDOMPromise.h
Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp
Source/WebCore/bindings/js/JSDOMPromiseDeferred.h
Source/WebCore/workers/service/ServiceWorkerContainer.cpp