Chromium Code Reviews| Index: ui/gl/gl_surface_egl_unittest.cc |
| diff --git a/ui/gl/gl_surface_egl_unittest.cc b/ui/gl/gl_surface_egl_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cdf09f5777950287de64fcb3a8ae08cccaa2b839 |
| --- /dev/null |
| +++ b/ui/gl/gl_surface_egl_unittest.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/gl/gl_surface_egl.h" |
| +#include "testing/gmock/include/gmock/gmock.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| +#include "ui/gl/gl_implementation.h" |
| +#include "ui/gl/init/gl_factory.h" |
| +#include "ui/gl/test/gl_surface_test_support.h" |
| + |
| +namespace gl { |
| + |
| +class GLSurfaceEGLTest : public testing::Test {}; |
| + |
| +TEST_F(GLSurfaceEGLTest, SurfaceFormatTest) { |
|
jbauman
2017/03/28 00:46:33
Still use TEST() here instead.
Lei Lei
2017/03/28 00:50:08
Ooops, done.
|
| + GLSurfaceTestSupport::InitializeOneOffImplementation( |
| + GLImplementation::kGLImplementationEGLGLES2, true); |
| + |
| + GLSurfaceFormat surface_format = GLSurfaceFormat(); |
| + surface_format.SetDepthBits(24); |
| + surface_format.SetStencilBits(8); |
| + surface_format.SetSamples(0); |
| + scoped_refptr<GLSurface> surface = |
| + init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(1, 1), surface_format); |
| + EGLConfig config = surface->GetConfig(); |
| + EXPECT_TRUE(config); |
| + |
| + EGLint attrib; |
| + eglGetConfigAttrib(surface->GetDisplay(), config, EGL_DEPTH_SIZE, &attrib); |
| + EXPECT_LE(24, attrib); |
| + |
| + eglGetConfigAttrib(surface->GetDisplay(), config, EGL_STENCIL_SIZE, &attrib); |
| + EXPECT_EQ(8, attrib); |
|
jbauman
2017/03/28 00:46:34
Change this to EXPECT_LE.
Lei Lei
2017/03/28 00:50:08
Done.
|
| + |
| + eglGetConfigAttrib(surface->GetDisplay(), config, EGL_SAMPLES, &attrib); |
| + EXPECT_EQ(0, attrib); |
| +} |
| + |
| +} // namespace gl |