OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Tests for displaying context menus in corner cases (and swallowing context | 5 // Tests for displaying context menus in corner cases (and swallowing context |
6 // menu events when appropriate) | 6 // menu events when appropriate) |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
15 #include "webkit/glue/webkit_glue.h" | 16 #include "webkit/glue/webkit_glue.h" |
16 #include "webkit/tools/test_shell/test_shell_test.h" | 17 #include "webkit/tools/test_shell/test_shell_test.h" |
17 #include "webkit/tools/test_shell/test_webview_delegate.h" | 18 #include "webkit/tools/test_shell/test_webview_delegate.h" |
18 | 19 |
19 using WebKit::WebInputEvent; | 20 using WebKit::WebInputEvent; |
20 using WebKit::WebMouseEvent; | 21 using WebKit::WebMouseEvent; |
21 using WebKit::WebView; | 22 using WebKit::WebView; |
22 | 23 |
23 // Right clicking inside on an iframe should produce a context menu | 24 // Right clicking inside on an iframe should produce a context menu |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 59 |
59 WebView* webview = test_shell_->webView(); | 60 WebView* webview = test_shell_->webView(); |
60 webview->handleInputEvent(mouse_event); | 61 webview->handleInputEvent(mouse_event); |
61 | 62 |
62 // Now simulate the corresponding up event which should display the menu | 63 // Now simulate the corresponding up event which should display the menu |
63 mouse_event.type = WebInputEvent::MouseUp; | 64 mouse_event.type = WebInputEvent::MouseUp; |
64 webview->handleInputEvent(mouse_event); | 65 webview->handleInputEvent(mouse_event); |
65 | 66 |
66 EXPECT_EQ(1U, test_delegate->captured_context_menu_events().size()); | 67 EXPECT_EQ(1U, test_delegate->captured_context_menu_events().size()); |
67 } | 68 } |
OLD | NEW |