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

Unified Diff: content/shell/browser/webkit_test_controller.cc

Issue 405433011: LeakDetector: Add commandline option to force crash when leak is found. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/browser/webkit_test_controller.h ('k') | content/shell/common/shell_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/webkit_test_controller.cc
diff --git a/content/shell/browser/webkit_test_controller.cc b/content/shell/browser/webkit_test_controller.cc
index e1266d5afe03f15729ba5ab417edc6ac61453d4c..c2036f962eedaefa5916a6799b9b58c595bc4ee1 100644
--- a/content/shell/browser/webkit_test_controller.cc
+++ b/content/shell/browser/webkit_test_controller.cc
@@ -202,9 +202,18 @@ WebKitTestController::WebKitTestController()
: main_window_(NULL),
test_phase_(BETWEEN_TESTS),
is_leak_detection_enabled_(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableLeakDetection)) {
+ switches::kEnableLeakDetection)),
+ crash_when_leak_found_(false) {
CHECK(!instance_);
instance_ = this;
+
+ if (is_leak_detection_enabled_) {
+ std::string switchValue =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kEnableLeakDetection);
+ crash_when_leak_found_ = switchValue == switches::kCrashOnFailure;
+ }
+
printer_.reset(new WebKitTestResultPrinter(&std::cout, &std::cerr));
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEncodeBinary))
printer_->set_encode_binary_data(true);
@@ -680,6 +689,8 @@ void WebKitTestController::OnLeakDetectionDone(
printer_->AddErrorMessage(
base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_,
result.detail.c_str()));
+ CHECK(!crash_when_leak_found_);
+
DiscardMainWindow();
}
« no previous file with comments | « content/shell/browser/webkit_test_controller.h ('k') | content/shell/common/shell_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698