Commit 39555519 authored by Alexander Dunaev's avatar Alexander Dunaev Committed by Commit Bot

[ozone/x11] Fixed the translucency check in widget unit tests.

Bug: 1109112
Change-Id: Iceda57cc2e066dbc1c7c6cb9a0957854a1173547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2530995
Auto-Submit: Alexander Dunaev <adunaev@igalia.com>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/master@{#826788}
parent e2df2b44
......@@ -64,6 +64,11 @@
#include "ui/wm/core/shadow_controller_delegate.h"
#endif
#if defined(USE_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/ozone/public/ozone_platform.h"
#endif
namespace views {
namespace test {
......@@ -4066,6 +4071,21 @@ TEST_F(DesktopWidgetTest, WindowModalOwnerDestroyedEnabledTest) {
namespace {
bool CanHaveCompositingManager() {
#if defined(USE_OZONE)
if (features::IsUsingOzonePlatform()) {
const auto* const egl_utility =
ui::OzonePlatform::GetInstance()->GetPlatformGLEGLUtility();
return egl_utility != nullptr;
}
#endif
#if defined(USE_X11)
return true;
#else
return false;
#endif
}
class CompositingWidgetTest : public DesktopWidgetTest {
public:
CompositingWidgetTest()
......@@ -4121,17 +4141,15 @@ class CompositingWidgetTest : public DesktopWidgetTest {
EXPECT_EQ(IsNativeWindowTransparent(widget->GetNativeWindow()),
should_be_transparent);
#if defined(USE_X11)
if (features::IsUsingOzonePlatform())
return;
if (HasCompositingManager() &&
(widget_type == Widget::InitParams::TYPE_DRAG ||
widget_type == Widget::InitParams::TYPE_WINDOW)) {
EXPECT_TRUE(widget->IsTranslucentWindowOpacitySupported());
} else {
EXPECT_FALSE(widget->IsTranslucentWindowOpacitySupported());
if (CanHaveCompositingManager()) {
if (HasCompositingManager() &&
(widget_type == Widget::InitParams::TYPE_DRAG ||
widget_type == Widget::InitParams::TYPE_WINDOW)) {
EXPECT_TRUE(widget->IsTranslucentWindowOpacitySupported());
} else {
EXPECT_FALSE(widget->IsTranslucentWindowOpacitySupported());
}
}
#endif
}
}
......
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