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

Side by Side Diff: content/shell/renderer/test_runner/web_frame_test_proxy.h

Issue 907893002: Retry to add MockPresentationClient to use in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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
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 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "content/shell/renderer/test_runner/mock_presentation_client.h"
9 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" 10 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
10 #include "content/shell/renderer/test_runner/test_interfaces.h" 11 #include "content/shell/renderer/test_runner/test_interfaces.h"
11 #include "content/shell/renderer/test_runner/test_runner.h" 12 #include "content/shell/renderer/test_runner/test_runner.h"
12 #include "content/shell/renderer/test_runner/web_test_delegate.h" 13 #include "content/shell/renderer/test_runner/web_test_delegate.h"
13 #include "content/shell/renderer/test_runner/web_test_proxy.h" 14 #include "content/shell/renderer/test_runner/web_test_proxy.h"
14 #include "content/test/test_media_stream_renderer_factory.h" 15 #include "content/test/test_media_stream_renderer_factory.h"
15 #include "third_party/WebKit/public/platform/WebString.h" 16 #include "third_party/WebKit/public/platform/WebString.h"
16 17
17 namespace content { 18 namespace content {
18 19
(...skipping 14 matching lines...) Expand all
33 blink::WebPlugin* plugin = base_proxy_->CreatePlugin(frame, params); 34 blink::WebPlugin* plugin = base_proxy_->CreatePlugin(frame, params);
34 if (plugin) 35 if (plugin)
35 return plugin; 36 return plugin;
36 return Base::createPlugin(frame, params); 37 return Base::createPlugin(frame, params);
37 } 38 }
38 39
39 virtual blink::WebScreenOrientationClient* webScreenOrientationClient() { 40 virtual blink::WebScreenOrientationClient* webScreenOrientationClient() {
40 return base_proxy_->GetScreenOrientationClientMock(); 41 return base_proxy_->GetScreenOrientationClientMock();
41 } 42 }
42 43
44 virtual blink::WebPresentationClient* presentationClient() {
45 if (!mock_presentation_client_.get()) {
46 mock_presentation_client_.reset(new MockPresentationClient(
47 base_proxy_->GetPresentationServiceMock()));
48 }
49 return mock_presentation_client_.get();
50 }
51
43 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, 52 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message,
44 const blink::WebString& source_name, 53 const blink::WebString& source_name,
45 unsigned source_line, 54 unsigned source_line,
46 const blink::WebString& stack_trace) { 55 const blink::WebString& stack_trace) {
47 base_proxy_->DidAddMessageToConsole(message, source_name, source_line); 56 base_proxy_->DidAddMessageToConsole(message, source_name, source_line);
48 Base::didAddMessageToConsole( 57 Base::didAddMessageToConsole(
49 message, source_name, source_line, stack_trace); 58 message, source_name, source_line, stack_trace);
50 } 59 }
51 60
52 virtual bool canCreatePluginWithoutRenderer( 61 virtual bool canCreatePluginWithoutRenderer(
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 #if defined(ENABLE_WEBRTC) 297 #if defined(ENABLE_WEBRTC)
289 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory() 298 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory()
290 override { 299 override {
291 return scoped_ptr<MediaStreamRendererFactory>( 300 return scoped_ptr<MediaStreamRendererFactory>(
292 new TestMediaStreamRendererFactory()); 301 new TestMediaStreamRendererFactory());
293 } 302 }
294 #endif 303 #endif
295 304
296 WebTestProxyBase* base_proxy_; 305 WebTestProxyBase* base_proxy_;
297 306
307 scoped_ptr<MockPresentationClient> mock_presentation_client_;
308
298 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); 309 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy);
299 }; 310 };
300 311
301 } // namespace content 312 } // namespace content
302 313
303 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ 314 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.cc ('k') | content/shell/renderer/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698