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

Side by Side Diff: ui/events/test/events_test_utils_x11.cc

Issue 560853003: Revert of Fix test for master device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « ui/events/test/events_test_utils_x11.h ('k') | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/test/events_test_utils_x11.h" 5 #include "ui/events/test/events_test_utils_x11.h"
6 6
7 #include <X11/extensions/XI2.h> 7 #include <X11/extensions/XI2.h>
8 #include <X11/keysym.h> 8 #include <X11/keysym.h>
9 #include <X11/X.h> 9 #include <X11/X.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 event_->xkey.x = 0; 164 event_->xkey.x = 0;
165 event_->xkey.y = 0; 165 event_->xkey.y = 0;
166 event_->xkey.x_root = 0; 166 event_->xkey.x_root = 0;
167 event_->xkey.y_root = 0; 167 event_->xkey.y_root = 0;
168 event_->xkey.state = XEventState(flags); 168 event_->xkey.state = XEventState(flags);
169 event_->xkey.keycode = XKeyCodeForWindowsKeyCode(key_code, flags, display); 169 event_->xkey.keycode = XKeyCodeForWindowsKeyCode(key_code, flags, display);
170 event_->xkey.same_screen = 1; 170 event_->xkey.same_screen = 1;
171 } 171 }
172 172
173 void ScopedXI2Event::InitGenericKeyEvent(int deviceid, 173 void ScopedXI2Event::InitGenericKeyEvent(int deviceid,
174 int sourceid,
175 EventType type, 174 EventType type,
176 KeyboardCode key_code, 175 KeyboardCode key_code,
177 int flags) { 176 int flags) {
178 event_.reset( 177 event_.reset(
179 CreateXInput2Event(deviceid, XIKeyEventType(type), 0, gfx::Point())); 178 CreateXInput2Event(deviceid, XIKeyEventType(type), 0, gfx::Point()));
180 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event_->xcookie.data); 179 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event_->xcookie.data);
181 CHECK_NE(0, xievent->evtype); 180 CHECK_NE(0, xievent->evtype);
182 XDisplay* display = gfx::GetXDisplay(); 181 XDisplay* display = gfx::GetXDisplay();
183 event_->xgeneric.display = display; 182 event_->xgeneric.display = display;
184 xievent->display = display; 183 xievent->display = display;
185 xievent->mods.effective = XEventState(flags); 184 xievent->mods.effective = XEventState(flags);
186 xievent->detail = XKeyCodeForWindowsKeyCode(key_code, flags, display); 185 xievent->detail = XKeyCodeForWindowsKeyCode(key_code, flags, display);
187 xievent->sourceid = sourceid;
188 } 186 }
189 187
190 void ScopedXI2Event::InitGenericButtonEvent(int deviceid, 188 void ScopedXI2Event::InitGenericButtonEvent(int deviceid,
191 EventType type, 189 EventType type,
192 const gfx::Point& location, 190 const gfx::Point& location,
193 int flags) { 191 int flags) {
194 event_.reset(CreateXInput2Event(deviceid, 192 event_.reset(CreateXInput2Event(deviceid,
195 XIButtonEventType(type), 0, gfx::Point())); 193 XIButtonEventType(type), 0, gfx::Point()));
196 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event_->xcookie.data); 194 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event_->xcookie.data);
197 xievent->mods.effective = XEventState(flags); 195 xievent->mods.effective = XEventState(flags);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list); 293 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list);
296 } 294 }
297 295
298 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) { 296 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) {
299 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices); 297 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices);
300 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); 298 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance();
301 manager->SetDeviceListForTest(devices, std::vector<unsigned int>()); 299 manager->SetDeviceListForTest(devices, std::vector<unsigned int>());
302 } 300 }
303 301
304 } // namespace ui 302 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/test/events_test_utils_x11.h ('k') | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698