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

Unified Diff: third_party/WebKit/Source/core/input/EventHandlerTest.cpp

Issue 2864833002: Tapping handle shouldn't select misspelled word (Closed)
Patch Set: Mac test Created 3 years, 7 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: third_party/WebKit/Source/core/input/EventHandlerTest.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
index 641ba710be21239cf25614faf122adb2c38c7ad7..47f1a051577c0ceffeab11d7ab76dcdf15226082 100644
--- a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
@@ -462,6 +462,32 @@ TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) {
ASSERT_FALSE(Selection().IsHandleVisible());
}
+TEST_F(EventHandlerTest, MisspellingContextMenuEvent) {
+ if (GetDocument()
+ .GetFrame()
+ ->GetEditor()
+ .Behavior()
+ .ShouldSelectOnContextualMenuClick())
+ return;
+
+ SetHtmlInnerHTML("<textarea cols=50 rows=50>Mispellinggg</textarea>");
+
+ TapEventBuilder single_tap_event(IntPoint(10, 10), 1);
+ GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(
+ single_tap_event);
+
+ ASSERT_TRUE(
+ Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret());
+ ASSERT_TRUE(Selection().IsHandleVisible());
+
+ GetDocument().GetFrame()->GetEventHandler().SendContextMenuEventForKey(
+ nullptr, kMenuSourceTouchHandle);
+
+ ASSERT_TRUE(
+ Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret());
+ ASSERT_TRUE(Selection().IsHandleVisible());
+}
+
TEST_F(EventHandlerTest, dragEndInNewDrag) {
SetHtmlInnerHTML(
"<style>.box { width: 100px; height: 100px; display: block; }</style>"

Powered by Google App Engine
This is Rietveld 408576698