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

Unified Diff: ui/views/test/views_test_base.cc

Issue 2280433004: Fix missing shadows for tooltip and menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/test/views_test_base.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.cc
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
index f37868f0e90ac456e5547b6422edf941e098496e..d3dbd71dbcaa2e47e6c4579b74da0be2069fcb7e 100644
--- a/ui/views/test/views_test_base.cc
+++ b/ui/views/test/views_test_base.cc
@@ -6,18 +6,49 @@
#include <utility>
+#include "base/environment.h"
#include "base/run_loop.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/test/material_design_controller_test_api.h"
#include "ui/views/test/platform_test_helper.h"
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+#include "ui/base/x/x11_util_internal.h"
+#endif
+
namespace views {
+namespace {
+
+bool InitializeVisuals() {
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ static int depth = 0;
+ static bool has_compositing_manager = false;
+
+ if (depth > 0)
+ return has_compositing_manager;
+
+ // testing/xvfb.py runs xvfb and xcompmgr.
+ std::unique_ptr<base::Environment> env(base::Environment::Create());
+ has_compositing_manager = env->HasVar("_CHROMIUM_INSIDE_XVFB");
+ ui::ChooseVisualForWindow(has_compositing_manager, NULL, &depth);
+
+ if (has_compositing_manager)
+ EXPECT_EQ(32, depth);
+
+ return has_compositing_manager;
+#else
+ return false;
+#endif
+}
+
+} // namespace
+
ViewsTestBase::ViewsTestBase()
: setup_called_(false),
- teardown_called_(false) {
-}
+ teardown_called_(false),
+ has_compositing_manager_(InitializeVisuals()) {}
ViewsTestBase::~ViewsTestBase() {
CHECK(setup_called_)
@@ -72,4 +103,8 @@ gfx::NativeWindow ViewsTestBase::GetContext() {
return test_helper_->GetContext();
}
+bool ViewsTestBase::HasCompositingManager() const {
+ return has_compositing_manager_;
+}
+
} // namespace views
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698