| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // make this a bit more robust in case of some other formatting or other bug.) | 49 // make this a bit more robust in case of some other formatting or other bug.) |
| 50 WebMouseEvent mouse_event; | 50 WebMouseEvent mouse_event; |
| 51 mouse_event.type = WebInputEvent::MouseDown; | 51 mouse_event.type = WebInputEvent::MouseDown; |
| 52 mouse_event.button = WebMouseEvent::ButtonRight; | 52 mouse_event.button = WebMouseEvent::ButtonRight; |
| 53 mouse_event.x = 250; | 53 mouse_event.x = 250; |
| 54 mouse_event.y = 250; | 54 mouse_event.y = 250; |
| 55 mouse_event.globalX = 250; | 55 mouse_event.globalX = 250; |
| 56 mouse_event.globalY = 250; | 56 mouse_event.globalY = 250; |
| 57 | 57 |
| 58 WebView* webview = test_shell_->webView(); | 58 WebView* webview = test_shell_->webView(); |
| 59 webview->HandleInputEvent(&mouse_event); | 59 webview->handleInputEvent(mouse_event); |
| 60 | 60 |
| 61 // Now simulate the corresponding up event which should display the menu | 61 // Now simulate the corresponding up event which should display the menu |
| 62 mouse_event.type = WebInputEvent::MouseUp; | 62 mouse_event.type = WebInputEvent::MouseUp; |
| 63 webview->HandleInputEvent(&mouse_event); | 63 webview->handleInputEvent(mouse_event); |
| 64 | 64 |
| 65 EXPECT_EQ(1U, test_delegate->captured_context_menu_events().size()); | 65 EXPECT_EQ(1U, test_delegate->captured_context_menu_events().size()); |
| 66 } | 66 } |
| OLD | NEW |