Finish basic timer query support in GL backend

EXT_disjoint_timer_query is feature complete with the WebGL tests passing
with Chromium using ANGLE as a backend. There is some flakiness in the
timestamp query test on WebGL, but investigation revealed a bug on
Chromium's end and a fix is being made there. Since the extension is
feature complete, it is now enabled by default on OpenGL so that it can be
regression tested.

BUG=angleproject:1265

Change-Id: If018b7e3ae84aff7e40c73ff8e672a86689ae6c4
Reviewed-on: https://chromium-review.googlesource.com/324580
Tryjob-Request: Ian Ewell <ewell@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Ian Ewell <ewell@google.com>
diff --git a/src/tests/gl_tests/TimerQueriesTest.cpp b/src/tests/gl_tests/TimerQueriesTest.cpp
index 341090f..29c7486 100644
--- a/src/tests/gl_tests/TimerQueriesTest.cpp
+++ b/src/tests/gl_tests/TimerQueriesTest.cpp
@@ -287,9 +287,55 @@
     EXPECT_LT(result1, result2);
 }
 
+class TimerQueriesTestES3 : public TimerQueriesTest
+{
+
+};
+
+// Tests getting timestamps via glGetInteger64v
+TEST_P(TimerQueriesTestES3, TimestampGetInteger64)
+{
+    if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
+    {
+        std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
+                  << std::endl;
+        return;
+    }
+
+    GLint queryTimestampBits = 0;
+    glGetQueryivEXT(GL_TIMESTAMP_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimestampBits);
+    ASSERT_GL_NO_ERROR();
+
+    std::cout << "Timestamp counter bits: " << queryTimestampBits << std::endl;
+
+    if (queryTimestampBits == 0)
+    {
+        std::cout << "Test skipped because of 0 counter bits" << std::endl;
+        return;
+    }
+
+    glDepthMask(GL_TRUE);
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
+    GLint64 result1 = 0;
+    GLint64 result2 = 0;
+    glGetInteger64v(GL_TIMESTAMP_EXT, &result1);
+    drawQuad(mProgram, "position", 0.8f);
+    glGetInteger64v(GL_TIMESTAMP_EXT, &result2);
+    ASSERT_GL_NO_ERROR();
+    std::cout << "Timestamps (getInteger64v): " << result1 << " " << result2 << std::endl;
+    EXPECT_LT(0l, result1);
+    EXPECT_LT(0l, result2);
+    EXPECT_LT(result1, result2);
+}
+
 ANGLE_INSTANTIATE_TEST(TimerQueriesTest,
                        ES2_D3D9(),
                        ES2_D3D11(),
                        ES3_D3D11(),
                        ES2_OPENGL(),
                        ES3_OPENGL());
+
+ANGLE_INSTANTIATE_TEST(TimerQueriesTestES3,
+                       ES3_D3D11(),
+                       ES3_OPENGL());
\ No newline at end of file