• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
7 
8 #include "ui/gl/gl_surface.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10 
11 namespace gpu {
12 
13 class GLSurfaceMock : public gfx::GLSurface {
14  public:
15   GLSurfaceMock();
16 
17   MOCK_METHOD0(Initialize, bool());
18   MOCK_METHOD0(Destroy, void());
19   MOCK_METHOD1(Resize, bool(const gfx::Size& size));
20   MOCK_METHOD0(IsOffscreen, bool());
21   MOCK_METHOD0(SwapBuffers, bool());
22   MOCK_METHOD4(PostSubBuffer, bool(int x, int y, int width, int height));
23   MOCK_METHOD0(SupportsPostSubBuffer, bool());
24   MOCK_METHOD0(GetSize, gfx::Size());
25   MOCK_METHOD0(GetHandle, void*());
26   MOCK_METHOD0(GetBackingFrameBufferObject, unsigned int());
27   MOCK_METHOD1(OnMakeCurrent, bool(gfx::GLContext* context));
28   MOCK_METHOD1(SetBackbufferAllocation, bool(bool allocated));
29   MOCK_METHOD1(SetFrontbufferAllocation, void(bool allocated));
30   MOCK_METHOD0(GetShareHandle, void*());
31   MOCK_METHOD0(GetDisplay, void*());
32   MOCK_METHOD0(GetConfig, void*());
33   MOCK_METHOD0(GetFormat, unsigned());
34 
35  protected:
36   virtual ~GLSurfaceMock();
37 
38  private:
39   DISALLOW_COPY_AND_ASSIGN(GLSurfaceMock);
40 };
41 
42 }  // namespace gpu
43 
44 #endif  // GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
45