Fix being unable to request some extensions implemented in the GL layer.

Some extensions are forced on in Context::initCaps even though the
backend's native extensions do not mark the extension as supported.
These extensions were not requestable because the
Context::isExtensionRequestable only checks if the backend supports the
extension.

Make GL_OES_vertex_array_object requestable to cover the issue.

BUG=angleproject:1523

Change-Id: Ie64df8e270924727ecf9cd3f993443abeb3ef658
Reviewed-on: https://chromium-review.googlesource.com/809197
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index a777e24..1cde5d7 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -1085,6 +1085,41 @@
     }
 }
 
+// Test enabling the GL_OES_vertex_array_object extension
+TEST_P(WebGLCompatibilityTest, EnableVertexArrayExtension)
+{
+    EXPECT_FALSE(extensionEnabled("GL_OES_vertex_array_object"));
+
+    // This extensions become core in in ES3/WebGL2.
+    ANGLE_SKIP_TEST_IF(getClientMajorVersion() >= 3);
+
+    GLint result = 0;
+    glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &result);
+    EXPECT_GL_ERROR(GL_INVALID_ENUM);
+
+    // Expect that GL_OES_vertex_array_object is always available.  It is implemented in the GL
+    // frontend.
+    EXPECT_TRUE(extensionRequestable("GL_OES_vertex_array_object"));
+
+    glRequestExtensionANGLE("GL_OES_vertex_array_object");
+    EXPECT_GL_NO_ERROR();
+
+    EXPECT_TRUE(extensionEnabled("GL_OES_vertex_array_object"));
+
+    glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &result);
+    EXPECT_GL_NO_ERROR();
+
+    GLuint vao = 0;
+    glGenVertexArraysOES(0, &vao);
+    EXPECT_GL_NO_ERROR();
+
+    glBindVertexArrayOES(vao);
+    EXPECT_GL_NO_ERROR();
+
+    glDeleteVertexArraysOES(1, &vao);
+    EXPECT_GL_NO_ERROR();
+}
+
 // Verify that the context generates the correct error when the framebuffer attachments are
 // different sizes
 TEST_P(WebGLCompatibilityTest, FramebufferAttachmentSizeMismatch)