| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/renderer/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 17 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 17 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 18 #include "content/shell/renderer/test_runner/event_sender.h" | 18 #include "content/shell/renderer/test_runner/event_sender.h" |
| 19 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 19 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
| 20 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" | 20 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" |
| 21 #include "content/shell/renderer/test_runner/mock_presentation_client.h" | |
| 22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
| 23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 22 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
| 24 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 23 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
| 25 #include "content/shell/renderer/test_runner/spell_check_client.h" | 24 #include "content/shell/renderer/test_runner/spell_check_client.h" |
| 26 #include "content/shell/renderer/test_runner/test_interfaces.h" | 25 #include "content/shell/renderer/test_runner/test_interfaces.h" |
| 27 #include "content/shell/renderer/test_runner/test_plugin.h" | 26 #include "content/shell/renderer/test_runner/test_plugin.h" |
| 28 #include "content/shell/renderer/test_runner/test_runner.h" | 27 #include "content/shell/renderer/test_runner/test_runner.h" |
| 29 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 28 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
| 30 #include "content/shell/renderer/test_runner/web_test_interfaces.h" | 29 #include "content/shell/renderer/test_runner/web_test_interfaces.h" |
| 31 #include "content/shell/renderer/test_runner/web_test_runner.h" | 30 #include "content/shell/renderer/test_runner/web_test_runner.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return speech_recognizer_.get(); | 645 return speech_recognizer_.get(); |
| 647 } | 646 } |
| 648 | 647 |
| 649 MockCredentialManagerClient* | 648 MockCredentialManagerClient* |
| 650 WebTestProxyBase::GetCredentialManagerClientMock() { | 649 WebTestProxyBase::GetCredentialManagerClientMock() { |
| 651 if (!credential_manager_client_.get()) | 650 if (!credential_manager_client_.get()) |
| 652 credential_manager_client_.reset(new MockCredentialManagerClient()); | 651 credential_manager_client_.reset(new MockCredentialManagerClient()); |
| 653 return credential_manager_client_.get(); | 652 return credential_manager_client_.get(); |
| 654 } | 653 } |
| 655 | 654 |
| 656 MockPresentationClient* WebTestProxyBase::GetPresentationClientMock() { | |
| 657 if (!presentation_client_.get()) | |
| 658 presentation_client_.reset(new MockPresentationClient()); | |
| 659 return presentation_client_.get(); | |
| 660 } | |
| 661 | |
| 662 void WebTestProxyBase::ScheduleAnimation() { | 655 void WebTestProxyBase::ScheduleAnimation() { |
| 663 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) | 656 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) |
| 664 return; | 657 return; |
| 665 | 658 |
| 666 if (!animate_scheduled_) { | 659 if (!animate_scheduled_) { |
| 667 animate_scheduled_ = true; | 660 animate_scheduled_ = true; |
| 668 delegate_->PostDelayedTask( | 661 delegate_->PostDelayedTask( |
| 669 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); | 662 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); |
| 670 } | 663 } |
| 671 } | 664 } |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 // to cancel the input method's ongoing composition session. | 1313 // to cancel the input method's ongoing composition session. |
| 1321 if (web_widget_) | 1314 if (web_widget_) |
| 1322 web_widget_->confirmComposition(); | 1315 web_widget_->confirmComposition(); |
| 1323 } | 1316 } |
| 1324 | 1317 |
| 1325 blink::WebString WebTestProxyBase::acceptLanguages() { | 1318 blink::WebString WebTestProxyBase::acceptLanguages() { |
| 1326 return blink::WebString::fromUTF8(accept_languages_); | 1319 return blink::WebString::fromUTF8(accept_languages_); |
| 1327 } | 1320 } |
| 1328 | 1321 |
| 1329 } // namespace content | 1322 } // namespace content |
| OLD | NEW |