diff options
Diffstat (limited to 'Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm')
-rw-r--r-- | Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm b/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm index ad901d3..64a7c1c 100644 --- a/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm +++ b/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm @@ -94,4 +94,33 @@ void PlatformWebView::simulateSpacebarKeyPress() [m_view keyUp:event]; } +void PlatformWebView::simulateRightClick(unsigned x, unsigned y) +{ + NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown + location:NSMakePoint(x, y) + modifierFlags:0 + timestamp:GetCurrentEventTime() + windowNumber:[m_window windowNumber] + context:[NSGraphicsContext currentContext] + eventNumber:0 + clickCount:0 + pressure:0]; + + + [m_view rightMouseDown:event]; + + event = [NSEvent mouseEventWithType:NSRightMouseUp + location:NSMakePoint(x, y) + modifierFlags:0 + timestamp:GetCurrentEventTime() + windowNumber:[m_window windowNumber] + context:[NSGraphicsContext currentContext] + eventNumber:0 + clickCount:0 + pressure:0]; + + [m_view rightMouseUp:event]; + +} + } // namespace TestWebKitAPI |