Roll src/third_party/WebKit 327fcc4:20c53c8 (svn 191269:191273)
[chromium-blink-merge.git] / ui / gl / gl_mock.h
blobb678a5e87913d80745352280d0af7a06a0a21c7b
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 // This file implements mock GL Interface for unit testing. The interface
6 // corresponds to the set of functionally distinct GL functions defined in
7 // generate_bindings.py, which may originate from either desktop GL or GLES.
9 #ifndef UI_GL_GL_MOCK_H_
10 #define UI_GL_GL_MOCK_H_
12 #include "testing/gmock/include/gmock/gmock.h"
13 #include "ui/gl/gl_bindings.h"
15 namespace gfx {
17 class MockGLInterface {
18 public:
19 MockGLInterface();
20 virtual ~MockGLInterface();
22 // Set the functions called from the mock GL implementation for the purposes
23 // of testing.
24 static void SetGLInterface(MockGLInterface* gl_interface);
26 // Find an entry point to the mock GL implementation.
27 static void* GL_BINDING_CALL GetGLProcAddress(const char* name);
29 // Include the auto-generated parts of this class. We split this because
30 // it means we can easily edit the non-auto generated parts right here in
31 // this file instead of having to edit some template or the code generator.
33 // Member functions
34 #include "gl_mock_autogen_gl.h"
36 private:
37 static MockGLInterface* interface_;
39 // Static mock functions that invoke the member functions of interface_.
40 #include "gl_bindings_autogen_mock.h"
43 } // namespace gfx
45 #endif // UI_GL_GL_MOCK_H_