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 <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3360 }; | 3360 }; |
3361 | 3361 |
3362 Mailbox mailbox = Mailbox::Generate(); | 3362 Mailbox mailbox = Mailbox::Generate(); |
3363 Cmds expected; | 3363 Cmds expected; |
3364 expected.cmd.Init(GL_TEXTURE_2D, kTexturesStartId, mailbox.name); | 3364 expected.cmd.Init(GL_TEXTURE_2D, kTexturesStartId, mailbox.name); |
3365 GLuint id = gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 3365 GLuint id = gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
3366 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 3366 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
3367 EXPECT_EQ(kTexturesStartId, id); | 3367 EXPECT_EQ(kTexturesStartId, id); |
3368 } | 3368 } |
3369 | 3369 |
3370 TEST_F(GLES2ImplementationTest, FailCreateImageCHROMIUMOnEmptyBuffers) { | |
reveman
2015/03/02 20:09:56
Do we need an error for this? We used to crash if
| |
3371 EXPECT_CALL(*command_buffer(), OnFlush()).Times(1).RetiresOnSaturation(); | |
3372 GLuint image_id = gl_->CreateImageCHROMIUM(nullptr, 10, 10, GL_RGBA); | |
3373 EXPECT_EQ(0u, image_id); | |
3374 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError()); | |
3375 } | |
3376 | |
3370 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { | 3377 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { |
3371 struct Cmds { | 3378 struct Cmds { |
3372 cmds::ProduceTextureCHROMIUMImmediate cmd; | 3379 cmds::ProduceTextureCHROMIUMImmediate cmd; |
3373 GLbyte data[64]; | 3380 GLbyte data[64]; |
3374 }; | 3381 }; |
3375 | 3382 |
3376 Mailbox mailbox = Mailbox::Generate(); | 3383 Mailbox mailbox = Mailbox::Generate(); |
3377 Cmds expected; | 3384 Cmds expected; |
3378 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); | 3385 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); |
3379 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 3386 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3684 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { | 3691 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
3685 ContextInitOptions init_options; | 3692 ContextInitOptions init_options; |
3686 init_options.transfer_buffer_initialize_fail = true; | 3693 init_options.transfer_buffer_initialize_fail = true; |
3687 EXPECT_FALSE(Initialize(init_options)); | 3694 EXPECT_FALSE(Initialize(init_options)); |
3688 } | 3695 } |
3689 | 3696 |
3690 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 3697 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
3691 | 3698 |
3692 } // namespace gles2 | 3699 } // namespace gles2 |
3693 } // namespace gpu | 3700 } // namespace gpu |
OLD | NEW |