| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/test/render_view_test.h" | 5 #include "content/public/test/render_view_test.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "components/scheduler/renderer/renderer_scheduler.h" | 10 #include "components/scheduler/renderer/renderer_scheduler.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 RendererBlinkPlatformImplNoSandbox() { | 108 RendererBlinkPlatformImplNoSandbox() { |
| 109 renderer_scheduler_ = scheduler::RendererScheduler::Create(); | 109 renderer_scheduler_ = scheduler::RendererScheduler::Create(); |
| 110 blink_platform_impl_.reset( | 110 blink_platform_impl_.reset( |
| 111 new RendererBlinkPlatformImplNoSandboxImpl(renderer_scheduler_.get())); | 111 new RendererBlinkPlatformImplNoSandboxImpl(renderer_scheduler_.get())); |
| 112 } | 112 } |
| 113 | 113 |
| 114 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: | 114 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: |
| 115 ~RendererBlinkPlatformImplNoSandbox() { | 115 ~RendererBlinkPlatformImplNoSandbox() { |
| 116 } | 116 } |
| 117 | 117 |
| 118 blink::Platform* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() { | 118 blink::Platform* |
| 119 RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() const { |
| 119 return blink_platform_impl_.get(); | 120 return blink_platform_impl_.get(); |
| 120 } | 121 } |
| 121 | 122 |
| 123 scheduler::RendererScheduler* |
| 124 RenderViewTest::RendererBlinkPlatformImplNoSandbox::Scheduler() const { |
| 125 return renderer_scheduler_.get(); |
| 126 } |
| 127 |
| 122 RenderViewTest::RenderViewTest() | 128 RenderViewTest::RenderViewTest() |
| 123 : view_(NULL) { | 129 : view_(NULL) { |
| 124 } | 130 } |
| 125 | 131 |
| 126 RenderViewTest::~RenderViewTest() { | 132 RenderViewTest::~RenderViewTest() { |
| 127 } | 133 } |
| 128 | 134 |
| 129 void RenderViewTest::ProcessPendingMessages() { | 135 void RenderViewTest::ProcessPendingMessages() { |
| 130 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 136 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
| 131 msg_loop_.Run(); | 137 msg_loop_.Run(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // After telling the view to close and resetting mock_process_ we may get | 279 // After telling the view to close and resetting mock_process_ we may get |
| 274 // some new tasks which need to be processed before shutting down WebKit | 280 // some new tasks which need to be processed before shutting down WebKit |
| 275 // (http://crbug.com/21508). | 281 // (http://crbug.com/21508). |
| 276 base::RunLoop().RunUntilIdle(); | 282 base::RunLoop().RunUntilIdle(); |
| 277 | 283 |
| 278 #if defined(OS_MACOSX) | 284 #if defined(OS_MACOSX) |
| 279 // Needs to run before blink::shutdown(). | 285 // Needs to run before blink::shutdown(). |
| 280 autorelease_pool_.reset(NULL); | 286 autorelease_pool_.reset(NULL); |
| 281 #endif | 287 #endif |
| 282 | 288 |
| 289 blink_platform_impl_.Scheduler()->Shutdown(); |
| 283 blink::shutdown(); | 290 blink::shutdown(); |
| 284 | 291 |
| 285 platform_->PlatformUninitialize(); | 292 platform_->PlatformUninitialize(); |
| 286 platform_.reset(); | 293 platform_.reset(); |
| 287 params_.reset(); | 294 params_.reset(); |
| 288 command_line_.reset(); | 295 command_line_.reset(); |
| 289 } | 296 } |
| 290 | 297 |
| 291 void RenderViewTest::SendNativeKeyEvent( | 298 void RenderViewTest::SendNativeKeyEvent( |
| 292 const NativeWebKeyboardEvent& key_event) { | 299 const NativeWebKeyboardEvent& key_event) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 | 547 |
| 541 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 548 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
| 542 request_params); | 549 request_params); |
| 543 | 550 |
| 544 // The load actually happens asynchronously, so we pump messages to process | 551 // The load actually happens asynchronously, so we pump messages to process |
| 545 // the pending continuation. | 552 // the pending continuation. |
| 546 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 553 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
| 547 } | 554 } |
| 548 | 555 |
| 549 } // namespace content | 556 } // namespace content |
| OLD | NEW |