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 @@ ...@@ -64,6 +64,11 @@
#include "ui/wm/core/shadow_controller_delegate.h" #include "ui/wm/core/shadow_controller_delegate.h"
#endif #endif
#if defined(USE_OZONE)
#include "ui/base/ui_base_features.h"
#include "ui/ozone/public/ozone_platform.h"
#endif
namespace views { namespace views {
namespace test { namespace test {
...@@ -4066,6 +4071,21 @@ TEST_F(DesktopWidgetTest, WindowModalOwnerDestroyedEnabledTest) { ...@@ -4066,6 +4071,21 @@ TEST_F(DesktopWidgetTest, WindowModalOwnerDestroyedEnabledTest) {
namespace { 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 { class CompositingWidgetTest : public DesktopWidgetTest {
public: public:
CompositingWidgetTest() CompositingWidgetTest()
...@@ -4121,17 +4141,15 @@ class CompositingWidgetTest : public DesktopWidgetTest { ...@@ -4121,17 +4141,15 @@ class CompositingWidgetTest : public DesktopWidgetTest {
EXPECT_EQ(IsNativeWindowTransparent(widget->GetNativeWindow()), EXPECT_EQ(IsNativeWindowTransparent(widget->GetNativeWindow()),
should_be_transparent); should_be_transparent);
#if defined(USE_X11) if (CanHaveCompositingManager()) {
if (features::IsUsingOzonePlatform()) if (HasCompositingManager() &&
return; (widget_type == Widget::InitParams::TYPE_DRAG ||
if (HasCompositingManager() && widget_type == Widget::InitParams::TYPE_WINDOW)) {
(widget_type == Widget::InitParams::TYPE_DRAG || EXPECT_TRUE(widget->IsTranslucentWindowOpacitySupported());
widget_type == Widget::InitParams::TYPE_WINDOW)) { } else {
EXPECT_TRUE(widget->IsTranslucentWindowOpacitySupported()); EXPECT_FALSE(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