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

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

Issue 2710883002: Expand FrameSeleciton::isNone() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T16:27:43 rebase to resolve conflict with DOMSelection in r452402 Created 3 years, 9 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 document().frame()->eventHandler().handleGestureEvent(longPressEvent); 375 document().frame()->eventHandler().handleGestureEvent(longPressEvent);
376 376
377 ASSERT_TRUE( 377 ASSERT_TRUE(
378 selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret()); 378 selection().computeVisibleSelectionInDOMTreeDeprecated().isCaret());
379 ASSERT_TRUE(selection().isHandleVisible()); 379 ASSERT_TRUE(selection().isHandleVisible());
380 380
381 // Tap away from text area should clear handle 381 // Tap away from text area should clear handle
382 TapEventBuilder singleTapEvent(IntPoint(700, 700), 1); 382 TapEventBuilder singleTapEvent(IntPoint(700, 700), 1);
383 document().frame()->eventHandler().handleGestureEvent(singleTapEvent); 383 document().frame()->eventHandler().handleGestureEvent(singleTapEvent);
384 384
385 ASSERT_TRUE(selection().isNone()); 385 ASSERT_TRUE(
386 selection().computeVisibleSelectionInDOMTreeDeprecated().isNone());
386 ASSERT_FALSE(selection().isHandleVisible()); 387 ASSERT_FALSE(selection().isHandleVisible());
387 } 388 }
388 389
389 TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) { 390 TEST_F(EventHandlerTest, HandleNotShownOnMouseEvents) {
390 setHtmlInnerHTML("<textarea cols=50 rows=50>Enter text</textarea>"); 391 setHtmlInnerHTML("<textarea cols=50 rows=50>Enter text</textarea>");
391 392
392 MousePressEventBuilder leftMousePressEvent( 393 MousePressEventBuilder leftMousePressEvent(
393 IntPoint(200, 200), 1, WebPointerProperties::Button::Left); 394 IntPoint(200, 200), 1, WebPointerProperties::Button::Left);
394 document().frame()->eventHandler().handleMousePressEvent(leftMousePressEvent); 395 document().frame()->eventHandler().handleMousePressEvent(leftMousePressEvent);
395 396
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0), 516 WebInputEvent::MouseLeave, WebFloatPoint(0, 0), WebFloatPoint(0, 0),
516 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers, 517 WebPointerProperties::Button::NoButton, 0, WebInputEvent::NoModifiers,
517 TimeTicks::Now().InSeconds()); 518 TimeTicks::Now().InSeconds());
518 mouseLeaveEvent.setFrameScale(1); 519 mouseLeaveEvent.setFrameScale(1);
519 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent); 520 document().frame()->eventHandler().handleMouseLeaveEvent(mouseLeaveEvent);
520 521
521 EXPECT_EQ(WTF::String(), lastToolTip()); 522 EXPECT_EQ(WTF::String(), lastToolTip());
522 } 523 }
523 524
524 } // namespace blink 525 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698