| 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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| 11 #include <GLES2/gl2extchromium.h> | 11 #include <GLES2/gl2extchromium.h> |
| 12 #include <GLES3/gl3.h> | 12 #include <GLES3/gl3.h> |
| 13 | 13 |
| 14 #include <stddef.h> | 14 #include <stddef.h> |
| 15 #include <stdint.h> | 15 #include <stdint.h> |
| 16 | 16 |
| 17 #include <memory> | 17 #include <memory> |
| 18 | 18 |
| 19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 20 #include "base/memory/ptr_util.h" |
| 20 #include "gpu/command_buffer/client/client_test_helper.h" | 21 #include "gpu/command_buffer/client/client_test_helper.h" |
| 21 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 22 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 22 #include "gpu/command_buffer/client/program_info_manager.h" | 23 #include "gpu/command_buffer/client/program_info_manager.h" |
| 23 #include "gpu/command_buffer/client/query_tracker.h" | 24 #include "gpu/command_buffer/client/query_tracker.h" |
| 24 #include "gpu/command_buffer/client/ring_buffer.h" | 25 #include "gpu/command_buffer/client/ring_buffer.h" |
| 25 #include "gpu/command_buffer/client/shared_memory_limits.h" | 26 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 26 #include "gpu/command_buffer/client/transfer_buffer.h" | 27 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 27 #include "gpu/command_buffer/common/command_buffer.h" | 28 #include "gpu/command_buffer/common/command_buffer.h" |
| 28 #include "gpu/command_buffer/common/sync_token.h" | 29 #include "gpu/command_buffer/common/sync_token.h" |
| 29 #include "testing/gmock/include/gmock/gmock.h" | 30 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 4572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4602 } | 4603 } |
| 4603 | 4604 |
| 4604 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { | 4605 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
| 4605 ContextInitOptions init_options; | 4606 ContextInitOptions init_options; |
| 4606 init_options.transfer_buffer_initialize_fail = true; | 4607 init_options.transfer_buffer_initialize_fail = true; |
| 4607 EXPECT_FALSE(Initialize(init_options)); | 4608 EXPECT_FALSE(Initialize(init_options)); |
| 4608 } | 4609 } |
| 4609 | 4610 |
| 4610 TEST_F(GLES2ImplementationTest, ClientVisibility) { | 4611 TEST_F(GLES2ImplementationTest, ClientVisibility) { |
| 4611 EXPECT_FALSE(gl_->AnyClientsVisible()); | 4612 EXPECT_FALSE(gl_->AnyClientsVisible()); |
| 4612 gl_->SetClientVisible(0, true); | 4613 { |
| 4613 EXPECT_TRUE(gl_->AnyClientsVisible()); | 4614 auto visibility_0 = gl_->ClientBecameVisible(); |
| 4614 gl_->SetClientVisible(0, false); | 4615 EXPECT_TRUE(gl_->AnyClientsVisible()); |
| 4615 EXPECT_FALSE(gl_->AnyClientsVisible()); | 4616 gl_->ClientBecameNotVisible(std::move(visibility_0)); |
| 4616 gl_->SetClientVisible(0, true); | 4617 EXPECT_FALSE(gl_->AnyClientsVisible()); |
| 4617 gl_->SetClientVisible(1, true); | 4618 } |
| 4618 EXPECT_TRUE(gl_->AnyClientsVisible()); | 4619 { |
| 4619 gl_->SetClientVisible(0, false); | 4620 auto visibility_0 = gl_->ClientBecameVisible(); |
| 4620 EXPECT_TRUE(gl_->AnyClientsVisible()); | 4621 auto visibility_1 = gl_->ClientBecameVisible(); |
| 4621 gl_->SetClientVisible(1, false); | 4622 EXPECT_TRUE(gl_->AnyClientsVisible()); |
| 4622 EXPECT_FALSE(gl_->AnyClientsVisible()); | 4623 gl_->ClientBecameNotVisible(std::move(visibility_0)); |
| 4624 EXPECT_TRUE(gl_->AnyClientsVisible()); |
| 4625 gl_->ClientBecameNotVisible(std::move(visibility_1)); |
| 4626 EXPECT_FALSE(gl_->AnyClientsVisible()); |
| 4627 } |
| 4623 } | 4628 } |
| 4624 | 4629 |
| 4625 #include "base/macros.h" | 4630 #include "base/macros.h" |
| 4626 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 4631 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 4627 | 4632 |
| 4628 } // namespace gles2 | 4633 } // namespace gles2 |
| 4629 } // namespace gpu | 4634 } // namespace gpu |
| OLD | NEW |