Enable a lot of extensions to increase fuzzer coverage
Pretend the underlying context (stub) supports most of the extensions we care
about, to make sure we exercise the code paths that are enabled by those.
Ideally we would test with arbitrary combinations of those, but this is a good
first step to increase coverage.
BUG=None
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2299413003
Cr-Commit-Position: refs/heads/master@{#416369}
diff --git a/ui/gl/gl_stub_api.h b/ui/gl/gl_stub_api.h
index e654ffb..99681163 100644
--- a/ui/gl/gl_stub_api.h
+++ b/ui/gl/gl_stub_api.h
@@ -5,6 +5,8 @@
#ifndef UI_GL_GL_STUB_API_H_
#define UI_GL_GL_STUB_API_H_
+#include <string>
+
#include "ui/gl/gl_export.h"
#include "ui/gl/gl_stub_api_base.h"
@@ -12,6 +14,15 @@
class GL_EXPORT GLStubApi: public GLStubApiBase {
public:
+ GLStubApi();
+ ~GLStubApi() override;
+
+ void set_version(std::string version) { version_ = std::move(version); }
+
+ void set_extensions(std::string extensions) {
+ extensions_ = std::move(extensions);
+ }
+
GLenum glCheckFramebufferStatusEXTFn(GLenum target) override;
GLuint glCreateProgramFn(void) override;
GLuint glCreateShaderFn(GLenum type) override;
@@ -54,6 +65,12 @@
GLenum glWaitSyncFn(GLsync sync,
GLbitfield flags,
GLuint64 timeout) override;
+
+ private:
+ std::string version_;
+ std::string extensions_;
+
+ DISALLOW_COPY_AND_ASSIGN(GLStubApi);
};
} // namespace gl