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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() { |
119 return blink_platform_impl_.get(); | 119 return blink_platform_impl_.get(); |
120 } | 120 } |
121 | 121 |
122 scheduler::RendererScheduler* | |
123 RenderViewTest::RendererBlinkPlatformImplNoSandbox::Scheduler() { | |
124 return renderer_scheduler_.get(); | |
125 } | |
126 | |
122 RenderViewTest::RenderViewTest() | 127 RenderViewTest::RenderViewTest() |
123 : view_(NULL) { | 128 : view_(NULL) { |
124 } | 129 } |
125 | 130 |
126 RenderViewTest::~RenderViewTest() { | 131 RenderViewTest::~RenderViewTest() { |
127 } | 132 } |
128 | 133 |
129 void RenderViewTest::ProcessPendingMessages() { | 134 void RenderViewTest::ProcessPendingMessages() { |
130 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 135 msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
131 msg_loop_.Run(); | 136 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 | 278 // 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 | 279 // some new tasks which need to be processed before shutting down WebKit |
275 // (http://crbug.com/21508). | 280 // (http://crbug.com/21508). |
276 base::RunLoop().RunUntilIdle(); | 281 base::RunLoop().RunUntilIdle(); |
277 | 282 |
278 #if defined(OS_MACOSX) | 283 #if defined(OS_MACOSX) |
279 // Needs to run before blink::shutdown(). | 284 // Needs to run before blink::shutdown(). |
280 autorelease_pool_.reset(NULL); | 285 autorelease_pool_.reset(NULL); |
281 #endif | 286 #endif |
282 | 287 |
288 blink_platform_impl_.Scheduler()->Shutdown(); | |
Sami
2015/05/01 20:46:31
This is a good idea since it matches what we do in
| |
283 blink::shutdown(); | 289 blink::shutdown(); |
284 | 290 |
285 platform_->PlatformUninitialize(); | 291 platform_->PlatformUninitialize(); |
286 platform_.reset(); | 292 platform_.reset(); |
287 params_.reset(); | 293 params_.reset(); |
288 command_line_.reset(); | 294 command_line_.reset(); |
289 } | 295 } |
290 | 296 |
291 void RenderViewTest::SendNativeKeyEvent( | 297 void RenderViewTest::SendNativeKeyEvent( |
292 const NativeWebKeyboardEvent& key_event) { | 298 const NativeWebKeyboardEvent& key_event) { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 | 546 |
541 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 547 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
542 request_params); | 548 request_params); |
543 | 549 |
544 // The load actually happens asynchronously, so we pump messages to process | 550 // The load actually happens asynchronously, so we pump messages to process |
545 // the pending continuation. | 551 // the pending continuation. |
546 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 552 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
547 } | 553 } |
548 | 554 |
549 } // namespace content | 555 } // namespace content |
OLD | NEW |