Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / gpu / command_buffer / service / gl_surface_mock.h
blob1d756d4d3597c53d305d6b824548df705641fb5a
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
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "ui/gfx/swap_result.h"
10 #include "ui/gl/gl_surface.h"
12 namespace gpu {
14 class GLSurfaceMock : public gfx::GLSurface {
15 public:
16 GLSurfaceMock();
18 MOCK_METHOD0(Initialize, bool());
19 MOCK_METHOD0(Destroy, void());
20 MOCK_METHOD1(Resize, bool(const gfx::Size& size));
21 MOCK_METHOD0(IsOffscreen, bool());
22 MOCK_METHOD0(SwapBuffers, gfx::SwapResult());
23 MOCK_METHOD4(PostSubBuffer,
24 gfx::SwapResult(int x, int y, int width, int height));
25 MOCK_METHOD0(SupportsPostSubBuffer, bool());
26 MOCK_METHOD0(GetSize, gfx::Size());
27 MOCK_METHOD0(GetHandle, void*());
28 MOCK_METHOD0(GetBackingFrameBufferObject, unsigned int());
29 MOCK_METHOD1(OnMakeCurrent, bool(gfx::GLContext* context));
30 MOCK_METHOD1(SetBackbufferAllocation, bool(bool allocated));
31 MOCK_METHOD1(SetFrontbufferAllocation, void(bool allocated));
32 MOCK_METHOD0(GetShareHandle, void*());
33 MOCK_METHOD0(GetDisplay, void*());
34 MOCK_METHOD0(GetConfig, void*());
35 MOCK_METHOD0(GetFormat, unsigned());
37 protected:
38 virtual ~GLSurfaceMock();
40 private:
41 DISALLOW_COPY_AND_ASSIGN(GLSurfaceMock);
44 } // namespace gpu
46 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_