Commit 887dd2f1 by Corentin Wallez

Make EGLQueryContextTest use ANGLE_INSTANTIATE_TEST

This makes it run correctly on Linux where the only platform available is OpenGL. BUG=angleproject:892 Change-Id: I3d72163b49b35daba702ebb5b48d010761c7fb6d Reviewed-on: https://chromium-review.googlesource.com/270262Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 973402fd
......@@ -49,14 +49,13 @@
'<(angle_path)/src/tests/gl_tests/UnpackRowLength.cpp',
'<(angle_path)/src/tests/gl_tests/VertexAttributeTest.cpp',
'<(angle_path)/src/tests/gl_tests/ViewportTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLQueryContextTest.cpp',
'<(angle_path)/src/tests/test_utils/ANGLETest.cpp',
'<(angle_path)/src/tests/test_utils/ANGLETest.h',
'<(angle_path)/src/tests/test_utils/angle_test_configs.h',
],
'angle_end2end_tests_win_sources':
[
# TODO(cwallez) for Linux, requires only trying the OpenGL ANGLE platform
'<(angle_path)/src/tests/egl_tests/EGLQueryContextTest.cpp',
# TODO(cwallez) for Linux, requires a portable implementation of sleep
'<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp',
# TODO(cwallez) for Linux, requires implementation of eglBindTexImage for pbuffers
......
......@@ -9,19 +9,23 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
class EGLQueryContextTest : public testing::TestWithParam<int>
#include "test_utils/angle_test_configs.h"
using namespace angle;
class EGLQueryContextTest : public testing::TestWithParam<PlatformParameters>
{
public:
void SetUp() override
{
int clientVersion = GetParam();
int clientVersion = GetParam().mClientVersion;
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
EXPECT_TRUE(eglGetPlatformDisplayEXT != NULL);
EGLint dispattrs[] =
{
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().mEGLPlatformParameters.renderer,
EGL_NONE
};
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, dispattrs);
......@@ -92,7 +96,7 @@ TEST_P(EGLQueryContextTest, GetClientVersion)
{
EGLint clientVersion;
EXPECT_TRUE(eglQueryContext(mDisplay, mContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion) != EGL_FALSE);
EXPECT_TRUE(clientVersion == GetParam());
EXPECT_TRUE(clientVersion == GetParam().mClientVersion);
}
TEST_P(EGLQueryContextTest, GetRenderBufferNoSurface)
......@@ -144,4 +148,5 @@ TEST_P(EGLQueryContextTest, BadAttribute)
EXPECT_TRUE(eglGetError() == EGL_BAD_ATTRIBUTE);
}
INSTANTIATE_TEST_CASE_P(, EGLQueryContextTest, testing::Values(2, 3));
ANGLE_INSTANTIATE_TEST(EGLQueryContextTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(),
ES3_D3D11(), ES3_OPENGL());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment