OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 #include "testing/gmock/include/gmock/gmock.h" | |
6 #include "testing/gtest/include/gtest/gtest.h" | |
7 #include "ui/gl/gl_implementation.h" | |
8 #include "ui/gl/gl_surface_egl.h" | |
9 #include "ui/gl/init/gl_factory.h" | |
10 #include "ui/gl/test/gl_surface_test_support.h" | |
11 | |
12 namespace gl { | |
13 | |
14 class GLSurfaceTest : public testing::Test {}; | |
15 | |
16 TEST_F(GLSurfaceTest, SurfaceFormatTest) { | |
jbauman
2017/03/24 23:48:48
Use TEST instead of TEST_F.
Lei Lei
2017/03/28 00:40:36
Done.
| |
17 gl::GLSurfaceTestSupport::InitializeOneOffImplementation( | |
jbauman
2017/03/24 23:48:48
Don't use gl:: in the gl namespace.
Lei Lei
2017/03/28 00:40:36
Done.
| |
18 gl::GLImplementation::kGLImplementationEGLGLES2, true); | |
19 | |
20 gl::GLSurfaceFormat surface_format = gl::GLSurfaceFormat(); | |
21 surface_format.SetDepthBits(24); | |
22 surface_format.SetStencilBits(8); | |
23 surface_format.SetSamples(0); | |
24 scoped_refptr<gl::GLSurface> surface = | |
25 gl::init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(1, 1), | |
26 surface_format); | |
27 EGLConfig config = surface->GetConfig(); | |
28 EXPECT_TRUE(config); | |
29 | |
30 EGLint attrib; | |
31 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_DEPTH_SIZE, &attrib); | |
32 EXPECT_EQ(24, attrib); | |
jbauman
2017/03/24 23:48:48
I think these should be EXPECT_LE, as it's possibl
Lei Lei
2017/03/28 00:40:36
Done.
| |
33 | |
34 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_STENCIL_SIZE, &attrib); | |
35 EXPECT_EQ(8, attrib); | |
36 | |
37 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_SAMPLES, &attrib); | |
38 EXPECT_EQ(0, attrib); | |
39 } | |
40 | |
41 } // namespace gl | |
OLD | NEW |