Chromium Code Reviews
DescriptionRevise layout tests to avoid race condition
At this moment, there is a race condition in this layout tests. This
layout tests includes the following steps:
1). Send a blob to worker
2). Right after that, both worker and main start creating ImageBitmap
from the blob.
3). Worker send the created ImageBitmap to main.
4). Get a Image from the blob using URL.createObjectURL(blob), Once this
Image is loaded, compare this Image with the ImageBitmaps created
in main and worker, they should have the same pixel data.
Now the problem here is that the main thread could wait for the Image to
be loaded and while in the meantime still wait for the created ImageBitmap
from worker. And there is a race condition here because one of them could
happen first and there is no guarantee to that.
This CL make changes such that the Image onload returns a promise. Also,
worker returning the ImageBitmap also returns a promise. We compare
the pixel data only when both promises are resolved. In this case, there
will be no race condition.
BUG=594196
Committed: https://crrev.com/6590bde0345a7d38a603cb4839ad2afd088db024
Cr-Commit-Position: refs/heads/master@{#380992}
Patch Set 1 #
Total comments: 3
Patch Set 2 : nits #
Messages
Total messages: 13 (6 generated)
|
|||||||||||||||||||||||||||||||||||||