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/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 17 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
18 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 18 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
19 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 19 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
20 #include "content/shell/renderer/test_runner/event_sender.h" | 20 #include "content/shell/renderer/test_runner/event_sender.h" |
21 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 21 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
| 22 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" |
22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 23 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
23 #include "content/shell/renderer/test_runner/mock_web_push_client.h" | 24 #include "content/shell/renderer/test_runner/mock_web_push_client.h" |
24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 25 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
25 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 26 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
26 #include "content/shell/renderer/test_runner/spell_check_client.h" | 27 #include "content/shell/renderer/test_runner/spell_check_client.h" |
27 #include "content/shell/renderer/test_runner/test_interfaces.h" | 28 #include "content/shell/renderer/test_runner/test_interfaces.h" |
28 #include "content/shell/renderer/test_runner/test_plugin.h" | 29 #include "content/shell/renderer/test_runner/test_plugin.h" |
29 #include "content/shell/renderer/test_runner/test_runner.h" | 30 #include "content/shell/renderer/test_runner/test_runner.h" |
30 #include "content/shell/renderer/test_runner/web_test_runner.h" | 31 #include "content/shell/renderer/test_runner/web_test_runner.h" |
31 // FIXME: Including platform_canvas.h here is a layering violation. | 32 // FIXME: Including platform_canvas.h here is a layering violation. |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 595 } |
595 | 596 |
596 MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() { | 597 MockWebSpeechRecognizer* WebTestProxyBase::GetSpeechRecognizerMock() { |
597 if (!speech_recognizer_.get()) { | 598 if (!speech_recognizer_.get()) { |
598 speech_recognizer_.reset(new MockWebSpeechRecognizer()); | 599 speech_recognizer_.reset(new MockWebSpeechRecognizer()); |
599 speech_recognizer_->SetDelegate(delegate_); | 600 speech_recognizer_->SetDelegate(delegate_); |
600 } | 601 } |
601 return speech_recognizer_.get(); | 602 return speech_recognizer_.get(); |
602 } | 603 } |
603 | 604 |
| 605 MockCredentialManagerClient* |
| 606 WebTestProxyBase::GetCredentialManagerClientMock() { |
| 607 if (!credential_manager_client_.get()) |
| 608 credential_manager_client_.reset(new MockCredentialManagerClient()); |
| 609 return credential_manager_client_.get(); |
| 610 } |
| 611 |
604 void WebTestProxyBase::ScheduleAnimation() { | 612 void WebTestProxyBase::ScheduleAnimation() { |
605 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) | 613 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) |
606 return; | 614 return; |
607 | 615 |
608 if (!animate_scheduled_) { | 616 if (!animate_scheduled_) { |
609 animate_scheduled_ = true; | 617 animate_scheduled_ = true; |
610 delegate_->postDelayedTask( | 618 delegate_->postDelayedTask( |
611 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); | 619 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); |
612 } | 620 } |
613 } | 621 } |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 if (!push_client_.get()) | 1288 if (!push_client_.get()) |
1281 push_client_.reset(new MockWebPushClient); | 1289 push_client_.reset(new MockWebPushClient); |
1282 return push_client_.get(); | 1290 return push_client_.get(); |
1283 } | 1291 } |
1284 | 1292 |
1285 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1293 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1286 return GetPushClientMock(); | 1294 return GetPushClientMock(); |
1287 } | 1295 } |
1288 | 1296 |
1289 } // namespace content | 1297 } // namespace content |
OLD | NEW |