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

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

Issue 2189733003: Remove virtual test suits virtual/threaded/fast/canvas-toBlob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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
deleted file mode 100644
index 39b3f2aed5d9df49d46494203a6f6c266b1c66db..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-createImageBitmap-blob-in-workers.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../../../resources/js-test.js"></script>
-</head>
-<body>
-<script>
-jsTestIsAsync = true;
-var worker = new Worker('../../../../fast/canvas/resources/canvas-createImageBitmap-blob-in-workers.js');
-
-description('Test race condition for createImageBitmap from blob in workers and main.');
-
-var imgWidth = 20;
-var imgHeight = 20;
-var numOfBitmaps = 5;
-var bitmapArray = [];
-
-var canvas1 = document.createElement("canvas");
-var ctx1 = canvas1.getContext("2d");
-ctx1.fillStyle = "#FF0000";
-ctx1.fillRect(0, 0, imgWidth, imgHeight);
-
-function compareImageData(data1, data2)
-{
- if (data1.length != data2.length) {
- testFailed("The two image have different dimensions");
- finishJSTest();
- }
- for (var i = 0; i < data1.length; i++) {
- if (data1[i] != data2[i]) {
- testFailed("The two image have different pixel data");
- finishJSTest();
- }
- }
-}
-
-var getMessageFromWorker = new Promise((resolve, reject) => {
- function onMessage(e) {
- resolve(e.data.data);
- worker.removeEventListener("message", onMessage);
- }
- worker.addEventListener("message", onMessage);
-});
-
-// check that the created ImageBitmaps from worker and main have the same pixel
-// data as the source, which is the canvas1.toBlob
-var newImg = new Image();
-canvas1.toBlob(function(blob) {
- worker.postMessage(blob);
- for (var i = 0; i < numOfBitmaps; i++) {
- createImageBitmap(blob).then(imageBitmap => {
- bitmapArray.push(imageBitmap);
- if (bitmapArray.length == numOfBitmaps) {
- var url = URL.createObjectURL(blob);
- newImg.src = url;
- }
- });
- }
-});
-
-var imageLoaded = new Promise((resolve, reject) => {
- newImg.onload = function() {
- var canvas2 = document.createElement("canvas");
- var ctx2 = canvas2.getContext("2d");
- ctx2.drawImage(newImg, 0, 0, imgWidth, imgHeight);
- resolve(ctx2.getImageData(0, 0, imgWidth, imgHeight).data);
- };
-});
-
-Promise.all([imageLoaded, getMessageFromWorker]).then(([imageDataFromImg, imageBitmapFromWorker]) => {
- var canvas3 = document.createElement("canvas");
- var ctx3 = canvas3.getContext("2d");
- for (var i = 0; i < numOfBitmaps; i++) {
- ctx3.clearRect(0, 0, imgWidth, imgHeight);
- ctx3.drawImage(bitmapArray[i], 0, 0, imgWidth, imgHeight);
- var imageData = ctx3.getImageData(0, 0, imgWidth, imgHeight).data;
- compareImageData(imageData, imageDataFromImg);
- }
-
- ctx3.clearRect(0, 0, imgWidth, imgHeight);
- ctx3.drawImage(imageBitmapFromWorker, 0, 0, imgWidth, imgHeight);
- var imageData = ctx3.getImageData(0, 0, imgWidth, imgHeight).data;
- compareImageData(imageData, imageDataFromImg);
- testPassed("ImageBitmaps created from blob in worker and in main have the same pixel data");
- finishJSTest();
-});
-
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698