Commit 9b9472c3 by Xinyi He Committed by Commit Bot

Fix ContextLostTest if robustness ext is disabled

Reset notification behavior is defined in the GL_EXT_robustness extension, and the resulting context must support the extension and the specified reset strategy. So if the ext is not supported, it should disable delivery of reset notifications. Bug: angleproject:4823 Change-Id: I49b9364a83eab9ebc0fdca3b1dc075c1a43070cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2302874 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 94303d17
......@@ -13,7 +13,17 @@ namespace angle
class ContextLostTest : public ANGLETest
{
protected:
ContextLostTest() { setContextResetStrategy(EGL_LOSE_CONTEXT_ON_RESET_EXT); }
ContextLostTest()
{
if (IsEGLClientExtensionEnabled("EGL_EXT_create_context_robustness"))
{
setContextResetStrategy(EGL_LOSE_CONTEXT_ON_RESET_EXT);
}
else
{
setContextResetStrategy(EGL_NO_RESET_NOTIFICATION_EXT);
}
}
};
// GL_CHROMIUM_lose_context is implemented in the frontend
......@@ -26,7 +36,8 @@ TEST_P(ContextLostTest, ExtensionStringExposed)
TEST_P(ContextLostTest, BasicUsage)
{
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_CHROMIUM_lose_context"));
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_robustness"));
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_robustness") ||
!IsEGLClientExtensionEnabled("EGL_EXT_create_context_robustness"));
glLoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET, GL_INNOCENT_CONTEXT_RESET);
EXPECT_GL_NO_ERROR();
......@@ -108,8 +119,15 @@ class ContextLostSkipValidationTest : public ANGLETest
protected:
ContextLostSkipValidationTest()
{
setContextResetStrategy(EGL_LOSE_CONTEXT_ON_RESET_EXT);
setNoErrorEnabled(true);
if (IsEGLClientExtensionEnabled("EGL_EXT_create_context_robustness"))
{
setContextResetStrategy(EGL_LOSE_CONTEXT_ON_RESET_EXT);
setNoErrorEnabled(true);
}
else
{
setContextResetStrategy(EGL_NO_RESET_NOTIFICATION_EXT);
}
}
};
......
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