From 198de6129a35812c6227f95daf834d854d0e94ff Mon Sep 17 00:00:00 2001 From: Jonah Ryan-Davis Date: Wed, 27 Mar 2019 14:26:51 -0400 Subject: [PATCH] Remove EGLThreadTest to fix angle_end2end_tests failures on Android. EGLThreadTest doesn't clean up well and the test framework can't handle it well. It caused test failures related to eglMakeCurrent (ELG_BAD_ACCESS) on Android that were masked by retries. Calling eglGetDisplay within a test can cause it to return a cached display from the test runner. The test is unable to know if it should terminate this display. bug: angleproject:3321 Change-Id: I14a539a00acaed4ee71622e7416a6c7a75596606 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1541717 Commit-Queue: Jonah Ryan-Davis Reviewed-by: Geoff Lang Reviewed-by: Jamie Madill --- src/tests/angle_end2end_tests.gni | 1 - src/tests/egl_tests/EGLThreadTest.cpp | 47 --------------------------- 2 files changed, 48 deletions(-) delete mode 100644 src/tests/egl_tests/EGLThreadTest.cpp diff --git a/src/tests/angle_end2end_tests.gni b/src/tests/angle_end2end_tests.gni index bfd0af315..ea42702f2 100644 --- a/src/tests/angle_end2end_tests.gni +++ b/src/tests/angle_end2end_tests.gni @@ -138,7 +138,6 @@ angle_end2end_tests_sources = [ "egl_tests/EGLSurfacelessContextTest.cpp", "egl_tests/EGLSurfaceTest.cpp", "egl_tests/EGLSyncTest.cpp", - "egl_tests/EGLThreadTest.cpp", "test_utils/ANGLETest.cpp", "test_utils/ANGLETest.h", "test_utils/MultiviewTest.cpp", diff --git a/src/tests/egl_tests/EGLThreadTest.cpp b/src/tests/egl_tests/EGLThreadTest.cpp deleted file mode 100644 index bf9d6f400..000000000 --- a/src/tests/egl_tests/EGLThreadTest.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright 2018 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// EGLThreadTest.h: Tests multi-threaded uses of EGL. - -#include - -#include "test_utils/ANGLETest.h" -#include "util/system_utils.h" - -#include - -class EGLThreadTest : public EGLTest -{ - public: - void threadingTest(); - - protected: - EGLDisplay mDisplay = EGL_NO_DISPLAY; -}; - -void EGLThreadTest::threadingTest() -{ - mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - - EXPECT_TRUE(mDisplay != EGL_NO_DISPLAY); - - eglInitialize(mDisplay, nullptr, nullptr); - eglGetCurrentContext(); -} - -// Test a bug in our EGL TLS implementation. -TEST_F(EGLThreadTest, ThreadInitCrash) -{ - std::thread runner(&EGLThreadTest::threadingTest, this); - - // wait for signal from thread - runner.join(); - - // crash, because the TLS value is NULL on main thread - eglGetCurrentSurface(EGL_DRAW); - eglGetCurrentContext(); - - eglTerminate(mDisplay); -}