Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: gpu/command_buffer/service/test_helper.cc

Issue 12647003: Refactor a bunch of Texture related GPU code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/test_helper.h ('k') | gpu/command_buffer/service/texture_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/test_helper.cc
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
index 2cbef214529a3a0c89b4a938e75b1b3a81c8d8f9..71a5c399d10b1a8732525c3d2224da10ce27664b 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -14,6 +14,7 @@
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/program_manager.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_mock.h"
@@ -517,6 +518,28 @@ void TestHelper::DoBufferData(
manager->DoBufferData(decoder, buffer, size, usage, data);
}
+void TestHelper::SetTexParameterWithExpectations(
+ ::gfx::MockGLInterface* gl, MockGLES2Decoder* decoder,
+ TextureManager* manager, Texture* texture,
+ GLenum pname, GLint value, GLenum error) {
+ if (error == GL_NO_ERROR) {
+ if (pname != GL_TEXTURE_POOL_CHROMIUM) {
+ EXPECT_CALL(*gl, TexParameteri(texture->target(), pname, value))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+ } else if (error == GL_INVALID_ENUM) {
+ EXPECT_CALL(*decoder, SetGLErrorInvalidEnum(_, value, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ } else {
+ EXPECT_CALL(*decoder, SetGLErrorInvalidParam(error, _, _, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+ manager->SetParameter("", decoder, texture, pname, value);
+}
+
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/test_helper.h ('k') | gpu/command_buffer/service/texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698