haikuwebkit/LayoutTests/crypto/workers
Chris Dumez 26f6d1401b [MacOS wk1] crypto/workers/subtle/hrsa-postMessage-worker.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=227540
<rdar://problem/79977662>

Reviewed by Geoffrey Garen.

Source/WebCore:

The test was sending 2 messages to the worker, the first one with the public key
and the second one for the private key. As the worker would receive those messages,
it would do some checks synchronously and post a message back to the main thread
script with the result. As we could see from the test's expected results, the
main thread script would usually (although flakily) receive the result for the
private key *before* the result for the public key, which was wrong.

The reason for this was that serializing / deserializing the crypto key would
spin the worker's run loop and the worker would thus process incoming messages
while serializing / deserializing a crypto key from a previous message.

To address the issue, we now use a BinarySemaphore to wait for the main thread
to finish the wrapping / unwrapping, instead of spinning the run loop.

No new tests, unskipped existing test.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::wrapCryptoKey):
(WebCore::WorkerGlobalScope::unwrapCryptoKey):

LayoutTests:

Rebaseline test now that the output is correct (and non-flaky). Also unmark the test as flaky.

* crypto/workers/subtle/ec-postMessage-worker-expected.txt:
* crypto/workers/subtle/hrsa-postMessage-worker-expected.txt:
* crypto/workers/subtle/hrsa-postMessage-worker.html:
* platform/mac-wk1/TestExpectations:


Canonical link: https://commits.webkit.org/239369@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-02 22:26:31 +00:00
..
resources
subtle
crypto-gc-worker-expected.txt
crypto-gc-worker.html
crypto-random-values-limits-worker-expected.txt
crypto-random-values-limits-worker.html
crypto-random-values-types-worker-expected.txt
crypto-random-values-types-worker.html
crypto-random-values-worker-expected.txt
crypto-random-values-worker.html