0
Files
src/ui/gl/gl_surface_format_unittest.cc
Peng Huang 28d9b11456 Remove not used SurfacePixelLayout from GLSurfaceFormat
Bug: 928873
Change-Id: If88e7712d01660343c743373ac2bebee109882bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610470
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659200}
2019-05-13 20:38:31 +00:00

36 lines
938 B
C++

// 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 "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_surface_format.h"
namespace gl {
TEST(GLSurfaceFormatTest, BasicTest) {
{
// Check default format properties.
GLSurfaceFormat format = GLSurfaceFormat();
EXPECT_EQ(32, format.GetBufferSize());
}
{
// Check rgb565 format as used for low-end Android devices.
GLSurfaceFormat format = GLSurfaceFormat();
format.SetRGB565();
EXPECT_EQ(16, format.GetBufferSize());
}
{
// Check IsCompatible
GLSurfaceFormat format = GLSurfaceFormat();
EXPECT_TRUE(format.IsCompatible(GLSurfaceFormat()));
GLSurfaceFormat other = GLSurfaceFormat();
other.SetRGB565();
EXPECT_FALSE(format.IsCompatible(other));
EXPECT_TRUE(other.IsCompatible(other));
}
}
}