| OLD | NEW |
| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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().frame()->selection().setSelection( | 257 document().frame()->selection().setSelection( |
| 258 VisibleSelection(Position(document().body(), 0))); | 258 createVisibleSelectionDeprecated(Position(document().body(), 0))); |
| 259 PlatformMouseEvent mouseDownEvent( | 259 PlatformMouseEvent mouseDownEvent( |
| 260 IntPoint(0, 0), | 260 IntPoint(0, 0), |
| 261 IntPoint(100, 200), | 261 IntPoint(100, 200), |
| 262 WebPointerProperties::Button::Right, | 262 WebPointerProperties::Button::Right, |
| 263 PlatformEvent::MousePressed, | 263 PlatformEvent::MousePressed, |
| 264 1, | 264 1, |
| 265 PlatformEvent::Modifiers::RightButtonDown, | 265 PlatformEvent::Modifiers::RightButtonDown, |
| 266 WTF::monotonicallyIncreasingTime()); | 266 WTF::monotonicallyIncreasingTime()); |
| 267 EXPECT_EQ(WebInputEventResult::HandledApplication, | 267 EXPECT_EQ(WebInputEventResult::HandledApplication, |
| 268 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent))
; | 268 document().frame()->eventHandler().sendContextMenuEvent(mouseDownEvent))
; |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace blink | 271 } // namespace blink |
| OLD | NEW |