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 ...@@ -17,7 +17,11 @@ namespace angle
class EGLDebugTest : public ANGLETest class EGLDebugTest : public ANGLETest
{ {
protected: protected:
void TearDown() override { eglDebugMessageControlKHR(nullptr, nullptr); } void TearDown() override
{
eglDebugMessageControlKHR(nullptr, nullptr);
ANGLETest::TearDown();
}
bool hasExtension() const { return eglClientExtensionEnabled("EGL_KHR_debug"); } bool hasExtension() const { return eglClientExtensionEnabled("EGL_KHR_debug"); }
......
...@@ -41,7 +41,9 @@ TEST_F(EGLSanityCheckTest, GetProcAddressNegativeTest) ...@@ -41,7 +41,9 @@ TEST_F(EGLSanityCheckTest, GetProcAddressNegativeTest)
// Tests that our whitelist function generally maps to our support function. // Tests that our whitelist function generally maps to our support function.
// We can add specific exceptions here if needed. // 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. // Has issues with Vulkan support detection on Android.
ANGLE_SKIP_TEST_IF(IsAndroid()); ANGLE_SKIP_TEST_IF(IsAndroid());
......
...@@ -18,14 +18,15 @@ using namespace angle; ...@@ -18,14 +18,15 @@ using namespace angle;
namespace namespace
{ {
class EGLSurfacelessContextTest : public ANGLETest class EGLSurfacelessContextTest : public EGLTest,
public testing::WithParamInterface<PlatformParameters>
{ {
public: public:
EGLSurfacelessContextTest() : mDisplay(0) {} EGLSurfacelessContextTest() : mDisplay(0) {}
void SetUp() override void SetUp() override
{ {
ANGLETest::SetUp(); EGLTest::SetUp();
EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE}; EGLint dispattrs[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, GetParam().getRenderer(), EGL_NONE};
mDisplay = eglGetPlatformDisplayEXT( mDisplay = eglGetPlatformDisplayEXT(
...@@ -65,7 +66,7 @@ class EGLSurfacelessContextTest : public ANGLETest ...@@ -65,7 +66,7 @@ class EGLSurfacelessContextTest : public ANGLETest
eglDestroyContext(mDisplay, mContext); eglDestroyContext(mDisplay, mContext);
} }
if (mContext != EGL_NO_SURFACE) if (mPbuffer != EGL_NO_SURFACE)
{ {
eglDestroySurface(mDisplay, mPbuffer); eglDestroySurface(mDisplay, mPbuffer);
} }
......
...@@ -51,6 +51,8 @@ class InstancingTest : public ANGLETest ...@@ -51,6 +51,8 @@ class InstancingTest : public ANGLETest
glDeleteBuffers(1, &mInstanceBuffer); glDeleteBuffers(1, &mInstanceBuffer);
glDeleteProgram(mProgram[0]); glDeleteProgram(mProgram[0]);
glDeleteProgram(mProgram[1]); glDeleteProgram(mProgram[1]);
ANGLETest::TearDown();
} }
void SetUp() override void SetUp() override
...@@ -210,7 +212,7 @@ class InstancingTest : public ANGLETest ...@@ -210,7 +212,7 @@ class InstancingTest : public ANGLETest
GLuint mInstanceBuffer; GLuint mInstanceBuffer;
static constexpr unsigned kMaxDrawn = 16; static constexpr unsigned kMaxDrawn = 16;
static constexpr float kDrawSize = 2.0 / kMaxDrawn; static constexpr float kDrawSize = 2.0 / kMaxDrawn;
GLfloat mInstanceData[kMaxDrawn]; GLfloat mInstanceData[kMaxDrawn];
// clang-format off // clang-format off
......
...@@ -1094,7 +1094,6 @@ ANGLE_INSTANTIATE_TEST(SimpleOperationTest, ...@@ -1094,7 +1094,6 @@ ANGLE_INSTANTIATE_TEST(SimpleOperationTest,
ES3_OPENGL(), ES3_OPENGL(),
ES2_OPENGLES(), ES2_OPENGLES(),
ES3_OPENGLES(), ES3_OPENGLES(),
ES2_WGL(),
ES2_VULKAN()); ES2_VULKAN());
} // namespace } // namespace
...@@ -677,8 +677,6 @@ class UniformTestES3 : public ANGLETest ...@@ -677,8 +677,6 @@ class UniformTestES3 : public ANGLETest
protected: protected:
UniformTestES3() : mProgram(0) {} UniformTestES3() : mProgram(0) {}
void SetUp() override { ANGLETest::SetUp(); }
void TearDown() override void TearDown() override
{ {
if (mProgram != 0) if (mProgram != 0)
...@@ -686,6 +684,8 @@ class UniformTestES3 : public ANGLETest ...@@ -686,6 +684,8 @@ class UniformTestES3 : public ANGLETest
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
mProgram = 0; mProgram = 0;
} }
ANGLETest::TearDown();
} }
GLuint mProgram; GLuint mProgram;
...@@ -1097,8 +1097,6 @@ class UniformTestES31 : public ANGLETest ...@@ -1097,8 +1097,6 @@ class UniformTestES31 : public ANGLETest
protected: protected:
UniformTestES31() : mProgram(0) {} UniformTestES31() : mProgram(0) {}
void SetUp() override { ANGLETest::SetUp(); }
void TearDown() override void TearDown() override
{ {
if (mProgram != 0) if (mProgram != 0)
...@@ -1106,6 +1104,8 @@ class UniformTestES31 : public ANGLETest ...@@ -1106,6 +1104,8 @@ class UniformTestES31 : public ANGLETest
glDeleteProgram(mProgram); glDeleteProgram(mProgram);
mProgram = 0; mProgram = 0;
} }
ANGLETest::TearDown();
} }
GLuint mProgram; GLuint mProgram;
......
...@@ -28,13 +28,6 @@ class WebGLFramebufferTest : public ANGLETest ...@@ -28,13 +28,6 @@ class WebGLFramebufferTest : public ANGLETest
setWebGLCompatibilityEnabled(true); setWebGLCompatibilityEnabled(true);
} }
void SetUp() override
{
ANGLETest::SetUp();
glRequestExtensionANGLE = reinterpret_cast<PFNGLREQUESTEXTENSIONANGLEPROC>(
eglGetProcAddress("glRequestExtensionANGLE"));
}
void drawUByteColorQuad(GLuint program, GLint uniformLoc, const GLColor &color); void drawUByteColorQuad(GLuint program, GLint uniformLoc, const GLColor &color);
void testDepthStencilDepthStencil(GLint width, GLint height); void testDepthStencilDepthStencil(GLint width, GLint height);
void testDepthStencilRenderbuffer(GLint width, void testDepthStencilRenderbuffer(GLint width,
...@@ -44,8 +37,6 @@ class WebGLFramebufferTest : public ANGLETest ...@@ -44,8 +37,6 @@ class WebGLFramebufferTest : public ANGLETest
void testRenderingAndReading(GLuint program); void testRenderingAndReading(GLuint program);
void testUsingIncompleteFramebuffer(GLenum depthFormat, GLenum depthAttachment); void testUsingIncompleteFramebuffer(GLenum depthFormat, GLenum depthAttachment);
void testDrawingMissingAttachment(); void testDrawingMissingAttachment();
PFNGLREQUESTEXTENSIONANGLEPROC glRequestExtensionANGLE = nullptr;
}; };
constexpr GLint ALLOW_COMPLETE = 0x1; constexpr GLint ALLOW_COMPLETE = 0x1;
...@@ -834,12 +825,7 @@ TEST_P(WebGLFramebufferTest, CheckValidColorDepthCombination) ...@@ -834,12 +825,7 @@ TEST_P(WebGLFramebufferTest, CheckValidColorDepthCombination)
// Test to cover a bug in preserving the texture image index for WebGL framebuffer attachments // Test to cover a bug in preserving the texture image index for WebGL framebuffer attachments
TEST_P(WebGLFramebufferTest, TextureAttachmentCommitBug) TEST_P(WebGLFramebufferTest, TextureAttachmentCommitBug)
{ {
if (extensionRequestable("GL_ANGLE_depth_texture")) ANGLE_SKIP_TEST_IF(!ensureExtensionEnabled("GL_ANGLE_depth_texture"));
{
glRequestExtensionANGLE("GL_ANGLE_depth_texture");
}
ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_ANGLE_depth_texture"));
GLTexture depthTexture; GLTexture depthTexture;
glBindTexture(GL_TEXTURE_2D, depthTexture.get()); glBindTexture(GL_TEXTURE_2D, depthTexture.get());
......
...@@ -53,7 +53,7 @@ class PixelRect ...@@ -53,7 +53,7 @@ class PixelRect
} }
else 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, glTexImage2D(target, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
mData.data()); mData.data());
} }
...@@ -235,20 +235,20 @@ class WebGLReadOutsideFramebufferTest : public ANGLETest ...@@ -235,20 +235,20 @@ class WebGLReadOutsideFramebufferTest : public ANGLETest
{ {
ANGLETest::SetUp(); ANGLETest::SetUp();
constexpr char kVS[] = constexpr char kVS[] = R"(
"attribute vec3 a_position;\n" attribute vec3 a_position;
"varying vec2 v_texCoord;\n" varying vec2 v_texCoord;
"void main() {\n" void main() {
" v_texCoord = a_position.xy * 0.5 + 0.5;\n" v_texCoord = a_position.xy * 0.5 + 0.5;
" gl_Position = vec4(a_position, 1);\n" gl_Position = vec4(a_position, 1);
"}\n"; })";
constexpr char kFS[] = constexpr char kFS[] = R"(
"precision mediump float;\n" precision mediump float;
"varying vec2 v_texCoord;\n" varying vec2 v_texCoord;
"uniform sampler2D u_texture;\n" uniform sampler2D u_texture;
"void main() {\n" void main() {
" gl_FragColor = texture2D(u_texture, v_texCoord);\n" gl_FragColor = texture2D(u_texture, v_texCoord);
"}\n"; })";
mProgram = CompileProgram(kVS, kFS); mProgram = CompileProgram(kVS, kFS);
glUseProgram(mProgram); 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