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

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

Issue 2428363004: Get rid of createVisibleSelection() taking PositionWithAffinity (Closed)
Patch Set: 2016-10-20T14:00:21 Created 4 years, 2 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 "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Range.h" 8 #include "core/dom/Range.h"
9 #include "core/editing/Editor.h" 9 #include "core/editing/Editor.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 "<div>foo</div>"); 238 "<div>foo</div>");
239 document().settings()->setScriptEnabled(true); 239 document().settings()->setScriptEnabled(true);
240 Element* script = document().createElement("script", ASSERT_NO_EXCEPTION); 240 Element* script = document().createElement("script", ASSERT_NO_EXCEPTION);
241 script->setInnerHTML( 241 script->setInnerHTML(
242 "document.addEventListener('contextmenu', event => " 242 "document.addEventListener('contextmenu', event => "
243 "event.preventDefault());", 243 "event.preventDefault());",
244 ASSERT_NO_EXCEPTION); 244 ASSERT_NO_EXCEPTION);
245 document().body()->appendChild(script); 245 document().body()->appendChild(script);
246 document().updateStyleAndLayout(); 246 document().updateStyleAndLayout();
247 document().frame()->selection().setSelection( 247 document().frame()->selection().setSelection(
248 createVisibleSelection(Position(document().body(), 0))); 248 SelectionInDOMTree::Builder()
249 .collapse(Position(document().body(), 0))
250 .build());
249 PlatformMouseEvent mouseDownEvent( 251 PlatformMouseEvent mouseDownEvent(
250 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right, 252 IntPoint(0, 0), IntPoint(100, 200), WebPointerProperties::Button::Right,
251 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown, 253 PlatformEvent::MousePressed, 1, PlatformEvent::Modifiers::RightButtonDown,
252 WTF::monotonicallyIncreasingTime()); 254 WTF::monotonicallyIncreasingTime());
253 EXPECT_EQ( 255 EXPECT_EQ(
254 WebInputEventResult::HandledApplication, 256 WebInputEventResult::HandledApplication,
255 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)); 257 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent));
256 } 258 }
257 259
258 } // namespace blink 260 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698