| 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> |
| (...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 // Use invalid border. | 2639 // Use invalid border. |
| 2640 gl_->TexImage2D( | 2640 gl_->TexImage2D( |
| 2641 kTarget, kLevel, kFormat, kWidth, kHeight, kInvalidBorder, kFormat, kType, | 2641 kTarget, kLevel, kFormat, kWidth, kHeight, kInvalidBorder, kFormat, kType, |
| 2642 pixels); | 2642 pixels); |
| 2643 | 2643 |
| 2644 EXPECT_TRUE(NoCommandsWritten()); | 2644 EXPECT_TRUE(NoCommandsWritten()); |
| 2645 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 2645 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 2646 | 2646 |
| 2647 ClearCommands(); | 2647 ClearCommands(); |
| 2648 | 2648 |
| 2649 gl_->AsyncTexImage2DCHROMIUM( | |
| 2650 kTarget, kLevel, kFormat, kWidth, kHeight, kInvalidBorder, kFormat, kType, | |
| 2651 NULL); | |
| 2652 | |
| 2653 EXPECT_TRUE(NoCommandsWritten()); | |
| 2654 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | |
| 2655 | |
| 2656 ClearCommands(); | |
| 2657 | |
| 2658 // Checking for CompressedTexImage2D argument validation is a bit tricky due | 2649 // Checking for CompressedTexImage2D argument validation is a bit tricky due |
| 2659 // to (runtime-detected) compression formats. Try to infer the error with an | 2650 // to (runtime-detected) compression formats. Try to infer the error with an |
| 2660 // aux check. | 2651 // aux check. |
| 2661 const GLenum kCompressedFormat = GL_ETC1_RGB8_OES; | 2652 const GLenum kCompressedFormat = GL_ETC1_RGB8_OES; |
| 2662 gl_->CompressedTexImage2D( | 2653 gl_->CompressedTexImage2D( |
| 2663 kTarget, kLevel, kCompressedFormat, kWidth, kHeight, kBorder, | 2654 kTarget, kLevel, kCompressedFormat, kWidth, kHeight, kBorder, |
| 2664 arraysize(pixels), pixels); | 2655 arraysize(pixels), pixels); |
| 2665 | 2656 |
| 2666 // In the above, kCompressedFormat and arraysize(pixels) are possibly wrong | 2657 // In the above, kCompressedFormat and arraysize(pixels) are possibly wrong |
| 2667 // values. First ensure that these do not cause failures at the client. If | 2658 // values. First ensure that these do not cause failures at the client. If |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4030 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { | 4021 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
| 4031 ContextInitOptions init_options; | 4022 ContextInitOptions init_options; |
| 4032 init_options.transfer_buffer_initialize_fail = true; | 4023 init_options.transfer_buffer_initialize_fail = true; |
| 4033 EXPECT_FALSE(Initialize(init_options)); | 4024 EXPECT_FALSE(Initialize(init_options)); |
| 4034 } | 4025 } |
| 4035 | 4026 |
| 4036 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 4027 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 4037 | 4028 |
| 4038 } // namespace gles2 | 4029 } // namespace gles2 |
| 4039 } // namespace gpu | 4030 } // namespace gpu |
| OLD | NEW |