| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
|
| index f2ce78dc8148577bad3955c4d05e6241f6cf7353..3a4ab4dc87899f8cf356b3ab351810f3f85a7215 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
|
| @@ -154,6 +154,7 @@ function loaded() {
|
| if (imageLoaded && imageBitmapLoaded && blobLoaded) {
|
| // check all of these elements
|
| elements = [image, aCanvas, d, testBitmap, blob];
|
| + //elements = [image];//, aCanvas, d, testBitmap, blob];
|
| // wait for callback to finish before each check to ensure synchronous behavior
|
| nextCheck(0);
|
| }
|
| @@ -177,6 +178,7 @@ function nextCheck(elementIndex) {
|
| var p8 = createImageBitmap(element, -30, -30, 30, 30).then(function (image) { imageBitmaps.empty = image });
|
| var p9 = createImageBitmap(element, 40, 30, 30, 30).then(function (image) { imageBitmaps.emptyTwo = image });
|
| Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9]).then(function() {
|
| + // Promise.all([p5]).then(function() {
|
| checkNoCrop(imageBitmaps.noCrop);
|
| checkCrop(imageBitmaps.crop);
|
| checkCropCenter(imageBitmaps.cropCenter);
|
| @@ -260,6 +262,8 @@ function checkCrop(imageBitmap) {
|
| // red should be drawn to (0, 0), (10, 10)
|
| clearContext(ctx);
|
| ctx.drawImage(imageBitmap, 0, 0);
|
| + shouldBeRed(0, 1);
|
| + shouldBeRed(1, 0);
|
| shouldBeRed(1, 1);
|
| shouldBeRed(9, 9);
|
| shouldBeClear(12, 12);
|
| @@ -329,45 +333,39 @@ function checkOverCrop(imageBitmap) {
|
| debug("Check over crop.");
|
| bitmap = imageBitmap;
|
| shouldBeType("bitmap", "ImageBitmap");
|
| - shouldBe("bitmap.width", "60");
|
| - shouldBe("bitmap.height", "60");
|
| + shouldBe("bitmap.width", "20");
|
| + shouldBe("bitmap.height", "20");
|
|
|
| - // should be drawn to (10, 10), (30, 30)
|
| + // should be drawn to (0, 0), (20, 20)
|
| clearContext(ctx);
|
| ctx.drawImage(imageBitmap, 0, 0);
|
| - shouldBeClear(1, 1);
|
| - shouldBeClear(9, 9);
|
| - shouldBeRed(11, 11);
|
| - shouldBeRed(19, 19);
|
| - shouldBeGreen(21, 19);
|
| - shouldBeBlue(19, 21);
|
| - shouldBeBlack(21, 21);
|
| - shouldBeBlack(29, 29);
|
| - shouldBeClear(32, 1);
|
| - shouldBeClear(1, 32);
|
| - shouldBeClear(32, 32);
|
| -
|
| - // should be drawn to (5, 5), (15, 15)
|
| - clearContext(ctx);
|
| - ctx.drawImage(imageBitmap, 0, 0, 30, 30);
|
| - shouldBeClear(1, 1);
|
| - shouldBeClear(4, 4);
|
| - shouldBeRed(6, 6);
|
| shouldBeRed(9, 9);
|
| shouldBeGreen(11, 9);
|
| shouldBeBlue(9, 11);
|
| shouldBeBlack(11, 11);
|
| - shouldBeBlack(14, 14);
|
| - shouldBeClear(16, 1);
|
| - shouldBeClear(1, 16);
|
| - shouldBeClear(16, 16);
|
| + shouldBeBlack(19, 19);
|
| + shouldBeClear(1, 21);
|
| + shouldBeClear(21, 1);
|
| + shouldBeClear(21, 21);
|
| +
|
| + // shrunk to (0, 0), (10, 10)
|
| + clearContext(ctx);
|
| + ctx.drawImage(imageBitmap, 0, 0, 10, 10);
|
| + shouldBeRed(4, 4);
|
| + shouldBeGreen(6, 4);
|
| + shouldBeBlue(4, 6);
|
| + shouldBeBlack(6, 6);
|
| + shouldBeBlack(9, 9);
|
| + shouldBeClear(1, 11);
|
| + shouldBeClear(11, 1);
|
| + shouldBeClear(11, 11);
|
| }
|
|
|
| function checkOverCropRight(imageBitmap) {
|
| debug("Check over crop right.");
|
| bitmap = imageBitmap;
|
| - shouldBe("bitmap.width", "50");
|
| - shouldBe("bitmap.height", "50");
|
| + shouldBe("bitmap.width", "10");
|
| + shouldBe("bitmap.height", "10");
|
|
|
| // black should be drawn to (0, 0), (10, 10)
|
| clearContext(ctx);
|
| @@ -380,7 +378,7 @@ function checkOverCropRight(imageBitmap) {
|
|
|
| // black should be drawn to (0, 0), (4, 4)
|
| clearContext(ctx);
|
| - ctx.drawImage(imageBitmap, 0, 0, 20, 20);
|
| + ctx.drawImage(imageBitmap, 0, 0, 4, 4);
|
| shouldBeBlack(1, 1);
|
| shouldBeBlack(3, 3);
|
| shouldBeClear(5, 5);
|
|
|