Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: content/shell/renderer/test_runner/web_test_proxy.cc

Issue 905823004: Added MockPresentationClient to use in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 return speech_recognizer_.get(); 646 return speech_recognizer_.get();
646 } 647 }
647 648
648 MockCredentialManagerClient* 649 MockCredentialManagerClient*
649 WebTestProxyBase::GetCredentialManagerClientMock() { 650 WebTestProxyBase::GetCredentialManagerClientMock() {
650 if (!credential_manager_client_.get()) 651 if (!credential_manager_client_.get())
651 credential_manager_client_.reset(new MockCredentialManagerClient()); 652 credential_manager_client_.reset(new MockCredentialManagerClient());
652 return credential_manager_client_.get(); 653 return credential_manager_client_.get();
653 } 654 }
654 655
656 MockPresentationClient* WebTestProxyBase::GetPresentationClientMock() {
657 if (!presentation_client_.get())
658 presentation_client_.reset(new MockPresentationClient());
659 return presentation_client_.get();
660 }
661
655 void WebTestProxyBase::ScheduleAnimation() { 662 void WebTestProxyBase::ScheduleAnimation() {
656 if (!test_interfaces_->GetTestRunner()->TestIsRunning()) 663 if (!test_interfaces_->GetTestRunner()->TestIsRunning())
657 return; 664 return;
658 665
659 if (!animate_scheduled_) { 666 if (!animate_scheduled_) {
660 animate_scheduled_ = true; 667 animate_scheduled_ = true;
661 delegate_->PostDelayedTask( 668 delegate_->PostDelayedTask(
662 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1); 669 new HostMethodTask(this, &WebTestProxyBase::AnimateNow), 1);
663 } 670 }
664 } 671 }
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 // to cancel the input method's ongoing composition session. 1320 // to cancel the input method's ongoing composition session.
1314 if (web_widget_) 1321 if (web_widget_)
1315 web_widget_->confirmComposition(); 1322 web_widget_->confirmComposition();
1316 } 1323 }
1317 1324
1318 blink::WebString WebTestProxyBase::acceptLanguages() { 1325 blink::WebString WebTestProxyBase::acceptLanguages() {
1319 return blink::WebString::fromUTF8(accept_languages_); 1326 return blink::WebString::fromUTF8(accept_languages_);
1320 } 1327 }
1321 1328
1322 } // namespace content 1329 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698