Enable crash reporting for chrome frame unit tests. This ensures that crashes are reported for
chrome frame unit test runs.

BUG=86846
TEST=Crash dumps are reported when running Chrome Frame unit tests in headless mode.
Review URL: http://codereview.chromium.org/7259009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90597 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome_frame/chrome_frame_unittest_main.cc b/chrome_frame/chrome_frame_unittest_main.cc
index 4050f9b..14042b0 100644
--- a/chrome_frame/chrome_frame_unittest_main.cc
+++ b/chrome_frame/chrome_frame_unittest_main.cc
@@ -6,6 +6,9 @@
 #include <atlcom.h>
 #include "base/at_exit.h"
 #include "base/command_line.h"
+#include "base/process.h"
+#include "chrome_frame/crash_server_init.h"
+#include "chrome_frame/test/chrome_frame_test_utils.h"
 #include "gtest/gtest.h"
 
 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> {
@@ -26,9 +29,18 @@
 
   base::AtExitManager at_exit_manager;
   g_at_exit_manager = &at_exit_manager;
+
+  base::ProcessHandle crash_service = chrome_frame_test::StartCrashService();
+
+  google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
+      InitializeCrashReporting(HEADLESS));
+
   CommandLine::Init(argc, argv);
 
   RUN_ALL_TESTS();
 
   g_at_exit_manager = NULL;
+
+  if (crash_service)
+    base::KillProcess(crash_service, 0, false);
 }