| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 // Returns the last widget created. | 345 // Returns the last widget created. |
| 346 content::RenderWidgetHost* last_render_widget_host() { | 346 content::RenderWidgetHost* last_render_widget_host() { |
| 347 return last_render_widget_host_; | 347 return last_render_widget_host_; |
| 348 } | 348 } |
| 349 | 349 |
| 350 private: | 350 private: |
| 351 void ScheduleWait() { | 351 void ScheduleWait() { |
| 352 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 352 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 353 FROM_HERE, | 353 FROM_HERE, |
| 354 base::Bind(&PopupCreatedObserver::Wait, base::Unretained(this)), | 354 base::BindOnce(&PopupCreatedObserver::Wait, base::Unretained(this)), |
| 355 base::TimeDelta::FromMilliseconds(200)); | 355 base::TimeDelta::FromMilliseconds(200)); |
| 356 } | 356 } |
| 357 | 357 |
| 358 size_t CountWidgets() { | 358 size_t CountWidgets() { |
| 359 std::unique_ptr<content::RenderWidgetHostIterator> widgets( | 359 std::unique_ptr<content::RenderWidgetHostIterator> widgets( |
| 360 content::RenderWidgetHost::GetRenderWidgetHosts()); | 360 content::RenderWidgetHost::GetRenderWidgetHosts()); |
| 361 size_t num_widgets = 0; | 361 size_t num_widgets = 0; |
| 362 while (content::RenderWidgetHost* widget = widgets->GetNextHost()) { | 362 while (content::RenderWidgetHost* widget = widgets->GetNextHost()) { |
| 363 if (content::RenderViewHost::From(widget)) | 363 if (content::RenderViewHost::From(widget)) |
| 364 continue; | 364 continue; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // Move mouse to start of text. | 417 // Move mouse to start of text. |
| 418 MoveMouseInsideWindow(gfx::Point(45, 8)); | 418 MoveMouseInsideWindow(gfx::Point(45, 8)); |
| 419 MoveMouseInsideWindow(gfx::Point(45, 9)); | 419 MoveMouseInsideWindow(gfx::Point(45, 9)); |
| 420 SendMouseEvent(ui_controls::LEFT, ui_controls::DOWN); | 420 SendMouseEvent(ui_controls::LEFT, ui_controls::DOWN); |
| 421 | 421 |
| 422 MoveMouseInsideWindow(gfx::Point(74, 12)); | 422 MoveMouseInsideWindow(gfx::Point(74, 12)); |
| 423 MoveMouseInsideWindow(gfx::Point(78, 12)); | 423 MoveMouseInsideWindow(gfx::Point(78, 12)); |
| 424 | 424 |
| 425 // Now wait a bit before moving mouse to initiate drag/drop. | 425 // Now wait a bit before moving mouse to initiate drag/drop. |
| 426 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 426 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 427 FROM_HERE, base::Bind(&WebViewInteractiveTestBase::DragTestStep2, | 427 FROM_HERE, |
| 428 base::Unretained(this)), | 428 base::BindOnce(&WebViewInteractiveTestBase::DragTestStep2, |
| 429 base::Unretained(this)), |
| 429 base::TimeDelta::FromMilliseconds(200)); | 430 base::TimeDelta::FromMilliseconds(200)); |
| 430 } | 431 } |
| 431 | 432 |
| 432 void DragTestStep2() { | 433 void DragTestStep2() { |
| 433 // Drag source over target. | 434 // Drag source over target. |
| 434 MoveMouseInsideWindow(gfx::Point(76, 76)); | 435 MoveMouseInsideWindow(gfx::Point(76, 76)); |
| 435 | 436 |
| 436 // Create a second mouse over the source to trigger the drag over event. | 437 // Create a second mouse over the source to trigger the drag over event. |
| 437 MoveMouseInsideWindow(gfx::Point(76, 77)); | 438 MoveMouseInsideWindow(gfx::Point(76, 77)); |
| 438 | 439 |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 // Get the input value from the guest. | 1590 // Get the input value from the guest. |
| 1590 value.clear(); | 1591 value.clear(); |
| 1591 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents, | 1592 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents, |
| 1592 "window.domAutomationController." | 1593 "window.domAutomationController." |
| 1593 "send(document.querySelector('" | 1594 "send(document.querySelector('" |
| 1594 "input').value)", | 1595 "input').value)", |
| 1595 &value)); | 1596 &value)); |
| 1596 EXPECT_EQ("A B C D", value); | 1597 EXPECT_EQ("A B C D", value); |
| 1597 } | 1598 } |
| 1598 #endif // OS_MACOSX | 1599 #endif // OS_MACOSX |
| OLD | NEW |