Commit 5ae26eaa by Jamie Madill Committed by Commit Bot

Fix several small issues in angle_end2end_tests.

Many TearDown calls were missing. Also a few tests had other small issues. Discovered while changing the test harness. Bug: angleproject:3261 Change-Id: I8915088a6ca82e6cc4d6c922d03dc447e6051518 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524699Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f0607639
......@@ -17,7 +17,11 @@ namespace angle
class EGLDebugTest : public ANGLETest
{
protected:
void TearDown() override { eglDebugMessageControlKHR(nullptr, nullptr); }
void TearDown() override
{
eglDebugMessageControlKHR(nullptr, nullptr);
ANGLETest::TearDown();
}
bool hasExtension() const { return eglClientExtensionEnabled("EGL_KHR_debug"); }
......
......@@ -41,7 +41,9 @@ TEST_F(EGLSanityCheckTest, GetProcAddressNegativeTest)
// Tests that our whitelist function generally maps to our support function.
// We can add specific exceptions here if needed.
TEST_F(EGLSanityCheckTest, WhitelistMatchesSupport)
// Disabled because it was creating a large number of configs. This could even result
// in a BDOD on Windows.
TEST_F(EGLSanityCheckTest, DISABLED_WhitelistMatchesSupport)
{
// Has issues with Vulkan support detection on Android.
ANGLE_SKIP_TEST_IF(IsAndroid());
......
......@@ -18,14 +18,15 @@ using namespace angle;
namespace
{
class EGLSurfacelessContextTest : public ANGLETest
class EGLSurfacelessContextTest : public EGLTest,
public testing::WithParamInterface<PlatformParameters>
{
public:
EGLSurfacelessContextTest() : mDisplay(0) {}
void SetUp() override
{
ANGLETest::SetUp();
EGLTest::SetUp();
EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE};
mDisplay = eglGetPlatformDisplayEXT(
......@@ -65,7 +66,7 @@ class EGLSurfacelessContextTest : public ANGLETest
eglDestroyContext(mDisplay, mContext);
}
if (mContext != EGL_NO_SURFACE)
if (mPbuffer != EGL_NO_SURFACE)
{
eglDestroySurface(mDisplay, mPbuffer);
}
......
......@@ -51,6 +51,8 @@ class InstancingTest : public ANGLETest
glDeleteBuffers(1, &mInstanceBuffer);
glDeleteProgram(mProgram[0]);
glDeleteProgram(mProgram[1]);
ANGLETest::TearDown();
}
void SetUp() override
......@@ -210,7 +212,7 @@ class InstancingTest : public ANGLETest
GLuint mInstanceBuffer;
static constexpr unsigned kMaxDrawn = 16;
static constexpr float kDrawSize = 2.0 / kMaxDrawn;
static constexpr float kDrawSize = 2.0 / kMaxDrawn;
GLfloat mInstanceData[kMaxDrawn];
// clang-format off
......
......@@ -1094,7 +1094,6 @@ ANGLE_INSTANTIATE_TEST(SimpleOperationTest,
ES3_OPENGL(),
ES2_OPENGLES(),
ES3_OPENGLES(),
ES2_WGL(),
ES2_VULKAN());
} // namespace
......@@ -677,8 +677,6 @@ class UniformTestES3 : public ANGLETest
protected:
UniformTestES3() : mProgram(0) {}
void SetUp() override { ANGLETest::SetUp(); }
void TearDown() override
{
if (mProgram != 0)
......@@ -686,6 +684,8 @@ class UniformTestES3 : public ANGLETest
glDeleteProgram(mProgram);
mProgram = 0;
}
ANGLETest::TearDown();
}
GLuint mProgram;
......@@ -1097,8 +1097,6 @@ class UniformTestES31 : public ANGLETest
protected:
UniformTestES31() : mProgram(0) {}
void SetUp() override { ANGLETest::SetUp(); }
void TearDown() override
{
if (mProgram != 0)
......@@ -1106,6 +1104,8 @@ class UniformTestES31 : public ANGLETest
glDeleteProgram(mProgram);
mProgram = 0;
}
ANGLETest::TearDown();
}
GLuint mProgram;
......
......@@ -28,13 +28,6 @@ class WebGLFramebufferTest : public ANGLETest
setWebGLCompatibilityEnabled(true);
}
void SetUp() override
{
ANGLETest::SetUp();
glRequestExtensionANGLE = reinterpret_cast<PFNGLREQUESTEXTENSIONANGLEPROC>(
eglGetProcAddress("glRequestExtensionANGLE"));
}
void drawUByteColorQuad(GLuint program, GLint uniformLoc, const GLColor &color);
void testDepthStencilDepthStencil(GLint width, GLint height);
void testDepthStencilRenderbuffer(GLint width,
......@@ -44,8 +37,6 @@ class WebGLFramebufferTest : public ANGLETest
void testRenderingAndReading(GLuint program);
void testUsingIncompleteFramebuffer(GLenum depthFormat, GLenum depthAttachment);
void testDrawingMissingAttachment();
PFNGLREQUESTEXTENSIONANGLEPROC glRequestExtensionANGLE = nullptr;
};
constexpr GLint ALLOW_COMPLETE = 0x1;
......@@ -834,12 +825,7 @@ TEST_P(WebGLFramebufferTest, CheckValidColorDepthCombination)
// Test to cover a bug in preserving the texture image index for WebGL framebuffer attachments
TEST_P(WebGLFramebufferTest, TextureAttachmentCommitBug)
{
if (extensionRequestable("GL_ANGLE_depth_texture"))
{
glRequestExtensionANGLE("GL_ANGLE_depth_texture");
}
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_ANGLE_depth_texture"));
ANGLE_SKIP_TEST_IF(!ensureExtensionEnabled("GL_ANGLE_depth_texture"));
GLTexture depthTexture;
glBindTexture(GL_TEXTURE_2D, depthTexture.get());
......
......@@ -53,7 +53,7 @@ class PixelRect
}
else
{
ASSERT_TRUE(target == GL_TEXTURE_2D);
ASSERT_GLENUM_EQ(GL_TEXTURE_2D, target);
glTexImage2D(target, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
mData.data());
}
......@@ -235,20 +235,20 @@ class WebGLReadOutsideFramebufferTest : public ANGLETest
{
ANGLETest::SetUp();
constexpr char kVS[] =
"attribute vec3 a_position;\n"
"varying vec2 v_texCoord;\n"
"void main() {\n"
" v_texCoord = a_position.xy * 0.5 + 0.5;\n"
" gl_Position = vec4(a_position, 1);\n"
"}\n";
constexpr char kFS[] =
"precision mediump float;\n"
"varying vec2 v_texCoord;\n"
"uniform sampler2D u_texture;\n"
"void main() {\n"
" gl_FragColor = texture2D(u_texture, v_texCoord);\n"
"}\n";
constexpr char kVS[] = R"(
attribute vec3 a_position;
varying vec2 v_texCoord;
void main() {
v_texCoord = a_position.xy * 0.5 + 0.5;
gl_Position = vec4(a_position, 1);
})";
constexpr char kFS[] = R"(
precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D u_texture;
void main() {
gl_FragColor = texture2D(u_texture, v_texCoord);
})";
mProgram = CompileProgram(kVS, kFS);
glUseProgram(mProgram);
......
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