| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 gfx::Point corner() { | 289 gfx::Point corner() { |
| 290 return corner_; | 290 return corner_; |
| 291 } | 291 } |
| 292 | 292 |
| 293 void SimulateRWHMouseClick(content::RenderWidgetHost* rwh, | 293 void SimulateRWHMouseClick(content::RenderWidgetHost* rwh, |
| 294 blink::WebMouseEvent::Button button, | 294 blink::WebMouseEvent::Button button, |
| 295 int x, | 295 int x, |
| 296 int y) { | 296 int y) { |
| 297 blink::WebMouseEvent mouse_event; | 297 blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown, |
| 298 blink::WebInputEvent::NoModifiers, |
| 299 blink::WebInputEvent::TimeStampForTesting); |
| 298 mouse_event.button = button; | 300 mouse_event.button = button; |
| 299 mouse_event.x = mouse_event.windowX = x; | 301 mouse_event.x = mouse_event.windowX = x; |
| 300 mouse_event.y = mouse_event.windowY = y; | 302 mouse_event.y = mouse_event.windowY = y; |
| 301 mouse_event.modifiers = 0; | |
| 302 // Needed for the WebViewTest.ContextMenuPositionAfterCSSTransforms | 303 // Needed for the WebViewTest.ContextMenuPositionAfterCSSTransforms |
| 303 gfx::Rect rect = rwh->GetView()->GetViewBounds(); | 304 gfx::Rect rect = rwh->GetView()->GetViewBounds(); |
| 304 mouse_event.globalX = x + rect.x(); | 305 mouse_event.globalX = x + rect.x(); |
| 305 mouse_event.globalY = y + rect.y(); | 306 mouse_event.globalY = y + rect.y(); |
| 306 mouse_event.type = blink::WebInputEvent::MouseDown; | |
| 307 rwh->ForwardMouseEvent(mouse_event); | 307 rwh->ForwardMouseEvent(mouse_event); |
| 308 mouse_event.type = blink::WebInputEvent::MouseUp; | 308 mouse_event.setType(blink::WebInputEvent::MouseUp); |
| 309 rwh->ForwardMouseEvent(mouse_event); | 309 rwh->ForwardMouseEvent(mouse_event); |
| 310 } | 310 } |
| 311 | 311 |
| 312 class PopupCreatedObserver { | 312 class PopupCreatedObserver { |
| 313 public: | 313 public: |
| 314 PopupCreatedObserver() | 314 PopupCreatedObserver() |
| 315 : initial_widget_count_(0), | 315 : initial_widget_count_(0), |
| 316 last_render_widget_host_(NULL) {} | 316 last_render_widget_host_(NULL) {} |
| 317 | 317 |
| 318 ~PopupCreatedObserver() {} | 318 ~PopupCreatedObserver() {} |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 1464 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 1465 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); | 1465 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); |
| 1466 | 1466 |
| 1467 next_step_listener.Reset(); | 1467 next_step_listener.Reset(); |
| 1468 EXPECT_TRUE(content::ExecuteScript( | 1468 EXPECT_TRUE(content::ExecuteScript( |
| 1469 embedder_web_contents(), | 1469 embedder_web_contents(), |
| 1470 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); | 1470 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); |
| 1471 | 1471 |
| 1472 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1472 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1473 } | 1473 } |
| OLD | NEW |