Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc |
index 7f4ec9c7a59d5f3eea23ee38a75e787fbd88304f..f071e7564650a16532d7cf5cc6af4d7704f5e840 100644 |
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc |
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc |
@@ -31,7 +31,6 @@ |
#include "ui/gfx/geometry/point.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/path.h" |
-#include "ui/gfx/x/x11_atom_cache.h" |
#include "ui/views/test/views_test_base.h" |
#include "ui/views/test/x11_property_change_waiter.h" |
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
@@ -48,18 +47,10 @@ const int kPointerDeviceId = 1; |
// Blocks till the window state hint, |hint|, is set or unset. |
class WMStateWaiter : public X11PropertyChangeWaiter { |
public: |
- WMStateWaiter(XID window, |
- const char* hint, |
- bool wait_till_set) |
+ WMStateWaiter(XID window, const char* hint, bool wait_till_set) |
: X11PropertyChangeWaiter(window, "_NET_WM_STATE"), |
hint_(hint), |
- wait_till_set_(wait_till_set) { |
- const char* const kAtomsToCache[] = { |
- hint, |
- nullptr |
- }; |
- atom_cache_.reset(new ui::X11AtomCache(gfx::GetXDisplay(), kAtomsToCache)); |
- } |
+ wait_till_set_(wait_till_set) {} |
~WMStateWaiter() override {} |
@@ -68,16 +59,13 @@ class WMStateWaiter : public X11PropertyChangeWaiter { |
bool ShouldKeepOnWaiting(const ui::PlatformEvent& event) override { |
std::vector<Atom> hints; |
if (ui::GetAtomArrayProperty(xwindow(), "_NET_WM_STATE", &hints)) { |
- auto it = std::find(hints.cbegin(), hints.cend(), |
- atom_cache_->GetAtom(hint_)); |
+ auto it = std::find(hints.cbegin(), hints.cend(), ui::GetAtom(hint_)); |
bool hint_set = (it != hints.cend()); |
return hint_set != wait_till_set_; |
} |
return true; |
} |
- std::unique_ptr<ui::X11AtomCache> atom_cache_; |
- |
// The name of the hint to wait to get set or unset. |
const char* hint_; |
@@ -346,22 +334,16 @@ TEST_F(DesktopWindowTreeHostX11Test, WindowManagerTogglesFullscreen) { |
// Emulate the window manager exiting fullscreen via a window manager |
// accelerator key. It should not affect the widget's fullscreen state. |
{ |
- const char* const kAtomsToCache[] = { |
- "_NET_WM_STATE", |
- "_NET_WM_STATE_FULLSCREEN", |
- nullptr |
- }; |
Display* display = gfx::GetXDisplay(); |
- ui::X11AtomCache atom_cache(display, kAtomsToCache); |
XEvent xclient; |
memset(&xclient, 0, sizeof(xclient)); |
xclient.type = ClientMessage; |
xclient.xclient.window = xid; |
- xclient.xclient.message_type = atom_cache.GetAtom("_NET_WM_STATE"); |
+ xclient.xclient.message_type = ui::GetAtom("_NET_WM_STATE"); |
xclient.xclient.format = 32; |
xclient.xclient.data.l[0] = 0; |
- xclient.xclient.data.l[1] = atom_cache.GetAtom("_NET_WM_STATE_FULLSCREEN"); |
+ xclient.xclient.data.l[1] = ui::GetAtom("_NET_WM_STATE_FULLSCREEN"); |
xclient.xclient.data.l[2] = 0; |
xclient.xclient.data.l[3] = 1; |
xclient.xclient.data.l[4] = 0; |
@@ -397,16 +379,8 @@ TEST_F(DesktopWindowTreeHostX11Test, ToggleMinimizePropogateToContentWindow) { |
// Minimize by sending _NET_WM_STATE_HIDDEN |
{ |
- const char* const kAtomsToCache[] = { |
- "_NET_WM_STATE", |
- "_NET_WM_STATE_HIDDEN", |
- nullptr |
- }; |
- |
- ui::X11AtomCache atom_cache(display, kAtomsToCache); |
- |
std::vector< ::Atom> atom_list; |
- atom_list.push_back(atom_cache.GetAtom("_NET_WM_STATE_HIDDEN")); |
+ atom_list.push_back(ui::GetAtom("_NET_WM_STATE_HIDDEN")); |
ui::SetAtomArrayProperty(xid, "_NET_WM_STATE", "ATOM", atom_list); |
XEvent xevent; |
@@ -416,7 +390,7 @@ TEST_F(DesktopWindowTreeHostX11Test, ToggleMinimizePropogateToContentWindow) { |
xevent.xproperty.send_event = 1; |
xevent.xproperty.display = display; |
xevent.xproperty.window = xid; |
- xevent.xproperty.atom = atom_cache.GetAtom("_NET_WM_STATE"); |
+ xevent.xproperty.atom = ui::GetAtom("_NET_WM_STATE"); |
xevent.xproperty.state = 0; |
XSendEvent(display, DefaultRootWindow(display), False, |
SubstructureRedirectMask | SubstructureNotifyMask, |
@@ -429,16 +403,8 @@ TEST_F(DesktopWindowTreeHostX11Test, ToggleMinimizePropogateToContentWindow) { |
// Show from minimized by sending _NET_WM_STATE_FOCUSED |
{ |
- const char* const kAtomsToCache[] = { |
- "_NET_WM_STATE", |
- "_NET_WM_STATE_FOCUSED", |
- nullptr |
- }; |
- |
- ui::X11AtomCache atom_cache(display, kAtomsToCache); |
- |
std::vector< ::Atom> atom_list; |
- atom_list.push_back(atom_cache.GetAtom("_NET_WM_STATE_FOCUSED")); |
+ atom_list.push_back(ui::GetAtom("_NET_WM_STATE_FOCUSED")); |
ui::SetAtomArrayProperty(xid, "_NET_WM_STATE", "ATOM", atom_list); |
XEvent xevent; |
@@ -448,7 +414,7 @@ TEST_F(DesktopWindowTreeHostX11Test, ToggleMinimizePropogateToContentWindow) { |
xevent.xproperty.send_event = 1; |
xevent.xproperty.display = display; |
xevent.xproperty.window = xid; |
- xevent.xproperty.atom = atom_cache.GetAtom("_NET_WM_STATE"); |
+ xevent.xproperty.atom = ui::GetAtom("_NET_WM_STATE"); |
xevent.xproperty.state = 0; |
XSendEvent(display, DefaultRootWindow(display), False, |
SubstructureRedirectMask | SubstructureNotifyMask, |