Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: content/public/test/render_view_test.cc

Issue 1472943004: Split up leak detector into two stages for better leak reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call clearScriptRegexpContext() in prepareForLeakDetection() Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/shell/renderer/layout_test/leak_detector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/layout_test/leak_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698