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/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
11 #include "gpu/command_buffer/client/client_test_helper.h" | 11 #include "gpu/command_buffer/client/client_test_helper.h" |
12 #include "gpu/command_buffer/client/program_info_manager.h" | 12 #include "gpu/command_buffer/client/program_info_manager.h" |
13 #include "gpu/command_buffer/client/transfer_buffer.h" | 13 #include "gpu/command_buffer/client/transfer_buffer.h" |
14 #include "gpu/command_buffer/common/command_buffer.h" | 14 #include "gpu/command_buffer/common/command_buffer.h" |
15 #include "gpu/command_buffer/common/compiler_specific.h" | 15 #include "gpu/command_buffer/common/compiler_specific.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 | 18 |
19 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) | 19 #if !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) |
20 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS | 20 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS |
21 #endif | 21 #endif |
22 | 22 |
23 using testing::_; | 23 using testing::_; |
| 24 using testing::AtLeast; |
24 using testing::AnyNumber; | 25 using testing::AnyNumber; |
25 using testing::DoAll; | 26 using testing::DoAll; |
26 using testing::InSequence; | 27 using testing::InSequence; |
27 using testing::Invoke; | 28 using testing::Invoke; |
28 using testing::Mock; | 29 using testing::Mock; |
29 using testing::Sequence; | 30 using testing::Sequence; |
30 using testing::StrictMock; | 31 using testing::StrictMock; |
31 using testing::Truly; | 32 using testing::Truly; |
32 using testing::Return; | 33 using testing::Return; |
33 | 34 |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 479 |
479 void GLES2ImplementationTest::SetUp() { | 480 void GLES2ImplementationTest::SetUp() { |
480 Initialize(false, true); | 481 Initialize(false, true); |
481 } | 482 } |
482 | 483 |
483 void GLES2ImplementationTest::TearDown() { | 484 void GLES2ImplementationTest::TearDown() { |
484 Mock::VerifyAndClear(gl_.get()); | 485 Mock::VerifyAndClear(gl_.get()); |
485 EXPECT_CALL(*command_buffer(), OnFlush()).Times(AnyNumber()); | 486 EXPECT_CALL(*command_buffer(), OnFlush()).Times(AnyNumber()); |
486 // For command buffer. | 487 // For command buffer. |
487 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) | 488 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) |
488 .Times(1) | 489 .Times(AtLeast(1)); |
489 .RetiresOnSaturation(); | |
490 gl_.reset(); | 490 gl_.reset(); |
491 } | 491 } |
492 | 492 |
493 class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest { | 493 class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest { |
494 protected: | 494 protected: |
495 virtual void SetUp() OVERRIDE; | 495 virtual void SetUp() OVERRIDE; |
496 }; | 496 }; |
497 | 497 |
498 void GLES2ImplementationStrictSharedTest::SetUp() { | 498 void GLES2ImplementationStrictSharedTest::SetUp() { |
499 Initialize(true, false); | 499 Initialize(true, false); |
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2801 gl_->Enable(GL_BLEND); | 2801 gl_->Enable(GL_BLEND); |
2802 EXPECT_TRUE(NoCommandsWritten()); | 2802 EXPECT_TRUE(NoCommandsWritten()); |
2803 } | 2803 } |
2804 | 2804 |
2805 | 2805 |
2806 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 2806 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
2807 | 2807 |
2808 } // namespace gles2 | 2808 } // namespace gles2 |
2809 } // namespace gpu | 2809 } // namespace gpu |
2810 | 2810 |
OLD | NEW |