| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 7 |
| 8 #include "gpu/command_buffer/tests/gl_manager.h" | 8 #include "gpu/command_buffer/tests/gl_manager.h" |
| 9 #include "gpu/command_buffer/tests/gl_test_utils.h" | 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace gpu { | 13 namespace gpu { |
| 14 | 14 |
| 15 class GLTest : public testing::Test { | 15 class GLTest : public testing::Test { |
| 16 protected: | 16 protected: |
| 17 virtual void SetUp() { | 17 void SetUp() override { gl_.Initialize(GLManager::Options()); } |
| 18 gl_.Initialize(GLManager::Options()); | |
| 19 } | |
| 20 | 18 |
| 21 virtual void TearDown() { | 19 void TearDown() override { gl_.Destroy(); } |
| 22 gl_.Destroy(); | |
| 23 } | |
| 24 | 20 |
| 25 GLManager gl_; | 21 GLManager gl_; |
| 26 }; | 22 }; |
| 27 | 23 |
| 28 // Test that GL is at least minimally working. | 24 // Test that GL is at least minimally working. |
| 29 TEST_F(GLTest, Basic) { | 25 TEST_F(GLTest, Basic) { |
| 30 glClearColor(0.0f, 1.0f, 0.0f, 1.0f); | 26 glClearColor(0.0f, 1.0f, 0.0f, 1.0f); |
| 31 glClear(GL_COLOR_BUFFER_BIT); | 27 glClear(GL_COLOR_BUFFER_BIT); |
| 32 uint8 expected[] = { 0, 255, 0, 255, }; | 28 uint8 expected[] = { 0, 255, 0, 255, }; |
| 33 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected)); | 29 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected)); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 EXPECT_STREQ( | 98 EXPECT_STREQ( |
| 103 "Chromium", | 99 "Chromium", |
| 104 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); | 100 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); |
| 105 EXPECT_STREQ( | 101 EXPECT_STREQ( |
| 106 "Chromium", | 102 "Chromium", |
| 107 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); | 103 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); |
| 108 } | 104 } |
| 109 | 105 |
| 110 } // namespace gpu | 106 } // namespace gpu |
| 111 | 107 |
| OLD | NEW |