| 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 "components/test_runner/web_widget_test_client.h" | 5 #include "components/test_runner/web_widget_test_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "components/test_runner/mock_screen_orientation_client.h" | 11 #include "components/test_runner/mock_screen_orientation_client.h" |
| 12 #include "components/test_runner/test_interfaces.h" | 12 #include "components/test_runner/test_interfaces.h" |
| 13 #include "components/test_runner/test_runner.h" | 13 #include "components/test_runner/test_runner.h" |
| 14 #include "components/test_runner/test_runner_for_specific_view.h" | 14 #include "components/test_runner/test_runner_for_specific_view.h" |
| 15 #include "components/test_runner/web_task.h" | |
| 16 #include "components/test_runner/web_test_delegate.h" | 15 #include "components/test_runner/web_test_delegate.h" |
| 17 #include "components/test_runner/web_view_test_proxy.h" | 16 #include "components/test_runner/web_view_test_proxy.h" |
| 18 #include "components/test_runner/web_widget_test_proxy.h" | 17 #include "components/test_runner/web_widget_test_proxy.h" |
| 19 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 18 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 20 #include "third_party/WebKit/public/web/WebPagePopup.h" | 19 #include "third_party/WebKit/public/web/WebPagePopup.h" |
| 21 #include "third_party/WebKit/public/web/WebWidget.h" | 20 #include "third_party/WebKit/public/web/WebWidget.h" |
| 22 | 21 |
| 23 namespace test_runner { | 22 namespace test_runner { |
| 24 | 23 |
| 25 WebWidgetTestClient::WebWidgetTestClient( | 24 WebWidgetTestClient::WebWidgetTestClient( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 void WebWidgetTestClient::scheduleAnimation() { | 38 void WebWidgetTestClient::scheduleAnimation() { |
| 40 if (!test_runner_->TestIsRunning()) | 39 if (!test_runner_->TestIsRunning()) |
| 41 return; | 40 return; |
| 42 | 41 |
| 43 if (!animation_scheduled_) { | 42 if (!animation_scheduled_) { |
| 44 animation_scheduled_ = true; | 43 animation_scheduled_ = true; |
| 45 test_runner_->OnAnimationScheduled( | 44 test_runner_->OnAnimationScheduled( |
| 46 web_widget_test_proxy_base_->web_widget()); | 45 web_widget_test_proxy_base_->web_widget()); |
| 47 | 46 |
| 48 web_view_test_proxy_base_->delegate()->PostDelayedTask( | 47 web_view_test_proxy_base_->delegate()->PostDelayedTask( |
| 49 new WebCallbackTask(base::Bind(&WebWidgetTestClient::AnimateNow, | 48 base::Bind(&WebWidgetTestClient::AnimateNow, |
| 50 weak_factory_.GetWeakPtr())), | 49 weak_factory_.GetWeakPtr()), |
| 51 1); | 50 1); |
| 52 } | 51 } |
| 53 } | 52 } |
| 54 | 53 |
| 55 void WebWidgetTestClient::AnimateNow() { | 54 void WebWidgetTestClient::AnimateNow() { |
| 56 if (animation_scheduled_) { | 55 if (animation_scheduled_) { |
| 57 blink::WebWidget* web_widget = web_widget_test_proxy_base_->web_widget(); | 56 blink::WebWidget* web_widget = web_widget_test_proxy_base_->web_widget(); |
| 58 animation_scheduled_ = false; | 57 animation_scheduled_ = false; |
| 59 test_runner_->OnAnimationBegun(web_widget); | 58 test_runner_->OnAnimationBegun(web_widget); |
| 60 | 59 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 101 |
| 103 void WebWidgetTestClient::resetInputMethod() { | 102 void WebWidgetTestClient::resetInputMethod() { |
| 104 // If a composition text exists, then we need to let the browser process | 103 // If a composition text exists, then we need to let the browser process |
| 105 // to cancel the input method's ongoing composition session. | 104 // to cancel the input method's ongoing composition session. |
| 106 if (web_widget_test_proxy_base_) | 105 if (web_widget_test_proxy_base_) |
| 107 web_widget_test_proxy_base_->web_widget()->finishComposingText( | 106 web_widget_test_proxy_base_->web_widget()->finishComposingText( |
| 108 blink::WebWidget::KeepSelection); | 107 blink::WebWidget::KeepSelection); |
| 109 } | 108 } |
| 110 | 109 |
| 111 } // namespace test_runner | 110 } // namespace test_runner |
| OLD | NEW |