Commit ab4c154d authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11 and Ozone: Disable some parts of webinput unittests

These parts are not used in Ozone/Linux for the use_x11 && !use_ozone
config. However, we are going towards have a single Linux
config where OzonePlatform is enabled by
--enable-features=UseOzonePlatform. Thus, the parts that
are guarded by \#ifdef(USE_X11) start to be executed. This is not
desired for Ozone/Linux as it can run Wayland instead.

Thus, temporarily add check for the OzonePlatform feature flag and
a TODO to properly fix that.

-----

PS: Please note that this is a temp solution that will help to choose
between ozone and non-ozone X11 build. The switch that will be used
to choose the path is --enable-features=UseOzonePlatform. Once
non-Ozone X11 path is removed (hopefully by Q1 2021 depending on how
the finch trial goes), the wrapper will be removed.

Please also note that it's impossible to build use_x11 && use_ozone
without some hacks in PlatformCursor code. The changes to that are
on their way to upstream.

----

Bug: 1085700
Change-Id: I45cb0c9d36a7e45e72b8ff52cbfbdfcb37bc4ee5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333199
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794874}
parent 0e8abbef
......@@ -10,6 +10,7 @@
#include "base/stl_util.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/event.h"
......@@ -79,6 +80,9 @@ TEST(WebInputEventTest, TestMakeWebKeyboardEvent) {
EXPECT_EQ(static_cast<int>(DomKey::CONTROL), webkit_event.dom_key);
}
#if defined(USE_X11)
// https://crbug.com/1109112): fix this.
if (features::IsUsingOzonePlatform())
return;
const int kLocationModifiers =
blink::WebInputEvent::kIsLeft | blink::WebInputEvent::kIsRight;
ScopedXI2Event xev;
......@@ -104,6 +108,9 @@ TEST(WebInputEventTest, TestMakeWebKeyboardEvent) {
TEST(WebInputEventTest, TestMakeWebKeyboardEventWindowsKeyCode) {
#if defined(USE_X11)
// https://crbug.com/1109112): enable this.
if (features::IsUsingOzonePlatform())
return;
ScopedXI2Event xev;
{
// Press left Ctrl.
......@@ -213,6 +220,9 @@ TEST(WebInputEventTest, TestMakeWebKeyboardEventKeyPadKeyCode) {
<< "}, expect: " << test_case.expected_result;
}
#if defined(USE_X11)
// https://crbug.com/1109112): fix this.
if (features::IsUsingOzonePlatform())
return;
ScopedXI2Event xev;
for (size_t i = 0; i < base::size(kTesCases); ++i) {
const TestCase& test_case = kTesCases[i];
......
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