Chromium Code Reviews| 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 "ui/gl/gl_surface_egl.h" | |
| 6 #include "testing/gmock/include/gmock/gmock.h" | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 #include "ui/gl/gl_implementation.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 GLSurfaceEGLTest : public testing::Test {}; | |
| 15 | |
| 16 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.
| |
| 17 GLSurfaceTestSupport::InitializeOneOffImplementation( | |
| 18 GLImplementation::kGLImplementationEGLGLES2, true); | |
| 19 | |
| 20 GLSurfaceFormat surface_format = GLSurfaceFormat(); | |
| 21 surface_format.SetDepthBits(24); | |
| 22 surface_format.SetStencilBits(8); | |
| 23 surface_format.SetSamples(0); | |
| 24 scoped_refptr<GLSurface> surface = | |
| 25 init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(1, 1), surface_format); | |
| 26 EGLConfig config = surface->GetConfig(); | |
| 27 EXPECT_TRUE(config); | |
| 28 | |
| 29 EGLint attrib; | |
| 30 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_DEPTH_SIZE, &attrib); | |
| 31 EXPECT_LE(24, attrib); | |
| 32 | |
| 33 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_STENCIL_SIZE, &attrib); | |
| 34 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.
| |
| 35 | |
| 36 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_SAMPLES, &attrib); | |
| 37 EXPECT_EQ(0, attrib); | |
| 38 } | |
| 39 | |
| 40 } // namespace gl | |
| OLD | NEW |