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/location.h" | 9 #include "base/location.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 void RenderViewTest::TearDown() { | 287 void RenderViewTest::TearDown() { |
288 // Run the loop so the release task from the renderwidget executes. | 288 // Run the loop so the release task from the renderwidget executes. |
289 ProcessPendingMessages(); | 289 ProcessPendingMessages(); |
290 | 290 |
291 render_thread_->SendCloseMessage(); | 291 render_thread_->SendCloseMessage(); |
292 | 292 |
293 scoped_ptr<blink::WebLeakDetector> leak_detector = | 293 scoped_ptr<blink::WebLeakDetector> leak_detector = |
294 make_scoped_ptr(blink::WebLeakDetector::create(this)); | 294 make_scoped_ptr(blink::WebLeakDetector::create(this)); |
295 | 295 |
296 leak_detector->collectGarbageAndGetDOMCounts(GetMainFrame()); | 296 leak_detector->prepareForLeakDetection(GetMainFrame()); |
297 | 297 |
298 view_ = NULL; | 298 view_ = NULL; |
299 mock_process_.reset(); | 299 mock_process_.reset(); |
300 | 300 |
301 // After telling the view to close and resetting mock_process_ we may get | 301 // After telling the view to close and resetting mock_process_ we may get |
302 // some new tasks which need to be processed before shutting down WebKit | 302 // some new tasks which need to be processed before shutting down WebKit |
303 // (http://crbug.com/21508). | 303 // (http://crbug.com/21508). |
304 base::RunLoop().RunUntilIdle(); | 304 base::RunLoop().RunUntilIdle(); |
305 | 305 |
306 #if defined(OS_MACOSX) | 306 #if defined(OS_MACOSX) |
307 // Needs to run before blink::shutdown(). | 307 // Needs to run before blink::shutdown(). |
308 autorelease_pool_.reset(NULL); | 308 autorelease_pool_.reset(NULL); |
309 #endif | 309 #endif |
310 | 310 |
| 311 leak_detector->collectGarbageAndReport(); |
| 312 |
311 blink_platform_impl_.Shutdown(); | 313 blink_platform_impl_.Shutdown(); |
312 blink::shutdown(); | 314 blink::shutdown(); |
313 | 315 |
314 platform_->PlatformUninitialize(); | 316 platform_->PlatformUninitialize(); |
315 platform_.reset(); | 317 platform_.reset(); |
316 params_.reset(); | 318 params_.reset(); |
317 command_line_.reset(); | 319 command_line_.reset(); |
318 } | 320 } |
319 | 321 |
320 void RenderViewTest::onLeakDetectionComplete(const Result& result) { | 322 void RenderViewTest::onLeakDetectionComplete(const Result& result) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 TestRenderFrame* frame = | 614 TestRenderFrame* frame = |
613 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 615 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
614 frame->Navigate(common_params, StartNavigationParams(), request_params); | 616 frame->Navigate(common_params, StartNavigationParams(), request_params); |
615 | 617 |
616 // The load actually happens asynchronously, so we pump messages to process | 618 // The load actually happens asynchronously, so we pump messages to process |
617 // the pending continuation. | 619 // the pending continuation. |
618 FrameLoadWaiter(frame).Wait(); | 620 FrameLoadWaiter(frame).Wait(); |
619 } | 621 } |
620 | 622 |
621 } // namespace content | 623 } // namespace content |
OLD | NEW |