diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 00:18:24 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-08 00:18:24 +0000 |
commit | 0a071a315daf2a8af0f7b85c84127cda268db2f5 (patch) | |
tree | 6927656c616bb451c2b31605a964b9cf7529632b /gpu | |
parent | cfbf0a1af6efcfdfdb540a59d8c167a9736a405c (diff) | |
download | chromium_src-0a071a315daf2a8af0f7b85c84127cda268db2f5.zip chromium_src-0a071a315daf2a8af0f7b85c84127cda268db2f5.tar.gz chromium_src-0a071a315daf2a8af0f7b85c84127cda268db2f5.tar.bz2 |
More out-of-lining of test code, along with a bunch of GMOCK objects.
Most notably, rename various mock_objects.h files in remoting/ because after deinlining, there were compile failures. This fixes Windows compiling because you can't have two implementation files with the same name in a project, even if they are in different directories. (The output from one compile will clobber the others!)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/6250198
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74059 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_mock.cc | 21 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_mock.h | 11 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 13 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h | 12 | ||||
-rw-r--r-- | gpu/gpu.gyp | 2 |
5 files changed, 41 insertions, 18 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.cc b/gpu/command_buffer/service/gles2_cmd_decoder_mock.cc new file mode 100644 index 0000000..a8e027d --- /dev/null +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.cc @@ -0,0 +1,21 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" + +namespace gpu { +namespace gles2 { + +MockGLES2Decoder::MockGLES2Decoder() + : GLES2Decoder() { + ON_CALL(*this, GetCommandName(testing::_)) + .WillByDefault(testing::Return("")); + ON_CALL(*this, MakeCurrent()) + .WillByDefault(testing::Return(true)); +} + +MockGLES2Decoder::~MockGLES2Decoder() {} + +} // namespace gles2 +} // namespace gpu diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index a0d91c9..0282709 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,13 +22,8 @@ namespace gles2 { class ContextGroup; class MockGLES2Decoder : public GLES2Decoder { public: - MockGLES2Decoder() - : GLES2Decoder() { - ON_CALL(*this, GetCommandName(testing::_)) - .WillByDefault(testing::Return("")); - ON_CALL(*this, MakeCurrent()) - .WillByDefault(testing::Return(true)); - } + MockGLES2Decoder(); + virtual ~MockGLES2Decoder(); MOCK_METHOD6(Initialize, bool(gfx::GLContext* context, const gfx::Size& size, diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index bf108cc..7125745 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -32,6 +32,19 @@ using ::testing::StrictMock; namespace gpu { namespace gles2 { +GLES2DecoderTestBase::GLES2DecoderTestBase() + : client_buffer_id_(100), + client_framebuffer_id_(101), + client_program_id_(102), + client_renderbuffer_id_(103), + client_shader_id_(104), + client_texture_id_(106), + client_element_buffer_id_(107) { + memset(immediate_buffer_, 0xEE, sizeof(immediate_buffer_)); +} + +GLES2DecoderTestBase::~GLES2DecoderTestBase() {} + void GLES2DecoderTestBase::SetUp() { InitDecoder(""); } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index fb85f6dd..1a1cb51 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -26,16 +26,8 @@ namespace gles2 { class GLES2DecoderTestBase : public testing::Test { public: - GLES2DecoderTestBase() - : client_buffer_id_(100), - client_framebuffer_id_(101), - client_program_id_(102), - client_renderbuffer_id_(103), - client_shader_id_(104), - client_texture_id_(106), - client_element_buffer_id_(107) { - memset(immediate_buffer_, 0xEE, sizeof(immediate_buffer_)); - } + GLES2DecoderTestBase(); + virtual ~GLES2DecoderTestBase(); protected: static const GLint kMaxTextureSize = 2048; diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index 9dad6cf..87b17a7 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -320,6 +320,8 @@ 'sources': [ 'command_buffer/common/gl_mock.h', 'command_buffer/common/gl_mock.cc', + 'command_buffer/service/gles2_cmd_decoder_mock.cc', + 'command_buffer/service/gles2_cmd_decoder_mock.cc', ], }, { |