| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/gl_mock.h" | 7 #include "gpu/command_buffer/common/gl_mock.h" |
| 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using ::testing::StrEq; | 25 using ::testing::StrEq; |
| 26 | 26 |
| 27 namespace gpu { | 27 namespace gpu { |
| 28 namespace gles2 { | 28 namespace gles2 { |
| 29 | 29 |
| 30 class GLES2DecoderTest3 : public GLES2DecoderTestBase { | 30 class GLES2DecoderTest3 : public GLES2DecoderTestBase { |
| 31 public: | 31 public: |
| 32 GLES2DecoderTest3() { } | 32 GLES2DecoderTest3() { } |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 TEST_F(GLES2DecoderTest3, TraceBeginCHROMIUM) { | |
| 36 const uint32 kBucketId = 123; | |
| 37 const char kName[] = "test_command"; | |
| 38 SetBucketAsCString(kBucketId, kName); | |
| 39 | |
| 40 TraceBeginCHROMIUM begin_cmd; | |
| 41 begin_cmd.Init(kBucketId); | |
| 42 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); | |
| 43 } | |
| 44 | |
| 45 TEST_F(GLES2DecoderTest3, TraceEndCHROMIUM) { | |
| 46 // Test end fails if no begin. | |
| 47 TraceEndCHROMIUM end_cmd; | |
| 48 end_cmd.Init(); | |
| 49 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); | |
| 50 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | |
| 51 | |
| 52 const uint32 kBucketId = 123; | |
| 53 const char kName[] = "test_command"; | |
| 54 SetBucketAsCString(kBucketId, kName); | |
| 55 | |
| 56 TraceBeginCHROMIUM begin_cmd; | |
| 57 begin_cmd.Init(kBucketId); | |
| 58 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); | |
| 59 | |
| 60 end_cmd.Init(); | |
| 61 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); | |
| 62 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | |
| 63 } | |
| 64 | |
| 65 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" | 35 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" |
| 66 | 36 |
| 67 } // namespace gles2 | 37 } // namespace gles2 |
| 68 } // namespace gpu | 38 } // namespace gpu |
| OLD | NEW |