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

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

Issue 2775633006: Add unittests for gl_surface_egl to cover the changes in crrev.com/2698573002. (Closed)
Patch Set: Fix test failure on linux_chromium_chromeos_ozone_rel_ng Created 3 years, 8 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 "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(GLSurfaceEGLTest, SurfaceFormatTest) {
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_LE(8, attrib);
35
36 eglGetConfigAttrib(surface->GetDisplay(), config, EGL_SAMPLES, &attrib);
37 EXPECT_EQ(0, attrib);
38 }
39
40 } // 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