Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webgl / src / sdk / tests / conformance / textures / gl-teximage.html
index bd327f0..d4db181 100644 (file)
@@ -64,6 +64,7 @@ var imgURLs = [
   '../resources/3x3.png',
   '../resources/blue-1x1.jpg',
   '../resources/red-indexed.png',
+  '../resources/transparent-on-left-indexed.png',
   '../resources/green-2x2-16bit.png',
   '../resources/small-square-with-colorspin-profile.jpg',
   '../resources/small-square-with-colorspin-profile.png',
@@ -422,6 +423,13 @@ function runTests(imgs) {
   // The image should be red.
   checkPixelRange(buf, middle, center, [ 255, 0, 0, 255 ], 10);
 
+  wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE,
+                imgs['../resources/transparent-on-left-indexed.png']);
+  wtu.clearAndDrawUnitQuad(gl);
+  wtu.checkCanvasRect(gl, 0, 0, 128, 16, [255, 0, 255, 0], "should be transparent purple");
+  wtu.checkCanvasRect(gl, 128, 0,128, 16, [255, 255, 0, 255], "should be yellow");
+
   debug("");
   debug("check uploading of 1-channel JPG images");
   gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,