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

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

Issue 308073011: test_runner: Migrate WebUserMediaClientMock to our Chromium C++ style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« 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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "content/shell/renderer/test_runner/MockColorChooser.h" 12 #include "content/shell/renderer/test_runner/MockColorChooser.h"
13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" 13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h"
14 #include "content/shell/renderer/test_runner/SpellCheckClient.h" 14 #include "content/shell/renderer/test_runner/SpellCheckClient.h"
15 #include "content/shell/renderer/test_runner/TestCommon.h" 15 #include "content/shell/renderer/test_runner/TestCommon.h"
16 #include "content/shell/renderer/test_runner/TestInterfaces.h" 16 #include "content/shell/renderer/test_runner/TestInterfaces.h"
17 #include "content/shell/renderer/test_runner/TestPlugin.h" 17 #include "content/shell/renderer/test_runner/TestPlugin.h"
18 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 18 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" 19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h"
20 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h"
21 #include "content/shell/renderer/test_runner/accessibility_controller.h" 20 #include "content/shell/renderer/test_runner/accessibility_controller.h"
22 #include "content/shell/renderer/test_runner/event_sender.h" 21 #include "content/shell/renderer/test_runner/event_sender.h"
22 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h"
23 #include "content/shell/renderer/test_runner/test_runner.h" 23 #include "content/shell/renderer/test_runner/test_runner.h"
24 #include "content/shell/renderer/test_runner/web_test_runner.h" 24 #include "content/shell/renderer/test_runner/web_test_runner.h"
25 // FIXME: Including platform_canvas.h here is a layering violation. 25 // FIXME: Including platform_canvas.h here is a layering violation.
26 #include "skia/ext/platform_canvas.h" 26 #include "skia/ext/platform_canvas.h"
27 #include "third_party/WebKit/public/platform/WebCString.h" 27 #include "third_party/WebKit/public/platform/WebCString.h"
28 #include "third_party/WebKit/public/platform/WebURLError.h" 28 #include "third_party/WebKit/public/platform/WebURLError.h"
29 #include "third_party/WebKit/public/platform/WebURLRequest.h" 29 #include "third_party/WebKit/public/platform/WebURLRequest.h"
30 #include "third_party/WebKit/public/platform/WebURLResponse.h" 30 #include "third_party/WebKit/public/platform/WebURLResponse.h"
31 #include "third_party/WebKit/public/web/WebAXEnums.h" 31 #include "third_party/WebKit/public/web/WebAXEnums.h"
32 #include "third_party/WebKit/public/web/WebAXObject.h" 32 #include "third_party/WebKit/public/web/WebAXObject.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 735 }
736 736
737 void WebTestProxyBase::ShowContextMenu( 737 void WebTestProxyBase::ShowContextMenu(
738 blink::WebLocalFrame* frame, 738 blink::WebLocalFrame* frame,
739 const blink::WebContextMenuData& context_menu_data) { 739 const blink::WebContextMenuData& context_menu_data) {
740 test_interfaces_->eventSender()->SetContextMenuData(context_menu_data); 740 test_interfaces_->eventSender()->SetContextMenuData(context_menu_data);
741 } 741 }
742 742
743 blink::WebUserMediaClient* WebTestProxyBase::GetUserMediaClient() { 743 blink::WebUserMediaClient* WebTestProxyBase::GetUserMediaClient() {
744 if (!user_media_client_.get()) 744 if (!user_media_client_.get())
745 user_media_client_.reset(new WebUserMediaClientMock(delegate_)); 745 user_media_client_.reset(new MockWebUserMediaClient(delegate_));
746 return user_media_client_.get(); 746 return user_media_client_.get();
747 } 747 }
748 748
749 // Simulate a print by going into print mode and then exit straight away. 749 // Simulate a print by going into print mode and then exit straight away.
750 void WebTestProxyBase::PrintPage(blink::WebLocalFrame* frame) { 750 void WebTestProxyBase::PrintPage(blink::WebLocalFrame* frame) {
751 blink::WebSize page_size_in_pixels = web_widget_->size(); 751 blink::WebSize page_size_in_pixels = web_widget_->size();
752 if (page_size_in_pixels.isEmpty()) 752 if (page_size_in_pixels.isEmpty())
753 return; 753 return;
754 blink::WebPrintParams printParams(page_size_in_pixels); 754 blink::WebPrintParams printParams(page_size_in_pixels);
755 frame->printBegin(printParams); 755 frame->printBegin(printParams);
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 // to cancel the input method's ongoing composition session. 1195 // to cancel the input method's ongoing composition session.
1196 if (web_widget_) 1196 if (web_widget_)
1197 web_widget_->confirmComposition(); 1197 web_widget_->confirmComposition();
1198 } 1198 }
1199 1199
1200 blink::WebString WebTestProxyBase::acceptLanguages() { 1200 blink::WebString WebTestProxyBase::acceptLanguages() {
1201 return blink::WebString::fromUTF8(accept_languages_); 1201 return blink::WebString::fromUTF8(accept_languages_);
1202 } 1202 }
1203 1203
1204 } // namespace content 1204 } // 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