Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Issue 1792623002: Revise layout tests to avoid race condition (Closed)

Created:
4 years, 9 months ago by xidachen
Modified:
4 years, 9 months ago
Reviewers:
jbroman
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revise 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -35 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html View 1 2 chunks +39 lines, -31 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers-expected.txt View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
xidachen
PTAL.
4 years, 9 months ago (2016-03-12 02:09:32 UTC) #2
jbroman
lgtm https://codereview.chromium.org/1792623002/diff/1/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html File third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html (right): https://codereview.chromium.org/1792623002/diff/1/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html#newcode45 third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html:45: var newImg = new Image(); nit: Not new ...
4 years, 9 months ago (2016-03-14 14:58:42 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1792623002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1792623002/20001
4 years, 9 months ago (2016-03-14 15:16:03 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-14 16:09:32 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1792623002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1792623002/20001
4 years, 9 months ago (2016-03-14 16:49:13 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 9 months ago (2016-03-14 16:58:13 UTC) #11
commit-bot: I haz the power
4 years, 9 months ago (2016-03-14 16:59:27 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/6590bde0345a7d38a603cb4839ad2afd088db024
Cr-Commit-Position: refs/heads/master@{#380992}

Powered by Google App Engine
This is Rietveld 408576698