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" | |
30 #include "ui/gl/test/gl_surface_test_support.h" | 29 #include "ui/gl/test/gl_surface_test_support.h" |
31 | 30 |
32 using ::gl::MockGLInterface; | 31 using ::gl::MockGLInterface; |
33 using ::testing::_; | 32 using ::testing::_; |
34 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
35 using ::testing::AtMost; | 34 using ::testing::AtMost; |
36 using ::testing::DoAll; | 35 using ::testing::DoAll; |
37 using ::testing::InSequence; | 36 using ::testing::InSequence; |
38 using ::testing::Invoke; | 37 using ::testing::Invoke; |
39 using ::testing::InvokeWithoutArgs; | 38 using ::testing::InvokeWithoutArgs; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 567 } |
569 } | 568 } |
570 | 569 |
571 decoder_->EndDecoding(); | 570 decoder_->EndDecoding(); |
572 decoder_->Destroy(!decoder_->WasContextLost()); | 571 decoder_->Destroy(!decoder_->WasContextLost()); |
573 decoder_.reset(); | 572 decoder_.reset(); |
574 group_->Destroy(mock_decoder_.get(), false); | 573 group_->Destroy(mock_decoder_.get(), false); |
575 engine_.reset(); | 574 engine_.reset(); |
576 ::gl::MockGLInterface::SetGLInterface(NULL); | 575 ::gl::MockGLInterface::SetGLInterface(NULL); |
577 gl_.reset(); | 576 gl_.reset(); |
578 gl::init::ClearGLBindings(); | 577 gl::ClearGLBindings(); |
579 } | 578 } |
580 | 579 |
581 void GLES2DecoderTestBase::TearDown() { | 580 void GLES2DecoderTestBase::TearDown() { |
582 ResetDecoder(); | 581 ResetDecoder(); |
583 } | 582 } |
584 | 583 |
585 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { | 584 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { |
586 if (enable) { | 585 if (enable) { |
587 EXPECT_CALL(*gl_, Enable(cap)) | 586 EXPECT_CALL(*gl_, Enable(cap)) |
588 .Times(1) | 587 .Times(1) |
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 SetupDefaultProgram(); | 2080 SetupDefaultProgram(); |
2082 } | 2081 } |
2083 | 2082 |
2084 // 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 |
2085 // 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 |
2086 // instead of having to edit some template or the code generator. | 2085 // instead of having to edit some template or the code generator. |
2087 #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" |
2088 | 2087 |
2089 } // namespace gles2 | 2088 } // namespace gles2 |
2090 } // namespace gpu | 2089 } // namespace gpu |
OLD | NEW |