This source file includes following definitions.
- TEST
#include "cc/output/shader.h"
#include "cc/test/test_gles2_interface.h"
#include "cc/test/test_web_graphics_context_3d.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
namespace cc {
TEST(ShaderTest, HighpThresholds) {
scoped_ptr<TestWebGraphicsContext3D> stub_context =
TestWebGraphicsContext3D::Create();
TestGLES2Interface stub_gl(stub_context.get());
int threshold_cache = 0;
int threshold_min;
gfx::Point closePoint(512, 512);
gfx::Size smallSize(512, 512);
gfx::Point farPoint(2560, 2560);
gfx::Size bigSize(2560, 2560);
threshold_min = 0;
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, closePoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, smallSize));
EXPECT_EQ(TexCoordPrecisionHigh, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, farPoint));
EXPECT_EQ(TexCoordPrecisionHigh, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, bigSize));
threshold_min = 3000;
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, closePoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, smallSize));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, farPoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
&stub_gl, &threshold_cache, threshold_min, bigSize));
}
}