Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc

Issue 2445323006: command buffer: remove "unsafe" from autogenerated ES3 apis; cleanly separate ES3 tests (Closed)
Patch Set: address comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
index 3b10afd9b9a12c2a705cb8278edd4fcacf7b2e90..432d1839a76b5d7ef9dbab1bf9154348e701f1a1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "base/command_line.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
@@ -43,8 +44,6 @@ class GLES2DecoderTest2 : public GLES2DecoderTestBase {
void TestAcceptedUniform(GLenum uniform_type,
uint32_t accepts_apis,
bool es3_enabled) {
- decoder_->set_unsafe_es3_apis_enabled(es3_enabled);
-
SetupShaderForUniform(uniform_type);
bool valid_uniform = false;
@@ -568,7 +567,23 @@ class GLES2DecoderTest2 : public GLES2DecoderTestBase {
}
};
+class GLES3DecoderTest2 : public GLES2DecoderTest2 {
+ public:
+ GLES3DecoderTest2() { shader_language_version_ = 300; }
+ protected:
+ void SetUp() override {
+ base::CommandLine command_line(0, nullptr);
+ command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
+ InitState init;
+ init.gl_version = "OpenGL ES 3.0";
+ init.bind_generates_resource = true;
+ init.context_type = CONTEXT_TYPE_OPENGLES3;
+ InitDecoderWithCommandLine(init, &command_line);
+ }
+};
+
INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest2, ::testing::Bool());
+INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest2, ::testing::Bool());
template <>
void GLES2DecoderTestBase::SpecializedSetup<cmds::GetProgramInfoLog, 0>(
@@ -941,7 +956,7 @@ TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) {
GL_BOOL, Program::kUniform1i | Program::kUniform1f, false);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL) {
+TEST_P(GLES3DecoderTest2, AcceptsUniformES3_GL_BOOL) {
TestAcceptedUniform(
GL_BOOL,
Program::kUniform1i | Program::kUniform1f | Program::kUniform1ui,
@@ -953,7 +968,7 @@ TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) {
GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f, false);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC2) {
+TEST_P(GLES3DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC2) {
TestAcceptedUniform(
GL_BOOL_VEC2,
Program::kUniform2i | Program::kUniform2f | Program::kUniform2ui,
@@ -965,7 +980,7 @@ TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) {
GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f, false);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC3) {
+TEST_P(GLES3DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC3) {
TestAcceptedUniform(
GL_BOOL_VEC3,
Program::kUniform3i | Program::kUniform3f | Program::kUniform3ui,
@@ -977,7 +992,7 @@ TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) {
GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f, false);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC4) {
+TEST_P(GLES3DecoderTest2, AcceptsUniformES3_GL_BOOL_VEC4) {
TestAcceptedUniform(
GL_BOOL_VEC4,
Program::kUniform4i | Program::kUniform4f | Program::kUniform4ui,
@@ -1012,43 +1027,43 @@ TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) {
TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f, false);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT) {
TestAcceptedUniform(GL_UNSIGNED_INT, Program::kUniform1ui, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC2) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC2) {
TestAcceptedUniform(GL_UNSIGNED_INT_VEC2, Program::kUniform2ui, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC3) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC3) {
TestAcceptedUniform(GL_UNSIGNED_INT_VEC3, Program::kUniform3ui, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC4) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_UNSIGNED_INT_VEC4) {
TestAcceptedUniform(GL_UNSIGNED_INT_VEC4, Program::kUniform4ui, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x3) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x3) {
TestAcceptedUniform(GL_FLOAT_MAT2x3, Program::kUniformMatrix2x3f, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x4) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2x4) {
TestAcceptedUniform(GL_FLOAT_MAT2x4, Program::kUniformMatrix2x4f, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x2) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x2) {
TestAcceptedUniform(GL_FLOAT_MAT3x2, Program::kUniformMatrix3x2f, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x4) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3x4) {
TestAcceptedUniform(GL_FLOAT_MAT3x4, Program::kUniformMatrix3x4f, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x2) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x2) {
TestAcceptedUniform(GL_FLOAT_MAT4x2, Program::kUniformMatrix4x2f, true);
}
-TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x3) {
+TEST_P(GLES3DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x3) {
TestAcceptedUniform(GL_FLOAT_MAT4x3, Program::kUniformMatrix4x3f, true);
}

Powered by Google App Engine
This is Rietveld 408576698