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

Unified Diff: ui/base/x/x11_util_unittest.cc

Issue 2280433004: Fix missing shadows for tooltip and menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just 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
Index: ui/base/x/x11_util_unittest.cc
diff --git a/ui/base/x/x11_util_unittest.cc b/ui/base/x/x11_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5d469e8edca1e23b45db2bd40881eb526b0f8b79
--- /dev/null
+++ b/ui/base/x/x11_util_unittest.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/environment.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/x/x11_util_internal.h"
+#include "ui/gfx/x/x11_types.h"
+
+namespace ui {
+
+class X11UtilTest : public testing::Test {
+ public:
+ X11UtilTest() {}
+ ~X11UtilTest() override {}
+};
+
+TEST_F(X11UtilTest, ChooseVisualForWindow) {
+ XDisplay* display = gfx::GetXDisplay();
+ XWindowAttributes windowAttribs;
sadrul 2016/09/02 19:53:24 window_attribs, or just attribs
Julien Isorce Samsung 2016/09/02 20:59:08 Done.
+ Window root = XDefaultRootWindow(display);
+ Status status = XGetWindowAttributes(display, root, &windowAttribs);
+ DCHECK(status != 0);
sadrul 2016/09/02 19:53:24 DCHECK_NE
Julien Isorce Samsung 2016/09/02 20:59:08 Done.
+
+ int depth = 0;
+ bool has_compositing_manager = false;
+ ui::ChooseVisualForWindow(has_compositing_manager, NULL, &depth);
sadrul 2016/09/02 19:53:24 nullptr instead of NULL
Julien Isorce Samsung 2016/09/02 20:59:08 Done.
+ EXPECT_EQ(windowAttribs.depth, depth);
+
+ // Setting to true has no effect because it has been called with false before.
+ has_compositing_manager = true;
+ ui::ChooseVisualForWindow(has_compositing_manager, NULL, &depth);
+ EXPECT_EQ(windowAttribs.depth, depth);
+}
+
+} // namespace ui
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/views/BUILD.gn » ('j') | ui/views/widget/widget_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698