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

Unified Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html

Issue 1781613002: Fix data race problem in createImageBitmap(Blob) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix data rance layout test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html
index 228e9e43be85bdf4a20b5ad8ef20951f0ef9e868..c4156ea221ae016ec9814fad7bb0c24406d9f5e2 100644
--- a/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html
@@ -64,13 +64,17 @@ newImg.onload = function() {
canvas1.toBlob(function(blob) {
worker.postMessage(blob);
+ var setImgSrc = false;
for (var i = 0; i < numOfBitmaps; i++) {
createImageBitmap(blob).then(imageBitmap => {
bitmapArray.push(imageBitmap);
+ if (i >= numOfBitmaps - 1 && setImgSrc == false) {
+ var url = URL.createObjectURL(blob);
+ newImg.src = url;
+ setImgSrc = true;
+ }
});
}
- url = URL.createObjectURL(blob);
- newImg.src = url;
});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698