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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-video-resize.html

Issue 2218963002: Add more layout tests for createImageBitmap with resize options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-image-resize.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="./resources/webgl-test-utils-full.js"></script>
5 <script src="./resources/tex-image-and-sub-image-utils.js"></script>
6 <script src="./resources/tex-image-and-sub-image-image-bitmap-utils.js"></script >
7 <script src="../../../resources/testharness.js"></script>
8 <script src="../../../resources/testharnessreport.js"></script>
9 <body>
10 <script>
11 var wtu = WebGLTestUtils;
12 var tiu = TexImageUtils;
13 var gl = null;
14 var internalFormat = "RGBA";
15 var pixelFormat = "RGBA";
16 var pixelType = "UNSIGNED_BYTE";
17 var redColor = [255, 0, 0];
18 var greenColor = [0, 255, 0];
19 var blackColor = [0, 0, 0];
20 var darkRed = [128, 0, 0];
21 var darkGreen = [0, 128, 0];
22
23 var video = document.createElement("video");
24
25 function generateTest()
26 {
27 var bitmaps = [];
28
29 var canvas = document.createElement('canvas');
30 canvas.width = 32;
31 canvas.height = 32;
32 document.body.appendChild(canvas);
33 gl = canvas.getContext("webgl");
34
35 gl.clearColor(0,0,0,1);
36 gl.clearDepth(1);
37
38 var p1 = createImageBitmap(video, {resizeWidth: 4, resizeHeight: 4, resizeQu ality: "hight"}).then(function(imageBitmap) { bitmaps.defaultOption = imageBitma p });
39 var p2 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlph a: "premultiply", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then (function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap });
40 var p3 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlph a: "default", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(fun ction(imageBitmap) { bitmaps.noFlipYDefault = imageBitmap });
41 var p4 = createImageBitmap(video, {imageOrientation: "none", premultiplyAlph a: "none", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(functi on(imageBitmap) { bitmaps.noFlipYUnpremul = imageBitmap });
42 var p5 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlp ha: "premultiply", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).the n(function(imageBitmap) { bitmaps.flipYPremul = imageBitmap });
43 var p6 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlp ha: "default", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(fu nction(imageBitmap) { bitmaps.flipYDefault = imageBitmap });
44 var p7 = createImageBitmap(video, {imageOrientation: "flipY", premultiplyAlp ha: "none", resizeWidth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(funct ion(imageBitmap) { bitmaps.flipYUnpremul = imageBitmap });
45 var p8 = createImageBitmap(video, {resizeWidth: 4, resizeHeight: 4, resizeQu ality: "hight"}).then(function(imageBitmap) { bitmaps.colorSpaceDef = imageBitma p });
46 var p9 = createImageBitmap(video, {colorSpaceConversion: "none", resizeWidth : 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitm aps.colorSpaceNone = imageBitmap });
47 var p10 = createImageBitmap(video, {colorSpaceConversion: "default", resizeW idth: 4, resizeHeight: 4, resizeQuality: "hight"}).then(function(imageBitmap) { bitmaps.colorSpaceDefault = imageBitmap });
48 return Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]).then(function( ) {
49 var alphaVal = 1;
50 var testPassed = runTest(bitmaps, alphaVal, false);
51 if (!testPassed)
52 assert_true(false, 'Test failed');
53 }, function() {
54 assert_true(false, 'Promise rejected');
55 });
56 }
57
58 promise_test(function() {
59 video.oncanplaythrough = function() {
60 return generateTest();
61 }
62 video.src = "resources/red-green.ogv";
63 }, 'createImageBitmap(HTMLVideoElement) with resize and other options');
64 </script>
65 </body>
66 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-from-image-resize.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698