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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandlerTest.cpp

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: fixing tests Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/input/EventHandler.h" 5 #include "core/input/EventHandler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Range.h" 9 #include "core/dom/Range.h"
10 #include "core/editing/Editor.h" 10 #include "core/editing/Editor.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 SetHtmlInnerHTML("<textarea cols=50 rows=50>Mispellinggg</textarea>"); 473 SetHtmlInnerHTML("<textarea cols=50 rows=50>Mispellinggg</textarea>");
474 474
475 TapEventBuilder single_tap_event(IntPoint(10, 10), 1); 475 TapEventBuilder single_tap_event(IntPoint(10, 10), 1);
476 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent( 476 GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(
477 single_tap_event); 477 single_tap_event);
478 478
479 ASSERT_TRUE( 479 ASSERT_TRUE(
480 Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret()); 480 Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret());
481 ASSERT_TRUE(Selection().IsHandleVisible()); 481 ASSERT_TRUE(Selection().IsHandleVisible());
482 482
483 GetDocument().GetFrame()->GetEventHandler().SendContextMenuEventForKey( 483 GetDocument().GetFrame()->GetEventHandler().ShowNonLocatedContextMenu(
484 nullptr, kMenuSourceTouchHandle); 484 nullptr, kMenuSourceTouchHandle);
485 485
486 ASSERT_TRUE( 486 ASSERT_TRUE(
487 Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret()); 487 Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret());
488 ASSERT_TRUE(Selection().IsHandleVisible()); 488 ASSERT_TRUE(Selection().IsHandleVisible());
489 } 489 }
490 490
491 TEST_F(EventHandlerTest, dragEndInNewDrag) { 491 TEST_F(EventHandlerTest, dragEndInNewDrag) {
492 SetHtmlInnerHTML( 492 SetHtmlInnerHTML(
493 "<style>.box { width: 100px; height: 100px; display: block; }</style>" 493 "<style>.box { width: 100px; height: 100px; display: block; }</style>"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 WebPointerProperties::Button::kNoButton, 0, WebInputEvent::kNoModifiers, 580 WebPointerProperties::Button::kNoButton, 0, WebInputEvent::kNoModifiers,
581 TimeTicks::Now().InSeconds()); 581 TimeTicks::Now().InSeconds());
582 mouse_leave_event.SetFrameScale(1); 582 mouse_leave_event.SetFrameScale(1);
583 GetDocument().GetFrame()->GetEventHandler().HandleMouseLeaveEvent( 583 GetDocument().GetFrame()->GetEventHandler().HandleMouseLeaveEvent(
584 mouse_leave_event); 584 mouse_leave_event);
585 585
586 EXPECT_EQ(WTF::String(), LastToolTip()); 586 EXPECT_EQ(WTF::String(), LastToolTip());
587 } 587 }
588 588
589 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698