| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
| 7 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
| 8 | 8 |
| 9 #include "gpu/command_buffer/tests/gl_manager.h" | 9 #include "gpu/command_buffer/tests/gl_manager.h" |
| 10 #include "gpu/command_buffer/tests/gl_test_utils.h" | 10 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 #define SHADER(Src) #Src | 14 #define SHADER(Src) #Src |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 | 17 |
| 18 class BindUniformLocationTest : public testing::Test { | 18 class BindUniformLocationTest : public testing::Test { |
| 19 protected: | 19 protected: |
| 20 static const GLsizei kResolution = 4; | 20 static const GLsizei kResolution = 4; |
| 21 virtual void SetUp() { | 21 void SetUp() override { |
| 22 GLManager::Options options; | 22 GLManager::Options options; |
| 23 options.size = gfx::Size(kResolution, kResolution); | 23 options.size = gfx::Size(kResolution, kResolution); |
| 24 gl_.Initialize(options); | 24 gl_.Initialize(options); |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual void TearDown() { | 27 void TearDown() override { gl_.Destroy(); } |
| 28 gl_.Destroy(); | |
| 29 } | |
| 30 | 28 |
| 31 GLManager gl_; | 29 GLManager gl_; |
| 32 }; | 30 }; |
| 33 | 31 |
| 34 TEST_F(BindUniformLocationTest, Basic) { | 32 TEST_F(BindUniformLocationTest, Basic) { |
| 35 ASSERT_TRUE( | 33 ASSERT_TRUE( |
| 36 GLTestHelper::HasExtension("GL_CHROMIUM_bind_uniform_location")); | 34 GLTestHelper::HasExtension("GL_CHROMIUM_bind_uniform_location")); |
| 37 | 35 |
| 38 static const char* v_shader_str = SHADER( | 36 static const char* v_shader_str = SHADER( |
| 39 attribute vec4 a_position; | 37 attribute vec4 a_position; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 GLTestHelper::CheckPixels(0, 0, kResolution, kResolution, 1, expected)); | 213 GLTestHelper::CheckPixels(0, 0, kResolution, kResolution, 1, expected)); |
| 216 | 214 |
| 217 GLTestHelper::CheckGLError("no errors", __LINE__); | 215 GLTestHelper::CheckGLError("no errors", __LINE__); |
| 218 | 216 |
| 219 } | 217 } |
| 220 | 218 |
| 221 } // namespace gpu | 219 } // namespace gpu |
| 222 | 220 |
| 223 | 221 |
| 224 | 222 |
| OLD | NEW |