Index: gpu/command_buffer/tests/gl_texture_storage_unittest.cc |
diff --git a/gpu/command_buffer/tests/gl_texture_storage_unittest.cc b/gpu/command_buffer/tests/gl_texture_storage_unittest.cc |
index 3006888aa6be6eb6ea13e02bd0c21cf9d061cca5..257fd7eb6f75881fd3441abb2dc81482d6d81729 100644 |
--- a/gpu/command_buffer/tests/gl_texture_storage_unittest.cc |
+++ b/gpu/command_buffer/tests/gl_texture_storage_unittest.cc |
@@ -5,8 +5,11 @@ |
#include <GLES2/gl2.h> |
#include <GLES2/gl2ext.h> |
+#include "base/command_line.h" |
+#include "base/strings/string_number_conversions.h" |
#include "gpu/command_buffer/tests/gl_manager.h" |
#include "gpu/command_buffer/tests/gl_test_utils.h" |
+#include "gpu/config/gpu_switches.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -16,9 +19,16 @@ class TextureStorageTest : public testing::Test { |
protected: |
static const GLsizei kResolution = 64; |
void SetUp() override { |
+ base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
+ command_line.AppendSwitchASCII( |
+ switches::kGpuDriverBugWorkarounds, |
+ base::IntToString(gpu::DISABLE_TEXTURE_STORAGE)); |
+ |
GLManager::Options options; |
options.size = gfx::Size(kResolution, kResolution); |
- gl_.Initialize(options); |
+ |
+ gl_.InitializeWithCommandLine(options, &command_line); |
+ DCHECK(gl_.workarounds().disable_texture_storage); |
gl_.MakeCurrent(); |
glGenTextures(1, &tex_); |
@@ -60,6 +70,9 @@ TEST_F(TextureStorageTest, CorrectPixels) { |
2, 2, |
GL_RGBA, GL_UNSIGNED_BYTE, |
source_pixels); |
+ |
+ // Mesa dirvers crash without DISABLE_TEXTURE_STORAGE workaround. |
+ // crbug.com/521904 |
EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 2, 2, 0, source_pixels)); |
} |