| 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 "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
| 17 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 17 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 18 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 18 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 19 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 19 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 20 #include "gpu/command_buffer/service/context_group.h" | 20 #include "gpu/command_buffer/service/context_group.h" |
| 21 #include "gpu/command_buffer/service/logger.h" | 21 #include "gpu/command_buffer/service/logger.h" |
| 22 #include "gpu/command_buffer/service/mailbox_manager.h" | 22 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 23 #include "gpu/command_buffer/service/program_manager.h" | 23 #include "gpu/command_buffer/service/program_manager.h" |
| 24 #include "gpu/command_buffer/service/test_helper.h" | 24 #include "gpu/command_buffer/service/test_helper.h" |
| 25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 #include "ui/gl/gl_implementation.h" | 27 #include "ui/gl/gl_implementation.h" |
| 28 #include "ui/gl/gl_mock.h" | 28 #include "ui/gl/gl_mock.h" |
| 29 #include "ui/gl/init/gl_factory.h" |
| 29 #include "ui/gl/test/gl_surface_test_support.h" | 30 #include "ui/gl/test/gl_surface_test_support.h" |
| 30 | 31 |
| 31 using ::gl::MockGLInterface; | 32 using ::gl::MockGLInterface; |
| 32 using ::testing::_; | 33 using ::testing::_; |
| 33 using ::testing::AnyNumber; | 34 using ::testing::AnyNumber; |
| 34 using ::testing::AtMost; | 35 using ::testing::AtMost; |
| 35 using ::testing::DoAll; | 36 using ::testing::DoAll; |
| 36 using ::testing::InSequence; | 37 using ::testing::InSequence; |
| 37 using ::testing::Invoke; | 38 using ::testing::Invoke; |
| 38 using ::testing::InvokeWithoutArgs; | 39 using ::testing::InvokeWithoutArgs; |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 567 } |
| 567 } | 568 } |
| 568 | 569 |
| 569 decoder_->EndDecoding(); | 570 decoder_->EndDecoding(); |
| 570 decoder_->Destroy(!decoder_->WasContextLost()); | 571 decoder_->Destroy(!decoder_->WasContextLost()); |
| 571 decoder_.reset(); | 572 decoder_.reset(); |
| 572 group_->Destroy(mock_decoder_.get(), false); | 573 group_->Destroy(mock_decoder_.get(), false); |
| 573 engine_.reset(); | 574 engine_.reset(); |
| 574 ::gl::MockGLInterface::SetGLInterface(NULL); | 575 ::gl::MockGLInterface::SetGLInterface(NULL); |
| 575 gl_.reset(); | 576 gl_.reset(); |
| 576 gl::ClearGLBindings(); | 577 gl::init::ClearGLBindings(); |
| 577 } | 578 } |
| 578 | 579 |
| 579 void GLES2DecoderTestBase::TearDown() { | 580 void GLES2DecoderTestBase::TearDown() { |
| 580 ResetDecoder(); | 581 ResetDecoder(); |
| 581 } | 582 } |
| 582 | 583 |
| 583 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { | 584 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { |
| 584 if (enable) { | 585 if (enable) { |
| 585 EXPECT_CALL(*gl_, Enable(cap)) | 586 EXPECT_CALL(*gl_, Enable(cap)) |
| 586 .Times(1) | 587 .Times(1) |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 SetupDefaultProgram(); | 2080 SetupDefaultProgram(); |
| 2080 } | 2081 } |
| 2081 | 2082 |
| 2082 // Include the auto-generated part of this file. We split this because it means | 2083 // Include the auto-generated part of this file. We split this because it means |
| 2083 // we can easily edit the non-auto generated parts right here in this file | 2084 // we can easily edit the non-auto generated parts right here in this file |
| 2084 // instead of having to edit some template or the code generator. | 2085 // instead of having to edit some template or the code generator. |
| 2085 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2086 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 2086 | 2087 |
| 2087 } // namespace gles2 | 2088 } // namespace gles2 |
| 2088 } // namespace gpu | 2089 } // namespace gpu |
| OLD | NEW |