Commit 50abf5a8 authored by kylechar's avatar kylechar Committed by Commit bot

Reland: Run gl_unittests with Ozone X11.

Add a new test target gl_unittests_ozonex that runs with
--ozone-platform=x11. The Ozone CrOS bot will now run gl_unittests with
both Ozone headless and Ozone X11.

The test requires an X server to be running on the bot. The mb.py script
is modified to look for GN arg use_ozone=true and runtime flag
--ozone-platform=x11. In this case, it runs the test using xvfb.

Original commit crrev.com/2493063003 was reverted due to
crbug.com/665895. There was no dependency on xdisplaycheck by the new
test target that needs it. This caused problems during the isolate step
when xdisplaycheck wasn't found.

BUG=664570

Review-Url: https://codereview.chromium.org/2509033006
Cr-Commit-Position: refs/heads/master@{#435000}
parent 5dbfcd08
......@@ -18,6 +18,7 @@ import("//media/media_options.gni")
import("//remoting/remoting_enable.gni")
import("//third_party/openh264/openh264_args.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
import("//ui/ozone/ozone.gni")
import("//v8/gni/v8.gni")
import("//v8/snapshot_toolchain.gni")
......@@ -373,7 +374,7 @@ group("both_gn_and_gyp") {
]
}
if (use_x11) {
if (use_x11 || ozone_platform_x11) {
deps += [ "//tools/xdisplaycheck" ]
}
......
......@@ -177,6 +177,12 @@
},
"test": "gl_unittests"
},
{
"swarming": {
"can_use_on_swarming_builders": true
},
"test": "gl_unittests_ozonex"
},
{
"swarming": {
"can_use_on_swarming_builders": true
......
......@@ -20,7 +20,8 @@
# "windowed_test_launcher"
# : the test is a gtest-based test that uses the "brave-new-test-launcher"
# from //base/test:test_support and needs to run under Xvfb if run on
# an X11-based platform (use_x11=true).
# an X11-based platform (use_x11=true or use_ozone=true &&
# --ozone_platform=x11).
# "console_test_launcher"
# : the test is a gtest-based test that uses the "brave-new-test-launcher"
# from //base/test:test_support but does not need Xvfb.
......@@ -439,6 +440,13 @@
"type": "raw",
"args": [],
},
"gl_unittests_ozonex": {
"label": "//ui/gl:gl_unittests_ozonex",
"label_type": "group",
"type": "windowed_test_launcher",
"executable": "gl_unittests",
"args": ["--ozone-platform=x11"],
},
"gn_all": {
"label": "//:gn_all",
"type": "additional_compile_target",
......
......@@ -1056,19 +1056,23 @@ class MetaBuildWrapper(object):
return ret
def GetIsolateCommand(self, target, vals):
isolate_map = self.ReadIsolateMap()
android = 'target_os="android"' in vals['gn_args']
ozone = 'use_ozone=true' in vals['gn_args']
ozone_x11 = (ozone and 'args' in isolate_map[target] and
'--ozone-platform=x11' in isolate_map[target]['args'])
# This needs to mirror the settings in //build/config/ui.gni:
# use_x11 = is_linux && !use_ozone.
# use_x11 = is_linux && !use_ozone || use_ozone && --ozone-platform=x11
use_x11 = (self.platform == 'linux2' and
not android and
not 'use_ozone=true' in vals['gn_args'])
(ozone_x11 or not ozone))
asan = 'is_asan=true' in vals['gn_args']
msan = 'is_msan=true' in vals['gn_args']
tsan = 'is_tsan=true' in vals['gn_args']
isolate_map = self.ReadIsolateMap()
test_type = isolate_map[target]['type']
executable = isolate_map[target].get('executable', target)
......
......@@ -404,6 +404,27 @@ test("gl_unittests") {
]
}
# Non-Ozone trybots end up trying to build this when building "all" and failing
# when X11 isn't there.
if (ozone_platform_x11) {
group("gl_unittests_ozonex") {
testonly = true
data_deps = [
":gl_unittests",
"//tools/xdisplaycheck",
]
}
# TODO(GYP_GONE): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("gl_unittests_ozonex_run") {
testonly = true
deps = [
":gl_unittests_ozonex",
]
}
}
if (is_android) {
generate_jar_jni("surface_jni_headers") {
jni_package = "ui/gl"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment