OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "base/test/scoped_feature_list.h" | 7 #include "base/test/scoped_feature_list.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert
est_util.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert
est_util.h" |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 content::RenderWidgetHostView* child_view = | 1093 content::RenderWidgetHostView* child_view = |
1094 ChildFrameAt(active_web_contents->GetMainFrame(), 0)->GetView(); | 1094 ChildFrameAt(active_web_contents->GetMainFrame(), 0)->GetView(); |
1095 | 1095 |
1096 ContextMenuWaiter menu_waiter(content::NotificationService::AllSources()); | 1096 ContextMenuWaiter menu_waiter(content::NotificationService::AllSources()); |
1097 | 1097 |
1098 // Declaring a lambda to send a right-button mouse event to the embedder | 1098 // Declaring a lambda to send a right-button mouse event to the embedder |
1099 // frame. | 1099 // frame. |
1100 auto send_right_mouse_event = [](content::RenderWidgetHost* host, int x, | 1100 auto send_right_mouse_event = [](content::RenderWidgetHost* host, int x, |
1101 int y, blink::WebInputEvent::Type type) { | 1101 int y, blink::WebInputEvent::Type type) { |
1102 blink::WebMouseEvent event; | 1102 blink::WebMouseEvent event; |
1103 event.x = x; | 1103 event.setPositionInWidget(x, y); |
1104 event.y = y; | |
1105 event.button = blink::WebMouseEvent::Button::Right; | 1104 event.button = blink::WebMouseEvent::Button::Right; |
1106 event.setType(type); | 1105 event.setType(type); |
1107 host->ForwardMouseEvent(event); | 1106 host->ForwardMouseEvent(event); |
1108 }; | 1107 }; |
1109 | 1108 |
1110 send_right_mouse_event(child_view->GetRenderWidgetHost(), 10, 20, | 1109 send_right_mouse_event(child_view->GetRenderWidgetHost(), 10, 20, |
1111 blink::WebInputEvent::MouseDown); | 1110 blink::WebInputEvent::MouseDown); |
1112 send_right_mouse_event(child_view->GetRenderWidgetHost(), 10, 20, | 1111 send_right_mouse_event(child_view->GetRenderWidgetHost(), 10, 20, |
1113 blink::WebInputEvent::MouseUp); | 1112 blink::WebInputEvent::MouseUp); |
1114 menu_waiter.WaitForMenuOpenAndClose(); | 1113 menu_waiter.WaitForMenuOpenAndClose(); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 | 1332 |
1334 // Ideally, the length of the error vector should be 0.0f. But due to | 1333 // Ideally, the length of the error vector should be 0.0f. But due to |
1335 // potential rounding errors, we assume a larger limit (which is slightly | 1334 // potential rounding errors, we assume a larger limit (which is slightly |
1336 // larger than square root of 2). | 1335 // larger than square root of 2). |
1337 EXPECT_LT(error.Length(), 1.4143f) | 1336 EXPECT_LT(error.Length(), 1.4143f) |
1338 << "Origin of bounds from focused node changed event is '" | 1337 << "Origin of bounds from focused node changed event is '" |
1339 << focus_observer.focused_node_bounds_in_screen().ToString() | 1338 << focus_observer.focused_node_bounds_in_screen().ToString() |
1340 << "' but AutofillClient is reporting '" << bounds_origin.ToString() | 1339 << "' but AutofillClient is reporting '" << bounds_origin.ToString() |
1341 << "'"; | 1340 << "'"; |
1342 } | 1341 } |
OLD | NEW |