Index: ui/views/widget/widget_unittest.cc |
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc |
index 45ea028344667104e55aa80eee54da1c9e167e1a..d3671da0945e4611710bcc5bb48b49dc351f2145 100644 |
--- a/ui/views/widget/widget_unittest.cc |
+++ b/ui/views/widget/widget_unittest.cc |
@@ -7,7 +7,7 @@ |
#include <set> |
#include "base/bind.h" |
-#include "base/command_line.h" |
+#include "base/environment.h" |
#include "base/macros.h" |
#include "base/message_loop/message_loop.h" |
#include "base/run_loop.h" |
@@ -3744,13 +3744,14 @@ void InitializeWidgetForOpacity( |
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); |
- |
+ // testing/xvfb.py runs xvfb and xcompmgr. |
+ std::unique_ptr<base::Environment> env(base::Environment::Create()); |
+ bool has_compositing_manager = env->HasVar("_CHROMIUM_INSIDE_XVFB"); |
Ken Russell (switch to Gerrit)
2016/07/06 22:32:17
This is a hack. Is there no better way to determin
Julien Isorce Samsung
2016/07/07 10:29:23
The idea here is to only do EXPECT_EQ(depth, 32);
|
int depth = 0; |
- ui::ChooseVisualForWindow(NULL, &depth); |
- EXPECT_EQ(depth, 32); |
+ ui::ChooseVisualForWindow(!has_compositing_manager, NULL, &depth); |
+ |
+ if (has_compositing_manager) |
+ EXPECT_EQ(depth, 32); |
#endif |
init_params.opacity = opacity; |
@@ -3762,7 +3763,8 @@ void InitializeWidgetForOpacity( |
widget.Init(init_params); |
#if defined(USE_X11) |
- EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported()); |
+ if (has_compositing_manager) |
+ EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported()); |
#endif |
} |