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

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

Issue 2375383005: Prune CreateVisibleSelectionDeprecated from unit test files (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 { 247 {
248 setHtmlInnerHTML( 248 setHtmlInnerHTML(
249 "<style>*:hover { color: red; }</style>" 249 "<style>*:hover { color: red; }</style>"
250 "<div>foo</div>"); 250 "<div>foo</div>");
251 document().settings()->setScriptEnabled(true); 251 document().settings()->setScriptEnabled(true);
252 Element* script = document().createElement("script", ASSERT_NO_EXCEPTION); 252 Element* script = document().createElement("script", ASSERT_NO_EXCEPTION);
253 script->setInnerHTML( 253 script->setInnerHTML(
254 "document.addEventListener('contextmenu', event => event.preventDefault( ));", 254 "document.addEventListener('contextmenu', event => event.preventDefault( ));",
255 ASSERT_NO_EXCEPTION); 255 ASSERT_NO_EXCEPTION);
256 document().body()->appendChild(script); 256 document().body()->appendChild(script);
257 document().updateStyleAndLayout();
257 document().frame()->selection().setSelection( 258 document().frame()->selection().setSelection(
258 createVisibleSelectionDeprecated(Position(document().body(), 0))); 259 createVisibleSelection(Position(document().body(), 0)));
259 PlatformMouseEvent mouseDownEvent( 260 PlatformMouseEvent mouseDownEvent(
260 IntPoint(0, 0), 261 IntPoint(0, 0),
261 IntPoint(100, 200), 262 IntPoint(100, 200),
262 WebPointerProperties::Button::Right, 263 WebPointerProperties::Button::Right,
263 PlatformEvent::MousePressed, 264 PlatformEvent::MousePressed,
264 1, 265 1,
265 PlatformEvent::Modifiers::RightButtonDown, 266 PlatformEvent::Modifiers::RightButtonDown,
266 WTF::monotonicallyIncreasingTime()); 267 WTF::monotonicallyIncreasingTime());
267 EXPECT_EQ(WebInputEventResult::HandledApplication, 268 EXPECT_EQ(WebInputEventResult::HandledApplication,
268 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)) ; 269 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent)) ;
269 } 270 }
270 271
271 } // namespace blink 272 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698