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

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

Issue 2471853002: remove 'unsafe' from ES3 apis in gpu process (Closed)
Patch Set: forgot to save file Created 4 years, 1 month 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/texture_manager_unittest.cc
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index 026b8c240082639c5502277d1764b33fe317f742..da1c9f9d2263d2789001b5112b64d9956924dcc2 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -68,12 +68,8 @@ class TextureManagerTest : public GpuServiceTest {
static const bool kUseDefaultTextures = false;
TextureManagerTest() {
- // Always run with this command line, but the ES3 features are not
- // enabled without FeatureInfo::EnableES3Validators().
- base::CommandLine command_line(0, nullptr);
- command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
- GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
- feature_info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
+ GpuDriverBugWorkarounds gpu_driver_bug_workaround;
+ feature_info_ = new FeatureInfo(gpu_driver_bug_workaround);
}
~TextureManagerTest() override {}
@@ -108,11 +104,13 @@ class TextureManagerTest : public GpuServiceTest {
void SetupFeatureInfo(const char* gl_extensions,
const char* gl_version,
bool enable_es3) {
+ ContextType context_type =
+ enable_es3 ? CONTEXT_TYPE_OPENGLES3 : CONTEXT_TYPE_OPENGLES2;
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
- gl_.get(), gl_extensions, "", gl_version,
- feature_info_->context_type(), enable_es3);
- feature_info_->InitializeForTesting();
- if (enable_es3) {
+ gl_.get(), gl_extensions, "", gl_version, context_type);
+ feature_info_->InitializeForTesting(context_type);
+ ASSERT_TRUE(feature_info_->context_type() == context_type);
+ if (feature_info_->IsWebGL2OrES3Context()) {
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
.WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
@@ -2200,11 +2198,13 @@ class SharedTextureTest : public GpuServiceTest {
void SetupFeatureInfo(const char* gl_extensions,
const char* gl_version,
bool enable_es3) {
+ ContextType context_type =
+ enable_es3 ? CONTEXT_TYPE_OPENGLES3 : CONTEXT_TYPE_OPENGLES2;
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
- gl_.get(), gl_extensions, "", gl_version,
- feature_info_->context_type(), enable_es3);
- feature_info_->InitializeForTesting();
- if (enable_es3) {
+ gl_.get(), gl_extensions, "", gl_version, context_type);
+ feature_info_->InitializeForTesting(context_type);
+ ASSERT_TRUE(feature_info_->context_type() == context_type);
+ if (feature_info_->IsWebGL2OrES3Context()) {
EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS, _))
.WillOnce(SetArgPointee<1>(8))
.RetiresOnSaturation();
« no previous file with comments | « gpu/command_buffer/service/texture_manager.cc ('k') | gpu/command_buffer/tests/es3_misc_functions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698