1 /*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <gtest/gtest.h>
18 #include "renderthread/RenderEffectCapabilityQuery.h"
19 #include "tests/common/TestContext.h"
20
TEST(RenderEffectCapabilityQuery,testSupportedVendor)21 TEST(RenderEffectCapabilityQuery, testSupportedVendor) {
22 ASSERT_TRUE(supportsRenderEffectCache("Google", "OpenGL ES 1.4 V@0.0"));
23 }
24
TEST(RenderEffectCapabilityQuery,testSupportedVendorWithDifferentVersion)25 TEST(RenderEffectCapabilityQuery, testSupportedVendorWithDifferentVersion) {
26 ASSERT_TRUE(supportsRenderEffectCache("Google", "OpenGL ES 1.3 V@571.0"));
27 }
28
TEST(RenderEffectCapabilityQuery,testVendorWithSupportedVersion)29 TEST(RenderEffectCapabilityQuery, testVendorWithSupportedVersion) {
30 ASSERT_TRUE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.5 V@571.0"));
31 }
32
TEST(RenderEffectCapabilityQuery,testVendorWithSupportedPatchVersion)33 TEST(RenderEffectCapabilityQuery, testVendorWithSupportedPatchVersion) {
34 ASSERT_TRUE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.5 V@571.1"));
35 }
36
TEST(RenderEffectCapabilityQuery,testVendorWithNewerThanSupportedMajorVersion)37 TEST(RenderEffectCapabilityQuery, testVendorWithNewerThanSupportedMajorVersion) {
38 ASSERT_TRUE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.5 V@572.0"));
39 }
40
TEST(RenderEffectCapabilityQuery,testVendorWithNewerThanSupportedMinorVersion)41 TEST(RenderEffectCapabilityQuery, testVendorWithNewerThanSupportedMinorVersion) {
42 ASSERT_TRUE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.5 V@571.2"));
43 }
44
TEST(RenderEffectCapabilityQuery,testVendorWithUnsupportedMajorVersion)45 TEST(RenderEffectCapabilityQuery, testVendorWithUnsupportedMajorVersion) {
46 ASSERT_FALSE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.0 V@570.1"));
47 }
48
TEST(RenderEffectCapabilityQuery,testVendorWithUnsupportedVersion)49 TEST(RenderEffectCapabilityQuery, testVendorWithUnsupportedVersion) {
50 ASSERT_FALSE(supportsRenderEffectCache("Qualcomm", "OpenGL ES 1.1 V@570.0"));
51 }
52
53