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

Unified Diff: content/browser/renderer_host/input/touch_emulator_unittest.cc

Issue 2084043003: Touch emulator: clear mouse buttons modifiers on emulated touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: content/browser/renderer_host/input/touch_emulator_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_emulator_unittest.cc b/content/browser/renderer_host/input/touch_emulator_unittest.cc
index 173a8cbd2695f7f0442b2da0d0e3a96f3c7e99eb..51580ff447b3ce17c4e566e849f486d97236f824 100644
--- a/content/browser/renderer_host/input/touch_emulator_unittest.cc
+++ b/content/browser/renderer_host/input/touch_emulator_unittest.cc
@@ -63,6 +63,9 @@ class TouchEmulatorTest : public testing::Test,
EXPECT_EQ(1U, event.touchesLength);
EXPECT_EQ(last_mouse_x_, event.touches[0].position.x);
EXPECT_EQ(last_mouse_y_, event.touches[0].position.y);
+ const int all_buttons = WebInputEvent::LeftButtonDown |
+ WebInputEvent::MiddleButtonDown | WebInputEvent::RightButtonDown;
+ EXPECT_EQ(0, event.modifiers & all_buttons);
WebInputEvent::DispatchType expected_dispatch_type =
event.type == WebInputEvent::TouchCancel
? WebInputEvent::EventNonBlocking
@@ -84,7 +87,8 @@ class TouchEmulatorTest : public testing::Test,
}
int modifiers() const {
- return shift_pressed_ ? WebInputEvent::ShiftKey : 0;
+ return (shift_pressed_ ? WebInputEvent::ShiftKey : 0) |
+ (mouse_pressed_ ? WebInputEvent::LeftButtonDown : 0);
}
std::string ExpectedEvents() {

Powered by Google App Engine
This is Rietveld 408576698