Commit 7323fd6e authored by Simon La Macchia's avatar Simon La Macchia Committed by Commit Bot

Fix GLCopyTextureCHROMIUMTest.InternalFormatNotSupported tests

Problem: There are 2 issues with these tests:
1. When testing glCopySubTextureCHROMIUM() the test does not clear
the previous error, so it fails when it calls glGetError(), as
the previous call to glTexImage2D also reports an error,
GL_INVALID_ENUM for GL_RED and GL_RG. This only occurs with ES2
devices.
2. When testing glCopyTextureCHROMIUM(), the error that will get hit
first and then returned depends on whether the test is being run
on a device with OpenGL ES2 or ES3+ capabilities. On ES2, the error
being returned is "internalformat GL_INVALID_VALUE".

Solution:
1. Clear previous error when testing glCopySubTextureCHROMIUM for
GL_INVALID_OPERATION so we get the error we are testing for.
2. Check if we get either GL_INVALID_VALUE or GL_INVALID_OPERATION,
as either is possible depending on which ES stack (ES2 or ES3) is
being executed base on the devices capabilities.

Bug: None
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ia99ea8a82341bd58fb634ea7144e142268ec6ab7
Reviewed-on: https://chromium-review.googlesource.com/1003075Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549233}
parent 669d4dc2
......@@ -867,16 +867,21 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) {
glCopyTextureCHROMIUM(textures_[0], 0, GL_TEXTURE_2D, textures_[1], 0,
unsupported_dest_formats[dest_index],
GL_UNSIGNED_BYTE, false, false, false);
EXPECT_THAT(glGetError(),
testing::AnyOf(GL_INVALID_VALUE, GL_INVALID_OPERATION))
<< "dest_index:" << dest_index;
} else {
glBindTexture(GL_TEXTURE_2D, textures_[1]);
glTexImage2D(GL_TEXTURE_2D, 0, unsupported_dest_formats[dest_index], 1, 1,
0, unsupported_dest_formats[dest_index], GL_UNSIGNED_BYTE,
nullptr);
// clear GL_INVALID_ENUM error from glTexImage2D on ES2 devices
glGetError();
glCopySubTextureCHROMIUM(textures_[0], 0, GL_TEXTURE_2D, textures_[1], 0,
0, 0, 0, 0, 1, 1, false, false, false);
EXPECT_TRUE(GL_INVALID_OPERATION == glGetError())
<< "dest_index:" << dest_index;
}
EXPECT_TRUE(GL_INVALID_OPERATION == glGetError())
<< "dest_index:" << dest_index;
}
glDeleteTextures(2, textures_);
glDeleteFramebuffers(1, &framebuffer_id_);
......
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