• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2022 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 // EGLWaitUntilWorkScheduledTest.cpp:
7 //   Checks the implementation of EGL_ANGLE_wait_until_work_scheduled.
8 //
9 
10 #include <gtest/gtest.h>
11 #include <tuple>
12 
13 #include "common/debug.h"
14 #include "common/string_utils.h"
15 #include "gpu_info_util/SystemInfo.h"
16 #include "test_utils/ANGLETest.h"
17 #include "test_utils/angle_test_platform.h"
18 #include "test_utils/system_info_util.h"
19 #include "util/OSWindow.h"
20 
21 using namespace angle;
22 
23 class EGLWaitUntilWorkScheduledTest : public ANGLETest<>
24 {
25   public:
testSetUp()26     void testSetUp() override { (void)GetSystemInfo(&mSystemInfo); }
27 
28   protected:
getDisplay() const29     EGLDisplay getDisplay() const { return getEGLWindow()->getDisplay(); }
30 
31     SystemInfo mSystemInfo;
32 };
33 
34 // Test if EGL_ANGLE_wait_until_work_scheduled is enabled that we can call
35 // eglWaitUntilWorkScheduledANGLE.
TEST_P(EGLWaitUntilWorkScheduledTest,WaitUntilWorkScheduled)36 TEST_P(EGLWaitUntilWorkScheduledTest, WaitUntilWorkScheduled)
37 {
38     ANGLE_SKIP_TEST_IF(
39         !IsEGLDisplayExtensionEnabled(getDisplay(), "EGL_ANGLE_wait_until_work_scheduled"));
40 
41     // We're not checking anything except that the function can be called.
42     eglWaitUntilWorkScheduledANGLE(getDisplay());
43 }
44 
45 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EGLWaitUntilWorkScheduledTest);
46 ANGLE_INSTANTIATE_TEST(EGLWaitUntilWorkScheduledTest,
47                        ES2_METAL(),
48                        ES3_METAL(),
49                        ES2_OPENGL(),
50                        ES3_OPENGL());
51