| 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 #include <stdint.h> |
| 8 | 9 |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "gpu/command_buffer/service/feature_info.h" | 11 #include "gpu/command_buffer/service/feature_info.h" |
| 11 #include "gpu/command_buffer/tests/gl_manager.h" | 12 #include "gpu/command_buffer/tests/gl_manager.h" |
| 12 #include "gpu/command_buffer/tests/gl_test_utils.h" | 13 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 namespace gpu { | 17 namespace gpu { |
| 17 | 18 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 TEST_F(GLLoseContextTest, ShareGroup) { | 43 TEST_F(GLLoseContextTest, ShareGroup) { |
| 43 // If losing the context will cause the process to exit, do not perform this | 44 // If losing the context will cause the process to exit, do not perform this |
| 44 // test as it will cause all subsequent tests to not run. | 45 // test as it will cause all subsequent tests to not run. |
| 45 if (gl1a_.workarounds().exit_on_context_lost) | 46 if (gl1a_.workarounds().exit_on_context_lost) |
| 46 return; | 47 return; |
| 47 | 48 |
| 48 gl1a_.MakeCurrent(); | 49 gl1a_.MakeCurrent(); |
| 49 glLoseContextCHROMIUM( | 50 glLoseContextCHROMIUM( |
| 50 GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTEXT_RESET_EXT); | 51 GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTEXT_RESET_EXT); |
| 51 | 52 |
| 52 uint8 expected_no_draw[] = { | 53 uint8_t expected_no_draw[] = { |
| 53 GLTestHelper::kCheckClearValue, | 54 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue, |
| 54 GLTestHelper::kCheckClearValue, | 55 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue, |
| 55 GLTestHelper::kCheckClearValue, | |
| 56 GLTestHelper::kCheckClearValue, | |
| 57 }; | 56 }; |
| 58 // Expect the read will fail. | 57 // Expect the read will fail. |
| 59 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); | 58 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); |
| 60 gl1b_.MakeCurrent(); | 59 gl1b_.MakeCurrent(); |
| 61 // Expect the read will fail. | 60 // Expect the read will fail. |
| 62 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); | 61 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); |
| 63 gl2_.MakeCurrent(); | 62 gl2_.MakeCurrent(); |
| 64 uint8 expected_draw[] = { 0, 0, 0, 0, }; | 63 uint8_t expected_draw[] = { |
| 64 0, 0, 0, 0, |
| 65 }; |
| 65 // Expect the read will succeed. | 66 // Expect the read will succeed. |
| 66 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); | 67 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace gpu | 70 } // namespace gpu |
| 70 | 71 |
| OLD | NEW |