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, CreateImageCHROMIUM) { | |
mcasas
2015/02/28 01:14:26
CreateImageCHROMIUM as test name is a bit misleadi
emircan
2015/02/28 02:33:36
Renamed it. Will add more tests as implementation
| |
3371 EXPECT_CALL(*command_buffer(), OnFlush()) | |
3372 .Times(1) | |
3373 .RetiresOnSaturation(); | |
mcasas
2015/02/28 01:14:26
I think l.3371-3373 can be put in one line (no nee
emircan
2015/02/28 02:33:36
Done.
| |
3374 GLuint image_id = gl_->CreateImageCHROMIUM( | |
3375 nullptr, 10, 10, GL_RGBA); | |
mcasas
2015/02/28 01:14:26
Fits in one line?
emircan
2015/02/28 02:33:36
Fits, sorry for mssing that.
| |
3376 EXPECT_EQ(0u, image_id); | |
3377 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_VALUE), gl_->GetError()); | |
3378 } | |
3379 | |
3370 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { | 3380 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { |
3371 struct Cmds { | 3381 struct Cmds { |
3372 cmds::ProduceTextureCHROMIUMImmediate cmd; | 3382 cmds::ProduceTextureCHROMIUMImmediate cmd; |
3373 GLbyte data[64]; | 3383 GLbyte data[64]; |
3374 }; | 3384 }; |
3375 | 3385 |
3376 Mailbox mailbox = Mailbox::Generate(); | 3386 Mailbox mailbox = Mailbox::Generate(); |
3377 Cmds expected; | 3387 Cmds expected; |
3378 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); | 3388 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); |
3379 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 3389 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) { | 3694 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
3685 ContextInitOptions init_options; | 3695 ContextInitOptions init_options; |
3686 init_options.transfer_buffer_initialize_fail = true; | 3696 init_options.transfer_buffer_initialize_fail = true; |
3687 EXPECT_FALSE(Initialize(init_options)); | 3697 EXPECT_FALSE(Initialize(init_options)); |
3688 } | 3698 } |
3689 | 3699 |
3690 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 3700 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
3691 | 3701 |
3692 } // namespace gles2 | 3702 } // namespace gles2 |
3693 } // namespace gpu | 3703 } // namespace gpu |
OLD | NEW |