| Index: third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e8a690d8c4ce3fd951e6277b29e1ab302858cea2
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html
|
| @@ -0,0 +1,66 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="./resources/webgl-test-utils-full.js"></script>
|
| +<script src="./resources/tex-image-and-sub-image-utils.js"></script>
|
| +<script src="./resources/tex-image-and-sub-image-image-bitmap-utils.js"></script>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<body>
|
| +<script>
|
| +var wtu = WebGLTestUtils;
|
| +var tiu = TexImageUtils;
|
| +var gl = null;
|
| +var internalFormat = "RGBA";
|
| +var pixelFormat = "RGBA";
|
| +var pixelType = "UNSIGNED_BYTE";
|
| +var redColor = [255, 0, 0];
|
| +var greenColor = [0, 255, 0];
|
| +var blackColor = [0, 0, 0];
|
| +var darkRed = [128, 0, 0];
|
| +var darkGreen = [0, 128, 0];
|
| +
|
| +var video = document.createElement("video");
|
| +
|
| +function generateTest()
|
| +{
|
| + var bitmaps = [];
|
| +
|
| + var canvas = document.createElement('canvas');
|
| + canvas.width = 32;
|
| + canvas.height = 32;
|
| + document.body.appendChild(canvas);
|
| + gl = canvas.getContext("webgl");
|
| +
|
| + gl.clearColor(0,0,0,1);
|
| + gl.clearDepth(1);
|
| +
|
| + var p1 = createImageBitmap(video, {resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.defaultOption = imageBitmap });
|
| + var p2 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlpha: "premultiply", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap });
|
| + var p3 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlpha: "default", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.noFlipYDefault = imageBitmap });
|
| + var p4 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlpha: "none", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.noFlipYUnpremul = imageBitmap });
|
| + var p5 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlpha: "premultiply", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.flipYPremul = imageBitmap });
|
| + var p6 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlpha: "default", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.flipYDefault = imageBitmap });
|
| + var p7 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlpha: "none", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.flipYUnpremul = imageBitmap });
|
| + var p8 = createImageBitmap(video, {resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.colorSpaceDef = imageBitmap });
|
| + var p9 = createImageBitmap(video, {colorSpaceConversion: "none", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.colorSpaceNone = imageBitmap });
|
| + var p10 = createImageBitmap(video, {colorSpaceConversion: "default", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.colorSpaceDefault = imageBitmap });
|
| + return Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]).then(function() {
|
| + var alphaVal = 1;
|
| + var testPassed = runTest(bitmaps, alphaVal, false);
|
| + if (!testPassed)
|
| + assert_true(false, 'Test failed');
|
| + }, function() {
|
| + assert_true(false, 'Promise rejected');
|
| + });
|
| +}
|
| +
|
| +promise_test(function() {
|
| + video.oncanplaythrough = function() {
|
| + return generateTest();
|
| + }
|
| + video.src = "resources/red-green.ogv";
|
| +}, 'createImageBitmap(HTMLVideoElement) with resize and other options');
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|