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

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

Issue 565943002: Credential Manager: Introduce a MockCredentialManagerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 6 years, 3 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/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
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
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
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