Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: ui/views/widget/widget_unittest.cc

Issue 2124633002: Add new gpu driver bug workaround DISABLE_TRANSPARENT_VISUALS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just make sure the new gpu driver workaround exist in second test instead of using fake values Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index cf6ee511d9d9ff6f052f9468e582e81a78824019..41d666e12c110ad307a69f760350f4066482b8cf 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"
@@ -3740,13 +3740,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");
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;
@@ -3758,7 +3759,8 @@ void InitializeWidgetForOpacity(
widget.Init(init_params);
#if defined(USE_X11)
- EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported());
+ if (has_compositing_manager)
+ EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported());
#endif
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698