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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../../resources/js-test.js"></script> 4 <script src="../../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 jsTestIsAsync = true; 8 jsTestIsAsync = true;
9 var worker = startWorker('../../../../fast/canvas/resources/canvas-createImageBi tmap-blob-in-workers.js'); 9 var worker = startWorker('../../../../fast/canvas/resources/canvas-createImageBi tmap-blob-in-workers.js');
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ctx3.drawImage(newImageBitmap, 0, 0, imgWidth, imgHeight); 57 ctx3.drawImage(newImageBitmap, 0, 0, imgWidth, imgHeight);
58 var imageData = ctx3.getImageData(0, 0, imgWidth, imgHeight).data; 58 var imageData = ctx3.getImageData(0, 0, imgWidth, imgHeight).data;
59 compareImageData(imageData, imageData2); 59 compareImageData(imageData, imageData2);
60 testPassed("ImageBitmaps created from blob in worker and in main have th e same pixel data"); 60 testPassed("ImageBitmaps created from blob in worker and in main have th e same pixel data");
61 finishJSTest(); 61 finishJSTest();
62 } 62 }
63 } 63 }
64 64
65 canvas1.toBlob(function(blob) { 65 canvas1.toBlob(function(blob) {
66 worker.postMessage(blob); 66 worker.postMessage(blob);
67 var setImgSrc = false;
67 for (var i = 0; i < numOfBitmaps; i++) { 68 for (var i = 0; i < numOfBitmaps; i++) {
68 createImageBitmap(blob).then(imageBitmap => { 69 createImageBitmap(blob).then(imageBitmap => {
69 bitmapArray.push(imageBitmap); 70 bitmapArray.push(imageBitmap);
71 if (i >= numOfBitmaps - 1 && setImgSrc == false) {
72 var url = URL.createObjectURL(blob);
73 newImg.src = url;
74 setImgSrc = true;
75 }
70 }); 76 });
71 } 77 }
72 url = URL.createObjectURL(blob);
73 newImg.src = url;
74 }); 78 });
75 79
76 </script> 80 </script>
77 </body> 81 </body>
78 </html> 82 </html>
OLDNEW
« 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