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 #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" | |
10 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 9 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
11 #include "content/shell/renderer/test_runner/test_interfaces.h" | 10 #include "content/shell/renderer/test_runner/test_interfaces.h" |
12 #include "content/shell/renderer/test_runner/test_runner.h" | 11 #include "content/shell/renderer/test_runner/test_runner.h" |
13 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 12 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
14 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 13 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
15 #include "content/test/test_media_stream_renderer_factory.h" | 14 #include "content/test/test_media_stream_renderer_factory.h" |
16 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 | 18 |
(...skipping 14 matching lines...) Expand all Loading... |
34 blink::WebPlugin* plugin = base_proxy_->CreatePlugin(frame, params); | 33 blink::WebPlugin* plugin = base_proxy_->CreatePlugin(frame, params); |
35 if (plugin) | 34 if (plugin) |
36 return plugin; | 35 return plugin; |
37 return Base::createPlugin(frame, params); | 36 return Base::createPlugin(frame, params); |
38 } | 37 } |
39 | 38 |
40 virtual blink::WebScreenOrientationClient* webScreenOrientationClient() { | 39 virtual blink::WebScreenOrientationClient* webScreenOrientationClient() { |
41 return base_proxy_->GetScreenOrientationClientMock(); | 40 return base_proxy_->GetScreenOrientationClientMock(); |
42 } | 41 } |
43 | 42 |
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 | |
52 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, | 43 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
53 const blink::WebString& source_name, | 44 const blink::WebString& source_name, |
54 unsigned source_line, | 45 unsigned source_line, |
55 const blink::WebString& stack_trace) { | 46 const blink::WebString& stack_trace) { |
56 base_proxy_->DidAddMessageToConsole(message, source_name, source_line); | 47 base_proxy_->DidAddMessageToConsole(message, source_name, source_line); |
57 Base::didAddMessageToConsole( | 48 Base::didAddMessageToConsole( |
58 message, source_name, source_line, stack_trace); | 49 message, source_name, source_line, stack_trace); |
59 } | 50 } |
60 | 51 |
61 virtual bool canCreatePluginWithoutRenderer( | 52 virtual bool canCreatePluginWithoutRenderer( |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 #if defined(ENABLE_WEBRTC) | 288 #if defined(ENABLE_WEBRTC) |
298 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory() | 289 virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory() |
299 override { | 290 override { |
300 return scoped_ptr<MediaStreamRendererFactory>( | 291 return scoped_ptr<MediaStreamRendererFactory>( |
301 new TestMediaStreamRendererFactory()); | 292 new TestMediaStreamRendererFactory()); |
302 } | 293 } |
303 #endif | 294 #endif |
304 | 295 |
305 WebTestProxyBase* base_proxy_; | 296 WebTestProxyBase* base_proxy_; |
306 | 297 |
307 scoped_ptr<MockPresentationClient> mock_presentation_client_; | |
308 | |
309 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 298 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
310 }; | 299 }; |
311 | 300 |
312 } // namespace content | 301 } // namespace content |
313 | 302 |
314 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 303 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
OLD | NEW |