| 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 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "gpu/command_buffer/service/feature_info.h" | 10 #include "gpu/command_buffer/service/feature_info.h" |
| 11 #include "gpu/command_buffer/tests/gl_manager.h" | 11 #include "gpu/command_buffer/tests/gl_manager.h" |
| 12 #include "gpu/command_buffer/tests/gl_test_utils.h" | 12 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace gpu { | 16 namespace gpu { |
| 17 | 17 |
| 18 class GLLoseContextTest : public testing::Test { | 18 class GLLoseContextTest : public testing::Test { |
| 19 protected: | 19 protected: |
| 20 virtual void SetUp() { | 20 void SetUp() override { |
| 21 GLManager::Options options; | 21 GLManager::Options options; |
| 22 gl2_.Initialize(options); | 22 gl2_.Initialize(options); |
| 23 options.context_lost_allowed = true; | 23 options.context_lost_allowed = true; |
| 24 gl1a_.Initialize(options); | 24 gl1a_.Initialize(options); |
| 25 options.share_group_manager = &gl1a_; | 25 options.share_group_manager = &gl1a_; |
| 26 gl1b_.Initialize(options); | 26 gl1b_.Initialize(options); |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual void TearDown() { | 29 void TearDown() override { |
| 30 gl1a_.Destroy(); | 30 gl1a_.Destroy(); |
| 31 gl1b_.Destroy(); | 31 gl1b_.Destroy(); |
| 32 gl2_.Destroy(); | 32 gl2_.Destroy(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 GLManager gl1a_; | 35 GLManager gl1a_; |
| 36 GLManager gl1b_; | 36 GLManager gl1b_; |
| 37 GLManager gl2_; | 37 GLManager gl2_; |
| 38 }; | 38 }; |
| 39 | 39 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 61 // Expect the read will fail. | 61 // Expect the read will fail. |
| 62 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); | 62 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); |
| 63 gl2_.MakeCurrent(); | 63 gl2_.MakeCurrent(); |
| 64 uint8 expected_draw[] = { 0, 0, 0, 0, }; | 64 uint8 expected_draw[] = { 0, 0, 0, 0, }; |
| 65 // Expect the read will succeed. | 65 // Expect the read will succeed. |
| 66 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); | 66 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace gpu | 69 } // namespace gpu |
| 70 | 70 |
| OLD | NEW |