Geoff Lang | 0ab41fa | 2018-03-14 11:03:30 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2018 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | // RequestExtensionTest: |
| 7 | // Tests that extensions can be requested and are disabled by default when using |
| 8 | // EGL_ANGLE_request_extension |
| 9 | // |
| 10 | |
| 11 | #include "test_utils/ANGLETest.h" |
| 12 | |
| 13 | namespace angle |
| 14 | { |
| 15 | |
| 16 | class RequestExtensionTest : public ANGLETest |
| 17 | { |
| 18 | protected: |
| 19 | RequestExtensionTest() { setExtensionsEnabled(false); } |
| 20 | }; |
| 21 | |
| 22 | // Test that a known requestable extension is disabled by default and make sure it can be requested |
| 23 | // if possible |
| 24 | TEST_P(RequestExtensionTest, ExtensionsDisabledByDefault) |
| 25 | { |
| 26 | EXPECT_TRUE(eglDisplayExtensionEnabled(getEGLWindow()->getDisplay(), |
| 27 | "EGL_ANGLE_create_context_extensions_enabled")); |
| 28 | EXPECT_FALSE(extensionEnabled("GL_OES_rgb8_rgba8")); |
| 29 | |
| 30 | if (extensionRequestable("GL_OES_rgb8_rgba8")) |
| 31 | { |
| 32 | glRequestExtensionANGLE("GL_OES_rgb8_rgba8"); |
| 33 | EXPECT_TRUE(extensionEnabled("GL_OES_rgb8_rgba8")); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // Use this to select which configurations (e.g. which renderer, which GLES major version) these |
| 38 | // tests should be run against. |
| 39 | ANGLE_INSTANTIATE_TEST(RequestExtensionTest, |
| 40 | ES2_D3D11(), |
| 41 | ES2_OPENGL(), |
| 42 | ES2_OPENGLES(), |
| 43 | ES2_VULKAN()); |
| 44 | |
| 45 | } // namespace angle |