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_service.h" |
21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
22 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
23 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 24 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
24 #include "content/shell/renderer/test_runner/spell_check_client.h" | 25 #include "content/shell/renderer/test_runner/spell_check_client.h" |
25 #include "content/shell/renderer/test_runner/test_interfaces.h" | 26 #include "content/shell/renderer/test_runner/test_interfaces.h" |
26 #include "content/shell/renderer/test_runner/test_plugin.h" | 27 #include "content/shell/renderer/test_runner/test_plugin.h" |
27 #include "content/shell/renderer/test_runner/test_runner.h" | 28 #include "content/shell/renderer/test_runner/test_runner.h" |
28 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 29 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
29 #include "content/shell/renderer/test_runner/web_test_interfaces.h" | 30 #include "content/shell/renderer/test_runner/web_test_interfaces.h" |
30 #include "content/shell/renderer/test_runner/web_test_runner.h" | 31 #include "content/shell/renderer/test_runner/web_test_runner.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 return speech_recognizer_.get(); | 651 return speech_recognizer_.get(); |
651 } | 652 } |
652 | 653 |
653 MockCredentialManagerClient* | 654 MockCredentialManagerClient* |
654 WebTestProxyBase::GetCredentialManagerClientMock() { | 655 WebTestProxyBase::GetCredentialManagerClientMock() { |
655 if (!credential_manager_client_.get()) | 656 if (!credential_manager_client_.get()) |
656 credential_manager_client_.reset(new MockCredentialManagerClient()); | 657 credential_manager_client_.reset(new MockCredentialManagerClient()); |
657 return credential_manager_client_.get(); | 658 return credential_manager_client_.get(); |
658 } | 659 } |
659 | 660 |
| 661 MockPresentationService* WebTestProxyBase::GetPresentationServiceMock() { |
| 662 if (!presentation_service_.get()) |
| 663 presentation_service_.reset(new MockPresentationService()); |
| 664 return presentation_service_.get(); |
| 665 } |
| 666 |
660 void WebTestProxyBase::ScheduleAnimation() { | 667 void WebTestProxyBase::ScheduleAnimation() { |
661 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) | 668 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) |
662 return; | 669 return; |
663 | 670 |
664 if (!animate_scheduled_) { | 671 if (!animate_scheduled_) { |
665 animate_scheduled_ = true; | 672 animate_scheduled_ = true; |
666 delegate_->PostDelayedTask( | 673 delegate_->PostDelayedTask( |
667 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); | 674 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); |
668 } | 675 } |
669 } | 676 } |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 // to cancel the input method's ongoing composition session. | 1329 // to cancel the input method's ongoing composition session. |
1323 if (web_widget_) | 1330 if (web_widget_) |
1324 web_widget_->confirmComposition(); | 1331 web_widget_->confirmComposition(); |
1325 } | 1332 } |
1326 | 1333 |
1327 blink::WebString WebTestProxyBase::acceptLanguages() { | 1334 blink::WebString WebTestProxyBase::acceptLanguages() { |
1328 return blink::WebString::fromUTF8(accept_languages_); | 1335 return blink::WebString::fromUTF8(accept_languages_); |
1329 } | 1336 } |
1330 | 1337 |
1331 } // namespace content | 1338 } // namespace content |
OLD | NEW |