| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/layout_test/layout_test_content_renderer_client
.h" | 5 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "components/test_runner/mock_credential_manager_client.h" | 10 #include "components/test_runner/mock_credential_manager_client.h" |
| 11 #include "components/test_runner/web_frame_test_proxy.h" | 11 #include "components/test_runner/web_frame_test_proxy.h" |
| 12 #include "components/test_runner/web_test_interfaces.h" | 12 #include "components/test_runner/web_test_interfaces.h" |
| 13 #include "components/test_runner/web_test_proxy.h" | 13 #include "components/test_runner/web_test_proxy.h" |
| 14 #include "components/test_runner/web_test_runner.h" |
| 14 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 15 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
| 15 #include "content/public/common/content_constants.h" | 16 #include "content/public/common/content_constants.h" |
| 16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 17 #include "content/public/renderer/render_view.h" | 18 #include "content/public/renderer/render_view.h" |
| 18 #include "content/public/test/layouttest_support.h" | 19 #include "content/public/test/layouttest_support.h" |
| 19 #include "content/shell/common/shell_switches.h" | 20 #include "content/shell/common/shell_switches.h" |
| 20 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 21 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
| 21 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 22 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| 22 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" | 23 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" |
| 23 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" | 24 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void LayoutTestContentRendererClient::RenderViewCreated( | 96 void LayoutTestContentRendererClient::RenderViewCreated( |
| 96 RenderView* render_view) { | 97 RenderView* render_view) { |
| 97 new ShellRenderViewObserver(render_view); | 98 new ShellRenderViewObserver(render_view); |
| 98 | 99 |
| 99 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view); | 100 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view); |
| 100 proxy->set_web_widget(render_view->GetWebView()); | 101 proxy->set_web_widget(render_view->GetWebView()); |
| 101 proxy->set_web_view(render_view->GetWebView()); | 102 proxy->set_web_view(render_view->GetWebView()); |
| 102 | 103 |
| 103 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view); | 104 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view); |
| 104 test_runner->Reset(false /* for_new_test */); | 105 test_runner->Reset(false /* for_new_test */); |
| 105 render_view->GetWebView()->setSpellCheckClient( | |
| 106 test_runner->proxy()->GetSpellCheckClient()); | |
| 107 | 106 |
| 108 render_view->GetWebView()->setCredentialManagerClient( | 107 LayoutTestRenderProcessObserver::GetInstance() |
| 109 test_runner->proxy()->GetCredentialManagerClientMock()); | 108 ->test_interfaces() |
| 109 ->TestRunner() |
| 110 ->InitializeWebViewWithMocks(render_view->GetWebView()); |
| 111 |
| 110 test_runner::WebTestDelegate* delegate = | 112 test_runner::WebTestDelegate* delegate = |
| 111 LayoutTestRenderProcessObserver::GetInstance()->test_delegate(); | 113 LayoutTestRenderProcessObserver::GetInstance()->test_delegate(); |
| 112 if (delegate == static_cast<test_runner::WebTestDelegate*>(test_runner)) | 114 if (delegate == static_cast<test_runner::WebTestDelegate*>(test_runner)) |
| 113 LayoutTestRenderProcessObserver::GetInstance()->SetMainWindow(render_view); | 115 LayoutTestRenderProcessObserver::GetInstance()->SetMainWindow(render_view); |
| 114 } | 116 } |
| 115 | 117 |
| 116 WebMediaStreamCenter* | 118 WebMediaStreamCenter* |
| 117 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter( | 119 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter( |
| 118 WebMediaStreamCenterClient* client) { | 120 WebMediaStreamCenterClient* client) { |
| 119 #if defined(ENABLE_WEBRTC) | 121 #if defined(ENABLE_WEBRTC) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { | 179 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { |
| 178 #if defined(ENABLE_WEBRTC) | 180 #if defined(ENABLE_WEBRTC) |
| 179 return scoped_ptr<MediaStreamRendererFactory>( | 181 return scoped_ptr<MediaStreamRendererFactory>( |
| 180 new TestMediaStreamRendererFactory()); | 182 new TestMediaStreamRendererFactory()); |
| 181 #else | 183 #else |
| 182 return nullptr; | 184 return nullptr; |
| 183 #endif | 185 #endif |
| 184 } | 186 } |
| 185 | 187 |
| 186 } // namespace content | 188 } // namespace content |
| OLD | NEW |