| Index: ui/views/widget/widget_unittest.cc
|
| diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
|
| index dadb85eb76ce19f4108f1402aae88f2556118592..f90572ca2ed9cd6939b1b186a03034646225a64b 100644
|
| --- a/ui/views/widget/widget_unittest.cc
|
| +++ b/ui/views/widget/widget_unittest.cc
|
| @@ -7,7 +7,6 @@
|
| #include <set>
|
|
|
| #include "base/bind.h"
|
| -#include "base/command_line.h"
|
| #include "base/macros.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/run_loop.h"
|
| @@ -15,7 +14,6 @@
|
| #include "build/build_config.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "ui/base/hit_test.h"
|
| -#include "ui/base/ui_base_switches.h"
|
| #include "ui/compositor/layer_animation_observer.h"
|
| #include "ui/compositor/scoped_animation_duration_scale_mode.h"
|
| #include "ui/compositor/scoped_layer_animation_settings.h"
|
| @@ -41,18 +39,12 @@
|
| #include "ui/aura/window.h"
|
| #include "ui/aura/window_tree_host.h"
|
| #include "ui/base/view_prop.h"
|
| -#include "ui/base/win/shell.h"
|
| #include "ui/base/win/window_event_target.h"
|
| #include "ui/views/win/hwnd_util.h"
|
| #endif
|
|
|
| #if defined(OS_MACOSX)
|
| #include "base/mac/mac_util.h"
|
| -#endif
|
| -
|
| -#if defined(USE_X11) && !defined(OS_CHROMEOS)
|
| -#include "ui/base/x/x11_util_internal.h" // nogncheck
|
| -#include "ui/gfx/x/x11_switches.h" // nogncheck
|
| #endif
|
|
|
| namespace views {
|
| @@ -3731,74 +3723,5 @@
|
|
|
| #endif // defined(OS_WIN)
|
|
|
| -#if !defined(OS_CHROMEOS)
|
| -
|
| -namespace {
|
| -
|
| -void InitializeWidgetForOpacity(
|
| - Widget& widget,
|
| - Widget::InitParams init_params,
|
| - const Widget::InitParams::WindowOpacity opacity) {
|
| -#if defined(USE_X11)
|
| - // On Linux, transparent visuals is currently not activated by default.
|
| - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| - command_line->AppendSwitch(switches::kEnableTransparentVisuals);
|
| -
|
| - int depth = 0;
|
| - ui::ChooseVisualForWindow(NULL, &depth);
|
| - EXPECT_EQ(depth, 32);
|
| -#elif defined(OS_WIN)
|
| - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| - EXPECT_FALSE(command_line->HasSwitch(switches::kDisableDwmComposition));
|
| -
|
| - // TODO(j.isorce): find a way to activate compositing for unit tests on win.
|
| - EXPECT_FALSE(ui::win::IsAeroGlassEnabled());
|
| -#endif
|
| -
|
| - init_params.opacity = opacity;
|
| - init_params.show_state = ui::SHOW_STATE_NORMAL;
|
| - init_params.bounds = gfx::Rect(0, 0, 500, 500);
|
| - init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
| - init_params.native_widget =
|
| - CreatePlatformDesktopNativeWidgetImpl(init_params, &widget, nullptr);
|
| - widget.Init(init_params);
|
| -
|
| -#if defined(USE_X11)
|
| - EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported());
|
| -#endif
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -// Test opacity when compositing is enabled.
|
| -TEST_F(WidgetTest, Transparency_DesktopWidgetInferOpacity) {
|
| - Widget widget;
|
| - InitializeWidgetForOpacity(widget,
|
| - CreateParams(Widget::InitParams::TYPE_WINDOW),
|
| - Widget::InitParams::INFER_OPACITY);
|
| - EXPECT_EQ(IsNativeWindowTransparent(widget.GetNativeWindow()),
|
| - widget.ShouldWindowContentsBeTransparent());
|
| -}
|
| -
|
| -TEST_F(WidgetTest, Transparency_DesktopWidgetOpaque) {
|
| - Widget widget;
|
| - InitializeWidgetForOpacity(widget,
|
| - CreateParams(Widget::InitParams::TYPE_WINDOW),
|
| - Widget::InitParams::OPAQUE_WINDOW);
|
| - EXPECT_EQ(IsNativeWindowTransparent(widget.GetNativeWindow()),
|
| - widget.ShouldWindowContentsBeTransparent());
|
| -}
|
| -
|
| -TEST_F(WidgetTest, Transparency_DesktopWidgetTranslucent) {
|
| - Widget widget;
|
| - InitializeWidgetForOpacity(widget,
|
| - CreateParams(Widget::InitParams::TYPE_WINDOW),
|
| - Widget::InitParams::TRANSLUCENT_WINDOW);
|
| - EXPECT_EQ(IsNativeWindowTransparent(widget.GetNativeWindow()),
|
| - widget.ShouldWindowContentsBeTransparent());
|
| -}
|
| -
|
| -#endif // !defined(OS_CHROMEOS)
|
| -
|
| } // namespace test
|
| } // namespace views
|
|
|