WebGL Compat: make sure to test the correct error

In ForbidsClientSideElementArrayBuffer we test that WebGL Compatibility
returns a GL_INVALID_OPERATION but on NVIDIA Shield, the pointer had the
top bit set and caused a GL_INVALID_VALUE to be generated instead. Use a
intptr_t(1) for indices to test the correct error.

BUG=angleproject:1523

Change-Id: I1497694264befa14b2b6df167b4f20fdbb707983
Reviewed-on: https://chromium-review.googlesource.com/452547
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index 600697d..59ecf85 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -243,10 +243,12 @@
     glVertexAttribPointer(posLocation, 3, GL_FLOAT, GL_FALSE, 0, 0);
     glEnableVertexAttribArray(posLocation);
 
-    const GLubyte indices[] = {0, 1, 2, 3, 4, 5};
-
     ASSERT_GL_NO_ERROR();
-    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);
+
+    // Use the pointer with value of 1 for indices instead of an actual pointer because WebGL also
+    // enforces that the top bit of indices must be 0 (i.e. offset >= 0) and would generate
+    // GL_INVALID_VALUE in that case. Using a null pointer gets caught by another check.
+    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, reinterpret_cast<const void*>(intptr_t(1)));
     EXPECT_GL_ERROR(GL_INVALID_OPERATION);
 }