Commit 7d738e26 by Corentin Wallez Committed by Commit Bot

Disable platform message when expecting OOM

BUG=angleproject:2122 Change-Id: I99eed52b1f12004f0bab3f94bd3acddda8dafd69 Reviewed-on: https://chromium-review.googlesource.com/650526Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 8a7b3a0c
...@@ -69,10 +69,14 @@ TEST_P(TextureRectangleTest, TexImage2D) ...@@ -69,10 +69,14 @@ TEST_P(TextureRectangleTest, TexImage2D)
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE, &maxSize); glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE, &maxSize);
// Defining a texture of the max size is allowed // Defining a texture of the max size is allowed
glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize, maxSize, 0, GL_RGBA, {
GL_UNSIGNED_BYTE, nullptr); ignorePlatformMessagesInScope();
GLenum error = glGetError();
ASSERT_TRUE(error == GL_NO_ERROR || error == GL_OUT_OF_MEMORY); glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize, maxSize, 0, GL_RGBA,
GL_UNSIGNED_BYTE, nullptr);
GLenum error = glGetError();
ASSERT_TRUE(error == GL_NO_ERROR || error == GL_OUT_OF_MEMORY);
}
// Defining a texture of the max size is allowed // Defining a texture of the max size is allowed
glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize + 1, maxSize, 0, GL_RGBA, glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize + 1, maxSize, 0, GL_RGBA,
...@@ -152,6 +156,8 @@ TEST_P(TextureRectangleTest, TexStorage2D) ...@@ -152,6 +156,8 @@ TEST_P(TextureRectangleTest, TexStorage2D)
// Defining a texture of the max size is allowed but still allow for OOM // Defining a texture of the max size is allowed but still allow for OOM
{ {
ignorePlatformMessagesInScope();
GLTexture tex; GLTexture tex;
glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex); glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8UI, maxSize, maxSize); TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8UI, maxSize, maxSize);
......
...@@ -1088,6 +1088,22 @@ void ANGLETestBase::ignoreD3D11SDKLayersWarnings() ...@@ -1088,6 +1088,22 @@ void ANGLETestBase::ignoreD3D11SDKLayersWarnings()
mIgnoreD3D11SDKLayersWarnings = true; mIgnoreD3D11SDKLayersWarnings = true;
} }
ANGLETestBase::ScopedIgnorePlatformMessages ANGLETestBase::ignorePlatformMessagesInScope()
{
return {this};
}
ANGLETestBase::ScopedIgnorePlatformMessages::ScopedIgnorePlatformMessages(ANGLETestBase *test)
: mTest(test)
{
mTest->mPlatformContext.ignoreMessages = true;
}
ANGLETestBase::ScopedIgnorePlatformMessages::~ScopedIgnorePlatformMessages()
{
mTest->mPlatformContext.ignoreMessages = false;
}
OSWindow *ANGLETestBase::mOSWindow = nullptr; OSWindow *ANGLETestBase::mOSWindow = nullptr;
Optional<EGLint> ANGLETestBase::mLastRendererType; Optional<EGLint> ANGLETestBase::mLastRendererType;
std::unique_ptr<angle::Library> ANGLETestBase::mGLESLibrary; std::unique_ptr<angle::Library> ANGLETestBase::mGLESLibrary;
......
...@@ -330,6 +330,20 @@ class ANGLETestBase ...@@ -330,6 +330,20 @@ class ANGLETestBase
angle::PlatformMethods mPlatformMethods; angle::PlatformMethods mPlatformMethods;
private: private:
class ScopedIgnorePlatformMessages : angle::NonCopyable
{
public:
ScopedIgnorePlatformMessages(ANGLETestBase *test);
~ScopedIgnorePlatformMessages();
private:
ANGLETestBase *mTest;
};
protected:
ScopedIgnorePlatformMessages ignorePlatformMessagesInScope();
private:
bool destroyEGLContext(); bool destroyEGLContext();
void checkD3D11SDKLayersMessages(); void checkD3D11SDKLayersMessages();
......
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