OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/environment.h" | |
6 #include "testing/gtest/include/gtest/gtest.h" | |
7 #include "ui/base/x/x11_util_internal.h" | |
8 #include "ui/gfx/x/x11_types.h" | |
9 | |
10 namespace ui { | |
11 | |
12 class X11UtilTest : public testing::Test { | |
13 public: | |
14 X11UtilTest() {} | |
15 ~X11UtilTest() override {} | |
16 }; | |
17 | |
18 TEST_F(X11UtilTest, ChooseVisualForWindow) { | |
19 XDisplay* display = gfx::GetXDisplay(); | |
20 XWindowAttributes windowAttribs; | |
sadrul
2016/09/02 19:53:24
window_attribs, or just attribs
Julien Isorce Samsung
2016/09/02 20:59:08
Done.
| |
21 Window root = XDefaultRootWindow(display); | |
22 Status status = XGetWindowAttributes(display, root, &windowAttribs); | |
23 DCHECK(status != 0); | |
sadrul
2016/09/02 19:53:24
DCHECK_NE
Julien Isorce Samsung
2016/09/02 20:59:08
Done.
| |
24 | |
25 int depth = 0; | |
26 bool has_compositing_manager = false; | |
27 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.
| |
28 EXPECT_EQ(windowAttribs.depth, depth); | |
29 | |
30 // Setting to true has no effect because it has been called with false before. | |
31 has_compositing_manager = true; | |
32 ui::ChooseVisualForWindow(has_compositing_manager, NULL, &depth); | |
33 EXPECT_EQ(windowAttribs.depth, depth); | |
34 } | |
35 | |
36 } // namespace ui | |
OLD | NEW |