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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 568 } |
568 } | 569 } |
569 | 570 |
570 decoder_->EndDecoding(); | 571 decoder_->EndDecoding(); |
571 decoder_->Destroy(!decoder_->WasContextLost()); | 572 decoder_->Destroy(!decoder_->WasContextLost()); |
572 decoder_.reset(); | 573 decoder_.reset(); |
573 group_->Destroy(mock_decoder_.get(), false); | 574 group_->Destroy(mock_decoder_.get(), false); |
574 engine_.reset(); | 575 engine_.reset(); |
575 ::gl::MockGLInterface::SetGLInterface(NULL); | 576 ::gl::MockGLInterface::SetGLInterface(NULL); |
576 gl_.reset(); | 577 gl_.reset(); |
577 gl::ClearGLBindings(); | 578 gl::init::ClearGLBindings(); |
578 } | 579 } |
579 | 580 |
580 void GLES2DecoderTestBase::TearDown() { | 581 void GLES2DecoderTestBase::TearDown() { |
581 ResetDecoder(); | 582 ResetDecoder(); |
582 } | 583 } |
583 | 584 |
584 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { | 585 void GLES2DecoderTestBase::ExpectEnableDisable(GLenum cap, bool enable) { |
585 if (enable) { | 586 if (enable) { |
586 EXPECT_CALL(*gl_, Enable(cap)) | 587 EXPECT_CALL(*gl_, Enable(cap)) |
587 .Times(1) | 588 .Times(1) |
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 SetupDefaultProgram(); | 2081 SetupDefaultProgram(); |
2081 } | 2082 } |
2082 | 2083 |
2083 // Include the auto-generated part of this file. We split this because it means | 2084 // Include the auto-generated part of this file. We split this because it means |
2084 // we can easily edit the non-auto generated parts right here in this file | 2085 // we can easily edit the non-auto generated parts right here in this file |
2085 // instead of having to edit some template or the code generator. | 2086 // instead of having to edit some template or the code generator. |
2086 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2087 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
2087 | 2088 |
2088 } // namespace gles2 | 2089 } // namespace gles2 |
2089 } // namespace gpu | 2090 } // namespace gpu |
OLD | NEW |