summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis <thakis@chromium.org>2016-02-09 07:23:11 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-09 15:23:53 +0000
commit9fb9c88c4101275f908f123ec0289d398adb0258 (patch)
treebcf7cf940e79dfc14a454b19fe2697ff6fe49bbc
parent6f45beb8dcf95618eeb09dbfcc82f53f786a60e9 (diff)
downloadchromium_src-9fb9c88c4101275f908f123ec0289d398adb0258.zip
chromium_src-9fb9c88c4101275f908f123ec0289d398adb0258.tar.gz
chromium_src-9fb9c88c4101275f908f123ec0289d398adb0258.tar.bz2
Revert of command_buffer_gles2: Add test command_buffer_gles2_test for command_buffer_gles2 (patchset #8 id:140001 of https://codereview.chromium.org/1640243002/ )
Reason for revert: This seems to not build in release component builds: https://build.chromium.org/p/chromium.fyi/builders/CrWinClang%28shared%29/builds/7700/steps/compile/logs/stdio FAILED: C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-with-manifests environment.x86 True command_buffer_gles2_tests.exe "C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /OUT:command_buffer_gles2_tests.exe @command_buffer_gles2_tests.exe.rsp" 1 mt.exe rc.exe "obj\gpu\command_buffer_gles2_tests.command_buffer_gles2_tests.exe.intermediate.manifest" obj\gpu\command_buffer_gles2_tests.command_buffer_gles2_tests.exe.generated.manifest ..\..\build\win\compatibility.manifest command_buffer_gles2_tests.command_buffer_gles2_tests_main.obj : error LNK2019: unresolved external symbol "bool g_command_buffer_gles_has_atexit_manager" (?g_command_buffer_gles_has_atexit_manager@@3_NA) referenced in function _main Original issue's description: > command_buffer_gles2: Add test command_buffer_gles2_test for command_buffer_gles2 > > Add test command_buffer_gles2_test for testing command_buffer_gles2 > library. > > Makes the gpu bots to build target, but the target is not run > on any bot. > > As an example, fix a potential nullptr reference in eglInitialize > and tests the problem. > > Adding the test runner would be useful in order to further develop > command_buffer_gles2. One development direction of the library > would be to extend it enough to support creating OpenGL ES 3.0 > context. > > BUG=581634 > > Committed: https://crrev.com/ee2d13a54fc1de09762f1e5be97d6db44235fa80 > Cr-Commit-Position: refs/heads/master@{#374353} TBR=piman@chromium.org,zmo@google.com,kbr@chromium.org,vmiura@chromium.org,kkinnunen@nvidia.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=581634 Review URL: https://codereview.chromium.org/1680743007 Cr-Commit-Position: refs/heads/master@{#374378}
-rw-r--r--build/all.gyp3
-rw-r--r--build/gn_migration.gypi1
-rw-r--r--gpu/BUILD.gn35
-rw-r--r--gpu/command_buffer/tests/command_buffer_gles2_tests_main.cc67
-rw-r--r--gpu/command_buffer/tests/egl_test.cc36
-rw-r--r--gpu/command_buffer_gles2_tests_apk.isolate18
-rw-r--r--gpu/gles2_conform_support/egl/display.cc11
-rw-r--r--gpu/gles2_conform_support/egl/egl.cc7
-rw-r--r--gpu/gles2_conform_support/egl/test_support.cc9
-rw-r--r--gpu/gles2_conform_support/egl/test_support.h20
-rw-r--r--gpu/gpu.gyp60
11 files changed, 4 insertions, 263 deletions
diff --git a/build/all.gyp b/build/all.gyp
index 92d9eaa..bd4f963 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -619,7 +619,6 @@
'../gpu/gpu.gyp:gl_tests',
'../gpu/gpu.gyp:angle_unittests',
'../gpu/gpu.gyp:gpu_unittests',
- '../gpu/gpu.gyp:command_buffer_gles2_tests',
'../third_party/catapult/telemetry/telemetry.gyp:*',
],
'conditions': [
@@ -657,7 +656,6 @@
'../gpu/gpu.gyp:gl_tests',
'../gpu/gpu.gyp:angle_unittests',
'../gpu/gpu.gyp:gpu_unittests',
- '../gpu/gpu.gyp:command_buffer_gles2_tests',
'../third_party/catapult/telemetry/telemetry.gyp:*',
],
'conditions': [
@@ -854,7 +852,6 @@
'../content/content_shell_and_tests.gyp:content_gl_tests_apk',
'../content/content_shell_and_tests.gyp:content_unittests_apk',
'../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk',
- '../gpu/gpu.gyp:command_buffer_gles2_tests_apk',
'../gpu/gpu.gyp:gl_tests_apk',
'../gpu/gpu.gyp:gpu_unittests_apk',
'../ipc/ipc.gyp:ipc_tests_apk',
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
index 8735d51..5fce891 100644
--- a/build/gn_migration.gypi
+++ b/build/gn_migration.gypi
@@ -210,7 +210,6 @@
'../content/content_shell_and_tests.gyp:content_unittests_apk',
'../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk',
'../device/device_tests.gyp:device_unittests_apk',
- '../gpu/gpu.gyp:command_buffer_gles2_tests_apk',
'../gpu/gpu.gyp:gl_tests_apk',
'../gpu/gpu.gyp:gpu_perftests_apk',
'../gpu/gpu.gyp:gpu_unittests_apk',
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index af33ed3..63447f1 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -60,8 +60,6 @@ shared_library("command_buffer_gles2") {
"gles2_conform_support/egl/egl.cc",
"gles2_conform_support/egl/surface.cc",
"gles2_conform_support/egl/surface.h",
- "gles2_conform_support/egl/test_support.cc",
- "gles2_conform_support/egl/test_support.h",
]
deps = [
@@ -83,39 +81,6 @@ shared_library("command_buffer_gles2") {
}
}
-# GYP version: //gpu/gpu.gyp:command_buffer_gles2_tests
-test("command_buffer_gles2_tests") {
- sources = [
- "command_buffer/tests/command_buffer_gles2_tests_main.cc",
- "command_buffer/tests/egl_test.cc",
- ]
-
- deps = [
- ":command_buffer_gles2",
- "//base",
- "//base/test:test_support",
- "//base/third_party/dynamic_annotations",
- "//testing/gmock",
- "//testing/gtest",
- ]
-
- defines = [
- "COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY",
- "EGLAPIENTRY=",
- "EGLAPI=",
- ]
-
- libs = []
-
- if (is_android) {
- libs += [ "android" ]
- deps += [ "//ui/android:ui_java" ]
- }
- if (!is_component_build) {
- configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
- }
-}
-
source_set("test_support") {
testonly = true
sources = [
diff --git a/gpu/command_buffer/tests/command_buffer_gles2_tests_main.cc b/gpu/command_buffer/tests/command_buffer_gles2_tests_main.cc
deleted file mode 100644
index f945390..0000000
--- a/gpu/command_buffer/tests/command_buffer_gles2_tests_main.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
-#if defined(OS_MACOSX)
-#include "base/mac/scoped_nsautorelease_pool.h"
-#endif
-#include "base/test/launcher/unit_test_launcher.h"
-#include "base/test/test_suite.h"
-#include "gpu/gles2_conform_support/egl/test_support.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-// This file implements the main entry point for tests for command_buffer_gles2,
-// the mode of command buffer where the code is compiled as a standalone dynamic
-// library and exposed through EGL API.
-namespace {
-
-int RunHelper(base::TestSuite* testSuite) {
-#if defined(USE_OZONE)
- base::MessageLoopForUI main_loop;
-#else
- base::MessageLoopForIO message_loop;
-#endif
- return testSuite->Run();
-}
-
-} // namespace
-
-int main(int argc, char** argv) {
-// NOTE: we initialize globals through TestSuite constructor or through JNI
-// library registration process on Android.
-
-// However, when the system is compiled with component build,
-// command_buffer_gles2 library and this test runner share the globals, such
-// as AtExitManager and JVM references. When command_buffer_gles2 is run with
-// the test runner, the globals may be populated. Any other app linking to
-// command_buffer_gles2 of course can not provide the globals.
-
-// When the system is compiled without component build, command_buffer_gles2
-// gets its own globals, while the test runner gets its own. The runner
-// initialize different global variables than the ones command_buffer_gles2
-// library uses. For example, there should be a global AtExitManager for the
-// test runner, and there should be a global AtExitManager that the library
-// uses. Similarly, if the test runner would use JNI, it should have global
-// reference to the JNI environent. If the command_buffer_gles2 library would
-// use JNI, it should have its own global reference to the JNI that always
-// remains null. The reference of the library should always stay null, since
-// JNI is not part of command_buffer_gles2 exported API (EGL API), and thus
-// there is no way for the client of the library to populate the JNI
-// pointer. The client may not even be a Java app.
-
-// We signify that the globals have been initialized when running
-// the component build.
-#if defined(COMPONENT_BUILD)
- g_command_buffer_gles_has_atexit_manager = true;
-#endif
-
- base::TestSuite test_suite(argc, argv);
-#if defined(OS_MACOSX)
- base::mac::ScopedNSAutoreleasePool pool;
-#endif
- testing::InitGoogleMock(&argc, argv);
- return base::LaunchUnitTestsSerially(
- argc, argv, base::Bind(&RunHelper, base::Unretained(&test_suite)));
-}
diff --git a/gpu/command_buffer/tests/egl_test.cc b/gpu/command_buffer/tests/egl_test.cc
deleted file mode 100644
index bf7e30e..0000000
--- a/gpu/command_buffer/tests/egl_test.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#include <EGL/egl.h>
-
-// This file tests EGL basic interface for command_buffer_gles2, the mode of
-// command buffer where the code is compiled as a standalone dynamic library and
-// exposed through EGL API.
-namespace gpu {
-
-using testing::Test;
-
-TEST_F(Test, BasicEGLInitialization) {
- EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- ASSERT_NE(display, EGL_NO_DISPLAY);
-
- // Test for no crash even though passing nullptrs for major, minor.
- EGLBoolean success = eglInitialize(display, nullptr, nullptr);
- ASSERT_TRUE(success);
-
- EGLint major = 0;
- EGLint minor = 0;
- success = eglInitialize(display, &major, &minor);
- ASSERT_TRUE(success);
- ASSERT_EQ(major, 1);
- ASSERT_EQ(minor, 4);
-
- success = eglTerminate(display);
- ASSERT_TRUE(success);
-}
-
-} // namespace gpu
diff --git a/gpu/command_buffer_gles2_tests_apk.isolate b/gpu/command_buffer_gles2_tests_apk.isolate
deleted file mode 100644
index aeae953..0000000
--- a/gpu/command_buffer_gles2_tests_apk.isolate
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
- 'includes': [
- '../build/android/android.isolate',
- ],
- 'variables': {
- 'command': [
- '<(PRODUCT_DIR)/bin/run_command_buffer_gles2_tests',
- '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
- ],
- 'files': [
- '<(PRODUCT_DIR)/bin/run_command_buffer_gles2_tests',
- '<(PRODUCT_DIR)/command_buffer_gles2_tests_apk/',
- ]
- },
-}
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index bf63108..9df0095 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -23,7 +23,6 @@
#include "gpu/command_buffer/service/valuebuffer_manager.h"
#include "gpu/gles2_conform_support/egl/config.h"
#include "gpu/gles2_conform_support/egl/surface.h"
-#include "gpu/gles2_conform_support/egl/test_support.h"
namespace {
const int32_t kCommandBufferSize = 1024 * 1024;
@@ -41,11 +40,6 @@ int g_exit_manager_use_count;
base::AtExitManager* g_exit_manager;
void RefAtExitManager() {
base::AutoLock lock(g_exit_manager_lock.Get());
-#if defined(COMPONENT_BUILD)
- if (g_command_buffer_gles_has_atexit_manager) {
- return;
- }
-#endif
if (g_exit_manager_use_count == 0) {
g_exit_manager = new base::AtExitManager;
}
@@ -53,11 +47,6 @@ void RefAtExitManager() {
}
void ReleaseAtExitManager() {
base::AutoLock lock(g_exit_manager_lock.Get());
-#if defined(COMPONENT_BUILD)
- if (g_command_buffer_gles_has_atexit_manager) {
- return;
- }
-#endif
--g_exit_manager_use_count;
if (g_exit_manager_use_count == 0) {
delete g_exit_manager;
diff --git a/gpu/gles2_conform_support/egl/egl.cc b/gpu/gles2_conform_support/egl/egl.cc
index 5a81954..a61bf53 100644
--- a/gpu/gles2_conform_support/egl/egl.cc
+++ b/gpu/gles2_conform_support/egl/egl.cc
@@ -143,10 +143,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy,
gfx::GLSurface::InitializeOneOff();
}
- if (major)
- *major = 1;
- if (minor)
- *minor = 4;
+
+ *major = 1;
+ *minor = 4;
return EglSuccess(EGL_TRUE);
}
diff --git a/gpu/gles2_conform_support/egl/test_support.cc b/gpu/gles2_conform_support/egl/test_support.cc
deleted file mode 100644
index 938abcf..0000000
--- a/gpu/gles2_conform_support/egl/test_support.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "test_support.h"
-
-#if defined(COMPONENT_BUILD) && defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY)
-bool g_command_buffer_gles_has_atexit_manager;
-#endif
diff --git a/gpu/gles2_conform_support/egl/test_support.h b/gpu/gles2_conform_support/egl/test_support.h
deleted file mode 100644
index 73536db..0000000
--- a/gpu/gles2_conform_support/egl/test_support.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef GPU_GLES2_CONFORM_SUPPORT_EGL_TEST_SUPPORT_H_
-#define GPU_GLES2_CONFORM_SUPPORT_EGL_TEST_SUPPORT_H_
-
-#if defined(COMPONENT_BUILD) && defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY)
-// A variable used for communicating whether the app has initialized the global
-// variables.
-// On component build, the dynamic library and the Chromium test
-// runner executable refer to the same global variables. Any non-Chromium client
-// of the dynamic library will not initialize the globabl variables.
-// On non-component (static) build, the library and the runner have distinct
-// global variables.
-EGLAPI extern EGLAPIENTRY bool g_command_buffer_gles_has_atexit_manager;
-
-#endif
-
-#endif
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index 8e14dfd..25487b0 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -437,8 +437,6 @@
'gles2_conform_support/egl/egl.cc',
'gles2_conform_support/egl/surface.cc',
'gles2_conform_support/egl/surface.h',
- 'gles2_conform_support/egl/test_support.cc',
- 'gles2_conform_support/egl/test_support.h',
],
'conditions': [
['OS=="win"', {
@@ -455,37 +453,7 @@
],
}, ],
],
- },
- {
- # GN version: //gpu:command_buffer_gles2_tests
- 'target_name': 'command_buffer_gles2_tests',
- 'type': '<(gtest_target_type)',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- '../testing/gmock.gyp:gmock',
- '../testing/gtest.gyp:gtest',
- 'command_buffer_gles2',
- ],
- 'sources': [
- # Note: sources list duplicated in GN build.
- 'command_buffer/tests/command_buffer_gles2_tests_main.cc',
- 'command_buffer/tests/egl_test.cc',
- ],
- 'defines': [
- 'COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY',
- 'EGLAPIENTRY=',
- 'EGLAPI='
- ],
- 'conditions': [
- ['OS == "android"', {
- 'dependencies': [
- '../testing/android/native_test.gyp:native_test_native_code',
- ],
- }],
- ],
- },
+ }
],
'conditions': [
['component=="static_library"', {
@@ -785,19 +753,6 @@
},
'includes': [ '../build/apk_test.gypi' ],
},
- {
- 'target_name': 'command_buffer_gles2_tests_apk',
- 'type': 'none',
- 'dependencies': [
- 'command_buffer_gles2_tests',
- ],
- 'variables': {
- 'test_suite_name': 'command_buffer_gles2_tests',
- },
- 'includes': [
- '../build/apk_test.gypi',
- ],
- },
],
}],
['OS == "win" or (OS == "linux" and use_x11==1) or OS == "mac"', {
@@ -925,19 +880,6 @@
{
'targets': [
{
- 'target_name': 'command_buffer_gles2_tests_apk_run',
- 'type': 'none',
- 'dependencies': [
- 'command_buffer_gles2_tests_apk',
- ],
- 'includes': [
- '../build/isolate.gypi',
- ],
- 'sources': [
- 'command_buffer_gles2_apk.isolate',
- ],
- },
- {
'target_name': 'gl_tests_apk_run',
'type': 'none',
'dependencies': [