Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: ui/gl/gl_surface_unittest.cc

Issue 2775633006: Add unittests for gl_surface_egl to cover the changes in crrev.com/2698573002. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/gl/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698