LayoutTest http/tests/workers/service/registration-clear-redundant-worker.html is...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 02:31:43 +0000 (02:31 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 02:31:43 +0000 (02:31 +0000)
commitf6a068dc896b0a904c421417acfc2084fc0bd938
treeac33c329c140037f7af8b5ea5c80255ade49aa67
parent1195194253a1dad795d286473f7ae637124f2676
LayoutTest http/tests/workers/service/registration-clear-redundant-worker.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179778

Reviewed by Youenn Fablet.

As per the specification [1], when clearing a registration, the registration's workers are first
marked as redundant *before* the registration's worker is set to null.

The test was waiting for the service worker's state to become redundant and then checking in a
setTimeout(0) that the registration's worker became null. However, a setTimeout(0) is racy here.
To address the issue, we now use setInterval() and wait until the worker becomes null.

[1] https://w3c.github.io/ServiceWorker/#clear-registration-algorithm

* TestExpectations:
* http/tests/workers/service/registration-clear-redundant-worker.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/workers/service/registration-clear-redundant-worker.html