2010-12-29 Zhenyao Mo <zmo@google.com>
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Dec 2010 03:54:50 +0000 (03:54 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Dec 2010 03:54:50 +0000 (03:54 +0000)
        Reviewed by Eric Seidel.

        drawElements should raise INVALID_OPERATION if offset is not a multiple of the type size
        https://bugs.webkit.org/show_bug.cgi?id=51726

        * fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
        * fast/canvas/webgl/draw-elements-out-of-bounds.html: Add test cases to verify the behavior.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html

index 6709299..54735d7 100644 (file)
@@ -1,3 +1,13 @@
+2010-12-29  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Eric Seidel.
+
+        drawElements should raise INVALID_OPERATION if offset is not a multiple of the type size
+        https://bugs.webkit.org/show_bug.cgi?id=51726
+
+        * fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
+        * fast/canvas/webgl/draw-elements-out-of-bounds.html: Add test cases to verify the behavior.
+
 2010-12-29  Mihai Parparita  <mihaip@chromium.org>
 
         Unreviewed Chromium expectations update.
index 07ff5e2..615a668 100644 (file)
@@ -49,6 +49,9 @@ PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 2*15) ge
 PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_VALUE.
 PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
 PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 1) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 2) generated expected GL error: NO_ERROR.
 
 PASS successfullyParsed is true
 
index 76bd00c..28ec2c6 100644 (file)
@@ -120,6 +120,11 @@ shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(
 
 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_SHORT, 0)");
 
+// invalid operation with offset that's not a multiple of the type size
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 1)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 2)");
+
 debug("")
 successfullyParsed = true;
 </script>